r78596 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78595‎ | r78596 | r78597 >
Date:14:57, 19 December 2010
Author:questpc
Status:deferred
Tags:
Comment:
Make PEAR Excel code compatible to PHP 5.3 strict mode
Modified paths:
  • /trunk/extensions/QPoll/Excel/Excel_Workbook.php (modified) (history)
  • /trunk/extensions/QPoll/Excel/Excel_Worksheet.php (modified) (history)
  • /trunk/extensions/QPoll/Excel/Excel_Writer.php (modified) (history)
  • /trunk/extensions/QPoll/Excel/OLE.php (modified) (history)
  • /trunk/extensions/QPoll/Excel/OLE_PPS_File.php (modified) (history)
  • /trunk/extensions/QPoll/Excel/OLE_PPS_Root.php (modified) (history)
  • /trunk/extensions/QPoll/Excel/System.php (modified) (history)
  • /trunk/extensions/QPoll/qp_question.php (modified) (history)
  • /trunk/extensions/QPoll/qp_user.php (modified) (history)

Diff [purge]

Index: trunk/extensions/QPoll/Excel/Excel_Worksheet.php
@@ -373,7 +373,7 @@
374374 &$url_format, &$parser)
375375 {
376376 // It needs to call its parent's constructor explicitly
377 - $this->Spreadsheet_Excel_Writer_BIFFwriter();
 377+ parent::__construct();
378378 $this->_BIFF_version = $BIFF_version;
379379 $rowmax = 65536; // 16384 in Excel 5
380380 $colmax = 256;
Index: trunk/extensions/QPoll/Excel/Excel_Writer.php
@@ -53,7 +53,7 @@
5454 function __construct($filename = '')
5555 {
5656 $this->_filename = $filename;
57 - $this->Spreadsheet_Excel_Writer_Workbook($filename);
 57+ parent::__construct($filename);
5858 }
5959
6060 /**
Index: trunk/extensions/QPoll/Excel/OLE_PPS_File.php
@@ -48,7 +48,7 @@
4949 function __construct($name)
5050 {
5151 $this->_tmp_dir = System::tmpdir();
52 - $this->OLE_PPS(
 52+ parent::__construct(
5353 null,
5454 $name,
5555 OLE_PPS_TYPE_FILE,
Index: trunk/extensions/QPoll/Excel/OLE_PPS_Root.php
@@ -48,7 +48,7 @@
4949 function __construct($time_1st, $time_2nd, $raChild)
5050 {
5151 $this->_tmp_dir = System::tmpdir();
52 - $this->OLE_PPS(
 52+ parent::__construct(
5353 null,
5454 OLE::Asc2Ucs('Root Entry'),
5555 OLE_PPS_TYPE_ROOT,
Index: trunk/extensions/QPoll/Excel/Excel_Workbook.php
@@ -180,7 +180,7 @@
181181 function __construct($filename)
182182 {
183183 // It needs to call its parent's constructor explicitly
184 - $this->Spreadsheet_Excel_Writer_BIFFwriter();
 184+ parent::__construct();
185185
186186 $this->_filename = $filename;
187187 $this->_parser = new Spreadsheet_Excel_Writer_Parser($this->_byte_order, $this->_BIFF_version);
Index: trunk/extensions/QPoll/Excel/OLE.php
@@ -470,7 +470,7 @@
471471 * @param string $ascii The ASCII string to transform
472472 * @return string The string in Unicode
473473 */
474 - function Asc2Ucs($ascii)
 474+ static function Asc2Ucs($ascii)
475475 {
476476 $rawname = '';
477477 for ($i = 0; $i < strlen($ascii); $i++) {
@@ -488,7 +488,7 @@
489489 * @param integer $date A timestamp
490490 * @return string The string for the OLE container
491491 */
492 - function LocalDate2OLE($date = null)
 492+ static function LocalDate2OLE($date = null)
493493 {
494494 if (!isset($date)) {
495495 return "\x00\x00\x00\x00\x00\x00\x00\x00";
@@ -533,7 +533,7 @@
534534 * @access public
535535 * @static
536536 */
537 - function OLE2LocalDate($string)
 537+ static function OLE2LocalDate($string)
538538 {
539539 if (strlen($string) != 8) {
540540 return new PEAR_Error("Expecting 8 byte string");
Index: trunk/extensions/QPoll/Excel/System.php
@@ -451,7 +451,7 @@
452452 * @static
453453 * @return string The temporary directory on the system
454454 */
455 - function tmpdir()
 455+ static function tmpdir()
456456 {
457457 if (OS_WINDOWS) {
458458 if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) {
Index: trunk/extensions/QPoll/qp_user.php
@@ -1236,6 +1236,7 @@
12371237 }
12381238
12391239 static function displayRow( $row, $rowattrs = "", $celltag = "td", $attribute_maps = null ) {
 1240+ # temporary var $tagsrow used to avoid warning in E_STRICT mode
12401241 $tagsrow = self::newRow( $row, $rowattrs, $celltag, $attribute_maps );
12411242 return self::renderHTMLobject( $tagsrow );
12421243 }
Index: trunk/extensions/QPoll/qp_question.php
@@ -1020,6 +1020,7 @@
10211021 }
10221022 # fill undefined spans with the last span value
10231023 $SpanCategDelta = count( $this->mCategories ) - count( $spans[0] );
 1024+ # temporary var $diff used to avoid warning in E_STRICT mode
10241025 $diff = array_diff( array_keys( $spans[1] ), array_keys( $spans[1], "", true ) );
10251026 $lastDefinedSpanKey = array_pop( $diff );
10261027 unset( $diff );

Status & tagging log