1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

Merge pull request #5999 from kasimi/ticket/16510-3.2.x

[ticket/16510] [3.2.x] Add config values to schema_data.sql
This commit is contained in:
Marc Alexander
2020-06-06 17:10:25 +02:00
5 changed files with 163 additions and 27 deletions

View File

@@ -0,0 +1,64 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v32x;
use phpbb\db\migration\migration_interface;
use phpbb\db\migrator;
class add_missing_config extends \phpbb\db\migration\container_aware_migration
{
static public function depends_on()
{
return [
'\phpbb\db\migration\data\v32x\v329',
];
}
public function update_data()
{
$migration_classes = [
'\phpbb\db\migration\data\v30x\release_3_0_3_rc1',
'\phpbb\db\migration\data\v30x\release_3_0_6_rc1',
'\phpbb\db\migration\data\v31x\add_jabber_ssl_context_config_options',
'\phpbb\db\migration\data\v31x\add_smtp_ssl_context_config_options',
'\phpbb\db\migration\data\v31x\update_hashes',
'\phpbb\db\migration\data\v320\font_awesome_update',
'\phpbb\db\migration\data\v320\text_reparser',
'\phpbb\db\migration\data\v32x\cookie_notice_p2',
];
/** @var migrator $migrator */
$migrator = $this->container->get('migrator');
$update_data = [];
foreach ($migration_classes as $migration_class)
{
/** @var migration_interface $migration */
$migration = $migrator->get_migration($migration_class);
$migration_update_data = $migration->update_data();
foreach ($migration_update_data as $entry)
{
if ($entry[0] == 'config.add')
{
$update_data[] = $entry;
}
}
}
return $update_data;
}
}

View File

@@ -23,7 +23,7 @@ class font_awesome_update_cdn extends \phpbb\db\migration\migration
static public function depends_on()
{
return [
'\phpbb\db\migration\data\v32x\v329',
'\phpbb\db\migration\data\v32x\add_missing_config',
];
}

View File

@@ -0,0 +1,44 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\db\migration\data\v32x;
class font_awesome_update_cdn_fix_depends_on extends \phpbb\db\migration\migration
{
static public function depends_on()
{
return [
'\phpbb\db\migration\data\v32x\font_awesome_update_cdn',
'\phpbb\db\migration\data\v32x\add_missing_config',
];
}
public function update_data()
{
return [
['custom', [[$this, 'fix_depends_on']]],
];
}
public function fix_depends_on()
{
$migration_class = '\phpbb\db\migration\data\v32x\font_awesome_update_cdn';
$migration_depends_on = $migration_class::depends_on();
$sql = 'UPDATE ' . $this->table_prefix . "migrations
SET migration_depends_on = '" . $this->db->sql_escape(serialize($migration_depends_on)) . "'
WHERE migration_name = ' . $migration_class . '";
$this->db->sql_query($sql);
}
}

View File

@@ -948,7 +948,7 @@ class migrator
* @param string $name Name of the migration
* @return \phpbb\db\migration\migration
*/
protected function get_migration($name)
public function get_migration($name)
{
$migration = new $name($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix);