Merge "StringUtils: Add a utility for checking if a string is a valid regex"
[lhc/web/wiklou.git] / includes / installer / Installer.php
index 289a721..b830b70 100644 (file)
@@ -731,6 +731,7 @@ abstract class Installer {
                if ( !$status->isOK() ) {
                        return $status;
                }
+               // @phan-suppress-next-line PhanUndeclaredMethod
                $status->value->insert(
                        'site_stats',
                        [
@@ -1088,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;
@@ -1313,7 +1316,10 @@ abstract class Installer {
                        }
                        $extStatus = $this->getExtensionInfo( $type, $directory, $file );
                        if ( $extStatus->isOK() ) {
-                               $exts[$file] = $status->value;
+                               $exts[$file] = $extStatus->value;
+                       } elseif ( $extStatus->hasMessage( 'config-extension-not-found' ) ) {
+                               // (T225512) The directory is not actually an extension. Downgrade to warning.
+                               $status->warning( 'config-extension-not-found', $file );
                        } else {
                                $status->merge( $extStatus );
                        }
@@ -1424,11 +1430,16 @@ abstract class Installer {
                        } elseif ( $e->missingExtensions || $e->missingSkins ) {
                                // There's an extension missing in the dependency tree,
                                // so add those to the dependency list and try again
-                               return $this->readExtension(
+                               $status = $this->readExtension(
                                        $fullJsonFile,
                                        array_merge( $extDeps, $e->missingExtensions ),
                                        array_merge( $skinDeps, $e->missingSkins )
                                );
+                               if ( !$status->isOK() && !$status->hasMessage( 'config-extension-dependency' ) ) {
+                                       $status = Status::newFatal( 'config-extension-dependency',
+                                               basename( dirname( $fullJsonFile ) ), $status->getMessage() );
+                               }
+                               return $status;
                        }
                        // Some other kind of dependency error?
                        return Status::newFatal( 'config-extension-dependency',