40 return new static( $ts );
64 if (
$lang ===
null ) {
65 $lang = RequestContext::getMain()->getLanguage();
68 return $lang->getHumanTimestamp( $this, $relativeTo, $user );
82 $option = $user->getOption(
'timecorrection' );
83 $data = explode(
'|', $option, 3 );
86 if (
$data[0] ==
'ZoneInfo' ) {
88 $tz =
new DateTimeZone(
$data[2] );
89 }
catch ( Exception
$e ) {
94 $this->timestamp->setTimezone( $tz );
104 if (
$data[0] ==
'System' ) {
115 $data = explode(
':', $option );
116 if ( count(
$data ) >= 2 ) {
119 if ( (
int)
$data[0] < 0 ) {
130 $interval->invert = 1;
133 $this->timestamp->add( $interval );
151 array $chosenIntervals = []
153 if ( $relativeTo ===
null ) {
154 $relativeTo =
new self;
156 if ( $user ===
null ) {
157 $user = RequestContext::getMain()->getUser();
159 if (
$lang ===
null ) {
160 $lang = RequestContext::getMain()->getLanguage();
164 $diff = $this->
diff( $relativeTo );
166 'GetRelativeTimestamp',
167 [ &$ts, &$diff, $this, $relativeTo, $user,
$lang ]
169 $seconds = ( ( ( $diff->days * 24 + $diff->h ) * 60 + $diff->i ) * 60 + $diff->s );
170 $ts =
wfMessage(
'ago',
$lang->formatDuration( $seconds, $chosenIntervals ) )
171 ->inLanguage(
$lang )->text();
187 $tzMsg = $this->
format(
'T' );
190 if ( $msg->exists() ) {
206 $timestamp =
new self( $ts );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
$wgLocaltimezone
Fake out the timezone that the server thinks it's in.
$wgLocalTZoffset
Set an offset from UTC in minutes to use for the default timezone setting for anonymous users and new...
Internationalisation code.
Library for creating and parsing MW-style timestamps.
getRelativeTimestamp(MWTimestamp $relativeTo=null, User $user=null, Language $lang=null, array $chosenIntervals=[])
Generate a purely relative timestamp, i.e., represent the time elapsed between the given base timesta...
getHumanTimestamp(MWTimestamp $relativeTo=null, User $user=null, Language $lang=null)
Get the timestamp in a human-friendly relative format, e.g., "3 days ago".
static getInstance( $ts=false)
Get a timestamp instance in GMT.
static getLocalInstance( $ts=false)
Get a timestamp instance in the server local timezone ($wgLocaltimezone)
getTimezoneMessage()
Get the localized timezone message, if available.
offsetForUser(User $user)
Adjust the timestamp depending on the given user's preferences.
Variant of the Message class.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
also included in $newHeader if any indicating whether we should show just the diff
if the prop value should be in the metadata multi language array format
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation use $formDescriptor instead default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "<div ...>$1</div>"). - flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException':Called before an exception(or PHP error) is logged. This is meant for integration with external error aggregation services
returning false will NOT prevent logging $e
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
if(!isset( $args[0])) $lang