Fix #1137 : Phrasea install fails on step 5

This commit is contained in:
Romain Neutron
2013-04-02 23:00:13 +02:00
parent 532064bc43
commit 06c2e45b74
3 changed files with 16 additions and 8 deletions

View File

@@ -11,8 +11,9 @@
namespace Alchemy\Phrasea\Core; namespace Alchemy\Phrasea\Core;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Alchemy\Phrasea\Core\Configuration\ApplicationSpecification; use Alchemy\Phrasea\Core\Configuration\ApplicationSpecification;
use Alchemy\Phrasea\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/** /**
* Handle configuration file mechanism of phraseanet * Handle configuration file mechanism of phraseanet
@@ -160,7 +161,7 @@ class Configuration
$configurations = $this->specifications->getConfigurations(); $configurations = $this->specifications->getConfigurations();
if ( ! isset($configurations[$this->environment])) { if ( ! isset($configurations[$this->environment])) {
throw new \Exception('Requested environnment is not available'); throw new InvalidArgumentException('Requested environnment is not available');
} }
$this->configuration = new ParameterBag($configurations[$this->environment]); $this->configuration = new ParameterBag($configurations[$this->environment]);
@@ -252,10 +253,15 @@ class Configuration
return $this->specifications->initialize(); return $this->specifications->initialize();
} }
public function setConfigurations($configurations) public function setConfigurations($configurations, $environment = null)
{ {
$this->specifications->setConfigurations($configurations); $this->specifications->setConfigurations($configurations);
$this->configuration = new ParameterBag($configurations[$this->environment]);
if (null === $environment) {
$environment = $this->environment;
}
$this->setEnvironnement($environment);
return $this->getConfigurations(); return $this->getConfigurations();
} }

View File

@@ -137,6 +137,8 @@ class ApplicationSpecification implements Specification
, $this->getConfigurationsPathFile() , $this->getConfigurationsPathFile()
); );
touch($this->getBinariesPathFile());
if (function_exists('chmod')) { if (function_exists('chmod')) {
chmod($this->getConnexionsPathFile(), 0700); chmod($this->getConnexionsPathFile(), 0700);
chmod($this->getConfigurationsPathFile(), 0700); chmod($this->getConfigurationsPathFile(), 0700);

View File

@@ -528,7 +528,7 @@ class appbox extends base
} }
} }
$Core->getConfiguration()->setConfigurations($arrayConf); $Core->getConfiguration()->setConfigurations($arrayConf, $arrayConf['environment']);
$Core->getConfiguration()->setEnvironnement('prod'); $Core->getConfiguration()->setEnvironnement('prod');
} }