From 09cfa01d589ead86cf811e27b52167539e0478ec Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 03:14:39 +0200 Subject: [ticket/11700] Fix installation after develop merge PHPBB3-11700 --- phpBB/config/notifications.yml | 4 +- phpBB/install/index.php | 6 +- phpBB/phpbb/cache/driver/file.php | 2 +- .../db/migration/data/310/auth_provider_oauth.php | 71 --------------------- phpBB/phpbb/db/migration/data/310/mod_rewrite.php | 25 -------- .../db/migration/data/310/notifications_cron.php | 25 -------- .../migration/data/310/softdelete_mcp_modules.php | 55 ---------------- .../db/migration/data/v310/auth_provider_oauth.php | 73 ++++++++++++++++++++++ phpBB/phpbb/db/migration/data/v310/mod_rewrite.php | 27 ++++++++ .../db/migration/data/v310/notifications_cron.php | 27 ++++++++ .../migration/data/v310/softdelete_mcp_modules.php | 57 +++++++++++++++++ 11 files changed, 190 insertions(+), 182 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php delete mode 100644 phpBB/phpbb/db/migration/data/310/mod_rewrite.php delete mode 100644 phpBB/phpbb/db/migration/data/310/notifications_cron.php delete mode 100644 phpBB/phpbb/db/migration/data/310/softdelete_mcp_modules.php create mode 100644 phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php create mode 100644 phpBB/phpbb/db/migration/data/v310/mod_rewrite.php create mode 100644 phpBB/phpbb/db/migration/data/v310/notifications_cron.php create mode 100644 phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php diff --git a/phpBB/config/notifications.yml b/phpBB/config/notifications.yml index 87a619661c..6fecae2aeb 100644 --- a/phpBB/config/notifications.yml +++ b/phpBB/config/notifications.yml @@ -104,7 +104,7 @@ services: - { name: notification.type } notification.type.group_request: - class: phpbb_notification_type_group_request + class: phpbb\notification\type\group_request scope: prototype # scope MUST be prototype for this to work! arguments: - @user_loader @@ -122,7 +122,7 @@ services: - { name: notification.type } notification.type.group_request_approved: - class: phpbb_notification_type_group_request_approved + class: phpbb\notification\type\group_request_approved scope: prototype # scope MUST be prototype for this to work! arguments: - @user_loader diff --git a/phpBB/install/index.php b/phpBB/install/index.php index e94c393922..ebfec4232f 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -108,11 +108,11 @@ phpbb_include_updated('includes/utf/utf_tools.' . $phpEx); phpbb_require_updated('includes/functions_install.' . $phpEx); // Setup class loader first -$phpbb_class_loader_new = new \phpbb\class_loader('phpbb_', "{$phpbb_root_path}install/update/new/phpbb/", $phpEx); +$phpbb_class_loader_new = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}install/update/new/phpbb/", $phpEx); $phpbb_class_loader_new->register(); -$phpbb_class_loader = new \phpbb\class_loader('phpbb_', "{$phpbb_root_path}phpbb/", $phpEx); +$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); $phpbb_class_loader->register(); -$phpbb_class_loader_ext = new \phpbb\class_loader('phpbb_ext_', "{$phpbb_root_path}ext/", $phpEx); +$phpbb_class_loader_ext = new \phpbb\class_loader('phpbb\\ext\\', "{$phpbb_root_path}ext/", $phpEx); $phpbb_class_loader_ext->register(); // Set up container diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php index 6e63b6a716..a64232400b 100644 --- a/phpBB/phpbb/cache/driver/file.php +++ b/phpBB/phpbb/cache/driver/file.php @@ -260,7 +260,7 @@ class file extends \phpbb\cache\driver\base { try { - $iterator = new DirectoryIterator($dir); + $iterator = new \DirectoryIterator($dir); } catch (Exception $e) { diff --git a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php deleted file mode 100644 index cad1c16bb2..0000000000 --- a/phpBB/phpbb/db/migration/data/310/auth_provider_oauth.php +++ /dev/null @@ -1,71 +0,0 @@ -db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); - } - - public function update_schema() - { - return array( - 'add_tables' => array( - $this->table_prefix . 'oauth_tokens' => array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), // phpbb_users.user_id - 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set - 'provider' => array('VCHAR', ''), // Name of the OAuth provider - 'oauth_token' => array('MTEXT', ''), // Serialized token - ), - 'KEYS' => array( - 'user_id' => array('INDEX', 'user_id'), - 'provider' => array('INDEX', 'provider'), - ), - ), - $this->table_prefix . 'oauth_accounts' => array( - 'COLUMNS' => array( - 'user_id' => array('UINT', 0), - 'provider' => array('VCHAR', ''), - 'oauth_provider_id' => array('TEXT_UNI', ''), - ), - 'PRIMARY_KEY' => array( - 'user_id', - 'provider', - ), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_tables' => array( - $this->table_prefix . 'oauth_tokens', - $this->table_prefix . 'oauth_accounts', - ), - ); - } - - public function update_data() - { - return array( - array('module.add', array( - 'ucp', - 'UCP_PROFILE', - array( - 'module_basename' => 'ucp_auth_link', - 'modes' => array('auth_link'), - ), - )), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/310/mod_rewrite.php b/phpBB/phpbb/db/migration/data/310/mod_rewrite.php deleted file mode 100644 index 85ce25abf3..0000000000 --- a/phpBB/phpbb/db/migration/data/310/mod_rewrite.php +++ /dev/null @@ -1,25 +0,0 @@ -db->sql_query($sql); - $module_id = $this->db->sql_fetchfield('module_id'); - $this->db->sql_freeresult($result); - - return $module_id !== false; - } - - static public function depends_on() - { - return array( - 'phpbb_db_migration_data_310_dev', - 'phpbb_db_migration_data_310_softdelete_p2', - ); - } - - public function update_data() - { - return array( - array('module.add', array( - 'mcp', - 'MCP_QUEUE', - array( - 'module_basename' => 'mcp_queue', - 'modes' => array('deleted_topics'), - ), - )), - array('module.add', array( - 'mcp', - 'MCP_QUEUE', - array( - 'module_basename' => 'mcp_queue', - 'modes' => array('deleted_posts'), - ), - )), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php new file mode 100644 index 0000000000..971a7e8504 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -0,0 +1,73 @@ +db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'oauth_tokens' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), // phpbb_users.user_id + 'session_id' => array('CHAR:32', ''), // phpbb_sessions.session_id used only when user_id not set + 'provider' => array('VCHAR', ''), // Name of the OAuth provider + 'oauth_token' => array('MTEXT', ''), // Serialized token + ), + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + 'provider' => array('INDEX', 'provider'), + ), + ), + $this->table_prefix . 'oauth_accounts' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'provider' => array('VCHAR', ''), + 'oauth_provider_id' => array('TEXT_UNI', ''), + ), + 'PRIMARY_KEY' => array( + 'user_id', + 'provider', + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'oauth_tokens', + $this->table_prefix . 'oauth_accounts', + ), + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'ucp', + 'UCP_PROFILE', + array( + 'module_basename' => 'ucp_auth_link', + 'modes' => array('auth_link'), + ), + )), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php b/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php new file mode 100644 index 0000000000..ffb790b135 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/mod_rewrite.php @@ -0,0 +1,27 @@ +db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + return $module_id !== false; + } + + static public function depends_on() + { + return array( + 'phpbb\db\migration\data\v310\dev', + 'phpbb\db\migration\data\v310\softdelete_p2', + ); + } + + public function update_data() + { + return array( + array('module.add', array( + 'mcp', + 'MCP_QUEUE', + array( + 'module_basename' => 'mcp_queue', + 'modes' => array('deleted_topics'), + ), + )), + array('module.add', array( + 'mcp', + 'MCP_QUEUE', + array( + 'module_basename' => 'mcp_queue', + 'modes' => array('deleted_posts'), + ), + )), + ); + } +} -- cgit v1.2.1