Go to the documentation of this file.
74 foreach ( $this->tablesToClone
as $tbl ) {
75 # Clean up from previous aborted run. So that table escaping
76 # works correctly across DB engines, we need to change the pre-
77 # fix back and forth so tableName() works right.
80 $oldTableName = $this->db->tableName( $tbl,
'raw' );
83 $newTableName = $this->db->tableName( $tbl,
'raw' );
85 if ( $this->dropCurrentTables
86 && !in_array( $this->db->getType(),
array(
'postgres',
'oracle' ) )
88 $this->db->dropTable( $tbl, __METHOD__ );
89 wfDebug( __METHOD__ .
" dropping {$newTableName}\n" );
94 wfDebug( __METHOD__ .
" duplicating $oldTableName to $newTableName\n" );
95 $this->db->duplicateTableStructure( $oldTableName, $newTableName, $this->
useTemporaryTables );
103 public function destroy( $dropTables =
false ) {
106 foreach ( $this->tablesToClone
as $tbl ) {
107 $this->db->dropTable( $tbl );
122 $wgDBprefix = $prefix;
131 $lb->forEachOpenConnection(
array(
'CloneDatabase',
'changeDBPrefix' ),
array( $prefix ) );
140 $db->tablePrefix( $prefix );
cloneTableStructure()
Clone the table structure.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
bool $useTemporaryTables
Whether to use temporary tables or not *.
array $tablesToClone
List of tables to be cloned *.
static changeDBPrefix( $db, $prefix)
if( $wgAPIRequestLog) $lb
static changeLBPrefix( $lb, $prefix)
string $oldTablePrefix
Current table prefix *.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
wfDebug( $text, $dest='all')
Sends a line to the debug log if enabled or, optionally, to a comment in output.
__construct(DatabaseBase $db, array $tablesToClone, $newTablePrefix, $oldTablePrefix='', $dropCurrentTables=true)
Constructor.
Database abstraction object.
destroy( $dropTables=false)
Change the prefix back to the original.
useTemporaryTables( $u=true)
Set whether to use temporary tables or not.
& wfGetLBFactory()
Get the load balancer factory object.
static changePrefix( $prefix)
Change the table prefix on all open DB connections/.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
bool $dropCurrentTables
Should we DROP tables containing the new names? *.
string $newTablePrefix
Table prefix for cloning *.