Alters behavior of wfTimestamp() and wfTimestampNow() in clearly broken ways, such that current time would not return current time anymore.
$wgAutoConfirmCount (defaulting to zero, naturally).
* Added rate limiter for Special:Emailuser
* Private logs can now be created using $wgLogRestrictions
-* Databases using timestamps with time zone (Postgres) can now set $wgDBtimezone
== New features since 1.9 ==
* (bug 6937) Introduce "statistics-footer" message, appended to
* (bug 4777) Separate prev/next messages for Special:Whatlinkshere
* Merge approx 15 missing Wikipedia language codes into wikipedia-interwiki.sql
based on Jeff Merkey's mediawiki-1.9.3.WG-20070316.tar.gz.bz2 archive.
-* (bug 9299) Allow user timezones to work with Postgres
* (bug 9411) Fix for shared image descriptions using query-string titles
* (bug 4756) Add user tool links for self created accounts at special:log
instead of sometimes broken block links from newuserlog extension
$article->updateRevisionOn( $wgDatabase, $revision );
}
- # If the database has a specific timezone, and its not the default(0), change LocalSettings.php
- if ($wgDBtimezone != 0) {
- $local = preg_replace('/(wgDBtimezone\s+= )0/', "$1$wgDBtimezone", $local);
- }
-
/* Write out the config file now that all is well */
print "<li style=\"list-style: none\">\n";
print "<p>Creating LocalSettings.php...</p>\n\n";
\$wgDBuser = \"{$slconf['DBuser']}\";
\$wgDBpassword = \"{$slconf['DBpassword']}\";
\$wgDBport = \"{$slconf['DBport']}\";
-\$wgDBtimezone = 0;
\$wgDBprefix = \"{$slconf['DBprefix']}\";
# Schemas for Postgres
## If this is the initial connection, setup the schema stuff and possibly create the user
if (defined('MEDIAWIKI_INSTALL')) {
global $wgDBname, $wgDBuser, $wgDBpassword, $wgDBsuperuser, $wgDBmwschema,
- $wgDBts2schema, $wgDBtimezone;
+ $wgDBts2schema;
print "<li>Checking the version of Postgres...";
$version = $this->getServerVersion();
}
print "version $this->numeric_version is OK.</li>\n";
- print "<li>Figuring out timezone the database is using...";
- ## Figure out what the local timezone is for this database
- $wgDBtimezone = 99;
- if ($this->doQuery("SET datestyle TO ISO")) {
- $res = $this->doQuery("SELECT substring(now() FROM E'-?\\\d\\\d\$')::int");
- if ($res) {
- $wgDBtimezone = pg_fetch_result($res,0,0);
- print "timezone is '$wgDBtimezone'</li>\n";
- }
- }
- if ($wgDBtimezone === 99) {
- print "<b>UNKNOWN</b>. Defaulting to '0'</li>\n";
- }
-
$safeuser = $this->quote_ident($wgDBuser);
## Are we connecting as a superuser for the first time?
if ($wgDBsuperuser) {
$wgDBserver = 'localhost';
/** database port number */
$wgDBport = '';
-/** timezone the database is using */
-$wgDBtimezone = 0;
/** name of the database */
$wgDBname = 'wikidb';
/** */
*/
function wfTimestampNow() {
# return NOW
- return wfTimestamp( TS_MW, 0 );
+ return wfTimestamp( TS_MW, time() );
}
/**
* @return string Time in the format specified in $outputtype
*/
function wfTimestamp($outputtype=TS_UNIX,$ts=0) {
- global $wgDBtimezone;
$uts = 0;
$da = array();
if ($ts==0) {
- $uts=time() - 60*60*$wgDBtimezone;
+ $uts=time();
} elseif (preg_match('/^(\d{4})\-(\d\d)\-(\d\d) (\d\d):(\d\d):(\d\d)$/D',$ts,$da)) {
# TS_DB
$uts=gmmktime((int)$da[4],(int)$da[5],(int)$da[6],
* @return int
*/
function userAdjust( $ts, $tz = false ) {
- global $wgUser, $wgLocalTZoffset, $wgDBtimezone;
+ global $wgUser, $wgLocalTZoffset;
if (!$tz) {
$tz = $wgUser->getOption( 'timecorrection' );
$hrDiff = intval( $tz );
}
- # Account for databases that use timestamp with time zone
- if ( isset($wgDBtimezone) and $tz ) {
- $hrDiff -= $wgDBtimezone;
- }
-
# No difference ? Return time unchanged
if ( 0 == $hrDiff && 0 == $minDiff ) { return $ts; }