Browse Source

Added stack services --php7/--php

master
Prabuddha Chakraborty 9 years ago
parent
commit
761e317545
  1. 66
      ee/cli/plugins/stack_services.py

66
ee/cli/plugins/stack_services.py

@ -23,7 +23,7 @@ class EEStackStatusController(CementBaseController):
def start(self): def start(self):
"""Start services""" """Start services"""
services = [] services = []
if not (self.app.pargs.nginx or self.app.pargs.php if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.mysql or self.app.pargs.postfix
or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.hhvm or self.app.pargs.memcache
or self.app.pargs.dovecot or self.app.pargs.redis): or self.app.pargs.dovecot or self.app.pargs.redis):
@ -39,10 +39,30 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "Nginx is not installed") Log.info(self, "Nginx is not installed")
if self.app.pargs.php: if self.app.pargs.php:
if EEVariables.ee_platform_codename != 'trusty':
if EEAptGet.is_installed(self, 'php5-fpm'): if EEAptGet.is_installed(self, 'php5-fpm'):
services = services + ['php5-fpm'] services = services + ['php5-fpm']
else: else:
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
else:
if EEAptGet.is_installed(self, 'php5.6-fpm'):
services = services + ['php5.6-fpm']
else:
Log.info(self, "PHP5.6-FPM is not installed")
if EEAptGet.is_installed(self, 'php7.0-fpm'):
services = services + ['php7.0-fpm']
else:
Log.info(self, "PHP7.0-FPM is not installed")
if self.app.pargs.php7:
if EEVariables.ee_platform_codename == 'trusty':
if EEAptGet.is_installed(self, 'php7.0-fpm'):
services = services + ['php7.0-fpm']
else:
Log.info(self, "PHP7.0-FPM is not installed")
else:
Log.info(self, "Your platform does not support PHP 7")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if ((EEVariables.ee_mysql_host is "localhost") or if ((EEVariables.ee_mysql_host is "localhost") or
@ -94,7 +114,7 @@ class EEStackStatusController(CementBaseController):
def stop(self): def stop(self):
"""Stop services""" """Stop services"""
services = [] services = []
if not (self.app.pargs.nginx or self.app.pargs.php if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.mysql or self.app.pargs.postfix
or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.hhvm or self.app.pargs.memcache
or self.app.pargs.dovecot or self.app.pargs.redis): or self.app.pargs.dovecot or self.app.pargs.redis):
@ -110,10 +130,30 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "Nginx is not installed") Log.info(self, "Nginx is not installed")
if self.app.pargs.php: if self.app.pargs.php:
if EEVariables.ee_platform_codename != 'trusty':
if EEAptGet.is_installed(self, 'php5-fpm'): if EEAptGet.is_installed(self, 'php5-fpm'):
services = services + ['php5-fpm'] services = services + ['php5-fpm']
else: else:
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
else:
if EEAptGet.is_installed(self, 'php5.6-fpm'):
services = services + ['php5.6-fpm']
else:
Log.info(self, "PHP5.6-FPM is not installed")
if EEAptGet.is_installed(self, 'php7.0-fpm'):
services = services + ['php7.0-fpm']
else:
Log.info(self, "PHP7.0-FPM is not installed")
if self.app.pargs.php7:
if EEVariables.ee_platform_codename == 'trusty':
if EEAptGet.is_installed(self, 'php7.0-fpm'):
services = services + ['php7.0-fpm']
else:
Log.info(self, "PHP7.0-FPM is not installed")
else:
Log.info(self, "Your platform does not support PHP 7")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if ((EEVariables.ee_mysql_host is "localhost") or if ((EEVariables.ee_mysql_host is "localhost") or
@ -349,7 +389,7 @@ class EEStackStatusController(CementBaseController):
def reload(self): def reload(self):
"""Reload service""" """Reload service"""
services = [] services = []
if not (self.app.pargs.nginx or self.app.pargs.php if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
or self.app.pargs.mysql or self.app.pargs.postfix or self.app.pargs.mysql or self.app.pargs.postfix
or self.app.pargs.hhvm or self.app.pargs.memcache or self.app.pargs.hhvm or self.app.pargs.memcache
or self.app.pargs.dovecot or self.app.pargs.redis): or self.app.pargs.dovecot or self.app.pargs.redis):
@ -365,10 +405,30 @@ class EEStackStatusController(CementBaseController):
Log.info(self, "Nginx is not installed") Log.info(self, "Nginx is not installed")
if self.app.pargs.php: if self.app.pargs.php:
if EEVariables.ee_platform_codename != 'trusty':
if EEAptGet.is_installed(self, 'php5-fpm'): if EEAptGet.is_installed(self, 'php5-fpm'):
services = services + ['php5-fpm'] services = services + ['php5-fpm']
else: else:
Log.info(self, "PHP5-FPM is not installed") Log.info(self, "PHP5-FPM is not installed")
else:
if EEAptGet.is_installed(self, 'php5.6-fpm'):
services = services + ['php5.6-fpm']
else:
Log.info(self, "PHP5.6-FPM is not installed")
if EEAptGet.is_installed(self, 'php7.0-fpm'):
services = services + ['php7.0-fpm']
else:
Log.info(self, "PHP7.0-FPM is not installed")
if self.app.pargs.php7:
if EEVariables.ee_platform_codename == 'trusty':
if EEAptGet.is_installed(self, 'php7.0-fpm'):
services = services + ['php7.0-fpm']
else:
Log.info(self, "PHP7.0-FPM is not installed")
else:
Log.info(self, "Your platform does not support PHP 7")
if self.app.pargs.mysql: if self.app.pargs.mysql:
if ((EEVariables.ee_mysql_host is "localhost") or if ((EEVariables.ee_mysql_host is "localhost") or

Loading…
Cancel
Save