class CliInstaller extends Installer {
private $specifiedScriptPath = false;
- private $optionMap = array(
+ private $optionMap = [
'dbtype' => 'wgDBtype',
'dbserver' => 'wgDBserver',
'dbname' => 'wgDBname',
'dbpass' => 'wgDBpassword',
'dbprefix' => 'wgDBprefix',
'dbtableoptions' => 'wgDBTableOptions',
- 'dbmysql5' => 'wgDBmysql5',
'dbport' => 'wgDBport',
'dbschema' => 'wgDBmwschema',
'dbpath' => 'wgSQLiteDataDir',
'server' => 'wgServer',
'scriptpath' => 'wgScriptPath',
- );
+ ];
/**
- * Constructor.
- *
* @param string $siteName
* @param string $admin
* @param array $option
*/
- function __construct( $siteName, $admin = null, array $option = array() ) {
+ function __construct( $siteName, $admin = null, array $option = [] ) {
global $wgContLang;
parent::__construct();
$this->setVar( '_AdminPassword', $option['pass'] );
}
+ // Detect and inject any extension found
+ if ( isset( $option['with-extensions'] ) ) {
+ $this->setVar( '_Extensions', array_keys( $this->findExtensions() ) );
+ }
+
// Set up the default skins
- $skins = $this->findExtensions( 'skins' );
+ $skins = array_keys( $this->findExtensions( 'skins' ) );
$this->setVar( '_Skins', $skins );
if ( $skins ) {
}
$this->performInstallation(
- array( $this, 'startStage' ),
- array( $this, 'endStage' )
+ [ $this, 'startStage' ],
+ [ $this, 'endStage' ]
);
}
$text = preg_replace( '/<a href="(.*?)".*?>(.*?)<\/a>/', '$2 <$1>', $text );
- return html_entity_decode( strip_tags( $text ), ENT_QUOTES );
+ return Sanitizer::stripAllTags( $text );
}
/**
if ( count( $warnings ) !== 0 ) {
foreach ( $warnings as $w ) {
- call_user_func_array( array( $this, 'showMessage' ), $w );
+ call_user_func_array( [ $this, 'showMessage' ], $w );
}
}
- if ( !$status->isOk() ) {
+ if ( !$status->isOK() ) {
echo "\n";
exit( 1 );
}