Use CSSJanus via composer
[lhc/web/wiklou.git] / maintenance / Maintenance.php
index ffb07eb..d740f56 100644 (file)
@@ -20,8 +20,8 @@
  * @defgroup Maintenance Maintenance
  */
 
-// Make sure we're on PHP5.3.2 or better
-if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) {
+// Make sure we're on PHP5.3.3 or better
+if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.3' ) < 0 ) {
        // We need to use dirname( __FILE__ ) here cause __DIR__ is PHP5.3+
        require_once dirname( __FILE__ ) . '/../includes/PHPVersionError.php';
        wfPHPVersionError( 'cli' );
@@ -113,6 +113,13 @@ abstract class Maintenance {
         */
        public $fileHandle;
 
+       /**
+        * Accessible via getConfig()
+        *
+        * @var Config
+        */
+       private $config;
+
        /**
         * Default constructor. Children should call this *first* if implementing
         * their own constructors
@@ -457,6 +464,26 @@ abstract class Maintenance {
                $this->mDependantParameters = array_diff_key( $this->mParams, $this->mGenericParameters );
        }
 
+       /**
+        * @since 1.24
+        * @return Config
+        */
+       public function getConfig() {
+               if ( $this->config === null ) {
+                       $this->config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
+               }
+
+               return $this->config;
+       }
+
+       /**
+        * @since 1.24
+        * @param Config $config
+        */
+       public function setConfig( Config $config ) {
+               $this->config = $config;
+       }
+
        /**
         * Run a child maintenance script. Pass all of the current arguments
         * to it.