1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-14 12:40:13 +01:00

Merge pull request #2967 from nickvergessen/ticket/12963

[ticket/12963] Revert back to "migrations" folder name for extensions

* nickvergessen/ticket/12963:
  [ticket/12963] Always use core_path and core_directory()
  [ticket/12963] Remove old migration/ folder from tests
  [ticket/12963] Revert back to "migrations" folder name for extensions
This commit is contained in:
Tristan Darricau 2014-09-18 14:04:06 +02:00
commit bad07b355c
8 changed files with 5 additions and 100 deletions

View File

@ -181,17 +181,9 @@ $phpbb_extension_manager = $phpbb_container->get('ext.manager');
$migrations = $phpbb_extension_manager $migrations = $phpbb_extension_manager
->get_finder() ->get_finder()
->core_path('phpbb/db/migration/data/') ->core_path('phpbb/db/migration/data/')
->extension_directory('/migration')
->get_classes();
// @deprecated 3.1.0-RC4 (To be removed: 3.2.0)
$migrations_deprecated = $phpbb_extension_manager
->get_finder()
->extension_directory('/migrations') ->extension_directory('/migrations')
->get_classes(); ->get_classes();
$migrations = array_merge($migrations, $migrations_deprecated);
$migrator->set_migrations($migrations); $migrator->set_migrations($migrations);
// What is a safe limit of execution time? Half the max execution time should be safe. // What is a safe limit of execution time? Half the max execution time should be safe.

View File

@ -117,17 +117,9 @@ class migrate extends \phpbb\console\command\command
$migrations = $this->extension_manager $migrations = $this->extension_manager
->get_finder() ->get_finder()
->core_path('phpbb/db/migration/data/') ->core_path('phpbb/db/migration/data/')
->extension_directory('/migration')
->get_classes();
// @deprecated 3.1.0-RC4 (To be removed: 3.2.0)
$migrations_deprecated = $this->extension_manager
->get_finder()
->extension_directory('/migrations') ->extension_directory('/migrations')
->get_classes(); ->get_classes();
$migrations = array_merge($migrations, $migrations_deprecated);
$this->migrator->set_migrations($migrations); $this->migrator->set_migrations($migrations);
} }

View File

@ -132,20 +132,11 @@ class base implements \phpbb\extension\extension_interface
// Only have the finder search in this extension path directory // Only have the finder search in this extension path directory
$migrations = $this->extension_finder $migrations = $this->extension_finder
->extension_directory('/migration') ->extension_directory('/migrations')
->find_from_extension($this->extension_name, $this->extension_path); ->find_from_extension($this->extension_name, $this->extension_path);
$migrations = $this->extension_finder->get_classes_from_files($migrations); $migrations = $this->extension_finder->get_classes_from_files($migrations);
// @deprecated 3.1.0-RC4 (To be removed: 3.2.0)
$migrations_deprecated = $this->extension_finder
->extension_directory('/migrations')
->find_from_extension($this->extension_name, $this->extension_path);
$migrations_deprecated = $this->extension_finder->get_classes_from_files($migrations_deprecated);
$migrations = array_merge($migrations, $migrations_deprecated);
return $migrations; return $migrations;
} }
} }

View File

@ -1,18 +0,0 @@
<?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 vendor2\bar\migration;
class migration extends \phpbb\db\migration\migration
{
}

View File

@ -1,18 +0,0 @@
<?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 vendor2\foo\migrations;
class migration extends \phpbb\db\migration\migration
{
}

View File

@ -1,18 +0,0 @@
<?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 vendor3\bar\migration;
class migration extends \phpbb\db\migration\migration
{
}

View File

@ -16,6 +16,9 @@ class phpbb_extension_extension_base_test extends phpbb_test_case
{ {
protected static $reflection_method_get_migration_file_list; protected static $reflection_method_get_migration_file_list;
/** @var phpbb_mock_extension_manager */
protected $extension_manager;
public static function setUpBeforeClass() public static function setUpBeforeClass()
{ {
parent::setUpBeforeClass(); parent::setUpBeforeClass();
@ -56,18 +59,9 @@ class phpbb_extension_extension_base_test extends phpbb_test_case
public function data_test_suffix_get_classes() public function data_test_suffix_get_classes()
{ {
return array( return array(
array(
'vendor3/bar',
array('\vendor3\bar\migration\migration'),
),
array(
'vendor2/foo',
array('\vendor2\foo\migrations\migration'),
),
array( array(
'vendor2/bar', 'vendor2/bar',
array( array(
'\vendor2\bar\migration\migration',
'\vendor2\bar\migrations\migration', '\vendor2\bar\migrations\migration',
), ),
), ),

View File

@ -69,21 +69,11 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
global $phpbb_root_path, $phpEx, $table_prefix; global $phpbb_root_path, $phpEx, $table_prefix;
$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx); $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
$classes = $finder->core_path('phpbb/') $classes = $finder->core_path('phpbb/db/migration/data/')
->core_directory('db/migration/data/')
->set_extensions($setup_extensions)
->extension_directory('/migration')
->get_classes();
// @deprecated 3.1.0-RC4 (To be removed: 3.2.0)
$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
$classes_deprecated = $finder
->set_extensions($setup_extensions) ->set_extensions($setup_extensions)
->extension_directory('/migrations') ->extension_directory('/migrations')
->get_classes(); ->get_classes();
$classes = array_merge($classes, $classes_deprecated);
$db = new \phpbb\db\driver\sqlite(); $db = new \phpbb\db\driver\sqlite();
$schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix); $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
$schema_data = $schema_generator->get_schema(); $schema_data = $schema_generator->get_schema();