本文整理汇总了PHP中phpbb_database_test_case::install_schema_file方法的典型用法代码示例。如果您正苦于以下问题:PHP phpbb_database_test_case::install_schema_file方法的具体用法?PHP phpbb_database_test_case::install_schema_file怎么用?PHP phpbb_database_test_case::install_schema_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类phpbb_database_test_case
的用法示例。
在下文中一共展示了phpbb_database_test_case::install_schema_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUpBeforeClass
public static function setUpBeforeClass()
{
global $phpbb_root_path, $phpEx;
$setup_extensions = static::setup_extensions();
$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
$finder->core_path('phpbb/db/migration/data/');
if (!empty($setup_extensions)) {
$finder->set_extensions($setup_extensions)->extension_directory('/migrations');
}
$classes = $finder->get_classes();
$schema_sha1 = sha1(serialize($classes));
self::$schema_file = __DIR__ . '/../tmp/' . $schema_sha1 . '.json';
self::$install_schema_file = __DIR__ . '/../../phpBB/install/schemas/schema.json';
if (!file_exists(self::$schema_file)) {
global $table_prefix;
$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);
file_put_contents(self::$schema_file, json_encode($schema_generator->get_schema()));
}
copy(self::$schema_file, self::$install_schema_file);
parent::setUpBeforeClass();
}