// Check to see if the file exists
if ( !$repo->fileExists( $filename ) ) {
- wfForbidden( 'img-auth-accessdenied','img-auth-nofile', $filename );
+ wfForbidden( 'img-auth-accessdenied', 'img-auth-nofile', $filename );
return;
}
define( 'OT_HTML', 1 );
define( 'OT_WIKI', 2 );
define( 'OT_PREPROCESS', 3 );
-define( 'OT_MSG' , 3 ); // b/c alias for OT_PREPROCESS
+define( 'OT_MSG', 3 ); // b/c alias for OT_PREPROCESS
define( 'OT_PLAIN', 4 );
/**@}*/
* @return String: valid dotted quad IPv4 address or null
*/
public static function canonicalize( $addr ) {
- $addr = preg_replace( '/\%.*/','', $addr ); // remove zone info (bug 35738)
+ // remove zone info (bug 35738)
+ $addr = preg_replace( '/\%.*/', '', $addr );
+
if ( self::isValid( $addr ) ) {
return $addr;
}
* appending MM_WELL_KNOWN_MIME_TYPES behind $wgMimeTypeFile, but who knows
* what will break? In practice this probably isn't a problem anyway -- Bryan)
*/
-define('MM_WELL_KNOWN_MIME_TYPES',<<<END_STRING
+define('MM_WELL_KNOWN_MIME_TYPES', <<<END_STRING
application/ogg ogx ogg ogm ogv oga spx
application/pdf pdf
application/vnd.oasis.opendocument.chart odc
$lastHangul = 0;
$startChar = '';
$combining = '';
- $x1 = ord(substr(UTF8_HANGUL_VBASE,0,1));
- $x2 = ord(substr(UTF8_HANGUL_TEND,0,1));
+ $x1 = ord(substr(UTF8_HANGUL_VBASE, 0, 1));
+ $x2 = ord(substr(UTF8_HANGUL_TEND, 0, 1));
for( $i = 0; $i < $len; $i++ ) {
$c = $string[$i];
$n = ord( $c );
if ( $start < 0 ) {
$start = 0;
}
- $groupedNumber = substr( $number , $start, $end -$start ) . $groupedNumber ;
+ $groupedNumber = substr( $number, $start, $end -$start ) . $groupedNumber ;
$end = $start;
if ( $numMatches > 1 ) {
// use the last pattern for the rest of the number
if ( !is_readable( $settingsFile ) ) {
$this->error( "A copy of your installation's LocalSettings.php\n" .
"must exist and be readable in the source directory.\n" .
- "Use --conf to specify it." , true );
+ "Use --conf to specify it.", true );
}
$wgCommandLineMode = true;
return $settingsFile;
var $infiles = null;
function BaseDump( $infile ) {
- $this->infiles = explode(';',$infile);
+ $this->infiles = explode( ';', $infile );
$this->reader = new XMLReader();
- $infile = array_shift($this->infiles);
+ $infile = array_shift( $this->infiles );
if (defined( 'LIBXML_PARSEHUGE' ) ) {
$this->reader->open( $infile, null, LIBXML_PARSEHUGE );
}
} elseif ( $this->hasOption( "userid" ) ) {
$user = User::newFromId( $this->getOption( 'userid' ) );
} else {
- $this->error( "A \"user\" or \"userid\" must be set to change the password for" , true );
+ $this->error( "A \"user\" or \"userid\" must be set to change the password for", true );
}
if ( !$user || !$user->getId() ) {
$this->error( "No such user: " . $this->getOption( 'user' ), true );
unset( $lags[0] );
echo gmdate( 'H:i:s' ) . ' ';
foreach ( $lags as $lag ) {
- printf( "%-12s " , $lag === false ? 'false' : $lag );
+ printf( "%-12s ", $lag === false ? 'false' : $lag );
}
echo "\n";
sleep( 5 );
$lags = $lb->getLagTimes();
foreach ( $lags as $i => $lag ) {
$name = $lb->getServerName( $i );
- $this->output( sprintf( "%-20s %s\n" , $name, $lag === false ? 'false' : $lag ) );
+ $this->output( sprintf( "%-20s %s\n", $name, $lag === false ? 'false' : $lag ) );
}
}
}
if ( isset( $messages[$key] ) ) {
- $messages[$key] = implode( $messages[$key],", " );
+ $messages[$key] = implode( $messages[$key], ", " );
}
}
return $messages;
);
$tmpCfg = str_replace( array_keys( $replacements ), array_values( $replacements ), $template );
$tmpFileName = tempnam( wfTempDir(), 'mwdocgen-' );
- file_put_contents( $tmpFileName , $tmpCfg ) or die( "Could not write doxygen configuration to file $tmpFileName\n" );
+ file_put_contents( $tmpFileName, $tmpCfg ) or die( "Could not write doxygen configuration to file $tmpFileName\n" );
return $tmpFileName;
}
public function __construct() {
parent::__construct();
$this->mDescription = "Send purge requests for listed pages to squid";
- $this->addOption( 'purge', 'Whether to update page_touched.' , false, false );
+ $this->addOption( 'purge', 'Whether to update page_touched.', false, false );
$this->addOption( 'namespace', 'Namespace number', false, true );
$this->setBatchSize( 100 );
}
$this->addOption( 'start', 'Name of file to start with', false, true );
$this->addOption( 'end', 'Name of file to end with', false, true );
- $this->addOption( 'mime', '(Inefficient!) Only refresh files with this mime type. Can accept wild-card image/*' , false, true );
+ $this->addOption( 'mime', '(Inefficient!) Only refresh files with this mime type. Can accept wild-card image/*', false, true );
$this->addOption( 'metadata-contains', '(Inefficient!) Only refresh files where the img_metadata field contains this string. Can be used if its known a specific property was being extracted incorrectly.', false, true );
}
$max_length_value = $max_length_desc = 0;
foreach ( $fields as $field => $desc ) {
$max_length_value = max( $max_length_value, strlen( $stats->$field ) );
- $max_length_desc = max( $max_length_desc , strlen( $desc ) ) ;
+ $max_length_desc = max( $max_length_desc, strlen( $desc ) ) ;
}
// Show them
'height' => 16,
'width' => 16,
'type' => 'image/x-icon' ),
- wfExpandUrl( $wgFavicon , PROTO_CURRENT ) );
+ wfExpandUrl( $wgFavicon, PROTO_CURRENT ) );
$urls = array();
<td class="mw-profileinfo-count"><?php echo $this->count(); ?></td>
<td class="mw-profileinfo-cpr"><?php echo round( sprintf( '%.2f', $this->callsPerRequest() ), 2 ); ?></td>
<td class="mw-profileinfo-tpc"><?php echo round( sprintf( '%.2f', $this->timePerCall() ), 2 ); ?></td>
- <td class="mw-profileinfo-mpc"><?php echo round( sprintf( '%.2f' ,$this->memoryPerCall() / 1024 ), 2 ); ?></td>
+ <td class="mw-profileinfo-mpc"><?php echo round( sprintf( '%.2f', $this->memoryPerCall() / 1024 ), 2 ); ?></td>
<td class="mw-profileinfo-tpr"><?php echo @round( sprintf( '%.2f', $this->time() / self::$totalcount ), 2 ); ?></td>
- <td class="mw-profileinfo-mpr"><?php echo @round( sprintf( '%.2f' ,$this->memory() / self::$totalcount / 1024 ), 2 ); ?></td>
+ <td class="mw-profileinfo-mpr"><?php echo @round( sprintf( '%.2f', $this->memory() / self::$totalcount / 1024 ), 2 ); ?></td>
</tr>
<?php
if ( $ex ) {