diff options
Diffstat (limited to 'phpBB/phpbb/db')
-rw-r--r-- | phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php | 47 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/tool/module.php | 26 | ||||
-rw-r--r-- | phpBB/phpbb/db/migration/tool/permission.php | 4 |
3 files changed, 55 insertions, 22 deletions
diff --git a/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php new file mode 100644 index 0000000000..7d4aea3c95 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php @@ -0,0 +1,47 @@ +<?php +/** +* +* @package migration +* @copyright (c) 2013 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ + +namespace phpbb\db\migration\data\v310; + +class postgres_fulltext_drop extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + // This migration is irrelevant for all non-PostgreSQL DBMSes. + return strpos($this->db->sql_layer, 'postgres') === false; + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v310\dev', + ); + } + + public function update_schema() + { + /* + * Drop FULLTEXT indexes related to PostgreSQL fulltext search. + * Doing so is equivalent to dropping the search index from the ACP. + * Possibly time-consuming recreation of the search index (i.e. + * FULLTEXT indexes) is left as a task to the admin to not + * unnecessarily stall the upgrade process. The new search index will + * then require about 40% less table space (also see PHPBB3-11040). + */ + return array( + 'drop_keys' => array( + $this->table_prefix . 'posts' => array( + 'post_subject', + 'post_text', + 'post_content', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 3e39d87c04..ebbcbae301 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -19,7 +19,7 @@ class module implements \phpbb\db\migration\tool\tool_interface /** @var \phpbb\cache\service */ protected $cache; - /** @var dbal */ + /** @var \phpbb\db\driver\driver */ protected $db; /** @var \phpbb\user */ @@ -38,7 +38,7 @@ class module implements \phpbb\db\migration\tool\tool_interface * Constructor * * @param \phpbb\db\driver\driver $db - * @param mixed $cache + * @param \phpbb\cache\service $cache * @param \phpbb\user $user * @param string $phpbb_root_path * @param string $php_ext @@ -163,11 +163,10 @@ class module implements \phpbb\db\migration\tool\tool_interface * ) * Optionally you may not send 'modes' and it will insert all of the * modules in that info file. - * @param string|bool $include_path If you would like to use a custom include * path, specify that here * @return null */ - public function add($class, $parent = 0, $data = array(), $include_path = false) + public function add($class, $parent = 0, $data = array()) { // Allows '' to be sent as 0 $parent = $parent ?: 0; @@ -328,11 +327,10 @@ class module implements \phpbb\db\migration\tool\tool_interface * @param int|string|bool $parent The parent module_id|module_langname(0 for no parent). * Use false to ignore the parent check and check class wide. * @param int|string $module The module id|module_langname - * @param string|bool $include_path If you would like to use a custom include path, * specify that here * @return null */ - public function remove($class, $parent = 0, $module = '', $include_path = false) + public function remove($class, $parent = 0, $module = '') { // Imitation of module_add's "automatic" and "manual" method so the uninstaller works from the same set of instructions for umil_auto if (is_array($module)) @@ -340,7 +338,7 @@ class module implements \phpbb\db\migration\tool\tool_interface if (isset($module['module_langname'])) { // Manual Method - return $this->remove($class, $parent, $module['module_langname'], $include_path); + return $this->remove($class, $parent, $module['module_langname']); } // Failed. @@ -407,22 +405,10 @@ class module implements \phpbb\db\migration\tool\tool_interface $module_ids[] = (int) $module_id; } $this->db->sql_freeresult($result); - - $module_name = $module; } else { - $module = (int) $module; - $sql = 'SELECT module_langname - FROM ' . $this->modules_table . " - WHERE module_id = $module - AND module_class = '" . $this->db->sql_escape($class) . "' - $parent_sql"; - $result = $this->db->sql_query($sql); - $module_name = $this->db->sql_fetchfield('module_id'); - $this->db->sql_freeresult($result); - - $module_ids[] = $module; + $module_ids[] = (int) $module; } if (!class_exists('acp_modules')) diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index fd2de9c8fb..38fcbd2952 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -22,7 +22,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface /** @var \phpbb\cache\service */ protected $cache; - /** @var dbal */ + /** @var \phpbb\db\driver\driver */ protected $db; /** @var string */ @@ -35,7 +35,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface * Constructor * * @param \phpbb\db\driver\driver $db - * @param mixed $cache + * @param \phpbb\cache\service $cache * @param \phpbb\auth\auth $auth * @param string $phpbb_root_path * @param string $php_ext |