PHP Classes

Required PHP version

Recommend this page to a friend!

      PHP Classes blog  >  User submitted book r...  >  All threads  >  Required PHP version  >  (Un) Subscribe thread alerts  
Subject:Required PHP version
Summary:PEAR CompatInfo to get the Required PHP versions
Messages:2
Author:Matthias Mohr
Date:2006-11-30 13:21:47
Update:2006-11-30 14:12:46
 

  1. Required PHP version   Reply   Report abuse  
Picture of Matthias Mohr Matthias Mohr - 2006-11-30 13:40:54
Hi,

i have a suggestion on the new feature "Required PHP versions". Maybe you can implement the Package PEAR::CompatInfo (http://pear.php.net/package/PHP_CompatInfo). You can implement that for each file or only for the complete package (and maybe only a tool to check the version while adding the class). I think this is much simpler for many authors.

Regards,
Matthias

  2. Re: Required PHP version   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-11-30 14:12:46 - In reply to message 1 from Matthias Mohr
I have not looked at that package, but it crossed my mind using the PHP tokenizer extension to parse each package PHP source files and figure which functions it uses and lookup against a table with the versions those functions were introduced in PHP. That is probably what that package does.

However, this is a bit more complicated than that. This site is running on PHP 4. Some packages use PHP 5. PHP 5 scripts fail to parse when using tokenizer functions under PHP 4. I would have to figure a way to run PHP 5 just for checking the minimum required version.

I already have that problem when I try to highlight PHP source files. It does not always fail to highlight PHP 5 scripts, but sometimes it gives me parsing errors.

Anyway, thank you for your suggestion.