mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Merge remote-tracking branch 'github-nickvergessen/ticket/12348' into develop-ascraeus
* github-nickvergessen/ticket/12348: [ticket/12348] Allow to run create_schema_files when phpBB is not installed
This commit is contained in:
commit
5de4d181ee
1 changed files with 19 additions and 8 deletions
|
@ -21,6 +21,7 @@ $supported_dbms = array(
|
||||||
'postgres',
|
'postgres',
|
||||||
'sqlite',
|
'sqlite',
|
||||||
);
|
);
|
||||||
|
$table_prefix = 'phpbb_';
|
||||||
|
|
||||||
if (!is_writable($schema_path))
|
if (!is_writable($schema_path))
|
||||||
{
|
{
|
||||||
|
@ -28,19 +29,29 @@ if (!is_writable($schema_path))
|
||||||
}
|
}
|
||||||
|
|
||||||
define('IN_PHPBB', true);
|
define('IN_PHPBB', true);
|
||||||
define('IN_INSTALL', true);
|
$phpbb_root_path = dirname(__FILE__) . '/../';
|
||||||
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
|
|
||||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||||
include($phpbb_root_path . 'common.' . $phpEx);
|
|
||||||
|
|
||||||
$classes = $phpbb_container->get('ext.manager')
|
include($phpbb_root_path . 'includes/constants.' . $phpEx);
|
||||||
->get_finder()
|
require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
|
||||||
->core_path('phpbb/')
|
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
|
||||||
|
$phpbb_class_loader->register();
|
||||||
|
|
||||||
|
class phpbb_extension_empty_manager extends \phpbb\extension\manager
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
$this->extensions = array();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$finder = new \phpbb\extension\finder(new \phpbb_extension_empty_manager(), new \phpbb\filesystem(), $phpbb_root_path);
|
||||||
|
$classes = $finder->core_path('phpbb/')
|
||||||
->directory('db/migration/data')
|
->directory('db/migration/data')
|
||||||
->get_classes();
|
->get_classes();
|
||||||
$db_tools = new \phpbb\db\tools($db, true);
|
|
||||||
|
|
||||||
$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, $db_tools, $phpbb_root_path, $phpEx, 'phpbb_');
|
$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_data = $schema_generator->get_schema();
|
$schema_data = $schema_generator->get_schema();
|
||||||
$dbms_type_map = phpbb\db\tools::get_dbms_type_map();
|
$dbms_type_map = phpbb\db\tools::get_dbms_type_map();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue