From f2d2fc6221069f89a20231e9cdb6e2fc0b21b479 Mon Sep 17 00:00:00 2001 From: Thomas Metois Date: Fri, 16 Dec 2016 16:31:24 +0100 Subject: [PATCH] Clear ZF2 cache conf when update-all --- config/application.config.php-dist-BO | 7 +++++++ config/application.config.php-dist-FO | 7 +++++++ scripts/update-all.sh | 3 +++ 3 files changed, 17 insertions(+) diff --git a/config/application.config.php-dist-BO b/config/application.config.php-dist-BO index b7e2a90..090d11a 100644 --- a/config/application.config.php-dist-BO +++ b/config/application.config.php-dist-BO @@ -6,6 +6,13 @@ * @see https://github.com/zendframework/ZFTool */ $env = getenv('APP_ENV') ?: 'production'; + +if(file_exists('data/cache/upgrade')){ + $env = 'upgrade'; + putenv('APP_ENV',$env); + unlink('data/cache/upgrade'); +} + return array( 'modules' => array( 'DoctrineModule', diff --git a/config/application.config.php-dist-FO b/config/application.config.php-dist-FO index ee624df..069f670 100644 --- a/config/application.config.php-dist-FO +++ b/config/application.config.php-dist-FO @@ -6,6 +6,13 @@ * @see https://github.com/zendframework/ZFTool */ $env = getenv('APP_ENV') ?: 'production'; + +if(file_exists('data/cache/upgrade')){ + $env = 'upgrade'; + putenv('APP_ENV',$env); + unlink('data/cache/upgrade'); +} + return array( 'modules' => array( 'DoctrineModule', diff --git a/scripts/update-all.sh b/scripts/update-all.sh index 6cf2598..1e54a58 100755 --- a/scripts/update-all.sh +++ b/scripts/update-all.sh @@ -71,3 +71,6 @@ fi php ./public/index.php orm:clear-cache:metadata php ./public/index.php orm:clear-cache:query php ./public/index.php orm:clear-cache:result + +# Clear ZF2 cache +touch ./data/cache/upgrade && chmod 777 ./data/cache/upgrade