* For some reason PHP doesn't always report errors even when error reporting is set to maxmium.
* The date\time system needs some sort of work doing to it, there is stuff for it spread everywhere and no definite timezone.
* Regardless, an E_STRICT level error does not constitute a major severity and High priority bug.
disabling $wgStrictFileExtensions
* (bug 14241) Pages can no longer be protected to levels you are not in
* (bug 14296) Fix local name of ang: (Anglo-Saxon)
-* (bug 7715) Use date_default_timezone_* instead of TZ environment variable if
- available
* (bug 4871) Hardcoded superscript in time zone preferences moved to message
=== API changes in 1.13 ===
* this in conjunction with the signature timezone and override the TZ
* environment variable like so:
* $wgLocaltimezone="Europe/Berlin";
- * date_default_timezone_set( $wgLocaltimezone );
+ * putenv("TZ=$wgLocaltimezone");
* $wgLocalTZoffset = date("Z") / 60;
*
* Leave at NULL to show times in universal time (UTC/GMT).
}
}
-if ( !function_exists( 'date_default_timezone_get' ) ) {
- /**
- * Exists in PHP 5.1.0+
- * Simulates functionality partially.
- * @return String: Environment timezone.
- */
- function date_default_timezone_get() {
- return getenv( 'TZ' );
- }
-}
-if ( !function_exists( 'date_default_timezone_set' ) ) {
- /**
- * Exists in PHP 5.1.0+
- * Simulates functionality partially.
- * @param String: Timezone to set to.
- * @return Boolean: Indication regarding if setting was successful.
- */
- function date_default_timezone_set( $setting ) {
- return putenv( 'TZ=' . $setting );
- }
-}
-
/**
* Like array_diff( $a, $b ) except that it works with two-dimensional arrays.
*/
# Use the time zone
global $wgLocaltimezone;
if ( isset( $wgLocaltimezone ) ) {
- $oldtz = date_default_timezone_get();
- date_default_timezone_set( $wgLocaltimezone );
+ $oldtz = getenv( 'TZ' );
+ putenv( 'TZ='.$wgLocaltimezone );
}
+ wfSuppressWarnings(); // E_STRICT system time bitching
$localTimestamp = date( 'YmdHis', $ts );
$localMonth = date( 'm', $ts );
$localMonthName = date( 'n', $ts );
$localYear = date( 'Y', $ts );
$localHour = date( 'H', $ts );
if ( isset( $wgLocaltimezone ) ) {
- date_default_timezone_set( $oldtz );
+ putenv( 'TZ='.$oldtz );
}
+ wfRestoreWarnings();
switch ( $index ) {
case 'currentmonth':
$tz = 'UTC';
if ( isset( $wgLocaltimezone ) ) {
$unixts = wfTimestamp( TS_UNIX, $ts );
- $oldtz = date_default_timezone_get();
- date_default_timezone_set( $wgLocaltimezone );
+ $oldtz = getenv( 'TZ' );
+ putenv( 'TZ='.$wgLocaltimezone );
$ts = date( 'YmdHis', $unixts );
$tz = date( 'T', $unixts ); # might vary on DST changeover!
- date_default_timezone_set( $oldtz );
+ putenv( 'TZ='.$oldtz );
}
$d = $wgContLang->timeanddate( $ts, false, false ) . " ($tz)";
# Use the time zone
global $wgLocaltimezone;
if ( isset( $wgLocaltimezone ) ) {
- $oldtz = date_default_timezone_get();
- date_default_timezone_set( $wgLocaltimezone );
+ $oldtz = getenv( 'TZ' );
+ putenv( 'TZ='.$wgLocaltimezone );
}
+ wfSuppressWarnings(); // E_STRICT system time bitching
$localTimestamp = date( 'YmdHis', $ts );
$localMonth = date( 'm', $ts );
$localMonthName = date( 'n', $ts );
$localYear = date( 'Y', $ts );
$localHour = date( 'H', $ts );
if ( isset( $wgLocaltimezone ) ) {
- date_default_timezone_set( $oldtz );
+ putenv( 'TZ='.$oldtz );
}
+ wfRestoreWarnings();
switch ( $index ) {
case 'currentmonth':
* than the one selected in each user's preferences.
*/
if ( isset( $wgLocaltimezone ) ) {
- $oldtz = date_default_timezone_get();
- date_default_timezone_set( $wgLocaltimezone );
+ $oldtz = getenv( 'TZ' );
+ putenv( 'TZ='.$wgLocaltimezone );
}
$d = $wgContLang->timeanddate( date( 'YmdHis' ), false, false) .
' (' . date( 'T' ) . ')';
if ( isset( $wgLocaltimezone ) ) {
- date_default_timezone_set( $oldtz );
+ putenv( 'TZ='.$oldtz );
}
# Variable replacement