mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-08 18:44:30 +00:00
102 lines
2.4 KiB
PHP
102 lines
2.4 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Phraseanet
|
|
*
|
|
* (c) 2005-2012 Alchemy
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
/**
|
|
*
|
|
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
|
* @link www.phraseanet.com
|
|
*/
|
|
class patch_320aa implements patchInterface
|
|
{
|
|
/**
|
|
*
|
|
* @var string
|
|
*/
|
|
private $release = '3.2.0.0.a1';
|
|
|
|
/**
|
|
*
|
|
* @var Array
|
|
*/
|
|
private $concern = array(base::APPLICATION_BOX);
|
|
|
|
/**
|
|
*
|
|
* @return string
|
|
*/
|
|
public function get_release()
|
|
{
|
|
return $this->release;
|
|
}
|
|
|
|
public function require_all_upgrades()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return Array
|
|
*/
|
|
public function concern()
|
|
{
|
|
return $this->concern;
|
|
}
|
|
|
|
public function apply(base &$appbox)
|
|
{
|
|
if (is_file(__DIR__ . '/../../../config/_GV.php'))
|
|
require __DIR__ . '/../../../config/_GV.php';
|
|
require __DIR__ . '/../../../lib/conf.d/_GV_template.inc';
|
|
|
|
define('GV_STATIC_URL', '');
|
|
define('GV_sphinx', false);
|
|
define('GV_sphinx_host', '');
|
|
define('GV_sphinx_port', '');
|
|
define('GV_sphinx_rt_host', '');
|
|
define('GV_sphinx_rt_port', '');
|
|
|
|
$registry = $appbox->get_registry();
|
|
|
|
foreach ($GV as $section => $datas_section) {
|
|
foreach ($datas_section['vars'] as $datas) {
|
|
|
|
$registry->un_set($datas['name']);
|
|
eval('$test = defined("' . $datas["name"] . '");');
|
|
if ( ! $test) {
|
|
continue;
|
|
}
|
|
eval('$val = ' . $datas["name"] . ';');
|
|
|
|
$val = $val === true ? '1' : $val;
|
|
$val = $val === false ? '0' : $val;
|
|
|
|
switch ($datas['type']) {
|
|
case registry::TYPE_ENUM_MULTI:
|
|
case registry::TYPE_INTEGER:
|
|
case registry::TYPE_BOOLEAN:
|
|
case registry::TYPE_STRING:
|
|
case registry::TYPE_ARRAY:
|
|
$type = $datas['type'];
|
|
break;
|
|
default:
|
|
$type = registry::TYPE_STRING;
|
|
break;
|
|
}
|
|
$registry->set($datas['name'], $val, $type);
|
|
}
|
|
}
|
|
$registry->un_set('registry_loaded');
|
|
|
|
return true;
|
|
}
|
|
}
|