# that would cause us to potentially mix gzip and non-gzip output, creating a
# big mess.
if ( !defined( 'MW_NO_OUTPUT_BUFFER' ) && ob_get_level() == 0 ) {
- require_once "$IP/includes/OutputHandler.php" ;
+ require_once "$IP/includes/OutputHandler.php";
ob_start( 'wfOutputHandler' );
}
wfProfileOut( 'WebStart.php-ob_start' );
# We are on current page (and not in PST), so
# take length of input to parser.
$length = $parser->mInputSize;
- } elseif( isset( $cache[$page] ) ) {
+ } elseif ( isset( $cache[$page] ) ) {
$length = $cache[$page];
} elseif ( $parser->incrementExpensiveFunctionCount() ) {
$rev = Revision::newFromTitle( $title, false, Revision::READ_NORMAL );
$this->requestedUser = '';
if ( $un != '' ) {
$username = Title::makeTitleSafe( NS_USER, $un );
- if( !is_null( $username ) ) {
+ if ( !is_null( $username ) ) {
$this->requestedUser = $username->getText();
}
}
$conds = array( 'rc_user > 0' ); // Users - no anons
$conds[] = 'rc_log_type IS NULL OR rc_log_type != ' . $dbr->addQuotes( 'newusers' );
$conds[] = 'rc_timestamp >= ' . $dbr->addQuotes(
- $dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge*24*3600 ) );
+ $dbr->timestamp( wfTimestamp( TS_UNIX ) - $this->RCMaxAge * 24 * 3600 ) );
if ( $this->requestedUser != '' ) {
$conds[] = 'rc_user_text >= ' . $dbr->addQuotes( $this->requestedUser );
$user = User::newFromId( $row->user_id );
// User right filter
- foreach( $this->hideRights as $right ) {
+ foreach ( $this->hideRights as $right ) {
// Calling User::getRights() within the loop so that
// if the hideRights() filter is empty, we don't have to
// trigger the lazy-init of the big userrights array in the
// Note: This is a different loop than for user rights,
// because we're reusing it to build the group links
// at the same time
- foreach( $user->getGroups() as $group ) {
+ foreach ( $user->getGroups() as $group ) {
if ( in_array( $group, $this->hideGroups ) ) {
return '';
}
*/
function dispatch() {
// the various namespaces supported by Special:Redirect
- switch( $this->mType ) {
+ switch ( $this->mType ) {
case 'user':
$url = $this->dispatchUser();
break;
'options' => array(),
'default' => current( array_keys( $ns ) ),
);
- foreach( $ns as $n => $m ) {
+ foreach ( $ns as $n => $m ) {
$m = $this->msg( $m )->text();
$a['type']['options'][$m] = $n;
}
// bytes. There shouldn't be a legitimate reason for this to happen.
wfDebug( __METHOD__ . ": Unmatched XML declaration start\n" );
return true;
- } elseif ( substr( $contents, 0, 4) == "\x4C\x6F\xA7\x94" ) {
+ } elseif ( substr( $contents, 0, 4 ) == "\x4C\x6F\xA7\x94" ) {
// EBCDIC encoded XML
wfDebug( __METHOD__ . ": EBCDIC Encoded XML\n" );
return true;
$this->statCache = array(); // clear
foreach ( $dstPathsRel as $dstPathRel ) {
$path = $dst->getRootStoragePath() . "/$backendRel/$dstPathRel";
- $this->statCache[sha1($path)] = $dst->getFileStat( array( 'src' => $path ) );
+ $this->statCache[sha1( $path )] = $dst->getFileStat( array( 'src' => $path ) );
}
$this->output( "done [" . count( $this->statCache ) . " file(s)]\n" );
}
$lc = new LocalisationCache_BulkLoad( $conf );
$allCodes = array_keys( Language::fetchLanguageNames( null, 'mwfile' ) );
- if( $this->hasOption( 'lang' ) ) {
+ if ( $this->hasOption( 'lang' ) ) {
# Validate requested languages
$codes = array_intersect( $allCodes,
explode( ',', $this->getOption( 'lang' ) ) );
# Bailed out if nothing is left
- if( count( $codes ) == 0 ) {
+ if ( count( $codes ) == 0 ) {
$this->error( 'None of the languages specified exists.', 1 );
}
} else {
}
$s = new profile_point( 'SQL Queries', 0, $sqltotal, 0, 0 );
- foreach ( $queries as $q )
+ foreach ( $queries as $q ) {
$s->add_child( $q );
+ }
$points[] = $s;
usort( $points, 'compare_point' );
array(
array(
'name' => 'Foobar',
- 'time' => $dbw->timestamp('20120101020202'),
+ 'time' => $dbw->timestamp( '20120101020202' ),
'age' => 42,
'height' => 9000.1,
'awesome' => true,