diff options
author | Nils Adermann <naderman@naderman.de> | 2012-10-25 13:02:56 -0700 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-01-09 16:40:00 -0600 |
commit | c802f2a66c577781036b7bfd6d6689159028c3a6 (patch) | |
tree | dbf6be4bbe68636084fd3241f1de42c4b0e2f54f /phpBB/includes/db/migrator.php | |
parent | 8645321f40d0b13de6201688c69f9f05bc649dcf (diff) | |
download | forums-c802f2a66c577781036b7bfd6d6689159028c3a6.tar forums-c802f2a66c577781036b7bfd6d6689159028c3a6.tar.gz forums-c802f2a66c577781036b7bfd6d6689159028c3a6.tar.bz2 forums-c802f2a66c577781036b7bfd6d6689159028c3a6.tar.xz forums-c802f2a66c577781036b7bfd6d6689159028c3a6.zip |
[feature/migrations] Standard vars for migrations and run sql with feedback
PHPBB3-9737
Diffstat (limited to 'phpBB/includes/db/migrator.php')
-rw-r--r-- | phpBB/includes/db/migrator.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/phpBB/includes/db/migrator.php b/phpBB/includes/db/migrator.php index 4a178af468..4ce54a4b92 100644 --- a/phpBB/includes/db/migrator.php +++ b/phpBB/includes/db/migrator.php @@ -24,6 +24,10 @@ class phpbb_db_migrator { var $db; var $db_tools; + var $table_prefix; + + var $phpbb_root_path; + var $php_ext; var $migrations_table; var $migration_state; @@ -35,16 +39,23 @@ class phpbb_db_migrator * * @param dbal $db Connected database abstraction instance * @param phpbb_db_tools $db_tools Instance of db schema manipulation tools + * @param string $table_prefix The prefix for all table names * @param string $migrations_table The name of the db table storing * information on applied migrations + * @param string $phpbb_root_path + * @param string $php_ext */ - function phpbb_db_migrator(&$db, &$db_tools, $migrations_table) + function phpbb_db_migrator(&$db, &$db_tools, $table_prefix, $migrations_table, $phpbb_root_path, $php_ext) { $this->db = &$db; $this->db_tools = &$db_tools; + $this->table_prefix = $table_prefix; $this->migrations_table = $migrations_table; $this->migrations = array(); + $this->phpbb_root_path = $phpbb_root_path; + $this->php_ext = $php_ext; + $this->load_migration_state(); } @@ -120,7 +131,7 @@ class phpbb_db_migrator return false; } - $migration =& new $name($this->db, $this->db_tools); + $migration =& new $name($this->db, $this->db_tools, $this->table_prefix, $this->phpbb_root_path, $this->php_ext); $state = (isset($this->migration_state[$name])) ? $this->migration_state[$name] : array( @@ -201,7 +212,7 @@ class phpbb_db_migrator return true; } - $migration =& new $name($this->db, $this->db_tools); + $migration =& new $name($this->db, $this->db_tools, $this->table_prefix, $this->phpbb_root_path, $this->php_ext); $depends = $migration->depends_on(); foreach ($depends as $depend) |