Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#497 closed Bug (fixed)

Update Zend Framework classes to their latest version + backport some changes

Reported by: matt Owned by: vipsoft
Priority: major Milestone: Piwik 0.4.4
Component: Core Keywords:
Cc: Sensitive: no

Description (last modified by vipsoft)

Piwik is using ZF 1.0 classes. We should update to the latest ZF classes, as long as they don't add an enormous overhead.

Also, we had to patch some files in the early days: look at core/misc/TODO. I noted some changes I had to make in ZF libraries due to some limitations. I created bugs in ZF bug tracker for some of them so some should be fixed by now. we may have to backport some of these changes though.

CHANGES DONE TO LIBRARIES
=========================

  • edited Zend/Db/Adapter/Abstract.php added resetConfigArray()
  • edited zend_log and changed attr to protected
  • fixed bug fwrite in zend_log stream writer
  • fixed PEAR so that it works under PHP5 with STRICT MODE enabled
  • edited line 145 registry.php from require_once 'Zend/Exception.php'; to require_once 'Exception.php'; so that it works when calling Piwik in CLI mode

Change History (18)

comment:1 Changed 5 years ago by vipsoft (robocoder)

ZF 1.7 has ballooned in size from 1.0. Would you propose to import the whole thing or piecemeal?

comment:2 Changed 5 years ago by vipsoft (robocoder)

Having worked through ticket #243, it's perhaps premature to contemplate this, but I will note (given comments about replacing some of the jquery plugins) that ZF includes the dojo toolkit.

comment:3 Changed 5 years ago by vipsoft (robocoder)

Should we include the complete ZF 1.7.x library?

Benefits:

  • 3rd party plugins can assume all Zend components available
  • wouldn't have to test for interdependies between Zend components that we include vs exclude

Negatives:

  • increases size of distribution (Piwik uses a 6 MB subset from ZF 1.0; the library in ZF 1.7.6 is ~22MB)
  • increases number of inodes used (could be an issue for some hosting accounts)


comment:4 Changed 5 years ago by matt (mattab)

no we should defintely not include all libs, small piwik.zip size is critical feature. we only include modules that we know we're using. If plugins need special modules then they can include it in the plugin code.

I think zend is pretty good as having each module autonomous so testing for dependency would be small effort.

comment:5 Changed 5 years ago by vipsoft (robocoder)

... ZF 1.8 preview released earlier this month; looks like they're targeting for a release at the end of this month ...

comment:6 Changed 5 years ago by vipsoft (robocoder)

According to http://www.zendframework.com/manual/en/requirements.html, ZF "supports" PHP 5.2.4 or later. Should Piwik raise its minimum PHP requirement?

comment:7 Changed 5 years ago by halfdan

Refering to zend.com they are targetting 1.9.0 for late July of this year.

I concur with matt, piwik should only use the required subset of Zend classes.

comment:8 Changed 5 years ago by matt (mattab)

piwik should not raise php minimum requirements as long as the subset of zend we need to use doesn't require higher php version. if this is the case that a zend lib we use require a higher php version, we might want to make sure this is necessary - as increasing php versions might mean lose a few users on the way :)

comment:9 Changed 5 years ago by vipsoft (robocoder)

The minimum requirements should be increased periodically for practical purposes, otherwise "costs" (time, effort, opportunity, etc) increase to provide end-user support and to maintain backwards compatibility (e.g., workarounds).

Does anyone still have a box running PHP 5.1.3 and MySQL 4.1 to test releases?

comment:10 Changed 5 years ago by albass

comment:11 Changed 5 years ago by alivenk

comment:12 Changed 5 years ago by vipsoft (robocoder)

  • Milestone changed from 4- Stable release to 2- DigitalVibes
  • Sensitive unset

comment:13 Changed 5 years ago by vipsoft (robocoder)

  • Owner set to vipsoft

comment:14 Changed 5 years ago by vipsoft (robocoder)

  • Description modified (diff)

comment:15 Changed 5 years ago by vipsoft (robocoder)

  • Description modified (diff)

PEAR isn't part of ZF and won't be addressed by this ticket.

The following changes have (since 1.0) been fixed/resolved upstream:

  • edited line 145 registry.php from require_once 'Zend/Exception.php'; to require_once 'Exception.php'; so that it works when calling Piwik in CLI mode
  • [ZF-1791] edited zend_log and changed attr to protected
  • [ZF-1790] fixed bug fwrite in zend_log stream writer
  • [ZF-1832] Zend_Date bug
  • [ZF-1796] Mysql adapter assumes Mysqli class is available

I submitted [ZF-7788] for the resetConfigArray() enhancement.

comment:16 Changed 5 years ago by vipsoft (robocoder)

  • Milestone changed from 2- DigitalVibes to 1 - Piwik 0.4.4

comment:17 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

In [1454], fixes #497 - update to Zend Framework 1.9.2 (subset); remove svn:keywords to preserve the original $Id; misc changes to handle fetchRow() sometimes returning null (instead of false)

comment:18 Changed 5 years ago by vipsoft (robocoder)

In [1457], refs #497 - fix regression; remove call to Zend_Session::destroy()

Note: See TracTickets for help on using tickets.