Add apache.get_php_version()
convenience function
This commit is contained in:
parent
4315799e1d
commit
98a64c5024
|
@ -67,6 +67,17 @@ def get_version(c):
|
|||
return float(match.group(1))
|
||||
|
||||
|
||||
def get_php_version(c):
|
||||
"""
|
||||
Fetch the version of PHP running on the target system
|
||||
"""
|
||||
result = c.sudo('php --version')
|
||||
if not result.failed:
|
||||
match = re.match(r'^PHP (\d+\.\d+)\.\d+-', result.stdout)
|
||||
if match:
|
||||
return float(match.group(1))
|
||||
|
||||
|
||||
def enable_mod(c, *names):
|
||||
"""
|
||||
Enable the given Apache modules
|
||||
|
|
Loading…
Reference in a new issue