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;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Alchemy\Phrasea\Core\Configuration\ApplicationSpecification;
use Alchemy\Phrasea\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
/**
* Handle configuration file mechanism of phraseanet
@@ -160,7 +161,7 @@ class Configuration
$configurations = $this->specifications->getConfigurations();
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]);
@@ -252,10 +253,15 @@ class Configuration
return $this->specifications->initialize();
}
public function setConfigurations($configurations)
public function setConfigurations($configurations, $environment = null)
{
$this->specifications->setConfigurations($configurations);
$this->configuration = new ParameterBag($configurations[$this->environment]);
if (null === $environment) {
$environment = $this->environment;
}
$this->setEnvironnement($environment);
return $this->getConfigurations();
}

View File

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

View File

@@ -114,11 +114,11 @@ class appbox extends base
if (null === $filename) {
break;
}
$media = $core['mediavorus']->guess($pathfile);
$imageSpec = new ImageSpecification();
if($media->getWidth() > 120 || $media->getHeight() > 24) {
$imageSpec->setResizeMode(ImageSpecification::RESIZE_MODE_INBOUND_FIXEDRATIO);
$imageSpec->setDimensions(120, 24);
@@ -528,7 +528,7 @@ class appbox extends base
}
}
$Core->getConfiguration()->setConfigurations($arrayConf);
$Core->getConfiguration()->setConfigurations($arrayConf, $arrayConf['environment']);
$Core->getConfiguration()->setEnvironnement('prod');
}