X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FgetConfiguration.php;h=1db53f30c9da886dd52b64a8b3fd79389f737421;hb=2b441eba406f2c4988da80d264738d45930bf041;hp=60bb8d8d2c4e8f3ef4ea3ba1e2cf4783e1120562;hpb=5c164ab1cb2c77d8c897c8b5817bf79a9086c2fd;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/getConfiguration.php b/maintenance/getConfiguration.php index 60bb8d8d2c..1db53f30c9 100644 --- a/maintenance/getConfiguration.php +++ b/maintenance/getConfiguration.php @@ -23,8 +23,6 @@ * @author Antoine Musso */ -define( 'MW_SETUP_NO_CACHE', 1 ); -define( 'MW_SETUP_NO_CONTEXT', 1 ); require_once __DIR__ . '/Maintenance.php'; /** @@ -65,7 +63,7 @@ class GetConfiguration extends Maintenance { $format = strtolower( $this->getOption( 'format', 'PHP' ) ); $validFormat = in_array( $format, self::$outFormats ); - if ( ! $validFormat ) { + if ( !$validFormat ) { $this->error( "--format set to an unrecognized format", 0 ); $error_out = true; } @@ -89,11 +87,11 @@ class GetConfiguration extends Maintenance { public function finalSetup() { parent::finalSetup(); - $this->regex = $this->getOption( 'regex' ) ?: $this->getOption( 'iregex' ); + $this->regex = $this->getOption( 'regex' ) ? : $this->getOption( 'iregex' ); if ( $this->regex ) { $this->regex = '/' . $this->regex . '/'; if ( $this->hasOption( 'iregex' ) ) { - $this->regex .= 'i'; # case insensitive regex + $this->regex .= 'i'; # case insensitive regex } } @@ -117,7 +115,7 @@ class GetConfiguration extends Maintenance { $res = array(); # Sane default: dump any wg / wmg variable - if ( ! $this->regex && ! $this->getOption( 'settings' ) ) { + if ( !$this->regex && !$this->getOption( 'settings' ) ) { $this->regex = '/^wm?g/'; } @@ -167,7 +165,7 @@ class GetConfiguration extends Maintenance { protected function formatVarDump( $res ) { $ret = ''; foreach ( $res as $key => $value ) { - ob_start(); # intercept var_dump() output + ob_start(); # intercept var_dump() output print "\${$key} = "; var_dump( $value ); # grab var_dump() output and discard it from the output buffer @@ -184,10 +182,12 @@ class GetConfiguration extends Maintenance { return false; } } + return true; } elseif ( is_scalar( $value ) ) { return true; } + return false; } }