Fix install

This commit is contained in:
Romain Neutron
2013-05-23 18:52:41 +02:00
parent 70d37b1f6a
commit 9285536d0d
6 changed files with 6 additions and 59 deletions

View File

@@ -56,9 +56,6 @@ class Install extends Command
{ {
$dialog = $this->getHelperSet()->get('dialog'); $dialog = $this->getHelperSet()->get('dialog');
$setupRegistry = new \Setup_Registry();
$this->container['phraseanet.registry'] = $setupRegistry;
$output->writeln("<comment> $output->writeln("<comment>
,-._.-._.-._.-._.-. ,-._.-._.-._.-._.-.
`-. ,-' `-. ,-'

View File

@@ -115,7 +115,6 @@ class Setup implements ControllerProviderInterface
$appbox_name = $request->request->get('ab_name'); $appbox_name = $request->request->get('ab_name');
$databox_name = $request->request->get('db_name'); $databox_name = $request->request->get('db_name');
$setupRegistry = new \Setup_Registry();
try { try {
$abConn = new \connection_pdo('appbox', $hostname, $port, $user_ab, $ab_password, $appbox_name, array(), $app['debug']); $abConn = new \connection_pdo('appbox', $hostname, $port, $user_ab, $ab_password, $appbox_name, array(), $app['debug']);

View File

@@ -52,7 +52,6 @@ class Installer
private function populateRegistryData($serverName, $dataPath, $binaryData) private function populateRegistryData($serverName, $dataPath, $binaryData)
{ {
$this->app['phraseanet.registry']->set('GV_base_datapath_noweb', $dataPath, \registry::TYPE_STRING); $this->app['phraseanet.registry']->set('GV_base_datapath_noweb', $dataPath, \registry::TYPE_STRING);
$this->app['phraseanet.registry']->set('GV_ServerName', $serverName, \registry::TYPE_STRING); $this->app['phraseanet.registry']->set('GV_ServerName', $serverName, \registry::TYPE_STRING);
@@ -236,6 +235,7 @@ class Installer
$arrayConf = $this->app['phraseanet.configuration']->getConfigurations(); $arrayConf = $this->app['phraseanet.configuration']->getConfigurations();
$arrayConf['key'] = md5(mt_rand(100000000, 999999999)); $arrayConf['key'] = md5(mt_rand(100000000, 999999999));
$this->app['phraseanet.registry']->setKey($arrayConf['key']);
foreach ($arrayConf as $key => $value) { foreach ($arrayConf as $key => $value) {
if (is_array($value) && array_key_exists('phraseanet', $value)) { if (is_array($value) && array_key_exists('phraseanet', $value)) {

View File

@@ -1,50 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2011 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Simple registry object for setup when appbox registry does not exists yet
*
* @package Setup
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class Setup_Registry implements registryInterface
{
protected $datas = array();
public function __construct()
{
$this->datas['GV_RootPath'] = realpath(__DIR__ . '/../../..') . '/';
}
public function get($key, $defaultvalue = null)
{
return isset($this->datas[$key]) ? $this->datas[$key] : $defaultvalue;
}
public function set($key, $value, $type)
{
$this->datas[$key] = $value;
}
public function is_set($key)
{
return isset($this->datas[$key]);
}
public function un_set($key)
{
if (isset($this->datas[$key]))
unset($datas[$key]);
return $this;
}
}

View File

@@ -68,8 +68,6 @@ class module_console_systemUpgrade extends Command
try { try {
$output->write('<info>Upgrading...</info>', true); $output->write('<info>Upgrading...</info>', true);
$this->container['phraseanet.registry'] = new \Setup_Registry();
if (count(User_Adapter::get_wrong_email_users($this->container)) > 0) { if (count(User_Adapter::get_wrong_email_users($this->container)) > 0) {
return $output->writeln(sprintf('<error>You have to fix your database before upgrade with the system:mailCheck command </error>')); return $output->writeln(sprintf('<error>You have to fix your database before upgrade with the system:mailCheck command </error>'));
} }
@@ -78,8 +76,6 @@ class module_console_systemUpgrade extends Command
$this->getService('phraseanet.appbox')->forceUpgrade($upgrader, $this->container); $this->getService('phraseanet.appbox')->forceUpgrade($upgrader, $this->container);
$this->container['phraseanet.registry'] = new \registry($this->container);
foreach ($upgrader->getRecommendations() as $recommendation) { foreach ($upgrader->getRecommendations() as $recommendation) {
list($message, $command) = $recommendation; list($message, $command) = $recommendation;

View File

@@ -199,6 +199,11 @@ class registry implements registryInterface
return $this; return $this;
} }
public function setKey($value)
{
$this->cache->save('GV_sit', $value);
}
/** /**
* *
* @param string $key * @param string $key