if( '' == $q ) {
$a = $wgScript;
} else {
- $a = "{$wgScript}?{$q}";
+ $a = $wgScript.'?'.$q;
}
} else if ( '' == $q ) {
- $a = str_replace( "$1", $a, $wgArticlePath );
+ $a = str_replace( '$1', $a, $wgArticlePath );
} else if ($wgScript != '' ) {
$a = "{$wgScript}?title={$a}&{$q}";
} else { //XXX hackish solution for toplevel wikis
if ( isset( $wgOut ) && $wgDebugComments && !$logonly ) {
$wgOut->debug( $text );
}
- if ( "" != $wgDebugLogFile && !$wgProfileOnly ) {
+ if ( '' != $wgDebugLogFile && !$wgProfileOnly ) {
error_log( $text, 3, $wgDebugLogFile );
}
}
function wfLogDBError( $text ) {
global $wgDBerrorLog;
if ( $wgDBerrorLog ) {
- $text = date("D M j G:i:s T Y") . "\t$text";
+ $text = date('D M j G:i:s T Y') . "\t".$text;
error_log( $text, 3, $wgDBerrorLog );
}
}
global $wgProfiling, $wgProfileStack, $wgProfileLimit, $wgUser;
$now = wfTime();
- list( $usec, $sec ) = explode( " ", $wgRequestTime );
+ list( $usec, $sec ) = explode( ' ', $wgRequestTime );
$start = (float)$sec + (float)$usec;
$elapsed = $now - $start;
if ( $wgProfiling ) {
function wfReadOnly() {
global $wgReadOnlyFile;
- if ( "" == $wgReadOnlyFile ) {
+ if ( '' == $wgReadOnlyFile ) {
return false;
}
return is_file( $wgReadOnlyFile );
}
-$wgReplacementKeys = array( "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9" );
+$wgReplacementKeys = array( '$1', '$2', '$3', '$4', '$5', '$6', '$7', '$8', '$9' );
# Get a message from anywhere
function wfMsg( $key ) {
if ( $wgCommandLineMode ) {
$msg .= "$file line {$call['line']} calls ";
} else {
- $msg .= '<li>' . $file . " line " . $call['line'] . ' calls ';
+ $msg .= '<li>' . $file . ' line ' . $call['line'] . ' calls ';
}
if( !empty( $call['class'] ) ) $msg .= $call['class'] . '::';
- $msg .= $call['function'] . "()";
+ $msg .= $call['function'] . '()';
if ( $wgCommandLineMode ) {
$msg .= "\n";
$po = $offset - $limit;
if ( $po < 0 ) { $po = 0; }
$q = "limit={$limit}&offset={$po}";
- if ( '' != $query ) { $q .= "&{$query}"; }
+ if ( '' != $query ) { $q .= '&'.$query; }
$plink = '<a href="' . wfLocalUrlE( $link, $q ) . "\">{$prev}</a>";
} else { $plink = $prev; }
$no = $offset + $limit;
- $q = "limit={$limit}&offset={$no}";
- if ( "" != $query ) { $q .= "&{$query}"; }
+ $q = 'limit='.$limit.'&offset='.$no;
+ if ( '' != $query ) { $q .= '&'.$query; }
if ( $atend ) {
$nlink = $next;
{
global $wgUser, $wgLang;
if ( '' == $query ) { $q = ''; }
- else { $q = "{$query}&"; }
- $q .= "limit={$limit}&offset={$offset}";
+ else { $q = $query.'&'; }
+ $q .= 'limit='.$limit.'&offset='.$offset;
$fmtLimit = $wgLang->formatNum( $limit );
$s = '<a href="' . wfLocalUrlE( $link, $q ) . "\">{$fmtLimit}</a>";
if ( '' != $cgi ) {
$cgi .= '&';
}
- $cgi .= "{$key}={$value}";
+ $cgi .= $key.'='.$value;
}
}
return $cgi;
}
function wfUnix2Timestamp( $unixtime ) {
- return gmdate( "YmdHis", $unixtime );
+ return gmdate( 'YmdHis', $unixtime );
}
function wfTimestampNow() {
# return NOW
- return gmdate( "YmdHis" );
+ return gmdate( 'YmdHis' );
}
# Sorting hack for MySQL 3, which doesn't use index sorts for DESC
function wfInvertTimestamp( $ts ) {
return strtr(
$ts,
- "0123456789",
- "9876543210"
+ '0123456789',
+ '9876543210'
);
}
}
# Autodetect, convert and provide timestamps of various types
-define("TS_UNIX",0); # Standard unix timestamp (number of seconds since 1 Jan 1970)
-define("TS_MW",1); # Mediawiki concatenated string timestamp (yyyymmddhhmmss)
-define("TS_DB",2); # Standard database timestamp (yyyy-mm-dd hh:mm:ss)
+define('TS_UNIX',0); # Standard unix timestamp (number of seconds since 1 Jan 1970)
+define('TS_MW',1); # Mediawiki concatenated string timestamp (yyyymmddhhmmss)
+define('TS_DB',2); # Standard database timestamp (yyyy-mm-dd hh:mm:ss)
function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
if (preg_match("/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/",$ts,$da)) {
return $uts;
break;
case TS_MW:
- return gmdate( "YmdHis", $uts );
+ return gmdate( 'YmdHis', $uts );
break;
case TS_DB:
- return gmdate( "Y-m-d H:i:s", $uts );
+ return gmdate( 'Y-m-d H:i:s', $uts );
break;
default:
return;