Merge "Make DBAccessBase use DBConnRef, rename $wiki, and hide getLoadBalancer()"
[lhc/web/wiklou.git] / includes / installer / Installer.php
index ccc548b..6d1e211 100644 (file)
@@ -1089,14 +1089,16 @@ abstract class Installer {
 
        /**
         * Checks if suhosin.get.max_value_length is set, and if so generate
-        * a warning because it decreases ResourceLoader performance.
+        * a warning because it is incompatible with ResourceLoader.
         * @return bool
         */
        protected function envCheckSuhosinMaxValueLength() {
-               $maxValueLength = ini_get( 'suhosin.get.max_value_length' );
-               if ( $maxValueLength > 0 && $maxValueLength < 1024 ) {
-                       // Only warn if the value is below the sane 1024
-                       $this->showMessage( 'config-suhosin-max-value-length', $maxValueLength );
+               $currentValue = ini_get( 'suhosin.get.max_value_length' );
+               $minRequired = 2000;
+               $recommended = 5000;
+               if ( $currentValue > 0 && $currentValue < $minRequired ) {
+                       $this->showError( 'config-suhosin-max-value-length', $currentValue, $minRequired, $recommended );
+                       return false;
                }
 
                return true;
@@ -1271,8 +1273,7 @@ abstract class Installer {
         *
         * @param string $directory Directory to search in, relative to $IP, must be either "extensions"
         *     or "skins"
-        * @return Status An object containing an error list. If there were no errors, an associative
-        *     array of information about the extension can be found in $status->value.
+        * @return array[][] [ $extName => [ 'screenshots' => [ '...' ] ]
         */
        public function findExtensions( $directory = 'extensions' ) {
                switch ( $directory ) {
@@ -1291,40 +1292,33 @@ abstract class Installer {
         *
         * @param string $type Either "extension" or "skin"
         * @param string $directory Directory to search in, relative to $IP
-        * @return Status An object containing an error list. If there were no errors, an associative
-        *     array of information about the extension can be found in $status->value.
+        * @return array [ $extName => [ 'screenshots' => [ '...' ] ]
         */
        protected function findExtensionsByType( $type = 'extension', $directory = 'extensions' ) {
                if ( $this->getVar( 'IP' ) === null ) {
-                       return Status::newGood( [] );
+                       return [];
                }
 
                $extDir = $this->getVar( 'IP' ) . '/' . $directory;
                if ( !is_readable( $extDir ) || !is_dir( $extDir ) ) {
-                       return Status::newGood( [] );
+                       return [];
                }
 
                $dh = opendir( $extDir );
                $exts = [];
-               $status = new Status;
                while ( ( $file = readdir( $dh ) ) !== false ) {
-                       // skip non-dirs and hidden directories
-                       if ( !is_dir( "$extDir/$file" ) || $file[0] === '.' ) {
+                       if ( !is_dir( "$extDir/$file" ) ) {
                                continue;
                        }
-                       $extStatus = $this->getExtensionInfo( $type, $directory, $file );
-                       if ( $extStatus->isOK() ) {
+                       $status = $this->getExtensionInfo( $type, $directory, $file );
+                       if ( $status->isOK() ) {
                                $exts[$file] = $status->value;
-                       } else {
-                               $status->merge( $extStatus );
                        }
                }
                closedir( $dh );
                uksort( $exts, 'strnatcasecmp' );
 
-               $status->value = $exts;
-
-               return $status;
+               return $exts;
        }
 
        /**