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

Merge branch 'develop-ascraeus' into develop

Conflicts:
	phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
	phpBB/phpbb/db/migration/profilefield_base_migration.php
	phpBB/phpbb/db/migrator.php
This commit is contained in:
Joas Schilling
2015-01-20 23:32:36 +01:00
12 changed files with 156 additions and 32 deletions

View File

@@ -0,0 +1,36 @@
<?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;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Abstract base class for container aware database migrations.
*/
abstract class container_aware_migration extends migration implements ContainerAwareInterface
{
/**
* @var ContainerInterface
*/
protected $container;
/**
* {@inheritdoc}
*/
public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
}
}

View File

@@ -13,7 +13,9 @@
namespace phpbb\db\migration\data\v30x;
class release_3_0_5_rc1 extends \phpbb\db\migration\migration
use phpbb\db\migration\container_aware_migration;
class release_3_0_5_rc1 extends container_aware_migration
{
public function effectively_installed()
{
@@ -55,10 +57,9 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration
public function hash_old_passwords()
{
global $phpbb_container;
/* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
$passwords_manager = $this->container->get('passwords.manager');
$sql = 'SELECT user_id, user_password
FROM ' . $this->table_prefix . 'users
WHERE user_pass_convert = 1';

View File

@@ -13,12 +13,14 @@
namespace phpbb\db\migration\data\v310;
use phpbb\db\migration\container_aware_migration;
/**
* Migration to convert the Soft Delete MOD for 3.0
*
* https://www.phpbb.com/customise/db/mod/soft_delete/
*/
class soft_delete_mod_convert extends \phpbb\db\migration\migration
class soft_delete_mod_convert extends container_aware_migration
{
static public function depends_on()
{
@@ -115,19 +117,11 @@ class soft_delete_mod_convert extends \phpbb\db\migration\migration
}
}
/**
* @return \phpbb\content_visibility
*/
protected function get_content_visibility()
{
return new \phpbb\content_visibility(
new \phpbb\auth\auth(),
$this->config,
$this->db,
new \phpbb\user('\phpbb\datetime'),
$this->phpbb_root_path,
$this->php_ext,
$this->table_prefix . 'forums',
$this->table_prefix . 'posts',
$this->table_prefix . 'topics',
$this->table_prefix . 'users'
);
return $this->container->get('content.visibility');
}
}

View File

@@ -13,7 +13,7 @@
namespace phpbb\db\migration;
abstract class profilefield_base_migration extends \phpbb\db\migration\migration
abstract class profilefield_base_migration extends container_aware_migration
{
protected $profilefield_name;
@@ -237,10 +237,8 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
if ($profile_row === null)
{
global $phpbb_container;
/* @var $manager \phpbb\profilefields\manager */
$manager = $phpbb_container->get('profilefields.manager');
$manager = $this->container->get('profilefields.manager');
$profile_row = $manager->build_insert_sql_array(array());
}