Add apache.get_php_version()
convenience function
This commit is contained in:
parent
4315799e1d
commit
98a64c5024
1 changed files with 11 additions and 0 deletions
|
@ -67,6 +67,17 @@ def get_version(c):
|
||||||
return float(match.group(1))
|
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):
|
def enable_mod(c, *names):
|
||||||
"""
|
"""
|
||||||
Enable the given Apache modules
|
Enable the given Apache modules
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue