From 9ca044a276ca507d5f6b3169a5ca81cf561c37bc Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 4 Feb 2016 15:48:46 +0530 Subject: [PATCH] Added stack restart --php7 --- ee/cli/plugins/stack_services.py | 40 ++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/ee/cli/plugins/stack_services.py b/ee/cli/plugins/stack_services.py index 3c4b1603..6df23398 100644 --- a/ee/cli/plugins/stack_services.py +++ b/ee/cli/plugins/stack_services.py @@ -165,7 +165,7 @@ class EEStackStatusController(CementBaseController): def restart(self): """Restart 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.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): @@ -181,10 +181,31 @@ class EEStackStatusController(CementBaseController): Log.info(self, "Nginx is not installed") if self.app.pargs.php: - if EEAptGet.is_installed(self, 'php5-fpm'): - services = services + ['php5-fpm'] + if EEVariables.ee_platform_codename != 'trusty': + if EEAptGet.is_installed(self, 'php5-fpm'): + services = services + ['php5-fpm'] + else: + Log.info(self, "PHP5-FPM is not installed") else: - Log.info(self, "PHP5-FPM is not installed") + 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 ((EEVariables.ee_mysql_host is "localhost") or @@ -236,7 +257,7 @@ class EEStackStatusController(CementBaseController): def status(self): """Status of 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.hhvm or self.app.pargs.memcache or self.app.pargs.dovecot or self.app.pargs.redis): @@ -269,6 +290,15 @@ class EEStackStatusController(CementBaseController): 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 ((EEVariables.ee_mysql_host is "localhost") or (EEVariables.ee_mysql_host is "127.0.0.1")):