[feature/migrations] Rename classes, depends on

PHPBB3-9737
This commit is contained in:
Nathan Guse 2013-01-08 22:07:01 -06:00
parent b52a0f50ab
commit ce021710fb
51 changed files with 3520 additions and 347 deletions

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v3011 extends phpbb_db_migration
class phpbb_db_migration_3_0_1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v3011rc2');
return array('phpbb_db_migration_3_0_1_rc1');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v3010rc2 extends phpbb_db_migration
class phpbb_db_migration_3_0_10 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v3010rc1');
return array('phpbb_db_migration_3_0_10_rc3');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v3010rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_10_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v309');
return array('phpbb_db_migration_3_0_9');
}
function update_schema()

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_10_rc2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_10_rc1');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_10_rc3 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_10_rc2');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v3010rc3 extends phpbb_db_migration
class phpbb_db_migration_3_0_11 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v3010rc2');
return array('phpbb_db_migration_3_0_11_rc2');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v3011rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_11_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v3010');
return array('phpbb_db_migration_3_0_10');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v3011rc2 extends phpbb_db_migration
class phpbb_db_migration_3_0_11_rc2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v3011rc1');
return array('phpbb_db_migration_3_0_11_rc1');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v3012rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_12_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v3011');
return array('phpbb_db_migration_3_0_11');
}
function update_schema()

View file

@ -7,7 +7,7 @@
*
*/
class phpbb_db_migration_v301rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_1_rc1 extends phpbb_db_migration
{
function depends_on()
{

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v301 extends phpbb_db_migration
class phpbb_db_migration_3_0_2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v301rc1');
return array('phpbb_db_migration_3_0_2_rc2');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v301rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_1_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v301');
return array('phpbb_db_migration_3_0_1');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v302rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_2_rc2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v302rc1');
return array('phpbb_db_migration_3_0_2_rc1');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v3010 extends phpbb_db_migration
class phpbb_db_migration_3_0_3 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v3010rc3');
return array('phpbb_db_migration_3_0_2_rc2');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v303rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_3_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v302');
return array('phpbb_db_migration_3_0_2');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v304 extends phpbb_db_migration
class phpbb_db_migration_3_0_4 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v304rc1');
return array('phpbb_db_migration_3_0_4_rc1');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v304rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_4_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v303');
return array('phpbb_db_migration_3_0_3');
}
function update_schema()

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_5 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_5_rc1part2');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v305rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_5_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v304');
return array('phpbb_db_migration_3_0_4');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v305rc1part2 extends phpbb_db_migration
class phpbb_db_migration_3_0_5_rc1part2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v305rc1');
return array('phpbb_db_migration_3_0_5_rc1');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v302 extends phpbb_db_migration
class phpbb_db_migration_3_0_6 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v302rc2');
return array('phpbb_db_migration_3_0_6_rc4');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v306rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_6_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v305');
return array('phpbb_db_migration_3_0_5');
}
function update_schema()

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_6_rc2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_6_rc1');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v306rc3 extends phpbb_db_migration
class phpbb_db_migration_3_0_6_rc3 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v306rc2');
return array('phpbb_db_migration_3_0_6_rc2');
}
function update_schema()

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_6_rc4 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_6_rc3');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_7 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_7_rc2');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_7_pl1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_7');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v307rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_7_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v306');
return array('phpbb_db_migration_3_0_6');
}
function update_schema()

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v307rc2 extends phpbb_db_migration
class phpbb_db_migration_3_0_7_rc2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v307rc1');
return array('phpbb_db_migration_3_0_7_rc1');
}
function update_schema()

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_8 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_8_rc1');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v308rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_8_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v307pl1');
return array('phpbb_db_migration_3_0_7_pl1');
}
function update_schema()

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_9 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_9_rc4');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -7,11 +7,11 @@
*
*/
class phpbb_db_migration_v309rc1 extends phpbb_db_migration
class phpbb_db_migration_3_0_9_rc1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v308');
return array('phpbb_db_migration_3_0_8');
}
function update_schema()

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_9_rc2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_9_rc1');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_9_rc3 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_9_rc2');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -0,0 +1,25 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_3_0_9_rc4 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_3_0_9_rc3');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v303 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v302rc2');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v305 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v305rc1part2');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v306 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v306rc4');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v306rc2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v306rc1');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v306rc4 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v306rc3');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v307 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v307rc2');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v307pl1 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v307');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v308 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v308rc1');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v309 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v309rc4');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v309rc2 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v309rc1');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v309rc3 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v309rc2');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -1,25 +0,0 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migration_v309rc4 extends phpbb_db_migration
{
function depends_on()
{
return array('phpbb_db_migration_v309rc3');
}
function update_schema()
{
return array();
}
function update_data()
{
}
}

View file

@ -0,0 +1,15 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migrationtools_base
{
var $cache;
var $config;
var $db;
}

View file

@ -0,0 +1,121 @@
<?php
/**
*
* @package migration
* @copyright (c) 2012 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License v2
*
*/
class phpbb_db_migrationtools_config extends phpbb_db_migration
{
/**
* Config Exists
*
* This function is to check to see if a config variable exists or if it does not.
*
* @param string $config_name The name of the config setting you wish to check for.
* @param bool $return_result - return the config value/default if true : default false.
*
* @return bool true/false if config exists
*/
function config_exists($config_name, $return_result = false)
{
$sql = 'SELECT *
FROM ' . CONFIG_TABLE . "
WHERE config_name = '" . $this->db->sql_escape($config_name) . "'";
$result = $this->db->sql_query($sql);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
if ($row)
{
if (!isset($this->config[$config_name]))
{
$this->config[$config_name] = $row['config_value'];
if (!$row['is_dynamic'])
{
$this->cache->destroy('config');
}
}
return ($return_result) ? $row : true;
}
// this should never happen, but if it does, we need to remove the config from the array
if (isset($this->config[$config_name]))
{
unset($this->config[$config_name]);
$this->cache->destroy('config');
}
return false;
}
/**
* Config Add
*
* This function allows you to add a config setting.
*
* @param string $config_name The name of the config setting you would like to add
* @param mixed $config_value The value of the config setting
* @param bool $is_dynamic True if it is dynamic (changes very often) and should not be stored in the cache, false if not.
*
* @return result
*/
function config_add($config_name, $config_value = '', $is_dynamic = false)
{
if ($this->config_exists($config_name))
{
return $this->umil_end('CONFIG_ALREADY_EXISTS', $config_name);
}
set_config($config_name, $config_value, $is_dynamic);
}
/**
* Config Update
*
* This function allows you to update an existing config setting.
*
* @param string $config_name The name of the config setting you would like to update
* @param mixed $config_value The value of the config setting
* @param bool $is_dynamic True if it is dynamic (changes very often) and should not be stored in the cache, false if not.
*
* @return result
*/
function config_update($config_name, $config_value = '')
{
if (!$this->config_exists($config_name))
{
return $this->umil_end('CONFIG_NOT_EXIST', $config_name);
}
set_config($config_name, $config_value);
}
/**
* Config Remove
*
* This function allows you to remove an existing config setting.
*
* @param string $config_name The name of the config setting you would like to remove
*
* @return result
*/
function config_remove($config_name)
{
if (!$this->config_exists($config_name))
{
return $this->umil_end('CONFIG_NOT_EXIST', $config_name);
}
$sql = 'DELETE FROM ' . CONFIG_TABLE . "
WHERE config_name = '" . $this->db->sql_escape($config_name) . "'";
$this->db->sql_query($sql);
unset($this->config[$config_name]);
$this->cache->destroy('config');
}
}

File diff suppressed because it is too large Load diff