partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 997774eb857f60d6db5e44889796b8dff2273fed
parent a4a0dec46efe7c39721e707f04292ff2bc5fa253
Author: Felicitus <felicitus@felicitus.org>
Date:   Thu, 15 Oct 2015 14:43:17 +0200

Allow different cache environments set by environment variables

Diffstat:
Mapp/AppKernel.php | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)

diff --git a/app/AppKernel.php b/app/AppKernel.php @@ -72,6 +72,21 @@ class AppKernel extends Kernel } /** + * Override to allow different cache environments set by the environment variable PARTKEEPR_ENVIRONMENT + * @return string + */ + public function getCacheDir() + { + $environment = getenv("PARTKEEPR_ENVIRONMENT"); + + if ($environment === false) { + $environment = $this->environment; + } + + return $this->rootDir.'/cache/'.$environment; + } + + /** * Override to avoid stripping comments. * * @see https://github.com/partkeepr/PartKeepr/issues/438