replace connexion.inc & replace servername

This commit is contained in:
Nicolas Le Goff
2012-01-03 14:47:56 +01:00
parent 8a73c310eb
commit cc05ba9ac6

View File

@@ -23,6 +23,7 @@ class registry implements registryInterface
* @var cache_opcode_adapter * @var cache_opcode_adapter
*/ */
protected $cache; protected $cache;
/** /**
* *
* @var registry * @var registry
@@ -57,11 +58,15 @@ class registry implements registryInterface
{ {
$this->cache = $cache; $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_RootPath', dirname(dirname(__DIR__)) . '/');
$this->cache->set('GV_ServerName', p4string::addEndSlash($servername)); $this->cache->set('GV_debug', $configuration->isDebug());
$this->cache->set('GV_debug', !!$debug); $this->cache->set('GV_maintenance', $configuration->isMaintained());
$this->cache->set('GV_maintenance', !!$maintenance);
return $this; return $this;
} }
@@ -88,7 +93,7 @@ class registry implements registryInterface
} }
catch (Exception $e) catch (Exception $e)
{ {
} }
foreach ($rs as $row) foreach ($rs as $row)
{ {
@@ -130,7 +135,7 @@ class registry implements registryInterface
if (!$this->cache->is_set($key)) if (!$this->cache->is_set($key))
$this->load(); $this->load();
if(!$this->cache->is_set($key) && !is_null($defaultvalue)) if (!$this->cache->is_set($key) && !is_null($defaultvalue))
return $defaultvalue; return $defaultvalue;
else else
return $this->cache->get($key); return $this->cache->get($key);