Jump to content

"Future-proofing" PHP development, need help


Go to solution Solved by KevinM1,

Recommended Posts

* I can't quite see the forum where this question exactly belongs, so moderators, please relocate as appropriate...

 

 

I know a lot of PHP development is TEMPORARY and not intended to last forever ( I used to code for an advertising company).

 

However, there are some things I would like to see endure... and I was really caught short a couple years back when my hosting provider (godaddy) KILLED PHP4 altogether.

 

I had a couple of sites that PERISHED because they were built on frameworks that were using PHP4, and could't reasonably be converted to PHP5.

Migration requirements were simply too pervasive in our case, would have required many many hours of rebuilding functions

 

I know I had the "option" to upgrade from shared hosting to a dedicated server ( and install my own PHP4 on it!) - but I simply couldn't afford a tenfold jump in hosting costs.

 

 

Now, the same hosting provider is only officially supporting PHP version 5.3  - with 5.2 as "legacy" language.

It seems that the days for 5.2 will be numbered ( and who knows - probably 5.3 down the road a bit, as well!) 

 

I notice the 5.2 to 5.3 migration guide shows a dozen lines of "backwards incompatible" changes - and the same for 5.3 to 5.4 ...

 

I rely on various frameworks and CMS's to get things done, and cringe at the thought that some day soon I could be faced with 8 zillion lines of code that need massaging.

 

How does everyone else look at this situation?

 

I need to decide whether to extend, or toss and start over some existing projects.

I certainly understand the value of  the latest supported language versions, but would hate to have the same problem sneak up and bite me 2 or 3 years down the road! 

I can't seem to find a really good "PHP language version roadmap" to make timeline decisions... not on PHP.net, anyway.

And the wikipedia page does not look too promising...

Edited by rockandroller

PHPFreaks.com Questions, Comments, & Suggestions

This is NOT a help forum! Do not post topics asking for help not related to the website.

Code becomes obsolete over time. Fact of life. Either stuff is actively maintained to keep up with the times or it falls behind and eventually dies. PHP 4 was supported long after PHP 5 came out, and remained in use even longer, and should PHP 6 prove to be as large a change then I'm sure the same will hold true for PHP 5.

 

There is no roadmap for PHP besides what you can overhear in the mailing list and the feature requests in the wiki (especially the RFC section). Don't use bad coding practices and you'll be set for a few years at least.

Generally speaking, if you code using current best practices, and keep informed of changes that are coming then you shouldn't be faced with too many problems from version updates. If something is changing that affects you (such as back when register_globals was removed), there is usually plenty of time for you to adapt your code before it becomes a crisis.

 

For example register_globals was pretty much depecated and on it's way out by 5.0 (though not officially til 5.3). It wasn't actually removed until 5.4 though. This means that anyone who was affected had at least 3 years official (8 years unofficial) warning before it became a problem. That is plenty of time to develop a plan of action and get your code updated. The same sort of thing is happening with the mysql_* functions right now. They have been unofficially deprecated for years, and have now been officially deprecated. It will probably be another year or so at least before they are officially removed though (and even longer before hosting companies remove support).

 

There is no solution to ensure you scripts never have to be updated, aside from running your own hosting where you have control over your upgrades. The key is just to stay informed of what changes are happening so you provide your self the best possible time frame for updating your code when it is necessary. As mentioned though, ensuring you code using the latest best practices will help keep the amount of changing you do need to do to a minimum. A project I work on started with php 5.1 and has been running just fine on 5.4 with hardly any changes required as a result of an upgrade (a few minor new E_STRICT notices at 5.4 is all). I've not yet tested the 5.5 betas but a quick scan through the change list doesn't show anything that should be a problem, the code will probably continue to work just fine with no or minimal changes.

These are very good points, thank you.

 

I guess this is the main drawback of not wanting to 'reinvent the wheel' - building upon existing CMS's and frameworks means I am choosing to rely on those people to 'do the right thing' with regards to 'the future'...

  • Solution

These are very good points, thank you.

 

I guess this is the main drawback of not wanting to 'reinvent the wheel' - building upon existing CMS's and frameworks means I am choosing to rely on those people to 'do the right thing' with regards to 'the future'...

 

CMS and Framework developers are the ones who are actually shaping the future.  Look at PHP-FIG (Framework Interoperability Group - http://www.php-fig.org/ ).  Representatives from the major frameworks and software developers (Symfony, Zend, Joomla, etc.) have created a group whose sole purpose is to create a set of standards for PHP coding.  Not just stylistic standards, but architectural standards.  They have created a series of PHP Standards Recommendations (PSRs) that their own projects use.  You can see the PSRs yourself here: https://github.com/php-fig/fig-standards/tree/master/accepted

 

Like the others have said, you futureproof by attempting to adhere to best practices.  The PSRs represent the PHP industry's de facto best practices.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.