mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
replace connexion.inc & replace servername
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user