r23146 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23145‎ | r23146 | r23147 >
Date:22:39, 20 June 2007
Author:david
Status:old
Tags:
Comment:
Fixed compatibility with PHP 5.0 date functions.
Modified paths:
  • /branches/liquidthreads/extensions/LqtModel.php (modified) (history)

Diff [purge]

Index: branches/liquidthreads/extensions/LqtModel.php
@@ -26,9 +26,7 @@
2727 return $this->moved('+1 month');
2828 }
2929 function moved($str) {
30 - $d = new DateTime($this->text());
31 - $d->modify($str);
32 - return new Date($d->format('YmdHis'));
 30+ return new Date( date('YmdHis', strtotime($this->text() . ' ' . $str)) );
3331 }
3432 /* function monthString() {
3533 return sprintf( '%04d%02d', $this->year, $this->month );
@@ -43,10 +41,10 @@
4442 $els = array('year', 'month', 'day', 'hour', 'minute', 'second');
4543 $deltas = array();
4644 foreach ($els as $e) {$deltas[$e] = $t->$e - $o->$e;
47 - $t->$e += $t->$e - $o->$e;
 45+ $t->$e += $t->$e - $o->$e;
4846 }
4947
50 - // format in style of DateTime::modify().
 48+ // format in style of date().
5149 $result = "";
5250 foreach( $deltas as $name => $val ) {
5351 $result .= "$val $name ";

Status & tagging log