Jump to content

PHP and PW minimal requirements


Nico Knoll
 Share

Recommended Posts

Hey,

it would be nice if you could add something like 'php_version_required' => '5.3' to the modules config and the module managment section of PW would show something like "You have to update to PHP 5.3 to use this module" or so. That would prevent that modules which need a newer version of PHP or PW would disturb the running system.

/ Nico

Link to comment
Share on other sites

Do any modules need a newer version of PHP than ProcessWire itself? Guess it's never come up before, but I suppose it could. PHP actually has a very handy function that you can use from your modules to compare against the PHP version or ProcessWire version:

if(version_compare(PHP_VERSION, '5.3.0', '<')) {
 throw new WireException("You must have PHP 5.3 or newer to install this module"); 
}

if(version_compare(wire('config')->version, '2.2.7', '<')) {
 throw new WireException("You must have ProcessWire 2.2.7 or newer to install this module"); 
}

I was thinking about making the PW version designation part of the getModuleInfo array so that PW would enforce it internally.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...