https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112827
Revision: 112827
Author: reedy
Date: 2012-03-01 19:12:07 +0000 (Thu, 01 Mar 2012)
Log Message:
-----------
Tidy up return values of envChecks
False is used to to signify a failure mode we need to do stuff for, so
returning true is ok in other cases, and makes it explicit
Modified Paths:
--------------
trunk/phase3/includes/installer/Installer.php
Modified: trunk/phase3/includes/installer/Installer.php
===================================================================
--- trunk/phase3/includes/installer/Installer.php 2012-03-01 18:36:19 UTC
(rev 112826)
+++ trunk/phase3/includes/installer/Installer.php 2012-03-01 19:12:07 UTC
(rev 112827)
@@ -659,6 +659,7 @@
return false;
}
$this->setVar( '_CompiledDBs', $databases );
+ return true;
}
/**
@@ -680,6 +681,7 @@
$this->showError( 'config-brokenlibxml' );
return false;
}
+ return true;
}
/**
@@ -694,6 +696,7 @@
$this->showError( 'config-using531', phpversion() );
return false;
}
+ return true;
}
/**
@@ -705,6 +708,7 @@
$this->showError( 'config-magic-quotes-runtime' );
return false;
}
+ return true;
}
/**
@@ -716,6 +720,7 @@
$this->showError( 'config-magic-quotes-sybase' );
return false;
}
+ return true;
}
/**
@@ -727,6 +732,7 @@
$this->showError( 'config-mbstring' );
return false;
}
+ return true;
}
/**
@@ -738,16 +744,19 @@
$this->showError( 'config-ze1' );
return false;
}
+ return true;
}
/**
* Environment check for safe_mode.
+ * @return bool
*/
protected function envCheckSafeMode() {
if ( wfIniGetBool( 'safe_mode' ) ) {
$this->setVar( '_SafeMode', true );
$this->showMessage( 'config-safe-mode' );
}
+ return true;
}
/**
@@ -759,6 +768,7 @@
$this->showError( 'config-xml-bad' );
return false;
}
+ return true;
}
/**
@@ -777,6 +787,7 @@
$this->showError( 'config-pcre-no-utf8' );
return false;
}
+ return true;
}
/**
@@ -801,9 +812,8 @@
$this->showMessage( 'config-memory-raised',
$limit, $newLimit );
$this->setVar( '_RaiseMemory', true );
}
- } else {
- return true;
}
+ return true;
}
/**
@@ -829,15 +839,18 @@
/**
* Scare user to death if they have mod_security
+ * @return bool
*/
protected function envCheckModSecurity() {
if ( self::apacheModulePresent( 'mod_security' ) ) {
$this->showMessage( 'config-mod-security' );
}
+ return true;
}
/**
* Search for GNU diff3.
+ * @return bool
*/
protected function envCheckDiff3() {
$names = array( "gdiff3", "diff3", "diff3.exe" );
@@ -851,6 +864,7 @@
$this->setVar( 'wgDiff3', false );
$this->showMessage( 'config-diff3-bad' );
}
+ return true;
}
/**
@@ -868,10 +882,11 @@
return true;
} elseif ( function_exists( 'imagejpeg' ) ) {
$this->showMessage( 'config-gd' );
- return true;
+
} else {
$this->showMessage( 'config-no-scaling' );
}
+ return true;
}
/**
@@ -881,6 +896,7 @@
$server = $this->envGetDefaultServer();
$this->showMessage( 'config-using-server', $server );
$this->setVar( 'wgServer', $server );
+ return true;
}
/**
@@ -913,6 +929,7 @@
$ext = 'php';
}
$this->setVar( 'wgScriptExtension', ".$ext" );
+ return true;
}
/**
@@ -1000,17 +1017,17 @@
$url = $this->getVar( 'wgServer' ) . $this->getVar(
'wgScriptPath' ) . '/images/';
$safe = !$this->dirIsExecutable( $dir, $url );
- if ( $safe ) {
- return true;
- } else {
+ if ( !$safe ) {
$this->showMessage( 'config-uploads-not-safe', $dir );
}
+ return true;
}
/**
* Checks if suhosin.get.max_value_length is set, and if so, sets
* $wgResourceLoaderMaxQueryLength to that value in the generated
* LocalSettings file
+ * @return bool
*/
protected function envCheckSuhosinMaxValueLength() {
$maxValueLength = ini_get( 'suhosin.get.max_value_length' );
@@ -1023,6 +1040,7 @@
$maxValueLength = -1;
}
$this->setVar( 'wgResourceLoaderMaxQueryLength',
$maxValueLength );
+ return true;
}
/**
@@ -1095,11 +1113,15 @@
}
}
+ /**
+ * @return bool
+ */
protected function envCheckCtype() {
if ( !function_exists( 'ctype_digit' ) ) {
$this->showError( 'config-ctype' );
return false;
}
+ return true;
}
/**
@@ -1181,6 +1203,8 @@
* Checks if scripts located in the given directory can be executed via
the given URL.
*
* Used only by environment checks.
+ * @param $dir string
+ * @param $url string
* @return bool|int|string
*/
public function dirIsExecutable( $dir, $url ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs