From 9b0ea51d35873bbc5718589c6c7b9e07d0e6725e Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 26 Feb 2025 09:37:31 +0000 Subject: [PATCH] Moved composer clear commands to after composer install per #16334 Signed-off-by: snipe --- upgrade.php | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/upgrade.php b/upgrade.php index ecc424c792..bd1678534b 100644 --- a/upgrade.php +++ b/upgrade.php @@ -479,15 +479,6 @@ foreach ($unused_files as $unused_file) { } echo "\n"; -$config_clear = shell_exec('php artisan config:clear'); -$cache_clear = shell_exec('php artisan cache:clear'); -$route_clear = shell_exec('php artisan route:clear'); -$view_clear = shell_exec('php artisan view:clear'); -echo $success_icon.' '.trim($config_clear)."\n"; -echo $success_icon.' '.trim($cache_clear)."\n"; -echo $success_icon.' '.trim($route_clear)."\n"; -echo $success_icon.' '.trim($view_clear)."\n"; -echo "\n"; echo "\e[95m--------------------------------------------------------\n"; echo "STEP 6: Updating composer dependencies:\n"; @@ -497,13 +488,11 @@ echo "-- Running the app in ".$app_environment." mode.\n"; // Composer install if (file_exists('composer.phar')) { - echo "√ Local composer.phar detected, so we'll use that.\n\n"; + echo $success_icon." Local composer.phar detected, so we'll use that.\n\n"; echo "-- Updating local composer.phar\n\n"; $composer_update = shell_exec('php composer.phar self-update'); echo $composer_update."\n\n"; - - // Use --no-dev only if we are in production mode. // This will cause errors otherwise, if the user is in develop or local for their APP_ENV if ($app_environment == 'production') { @@ -511,10 +500,9 @@ if (file_exists('composer.phar')) { } else { $composer = shell_exec('php composer.phar install --prefer-source'); } + $composer_dump = shell_exec('php composer.phar dump'); - - } else { echo "-- We couldn't find a local composer.phar. No worries, trying globally.\n"; @@ -531,13 +519,20 @@ if (file_exists('composer.phar')) { $composer_dump = shell_exec('composer dump'); - } echo $composer_dump."\n"; echo $composer; - +$config_clear = shell_exec('php artisan config:clear'); +$cache_clear = shell_exec('php artisan cache:clear'); +$route_clear = shell_exec('php artisan route:clear'); +$view_clear = shell_exec('php artisan view:clear'); +echo $success_icon.' '.trim($config_clear)."\n"; +echo $success_icon.' '.trim($cache_clear)."\n"; +echo $success_icon.' '.trim($route_clear)."\n"; +echo $success_icon.' '.trim($view_clear)."\n"; +echo "\n"; echo "\e[95m--------------------------------------------------------\n"; echo "STEP 7: Putting application into maintenance mode: \n";