'envCheckRegisterGlobals',
'envCheckBrokenXML',
'envCheckMagicQuotes',
- 'envCheckMagicSybase',
'envCheckMbstring',
'envCheckSafeMode',
'envCheckXML',
'envCheckLibicu',
'envCheckSuhosinMaxValueLength',
'envCheckCtype',
+ 'envCheckIconv',
'envCheckJSON',
);
'_LicenseCode' => 'none',
'_CCDone' => false,
'_Extensions' => array(),
+ '_Skins' => array(),
'_MemCachedServers' => '',
'_UpgradeKeySupplied' => false,
'_ExistingDBSettings' => false,
abstract public function showError( $msg /*, ... */ );
/**
- * Show a message to the installing user by using a Status object
+ * Shows messages to the user through a Status object
* @param Status $status
*/
- abstract public function showStatusMessage( Status $status );
+ public function showStatusMessage( Status $status ) {
+ $errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
+ if ( $errors ) {
+ foreach ( $errors as $error ) {
+ call_user_func( 'showMessage', $error );
+ }
+ }
+ }
/**
* Constructor, always call this from child classes.
}
/**
- * Environment check for magic_quotes_runtime.
+ * Environment check for magic_quotes_(gpc|runtime|sybase).
* @return bool
*/
protected function envCheckMagicQuotes() {
- if ( wfIniGetBool( "magic_quotes_runtime" ) ) {
- $this->showError( 'config-magic-quotes-runtime' );
-
- return false;
- }
-
- return true;
- }
-
- /**
- * Environment check for magic_quotes_sybase.
- * @return bool
- */
- protected function envCheckMagicSybase() {
- if ( wfIniGetBool( 'magic_quotes_sybase' ) ) {
- $this->showError( 'config-magic-quotes-sybase' );
-
- return false;
+ $status = true;
+ foreach ( array( 'gpc', 'runtime', 'sybase' ) as $magicJunk ) {
+ if ( wfIniGetBool( "magic_quotes_$magicJunk" ) ) {
+ $this->showError( "config-magic-quotes-$magicJunk" );
+ $status = false;
+ }
}
- return true;
+ return $status;
}
/**
return true;
}
+ /**
+ * @return bool
+ */
+ protected function envCheckIconv() {
+ if ( !function_exists( 'iconv' ) ) {
+ $this->showError( 'config-iconv' );
+
+ return false;
+ }
+
+ return true;
+ }
+
/**
* @return bool
*/
}
/**
- * Finds extensions that follow the format /extensions/Name/Name.php,
+ * Finds extensions that follow the format /$directory/Name/Name.php,
* and returns an array containing the value for 'Name' for each found extension.
*
+ * Reasonable values for $directory include 'extensions' (the default) and 'skins'.
+ *
+ * @param string $directory Directory to search in
* @return array
*/
- public function findExtensions() {
+ public function findExtensions( $directory = 'extensions' ) {
if ( $this->getVar( 'IP' ) === null ) {
return array();
}
- $extDir = $this->getVar( 'IP' ) . '/extensions';
+ $extDir = $this->getVar( 'IP' ) . '/' . $directory;
if ( !is_readable( $extDir ) || !is_dir( $extDir ) ) {
return array();
}