Add apache.get_php_version() convenience function

This commit is contained in:
Lance Edgar 2018-12-12 18:28:41 -06:00
parent 4344b2eae0
commit d2f04b315a

View file

@ -51,6 +51,17 @@ def get_version():
return float(match.group(1)) return float(match.group(1))
def get_php_version():
"""
Fetch the version of PHP running on the target system
"""
result = sudo('php --version')
if result.succeeded:
match = re.match(r'^PHP (\d+\.\d+)\.\d+-', result)
if match:
return float(match.group(1))
def install_wsgi(python_home=None, python3=False): def install_wsgi(python_home=None, python3=False):
""" """
Install the mod_wsgi Apache module, with optional ``WSGIPythonHome`` value. Install the mod_wsgi Apache module, with optional ``WSGIPythonHome`` value.