// Bail on old versions of PHP, or if composer has not been run yet to install
// dependencies.
require_once __DIR__ . '/../includes/PHPVersionCheck.php';
-wfEntryPointCheck( 'cli' );
+wfEntryPointCheck( 'text' );
use MediaWiki\Shell\Shell;
$settingsFile = "$IP/LocalSettings.php";
}
if ( isset( $this->mOptions['wiki'] ) ) {
- $bits = explode( '-', $this->mOptions['wiki'] );
+ $bits = explode( '-', $this->mOptions['wiki'], 2 );
if ( count( $bits ) == 1 ) {
$bits[] = '';
}
$this->output( "done.\n" );
}
- # Done
$this->commitTransaction( $dbw, __METHOD__ );
}
* @return IMaintainableDatabase
*/
protected function getDB( $db, $groups = [], $wiki = false ) {
- if ( is_null( $this->mDb ) ) {
+ if ( $this->mDb === null ) {
return wfGetDB( $db, $groups, $wiki );
- } else {
- return $this->mDb;
}
+ return $this->mDb;
}
/**