From 761e3175459311cdb89a6a6244d715df88c92d90 Mon Sep 17 00:00:00 2001 From: Prabuddha Chakraborty Date: Thu, 4 Feb 2016 15:52:09 +0530 Subject: [PATCH] Added stack services --php7/--php --- ee/cli/plugins/stack_services.py | 84 +++++++++++++++++++++++++++----- 1 file changed, 72 insertions(+), 12 deletions(-) diff --git a/ee/cli/plugins/stack_services.py b/ee/cli/plugins/stack_services.py index 6df23398..26b540fc 100644 --- a/ee/cli/plugins/stack_services.py +++ b/ee/cli/plugins/stack_services.py @@ -23,7 +23,7 @@ class EEStackStatusController(CementBaseController): def start(self): """Start 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): @@ -39,10 +39,30 @@ 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: + 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, "PHP5-FPM is not installed") + Log.info(self, "Your platform does not support PHP 7") if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or @@ -94,7 +114,7 @@ class EEStackStatusController(CementBaseController): def stop(self): """Stop 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): @@ -110,10 +130,30 @@ 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: + 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, "PHP5-FPM is not installed") + Log.info(self, "Your platform does not support PHP 7") if self.app.pargs.mysql: if ((EEVariables.ee_mysql_host is "localhost") or @@ -349,7 +389,7 @@ class EEStackStatusController(CementBaseController): def reload(self): """Reload service""" 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): @@ -365,10 +405,30 @@ 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