Browse Source

added php version in siteinfo

master
Prabuddha Chakraborty 9 years ago
parent
commit
ec2505cc1a
  1. 3
      ee/cli/plugins/site.py
  2. 55
      ee/cli/plugins/site_functions.py

3
ee/cli/plugins/site.py

@ -156,6 +156,7 @@ class EESiteController(CementBaseController):
error_log = "/var/log/nginx/{0}.error.log".format(ee_domain)
ee_site_webroot = ''
php_version = siteinfo.php_version
pagespeed = ("enabled" if siteinfo.is_pagespeed else "disabled")
ssl = ("enabled" if siteinfo.is_ssl else "disabled")
if (ssl == "enabled"):
@ -166,7 +167,7 @@ class EESiteController(CementBaseController):
sslexpiry = ''
data = dict(domain=ee_domain, webroot=ee_site_webroot,
accesslog=access_log, errorlog=error_log,
dbname=ee_db_name, dbuser=ee_db_user,
dbname=ee_db_name, dbuser=ee_db_user,php_version=php_version,
dbpass=ee_db_pass, hhvm=hhvm, pagespeed=pagespeed,
ssl=ssl, sslprovider=sslprovider, sslexpiry= sslexpiry,
type=sitetype + " " + cachetype + " ({0})"

55
ee/cli/plugins/site_functions.py

@ -674,7 +674,7 @@ def site_package_check(self, stype):
stack = EEStackController()
stack.app = self.app
if stype in ['html', 'proxy', 'php', 'mysql', 'wp', 'wpsubdir',
'wpsubdomain']:
'wpsubdomain', 'php7']:
Log.debug(self, "Setting apt_packages variable for Nginx")
# Check if server has nginx-custom package
@ -1083,12 +1083,24 @@ def detSitePar(opts):
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('php7','mysql','html') for x in typelist]:
sitetype = 'mysql'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('php','mysql') for x in typelist]:
sitetype = 'mysql'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('php7','mysql') for x in typelist]:
sitetype = 'mysql'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('html','mysql') for x in typelist]:
sitetype = 'mysql'
if not cachelist:
@ -1101,6 +1113,12 @@ def detSitePar(opts):
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('php7','html') for x in typelist]:
sitetype = 'php'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('wp','wpsubdir') for x in typelist]:
sitetype = 'wpsubdir'
if not cachelist:
@ -1119,22 +1137,33 @@ def detSitePar(opts):
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('wpsubdir','php7') for x in typelist]:
sitetype = 'wpsubdir'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
elif False not in [x in ('wpsubdomain','php7') for x in typelist]:
sitetype = 'wpsubdomain'
if not cachelist:
cachetype = 'basic'
else:
cachetype = cachelist[0]
else:
raise RuntimeError("could not determine site and cache type")
if not typelist and not cachelist:
sitetype = None
cachetype = None
elif (not typelist) and cachelist:
sitetype = 'wp'
cachetype = cachelist[0]
elif typelist and (not cachelist):
sitetype = typelist[0]
cachetype = 'basic'
else:
if not typelist and not cachelist:
sitetype = None
cachetype = None
elif (not typelist) and cachelist:
sitetype = 'wp'
cachetype = cachelist[0]
elif typelist and (not cachelist):
sitetype = typelist[0]
cachetype = 'basic'
else:
sitetype = typelist[0]
cachetype = cachelist[0]
sitetype = typelist[0]
cachetype = cachelist[0]
return (sitetype, cachetype)

Loading…
Cancel
Save