-<?php
+<?php declare(strict_types=1);
namespace Cli\Commands;
protected function cleanupAppServices(string $appDir): bool
{
- $servicesFile = implode(DIRECTORY_SEPARATOR, [$appDir, 'bootstrap', 'cache', 'services.php']);
- if (file_exists($servicesFile)) {
- return @unlink($servicesFile);
+ $filesToClear = [
+ implode(DIRECTORY_SEPARATOR, [$appDir, 'bootstrap', 'cache', 'services.php']),
+ implode(DIRECTORY_SEPARATOR, [$appDir, 'bootstrap', 'cache', 'packages.php']),
+ ];
+
+ $status = true;
+
+ foreach ($filesToClear as $file) {
+ if (file_exists($file)) {
+ if (@unlink($file) === false) {
+ $status = false;
+ }
+ }
}
- return true;
+ return $status;
}
protected function extractZip(string $zipPath, string $appDir): void