aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-04-03 14:44:07 +0200
committerJoas Schilling <nickvergessen@gmx.de>2014-04-03 14:44:07 +0200
commit049872644ae6b9795eb2ea159bd308b7e5319a1a (patch)
tree2adc77cbc0f156726e333cad71df6109b2a32a39 /phpBB/develop
parent5a3d4109bbad42367d363b616e5a705ee01388e9 (diff)
downloadforums-049872644ae6b9795eb2ea159bd308b7e5319a1a.tar
forums-049872644ae6b9795eb2ea159bd308b7e5319a1a.tar.gz
forums-049872644ae6b9795eb2ea159bd308b7e5319a1a.tar.bz2
forums-049872644ae6b9795eb2ea159bd308b7e5319a1a.tar.xz
forums-049872644ae6b9795eb2ea159bd308b7e5319a1a.zip
[ticket/12348] Allow to run create_schema_files when phpBB is not installed
PHPBB3-12348
Diffstat (limited to 'phpBB/develop')
-rw-r--r--phpBB/develop/create_schema_files.php27
1 files changed, 19 insertions, 8 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 8e01b3c286..9ab8bd193f 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -21,6 +21,7 @@ $supported_dbms = array(
'postgres',
'sqlite',
);
+$table_prefix = 'phpbb_';
if (!is_writable($schema_path))
{
@@ -28,19 +29,29 @@ if (!is_writable($schema_path))
}
define('IN_PHPBB', true);
-define('IN_INSTALL', true);
-$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
+$phpbb_root_path = dirname(__FILE__) . '/../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-include($phpbb_root_path . 'common.' . $phpEx);
-$classes = $phpbb_container->get('ext.manager')
- ->get_finder()
- ->core_path('phpbb/')
+include($phpbb_root_path . 'includes/constants.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+$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')
->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();
$dbms_type_map = phpbb\db\tools::get_dbms_type_map();