From 06eee1e711bbf2cdd628ed569b02a229fc361022 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Tue, 5 Feb 2019 13:23:16 +0200 Subject: [PATCH] Some installer fixes (clear cache, direct install with full package) --- system/src/Grav/Console/Gpm/DirectInstallCommand.php | 8 ++++++-- system/src/Grav/Console/Gpm/SelfupgradeCommand.php | 8 ++++++-- system/src/Grav/Installer/Install.php | 3 +++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/system/src/Grav/Console/Gpm/DirectInstallCommand.php b/system/src/Grav/Console/Gpm/DirectInstallCommand.php index ab89e800e..1554fe53a 100644 --- a/system/src/Grav/Console/Gpm/DirectInstallCommand.php +++ b/system/src/Grav/Console/Gpm/DirectInstallCommand.php @@ -9,6 +9,7 @@ namespace Grav\Console\Gpm; +use Grav\Common\Cache; use Grav\Common\Grav; use Grav\Common\Filesystem\Folder; use Grav\Common\GPM\GPM; @@ -271,13 +272,14 @@ class DirectInstallCommand extends ConsoleCommand private function upgradeGrav($zip, $folder, $keepFolder = false) { static $ignores = [ - 'assets', 'backup', 'cache', 'images', 'logs', 'tmp', - 'user' + 'user', + '.htaccess', + 'robots.txt' ]; if (!is_dir($folder)) { @@ -297,6 +299,8 @@ class DirectInstallCommand extends ConsoleCommand $folder, $keepFolder ); + + Cache::clearCache(); } } catch (\Exception $e) { Installer::setError($e->getMessage()); diff --git a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php index 9e512e058..0aa753d9a 100644 --- a/system/src/Grav/Console/Gpm/SelfupgradeCommand.php +++ b/system/src/Grav/Console/Gpm/SelfupgradeCommand.php @@ -9,6 +9,7 @@ namespace Grav\Console\Gpm; +use Grav\Common\Cache; use Grav\Common\Filesystem\Folder; use Grav\Common\GPM\Installer; use Grav\Common\GPM\Response; @@ -273,13 +274,14 @@ class SelfupgradeCommand extends ConsoleCommand private function upgradeGrav($zip, $folder, $keepFolder = false) { static $ignores = [ - 'assets', 'backup', 'cache', 'images', 'logs', 'tmp', - 'user' + 'user', + '.htaccess', + 'robots.txt' ]; if (!is_dir($folder)) { @@ -299,6 +301,8 @@ class SelfupgradeCommand extends ConsoleCommand $folder, $keepFolder ); + + Cache::clearCache(); } } catch (\Exception $e) { Installer::setError($e->getMessage()); diff --git a/system/src/Grav/Installer/Install.php b/system/src/Grav/Installer/Install.php index 8fa0ce66f..58bc06198 100644 --- a/system/src/Grav/Installer/Install.php +++ b/system/src/Grav/Installer/Install.php @@ -10,6 +10,7 @@ namespace Grav\Installer; use Composer\Autoload\ClassLoader; +use Grav\Common\Cache; use Grav\Common\GPM\Installer; use Grav\Common\Grav; use Grav\Common\Plugins; @@ -215,6 +216,8 @@ class Install */ public function finalize(): void { + Cache::clearCache(); + clearstatcache(); if (function_exists('opcache_reset')) { @opcache_reset();