<?php
-/**
- * Date formatter, recognises dates in plain text and formats them accoding to user preferences.
- *
- * @package MediaWiki
- * @subpackage Parser
- */
/**
+ * Date formatter, recognises dates in plain text and formats them accoding to user preferences.
* @todo preferences, OutputPage
- * @package MediaWiki
- * @subpackage Parser
+ * @addtogroup Parser
*/
class DateFormatter
{
* @static
*/
function &getInstance() {
- global $wgDBname, $wgMemc;
+ global $wgMemc;
static $dateFormatter = false;
if ( !$dateFormatter ) {
- $dateFormatter = $wgMemc->get( "$wgDBname:dateformatter" );
+ $dateFormatter = $wgMemc->get( wfMemcKey( 'dateformatter' ) );
if ( !$dateFormatter ) {
$dateFormatter = new DateFormatter;
- $wgMemc->set( "$wgDBname:dateformatter", $dateFormatter, 3600 );
+ $wgMemc->set( wfMemcKey( 'dateformatter' ), $dateFormatter, 3600 );
}
}
return $dateFormatter;
}
for ( $i=1; $i<=self::LAST; $i++ ) {
$this->mSource = $i;
- if ( @$this->rules[$preference][$i] ) {
+ if ( isset ( $this->rules[$preference][$i] ) ) {
# Specific rules
$this->mTarget = $this->rules[$preference][$i];
- } elseif ( @$this->rules[self::ALL][$i] ) {
+ } elseif ( isset ( $this->rules[self::ALL][$i] ) ) {
# General rules
$this->mTarget = $this->rules[self::ALL][$i];
} elseif ( $preference ) {
}
}
-?>
+