diff --git a/hudson/_GV.php b/hudson/_GV.php index d879f1ce6b..c4a14423c3 100644 --- a/hudson/_GV.php +++ b/hudson/_GV.php @@ -1,3 +1,88 @@ get_viewname()] = $cgus[$app['locale']]['value']; } - return new Response($app['Core']['Twig']->render('/prod/TOU.html.twig', array('TOUs' => $data))); + return new Response($app['twig']->render('/prod/TOU.html.twig', array('TOUs' => $data))); }); return $controllers; diff --git a/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php b/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php index f823cb2c30..beb278eaa2 100644 --- a/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php +++ b/lib/Alchemy/Phrasea/Core/Configuration/ApplicationSpecification.php @@ -122,6 +122,8 @@ class ApplicationSpecification implements SpecificationInterface , $this->getConfigurationsPathFile() ); + $this->setBinaries(array('binaries' => array())); + if (function_exists('chmod')) { chmod($this->getConnexionsPathFile(), 0700); chmod($this->getConfigurationsPathFile(), 0700); diff --git a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php index ecea77367c..96fed8388a 100644 --- a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php +++ b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php @@ -99,7 +99,6 @@ class Migration31 implements MigrationInterface $type = $datas['type']; switch ($datas['type']) { case \registry::TYPE_ENUM_MULTI: - case \registry::TYPE_ENUM: $val = serialize($val); break; case \registry::TYPE_INTEGER: @@ -112,6 +111,7 @@ class Migration31 implements MigrationInterface case \registry::TYPE_BINARY: case \registry::TYPE_TEXT: case \registry::TYPE_TIMEZONE: + case \registry::TYPE_ENUM: $val = (string) $val; break; default: @@ -127,6 +127,13 @@ class Migration31 implements MigrationInterface )); } } + + $stmt->execute(array( + ':key' => 'GV_sit', + ':value' => GV_sit, + ':type' => \registry::TYPE_STRING, + )); + $stmt->closeCursor(); rename(__DIR__ . '/../../../../../../config/_GV.php', __DIR__ . '/../../../../../../config/_GV.php.old'); diff --git a/lib/classes/patch/373.class.php b/lib/classes/patch/373.class.php index 41ab8d6857..884ed98b10 100644 --- a/lib/classes/patch/373.class.php +++ b/lib/classes/patch/373.class.php @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ +use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Core\Configuration; -use Symfony\Component\Yaml\Dumper; /** * @@ -57,7 +57,7 @@ class patch_373 implements patchInterface /** * @param base $databox */ - public function apply(base &$appbox) + public function apply(base $appbox, Application $app) { $sql = 'SELECT * FROM registry WHERE `key` = :key'; $stmt = $appbox->get_connection()->prepare($sql); @@ -100,8 +100,7 @@ class patch_373 implements patchInterface $stmt->closeCursor(); - $configuration = Configuration::build(); - $configuration->setBinaries(array('binaries' => $binaries)); + $app['phraseanet.configuration']->setBinaries(array('binaries' => $binaries)); $sql = 'DELETE FROM registry WHERE `key` = :key'; $stmt = $appbox->get_connection()->prepare($sql); @@ -112,18 +111,16 @@ class patch_373 implements patchInterface $stmt->closeCursor(); - $GV_sit = null; - $sql = 'SELECT value FROM registry WHERE `key` = :key'; $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(array(':key'=>'GV_sit')); $row = $stmt->fetch(\PDO::FETCH_ASSOC); $stmt->closeCursor(); - $configs = $configuration->getConfigurations(); + $configs = $app['phraseanet.configuration']->getConfigurations(); $configs['key'] = $row['value']; - $configuration->setConfigurations($configs); - + $app['phraseanet.configuration']->setConfigurations($configs); + $sql = 'DELETE FROM registry WHERE `key` = :key'; $stmt = $appbox->get_connection()->prepare($sql); $stmt->execute(array(':key'=>'GV_sit')); diff --git a/tests/Alchemy/Phrasea/Setup/AbstractSetupTester.inc b/tests/Alchemy/Phrasea/Setup/AbstractSetupTester.inc index 72fb6358b9..490ef9f9d6 100644 --- a/tests/Alchemy/Phrasea/Setup/AbstractSetupTester.inc +++ b/tests/Alchemy/Phrasea/Setup/AbstractSetupTester.inc @@ -37,7 +37,10 @@ abstract class AbstractSetupTester extends \PHPUnit_Framework_TestCase $this->uninstall(); - file_put_contents(__DIR__ . '/../../../../config/_GV.php', "get_connection()->get_credentials(); - + $this->uninstall(); file_put_contents(__DIR__ . '/../../../../config/config.inc', "rootDir . 'services.yml'; } + + protected function getBinariesPathFile() + { + return $this->rootDir . 'binaries.yml'; + } } diff --git a/tests/PhraseanetPHPUnitAbstract.class.inc b/tests/PhraseanetPHPUnitAbstract.class.inc index 46629b2747..ce6d699f92 100644 --- a/tests/PhraseanetPHPUnitAbstract.class.inc +++ b/tests/PhraseanetPHPUnitAbstract.class.inc @@ -136,7 +136,6 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase return $app; }); - self::$DI['client'] = self::$DI->share(function($DI) { return new Client($DI['app'], array()); });