A community in which webmasters can ask for help with topics such as PHP coding , MySQL , IT jobs, web design, IT security.
Current location:homephp forumphp talk in 2009 yearMigrating to a newer version of PHP - page 1
User InfoPosts
Migrating to a newer version of PHP#1
I notice that a couple of weeks ago PHP 5.3 reached release candidate stage (woo!), but then seeing the list of already-deprecated functions finally being removed, that got me thinking about whether it would break any of my old code.

Short of doing a suck-it-and-see test (installing on a test server and trying it out), are there any sort of migration tools which can analyse your code to highlight issues? For example, if some scripts use the ereg_* functions.

posted date: 2009-04-08 14:51:00


Re: Migrating to a newer version of PHP#2
I had made out the solution of this problem. click to view my topic...

hope that hepls.

posted date: 2009-04-08 14:51:01


Re: Migrating to a newer version of PHP#3
What version are you currently running?

posted date: 2009-04-08 14:54:00


Re: Migrating to a newer version of PHP#4
5.2.4, though that shouldn't matter?

posted date: 2009-04-08 15:00:00


Re: Migrating to a newer version of PHP#5
Well I can think of issues if you go from 5.1 -> 5.3 that won't be there if you go from 5.2 -> 5.3. Of coruse current and new versions are both relevant.

posted date: 2009-04-08 15:03:00


Re: Migrating to a newer version of PHP#6
Nothing beats installing on a test server and running your unit tests. You do have unit tests, right? ;)

posted date: 2009-04-08 15:05:00


Re: Migrating to a newer version of PHP#7
Unit tests are FTW, but I think he explicitly said he wants a heuristic that doesn't involve a test server. :-)

posted date: 2009-04-08 15:08:00


Re: Migrating to a newer version of PHP#8
One technique you could use is to take the list of deprecated functions that is being removed and grep for them. A little shell scripting fu goes a long way for things like this. Let(s suppose you have a file deprecated.txt with deprecated function names one per line: for func in `cat deprecated.txt`do grep -R $func /path/to/srcdoneThat will tell you all the instances of the deprecated functions you(re using.

posted date: 2009-04-08 15:10:00


Re: Migrating to a newer version of PHP#9
In the article here: cvs.php.net/viewvc.cgi/php-src/… I don't see mention of removed functions. Can you link to where you saw that?

posted date: 2009-04-08 15:15:00


Re: Migrating to a newer version of PHP#10
I know of a few things that get deprecated in 5.3 but not removed until 6.

posted date: 2009-04-08 15:17:00


Re: Migrating to a newer version of PHP#11
Rather than re-grep in a loop, it's probably more efficient to create a statement like: egrep -R '(dep_func_1|dep_func_2|etc...)' /path/to/src Another option would be to generate an xdebug trace file, which will include the names of called functions -- but it'd be hard to get 100% code coverage

posted date: 2009-04-08 16:33:00


Re: Migrating to a newer version of PHP#12
Of course that would be more efficient, but it's a bit harder to write an easy-to-read shell script that reads dep_func_1, dep_func_2, etc. from a file and does the grep. I did it for ease of readability, not for speed. :-P

posted date: 2009-04-09 12:56:00


select page: « 1 »
Copyright ©2008-2017 www.momige.com, all rights reserved.