partkeepr

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

commit 28876a44b5a109ef674d7ca73f1a67c7330d9416
parent ab86173843626c2da4be830e72b2323fbcf34192
Author: Felicitus <felicitus@felicitus.org>
Date:   Fri, 25 Nov 2011 08:57:26 +0100

Check if APC exists; if not, use ArrayCache instead of ApcCache

Diffstat:
Msrc/de/RaumZeitLabor/PartKeepr/PartKeepr.php | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/de/RaumZeitLabor/PartKeepr/PartKeepr.php b/src/de/RaumZeitLabor/PartKeepr/PartKeepr.php @@ -116,7 +116,12 @@ class PartKeepr { 'host' => PartKeeprConfiguration::getOption("partkeepr.database.hostname", "localhost") ); - $cache = new \Doctrine\Common\Cache\ApcCache(); + if (extension_loaded("apc")) { + $cache = new \Doctrine\Common\Cache\ApcCache(); + } else { + $cache = new \Doctrine\Common\Cache\ArrayCache(); + } + $config->setMetadataCacheImpl($cache); $config->setQueryCacheImpl($cache);