Browse Source

update info

master
Prabuddha Chakraborty 9 years ago
parent
commit
f1c6af90d5
  1. 6
      ee/cli/plugins/info.py
  2. 12
      ee/cli/plugins/site.py
  3. 49
      ee/cli/templates/virtualconf-php7.mustache

6
ee/cli/plugins/info.py

@ -67,7 +67,7 @@ class EEInfoController(CementBaseController):
@expose(hide=True)
def info_php(self):
"""Display PHP information"""
version = os.popen("php -v | head -n1 | cut -d' ' -f2 |"
version = os.popen("{0} -v 2>/dev/null | head -n1 | cut -d' ' -f2 |".format("php5.6" if EEVariables.ee_platform_codename == 'trusty' else "php") +
" cut -d'+' -f1 | tr -d '\n'").read
config = configparser.ConfigParser()
config.read('/etc/{0}/fpm/php.ini'.format("php/5.6" if EEVariables.ee_platform_codename == 'trusty' else "php5"))
@ -141,7 +141,7 @@ class EEInfoController(CementBaseController):
@expose(hide=True)
def info_php7(self):
"""Display PHP information"""
version = os.popen("php -v | head -n1 | cut -d' ' -f2 |"
version = os.popen("php7.0 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
" cut -d'+' -f1 | tr -d '\n'").read
config = configparser.ConfigParser()
config.read('/etc/php/7.0/fpm/php.ini')
@ -248,6 +248,8 @@ class EEInfoController(CementBaseController):
self.app.pargs.nginx = True
self.app.pargs.php = True
self.app.pargs.mysql = True
if EEAptGet.is_installed(self, 'php7.0-fpm'):
self.app.pargs.php = True
if self.app.pargs.nginx:
if EEAptGet.is_installed(self, 'nginx-common'):

12
ee/cli/plugins/site.py

@ -931,6 +931,7 @@ class EESiteUpdateController(CementBaseController):
letsencrypt = False
php7 = None
data = dict()
try:
stype, cache = detSitePar(vars(pargs))
@ -1061,7 +1062,6 @@ class EESiteUpdateController(CementBaseController):
currsitetype=oldsitetype,
currcachetype=oldcachetype,
webroot=ee_site_webroot)
stype = oldsitetype
cache = oldcachetype
if oldsitetype == 'html' or oldsitetype == 'proxy':
@ -1135,12 +1135,14 @@ class EESiteUpdateController(CementBaseController):
data['pagespeed'] = False
pagespeed = False
if pargs.php7 != 'off' :
if pargs.php7 == 'on' :
data['php7'] = True
php7 = True
check_php_version= '7.0'
elif pargs.php7 == 'off':
data['php7'] = False
php7 = False
check_php_version = '5.6'
@ -1479,7 +1481,7 @@ class EESiteUpdateController(CementBaseController):
"check issues with `nginx -t` command")
updateSiteInfo(self, ee_domain, stype=stype, cache=cache,
hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False)
hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False, php_version=check_php_version)
Log.info(self, "Successfully updated site"
" http://{0}".format(ee_domain))
@ -1697,10 +1699,10 @@ class EESiteUpdateController(CementBaseController):
db_user=data['ee_db_user'],
db_password=data['ee_db_pass'],
db_host=data['ee_db_host'], hhvm=hhvm,
pagespeed=pagespeed,ssl=True if check_site.is_ssl else False)
pagespeed=pagespeed,ssl=True if check_site.is_ssl else False,php_version=check_php_version)
else:
updateSiteInfo(self, ee_domain, stype=stype, cache=cache,
hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False)
hhvm=hhvm, pagespeed=pagespeed,ssl=True if check_site.is_ssl else False,php_version=check_php_version)
Log.info(self, "Successfully updated site"
" http://{0}".format(ee_domain))
return 0

49
ee/cli/templates/virtualconf-php7.mustache

@ -1,49 +0,0 @@
server {
{{#multisite}}
# Uncomment the following line for domain mapping
# listen 80 default_server;
{{/multisite}}
server_name {{^vma}}{{^rc}}{{site_name}}{{/rc}}{{/vma}} {{#vma}}vma.*{{/vma}} {{#rc}}webmail.*{{/rc}} {{^vma}}{{^rc}}{{#multisite}}*{{/multisite}}{{^multisite}}www{{/multisite}}.{{site_name}}{{/rc}}{{/vma}};
{{#multisite}}
# Uncomment the following line for domain mapping
#server_name_in_redirect off;
{{/multisite}}
access_log /var/log/nginx/{{site_name}}.access.log {{^wpredis}}{{^static}}rt_cache{{/static}}{{/wpredis}}{{#wpredis}}rt_cache_redis{{/wpredis}};
error_log /var/log/nginx/{{site_name}}.error.log;
{{#proxy}}
add_header X-Proxy-Cache $upstream_cache_status;
location / {
proxy_pass http://{{host}}:{{port}};
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
{{/proxy}}
{{^proxy}}
{{^vma}}{{^rc}}root {{webroot}}/htdocs;{{/rc}}{{/vma}}
{{#vma}}root /var/www/22222/htdocs/vimbadmin/public;{{/vma}}
{{#rc}}root /var/www/roundcubemail/htdocs/;{{/rc}}
{{^proxy}}index {{^static}}index.php{{/static}} index.html index.htm;{{/proxy}}
{{#static}}
location / {
try_files $uri $uri/ =404;
}
{{/static}}
{{^static}}include {{^hhvm}}{{#basic}}common/php7.conf;{{/basic}}{{#w3tc}}common/w3tc-php7.conf;{{/w3tc}}{{#wpfc}}common/wpfc-php7.conf;{{/wpfc}} {{#wpsc}}common/wpsc-php7.conf;{{/wpsc}}{{#wpredis}}common/redis-php7.conf;{{/wpredis}} {{/hhvm}}{{#hhvm}}{{#basic}}common/php-hhvm.conf;{{/basic}}{{#w3tc}}common/w3tc-hhvm.conf;{{/w3tc}}{{#wpfc}}common/wpfc-hhvm.conf;{{/wpfc}} {{#wpsc}}common/wpsc-hhvm.conf;{{/wpsc}}{{#wpredis}}common/redis-hhvm.conf;{{/wpredis}} {{/hhvm}}
{{#wpsubdir}}include common/wpsubdir.conf;{{/wpsubdir}}{{/static}}
{{#wp}}include common/wpcommon.conf;{{/wp}}
{{^proxy}}include common/locations.conf;{{/proxy}}
{{^vma}}{{^rc}}include {{webroot}}/conf/nginx/*.conf;{{/rc}}{{/vma}}
{{/proxy}}
}
Loading…
Cancel
Save