Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Piwik 2.0 codebase to PHP 5.3! #3741

Closed
halfdan opened this issue Feb 7, 2013 · 11 comments
Closed

Upgrade Piwik 2.0 codebase to PHP 5.3! #3741

halfdan opened this issue Feb 7, 2013 · 11 comments
Assignees
Labels
Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@halfdan
Copy link
Member

halfdan commented Feb 7, 2013

This ticket should serve as a placeholder ticket for discussion and future changes related to Piwik 2.0.

With Piwik 2.0 in sight we should raise the minimum PHP version to 5.3. PHP 5.1 has EOL'd more than 7 years ago, and PHP 5.2 more than 2 years ago. [[http://php.net/eol.php]]

PHP 5.3 introduced several interesting features that we can utilize.

Namespaces

For Piwik 2.0 I propose the following changes regarding namespaces.

We use \Piwik as central namespace. Everything else will go into subnamespaces. This will allow us to get rid of long class names like Piwik_Plugin_Config (which will become the class Config in the namespace \Piwik\Core\Plugin.

I propose the following namespaces:

||core/||\Piwik\Core||
||core/API||\Piwik\Core\API||
||plugins/||\Piwik\Plugin||
||plugins/Goals||\Piwik\Plugin\Goals||

and so on. We should discuss if the "Core" namespace is necessary however.

Other

PHP 5.3 also introduced anonymous functions, which we can use as callback methods in some places.

It also introduced better XML support with XMLReader/XMLWriter, which could act as a replacement for SimpleXML and solve #1522.


This will break backwards compatibility, but since 2.0 is a major release we should use this to bring Piwik to the latest standard in PHP development.

This will also allow us to upgrade or change some of our dependencies that have moved to PHP 5.3 as well.

Bringing Piwik to PHP 5.3 is no easy task and will very likely be a joint effort. We need to decide on a feature freeze date. At this date, no new features will be implemented in the master branch. We will then create a "Piwik 1.x" branch which we can maintain for security patches and backports of Piwik 2.0 features. The master branch will then be used to upgrade Piwik to PHP 5.3.

Feel free to add to this ticket!

@sgiehl
Copy link
Member

sgiehl commented Feb 7, 2013

Have you already looked at ZF2? It is not really a new version of zend framework (1). It's more like a complete new framework. I don't think its even possible to upgrade without rewriting everything.

If we realy want to switch to PHP 5.3 features and a new framework, maybe we should also have a look at symphony (http://symfony.com/) and start completly new. That way we would have a clean new code base and could directly implement some features that are very hard to implement with the current code base.

Note: PHPUnit 3.8 requires PHP 5.4.7 (or later).

@halfdan
Copy link
Member Author

halfdan commented Feb 7, 2013

No I haven't looked at ZF2 very close. I did not think that the changes were that big.

Symfony would be very interesting indeed as it would allow us to clean up the code base quite a bit. Templating also seems to be much easier in Symfony as compared to Smarty.

I think the first step is to bring Piwik to 5.3. After that we can consider changing the framework.

@julienmoumne
Copy link
Member

+1 for namespaces
+1 for anonymous functions (I would then be able to simplify https://github.com/piwik/piwik/blob/1.9.2/plugins/MobileMessaging/ReportRenderer/Sms.php#L74)

@mattab
Copy link
Member

mattab commented Mar 11, 2013

Regarding \Core namespace: IMHO it adds clutter so better leave it out.

@mattab
Copy link
Member

mattab commented Jul 30, 2013

In 765be0d: Refs #3741 Resuming PHP Namespaces conversion of Piwik core, mostly finished core/ conversion

@mattab
Copy link
Member

mattab commented Jul 31, 2013

In 1175294: Refs #3741 PHP Namespace conversion continued: Tracker classes,
renaming Unzip to Uncompress,
Renaming Tracker/Referer to Tracker/Referrer,
and few more

@sgiehl
Copy link
Member

sgiehl commented Jul 31, 2013

In 9c12ab4: refs #3741 fixing some namespaces

@mattab
Copy link
Member

mattab commented Aug 9, 2013

In 32fe681: Piwik now requires PHP 5.3 Fixes #3741

@mattab
Copy link
Member

mattab commented Aug 9, 2013

In 215fdbe: Refs #3741 Removing pre 5.3 compatibility code

@mattab
Copy link
Member

mattab commented Aug 9, 2013

namespaces covered in #4059

@anonymous-matomo-user
Copy link

In 3f7a679: Remove compat code for PHP < 5.3. inet_pton/inet_ntop are available in Windows in PHP >= 5.3 so we don't need the compat code anymore.

refs #3741, #4113

@halfdan halfdan added this to the 2.0 - Piwik 2.0 milestone Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…ses,

renaming Unzip to Uncompress,
Renaming Tracker/Referer to Tracker/Referrer,
and few more
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
…n Windows in PHP >= 5.3 so we don't need the compat code anymore.

refs matomo-org#3741, matomo-org#4113
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

5 participants