From cc05ba9ac6af9b85e7adc9c0c00448a304442297 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 3 Jan 2012 14:47:56 +0100 Subject: [PATCH] replace connexion.inc & replace servername --- lib/classes/registry.class.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/classes/registry.class.php b/lib/classes/registry.class.php index ada342d04d..3084d24cc2 100644 --- a/lib/classes/registry.class.php +++ b/lib/classes/registry.class.php @@ -23,6 +23,7 @@ class registry implements registryInterface * @var cache_opcode_adapter */ protected $cache; + /** * * @var registry @@ -57,11 +58,15 @@ class registry implements registryInterface { $this->cache = $cache; - require __DIR__ . '/../../config/config.inc'; + $handler = new \Alchemy\Phrasea\Core\Configuration\Handler( + new \Alchemy\Phrasea\Core\Configuration\Application(), + new \Alchemy\Phrasea\Core\Configuration\Parser\Yaml() + ); + $configuration = new \Alchemy\Phrasea\Core\Configuration($handler); + $this->cache->set('GV_RootPath', dirname(dirname(__DIR__)) . '/'); - $this->cache->set('GV_ServerName', p4string::addEndSlash($servername)); - $this->cache->set('GV_debug', !!$debug); - $this->cache->set('GV_maintenance', !!$maintenance); + $this->cache->set('GV_debug', $configuration->isDebug()); + $this->cache->set('GV_maintenance', $configuration->isMaintained()); return $this; } @@ -88,7 +93,7 @@ class registry implements registryInterface } catch (Exception $e) { - + } foreach ($rs as $row) { @@ -130,7 +135,7 @@ class registry implements registryInterface if (!$this->cache->is_set($key)) $this->load(); - if(!$this->cache->is_set($key) && !is_null($defaultvalue)) + if (!$this->cache->is_set($key) && !is_null($defaultvalue)) return $defaultvalue; else return $this->cache->get($key);