A note to Revolution SVN users:
As of r5984, in SVN in the branches/2.0 branch, (and soon to be in branches/revolution), Revolution is now PHP5-only, specifically PHP 5.1.1+.
For those of you using an older PHP, we greatly encourage you to upgrade to at least 5.1.1 (we recommend upgrading to PHP 5.3.0).
For those of you asking, "Why did we do this?", we offer these statements:
- PHP4 has long since lost support from the core PHP team.
- PHP5 offers access modifiers for classes, better OOP support, class constants, iterators, and exception handling. For now, in Revo we’re using access modifiers and iterators. We’ll soon be implementing exception handling and better loading methods.
- The change significantly reduced the PHP load times, as there are no more E_STRICT errors being thrown (in fact, to our knowledge, Revo should run on E_STRICT, but we dont recommend it) and the xPDO/MODx core code no longer has to do PHP4 workarounds.
- It allows us to properly contain protected/private methods and structure the OOP core more properly. This will also help in development as 3PC devs wont use functions they’re not supposed to.
- It limits our problems with install environments, as this effectively cuts our environments-to-test spectrum in half.
Why PHP 5.1.1 instead of PHP 5.0? Well, the PHP 5.0.* series had major issues with PDO and other drivers, and 5.1.0 was missing basic Iterator functions. We’ve solidified on 5.1.1 for now as a baseline.
So you’re now asking, what do I need to do? Nothing. Just simply run the build and upgrade like normal. MODx will handle the rest.
For 3PC devs, there are some changes that you might want to make:
- MODX_ constants are now referred to by modX::CONSTANT_NAME. This means you might have to change some code. Some examples:
MODX_LOG_LEVEL_ERROR => modX::LOG_LEVEL_ERROR
XPDO_TRANSPORT_UPDATE_OBJECT => xPDOTransport::UPDATE_OBJECT
MAIL_SUBJECT => modMail::MAIL_SUBJECT
PDO_FETCH_ASSOC => PDO::FETCH_ASSOC
Note that this does not apply to the path defines, such as MODX_CORE_PATH, MODX_ASSETS_PATH, MODX_BASE_URL, XPDO_CORE_PATH, MODX_SITE_URL, etc.
- Your build scripts will need to be updated to reflect the class constant changes.
- You’ll need to change any PDO_ constants to PDO::, as in the PHP docs.
- You no longer need to do PHP4-supported code. PHP 5.1.1 will be the baseline.
So you’ll probably have to update some of your build scripts and components to reflect this. We apologize for the change, but we feel it best in the long run.
Thanks to the community for their support, and we hope this change will benefit all present and future Revolution users. Feel free to comment or make suggestions about the change in this thread.