X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FgetConfiguration.php;h=1db53f30c9da886dd52b64a8b3fd79389f737421;hb=17b631a1719a70a9490740a3ceb58d4ca70cb333;hp=52cb209ce842a2b199b4cd8e7fab95f5764a70e0;hpb=806df0771ec33e1e6abd4b83105a8c6ffa1d9bad;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/getConfiguration.php b/maintenance/getConfiguration.php index 52cb209ce8..1db53f30c9 100644 --- a/maintenance/getConfiguration.php +++ b/maintenance/getConfiguration.php @@ -63,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; } @@ -87,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 } } @@ -115,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/'; } @@ -165,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 @@ -182,10 +182,12 @@ class GetConfiguration extends Maintenance { return false; } } + return true; } elseif ( is_scalar( $value ) ) { return true; } + return false; } }