-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Comments
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). |
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. |
+1 for namespaces |
Regarding \Core namespace: IMHO it adds clutter so better leave it out. |
namespaces covered in #4059 |
…, mostly finished core/ conversion
…ses, renaming Unzip to Uncompress, Renaming Tracker/Referer to Tracker/Referrer, and few more
…n Windows in PHP >= 5.3 so we don't need the compat code anymore. refs matomo-org#3741, matomo-org#4113
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 likePiwik_Plugin_Config
(which will become the classConfig
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!
The text was updated successfully, but these errors were encountered: