mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 04:23:19 +00:00
Refactor Phrasea::start
This commit is contained in:
@@ -303,7 +303,7 @@ class Installer implements ControllerProviderInterface
|
||||
}
|
||||
}
|
||||
|
||||
\phrasea::start();
|
||||
\phrasea::start($app['Core']);
|
||||
|
||||
$auth = new \Session_Authentication_None($user);
|
||||
|
||||
|
@@ -80,7 +80,7 @@ class Core extends \Pimple
|
||||
return \registry::get_instance($core);
|
||||
});
|
||||
|
||||
\phrasea::start();
|
||||
\phrasea::start($this);
|
||||
|
||||
$this->enableEvents();
|
||||
}
|
||||
|
@@ -88,6 +88,12 @@ class Configuration
|
||||
if ($this->specifications->isSetup())
|
||||
{
|
||||
$configurations = $this->specifications->getConfigurations();
|
||||
|
||||
if(!isset($configurations[$this->environment]))
|
||||
{
|
||||
throw new \Exception('Requested environnment is not available');
|
||||
}
|
||||
|
||||
$this->configuration = new ParameterBag($configurations[$this->environment]);
|
||||
}
|
||||
else
|
||||
|
@@ -79,7 +79,7 @@ class appbox extends base
|
||||
$this->registry = $registry;
|
||||
$this->session = Session_Handler::getInstance($this);
|
||||
|
||||
$configuration = \Alchemy\Phrasea\Core\Configuration::build();
|
||||
$configuration = $Core->getConfiguration();
|
||||
|
||||
$choosenConnexion = $configuration->getPhraseanet()->get('database');
|
||||
|
||||
|
@@ -103,9 +103,9 @@ class phrasea
|
||||
return $retval;
|
||||
}
|
||||
|
||||
public static function start()
|
||||
public static function start(\Alchemy\Phrasea\Core $Core)
|
||||
{
|
||||
$configuration = \Alchemy\Phrasea\Core\Configuration::build();
|
||||
$configuration = $Core->getConfiguration();
|
||||
|
||||
$choosenConnexion = $configuration->getPhraseanet()->get('database');
|
||||
|
||||
|
@@ -814,7 +814,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
||||
*/
|
||||
protected function resetTwig()
|
||||
{
|
||||
$configuration = \Alchemy\Phrasea\Core\Configuration::build();
|
||||
$configuration = self::$core->getConfiguration();
|
||||
|
||||
$serviceName = $configuration->getTemplating();
|
||||
$confService = $configuration->getService($serviceName);
|
||||
|
@@ -65,7 +65,7 @@ function getFormTimezone($props=array(), $selected=false)
|
||||
return $form;
|
||||
}
|
||||
|
||||
phrasea::start();
|
||||
phrasea::start($Core);
|
||||
?>
|
||||
<html lang="<?php echo $session->get_I18n(); ?>">
|
||||
<head>
|
||||
|
Reference in New Issue
Block a user