Ticket #845 (closed Bug: fixed)

Opened 3 years ago

Last modified 3 years ago

PHP 5.3 generates slew of errors

Reported by: craigmj Owned by: vipsoft
Priority: critical Milestone: Piwik 0.4.3
Component: Core Keywords:
Cc: Sensitive:

Description

Under PHP 5.3 the ereg() method has been deprecated, and a number of other features are changed.

The attached diff allows Piwik to install and run under 5.3. It primarily fixes the deprecated issues in the code, BUT NOT in the Unit Tests: these currently generate a range of warnings about depracation.

Therefore this diff is a starting point, and SHOULD BE CHECKED since in some places it is not immediately obvious that the ereg -> preg replacement is trivial.

In theory, the diff is backwards-compatible, but I've only tested under 5.3, so am unsure about this.

Note too that I've not changed the ereg calls in

libs/PclZip/pclzip.lib.php libs/UserAgentParser/UserAgentParser.php

Since these are libraries, I have left them, and they don't appear to cause a problem on my instance yet (which I've only just installed and started playing with).

Attachments

php53_patch.txt Download (10.4 KB) - added by craigmj 3 years ago.
Patch to get Piwik running under PHP 5.3

Change History

Changed 3 years ago by craigmj

Patch to get Piwik running under PHP 5.3

Changed 3 years ago by vipsoft

  • milestone set to 1 - Piwik 0.4.2

Changed 3 years ago by vipsoft

craigmj: thanks for the patch. I've extended the changes to libs and tests, and reviewed/applied fixes for the other backward incompatibilities and deprecated functions (e.g., split and magic methods).

Notes:

  • I didn't apply the change to config/global.ini.php as it isn't backwards compatible with php 5.2.x
  • I reworked the fix for libs/Event/Dispatcher.php to handle the header & footer callbacks.
  • the patch to libs/Smarty/plugins/functions.fetch.php comes from Smarty SVN
  • the patches to Zend will be reviewed again in #497

Changed 3 years ago by vipsoft

  • status changed from new to closed
  • resolution set to fixed

(In [1287]) fixes #845 - php 5.3 backward incompatibilities and deprecated functionality; quick fixes #851 - unit tests; also fix redirect error in Installation when deleting existing tables

Changed 3 years ago by matt

craigmj & vipsoft, good stuff - Piwik has been fast to be 5.3 compatible.

Changed 3 years ago by matt

by the way, vipsoft, please let me know when you think it is best to release 0.4.2 to address these changes.

Changed 3 years ago by vipsoft

(In [1293]) refs #845 - update simpletest (from 1.0.1beta to 1.0.1); apply changes for php 5.3 (i.e., deprecated functionality); change ordering of unit tests (all_tests.php)

Changed 3 years ago by vipsoft

  • status changed from closed to reopened
  • resolution fixed deleted
  • milestone changed from 1 - Piwik 0.4.2 to 1 - Piwik 0.4.3

re-opening: regression with php 5.2.x; all_tests.php broken in trunk

Changed 3 years ago by vipsoft

  • owner set to vipsoft
  • status changed from reopened to new

Changed 3 years ago by vipsoft

  • priority changed from major to critical
  • status changed from new to assigned

Changed 3 years ago by vipsoft

  • status changed from assigned to closed
  • resolution set to fixed

Not a regression.

Note: See TracTickets for help on using tickets.