[development] module version tracking [WAS: module_exists vs. functions_exists?]

Earnie Boyd earnie at users.sourceforge.net
Wed Jun 25 18:58:37 UTC 2008


Quoting Adrian Rossouw <adrian at bryght.com>:

>
> On 25 Jun 2008, at 6:01 PM, Aaron Winborn wrote:
>
>>
>> There's no easy answer for the first case, other than bloating your  
>> code with additional drupal_function_exists checks, and the second  
>> would require tracking module version (at least its major version).
> we need this anyway.
>

Now this I agree with.  But we could development a MOP to handle this 
easily enough.  Something like define('MYMOD_VERSION', '2.x') but be 
good enough for that.

> badly.
>

The other option is to read the module.info file and grab the version 
info from it.  The version info is appended to the file by the 
packaging script and could be easily parsed using the PHP function 
parse_ini_file; like $urmod_info = 
parse_ini_file('/path/to/urmod/urmod.info').

Earnie -- http://for-my-kids.com/
-- http://give-me-an-offer.com/



More information about the development mailing list