set proper services names
* rename memcache to memcached * remove outdated platform checks
This commit is contained in:
@@ -19,14 +19,14 @@ class WOCleanController(CementBaseController):
|
||||
label = 'clean'
|
||||
stacked_on = 'base'
|
||||
stacked_type = 'nested'
|
||||
description = ('Clean NGINX FastCGI cache, Opcache, Memcache, Redis Cache')
|
||||
description = ('Clean NGINX FastCGI cache, Opcache, Memcached, Redis Cache')
|
||||
arguments = [
|
||||
(['--all'],
|
||||
dict(help='Clean all cache', action='store_true')),
|
||||
(['--fastcgi'],
|
||||
dict(help='Clean FastCGI cache', action='store_true')),
|
||||
(['--memcache'],
|
||||
dict(help='Clean MemCache', action='store_true')),
|
||||
(['--memcached'],
|
||||
dict(help='Clean MemCached', action='store_true')),
|
||||
(['--opcache'],
|
||||
dict(help='Clean OpCache', action='store_true')),
|
||||
(['--redis'],
|
||||
@@ -37,18 +37,18 @@ class WOCleanController(CementBaseController):
|
||||
@expose(hide=True)
|
||||
def default(self):
|
||||
if (not (self.app.pargs.all or self.app.pargs.fastcgi or
|
||||
self.app.pargs.memcache or self.app.pargs.opcache or
|
||||
self.app.pargs.memcached or self.app.pargs.opcache or
|
||||
self.app.pargs.redis)):
|
||||
self.clean_fastcgi()
|
||||
if self.app.pargs.all:
|
||||
self.clean_memcache()
|
||||
self.clean_memcached()
|
||||
self.clean_fastcgi()
|
||||
self.clean_opcache()
|
||||
self.clean_redis()
|
||||
if self.app.pargs.fastcgi:
|
||||
self.clean_fastcgi()
|
||||
if self.app.pargs.memcache:
|
||||
self.clean_memcache()
|
||||
if self.app.pargs.memcached:
|
||||
self.clean_memcached()
|
||||
if self.app.pargs.opcache:
|
||||
self.clean_opcache()
|
||||
if self.app.pargs.redis:
|
||||
@@ -68,9 +68,9 @@ class WOCleanController(CementBaseController):
|
||||
try:
|
||||
if(WOAptGet.is_installed(self, "memcached")):
|
||||
WOService.restart_service(self, "memcached")
|
||||
Log.info(self, "Cleaning MemCache")
|
||||
Log.info(self, "Cleaning MemCached")
|
||||
else:
|
||||
Log.info(self, "Memcache not installed")
|
||||
Log.info(self, "Memcached not installed")
|
||||
except Exception as e:
|
||||
Log.debug(self, "{0}".format(e))
|
||||
Log.error(self, "Unable to restart Memcached", False)
|
||||
|
||||
@@ -66,19 +66,17 @@ class WOInfoController(CementBaseController):
|
||||
@expose(hide=True)
|
||||
def info_php(self):
|
||||
"""Display PHP information"""
|
||||
version = os.popen("{0} -v 2>/dev/null | head -n1 | cut -d' ' -f2 |".format("php7.2" if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php") +
|
||||
version = os.popen("php7.2 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
|
||||
" cut -d'+' -f1 | tr -d '\n'").read
|
||||
config = configparser.ConfigParser()
|
||||
config.read('/etc/{0}/fpm/php.ini'.format("php/7.2" if (WOVariables.wo_platform_codename ==
|
||||
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||
config.read('/etc/{0}/fpm/php.ini'.format("php/7.2"))
|
||||
expose_php = config['PHP']['expose_php']
|
||||
memory_limit = config['PHP']['memory_limit']
|
||||
post_max_size = config['PHP']['post_max_size']
|
||||
upload_max_filesize = config['PHP']['upload_max_filesize']
|
||||
max_execution_time = config['PHP']['max_execution_time']
|
||||
|
||||
config.read('/etc/{0}/fpm/pool.d/www.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
|
||||
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||
config.read('/etc/{0}/fpm/pool.d/www.conf'.format("php/7.2"))
|
||||
www_listen = config['www']['listen']
|
||||
www_ping_path = config['www']['ping.path']
|
||||
www_pm_status_path = config['www']['pm.status_path']
|
||||
@@ -96,8 +94,7 @@ class WOInfoController(CementBaseController):
|
||||
except Exception as e:
|
||||
www_xdebug = 'off'
|
||||
|
||||
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_codename ==
|
||||
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
|
||||
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2"))
|
||||
debug_listen = config['debug']['listen']
|
||||
debug_ping_path = config['debug']['ping.path']
|
||||
debug_pm_status_path = config['debug']['pm.status_path']
|
||||
@@ -251,7 +248,7 @@ class WOInfoController(CementBaseController):
|
||||
self.app.pargs.php = True
|
||||
self.app.pargs.mysql = True
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
self.app.pargs.php = True
|
||||
self.app.pargs.php73 = True
|
||||
|
||||
if self.app.pargs.nginx:
|
||||
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-common'):
|
||||
@@ -260,16 +257,10 @@ class WOInfoController(CementBaseController):
|
||||
Log.error(self, "Nginx is not installed")
|
||||
|
||||
if self.app.pargs.php:
|
||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
self.info_php()
|
||||
else:
|
||||
Log.error(self, "PHP 7.2 is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
self.info_php()
|
||||
else:
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
self.info_php()
|
||||
else:
|
||||
Log.error(self, "PHP 7.2 is not installed")
|
||||
Log.error(self, "PHP 7.2 is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
|
||||
@@ -444,9 +444,9 @@ class WOLogMailController(CementBaseController):
|
||||
(['--nginx'],
|
||||
dict(help='Mail Nginx Error logs file', action='store_true')),
|
||||
(['--php'],
|
||||
dict(help='Mail PHP Error logs file', action='store_true')),
|
||||
dict(help='Mail PHP 7.2 Error logs file', action='store_true')),
|
||||
(['--fpm'],
|
||||
dict(help='Mail PHP5-fpm slow logs file',
|
||||
dict(help='Mail PHP 7.2-fpm slow logs file',
|
||||
action='store_true')),
|
||||
(['--mysql'],
|
||||
dict(help='Mail MySQL logs file', action='store_true')),
|
||||
|
||||
@@ -1218,16 +1218,16 @@ class WOStackController(CementBaseController):
|
||||
WOVariables.wo_php_user,
|
||||
WOVariables.wo_php_user,
|
||||
recursive=True)
|
||||
if any('/tmp/memcache.tar.gz' == x[1]
|
||||
if any('/tmp/memcached.tar.gz' == x[1]
|
||||
for x in packages):
|
||||
Log.debug(self, "Extracting memcache.tar.gz to location"
|
||||
" {0}22222/htdocs/cache/memcache "
|
||||
Log.debug(self, "Extracting memcached.tar.gz to location"
|
||||
" {0}22222/htdocs/cache/memcached "
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOExtract.extract(self, '/tmp/memcache.tar.gz',
|
||||
'{0}22222/htdocs/cache/memcache'
|
||||
WOExtract.extract(self, '/tmp/memcached.tar.gz',
|
||||
'{0}22222/htdocs/cache/memcached'
|
||||
.format(WOVariables.wo_webroot))
|
||||
Log.debug(self, "Setting Privileges to "
|
||||
"{0}22222/htdocs/cache/memcache file"
|
||||
"{0}22222/htdocs/cache/memcached file"
|
||||
.format(WOVariables.wo_webroot))
|
||||
WOFileUtils.chown(self, '{0}22222'
|
||||
.format(WOVariables.wo_webroot),
|
||||
@@ -1527,7 +1527,7 @@ class WOStackController(CementBaseController):
|
||||
Log.debug(self, "Setting packages variable for utils")
|
||||
packages = packages + [["https://storage.googleapis.com/google-code-archive-downloads/"
|
||||
"v2/code.google.com/phpmemcacheadmin/"
|
||||
"phpMemcachedAdmin-1.2.2-r262.tar.gz", '/tmp/memcache.tar.gz',
|
||||
"phpMemcachedAdmin-1.2.2-r262.tar.gz", '/tmp/memcached.tar.gz',
|
||||
'phpMemcachedAdmin'],
|
||||
["https://raw.githubusercontent.com"
|
||||
"/rtCamp/eeadmin/master/cache/nginx/"
|
||||
@@ -1725,7 +1725,7 @@ class WOStackController(CementBaseController):
|
||||
.format(WOVariables.wo_webroot),
|
||||
'{0}22222/htdocs/cache/nginx/'
|
||||
'clean.php'.format(WOVariables.wo_webroot),
|
||||
'{0}22222/htdocs/cache/memcache'
|
||||
'{0}22222/htdocs/cache/memcached'
|
||||
.format(WOVariables.wo_webroot),
|
||||
'/usr/bin/pt-query-advisor',
|
||||
'{0}22222/htdocs/db/anemometer'
|
||||
@@ -1862,7 +1862,7 @@ class WOStackController(CementBaseController):
|
||||
.format(WOVariables.wo_webroot),
|
||||
'{0}22222/htdocs/cache/nginx/'
|
||||
'clean.php'.format(WOVariables.wo_webroot),
|
||||
'{0}22222/htdocs/cache/memcache'
|
||||
'{0}22222/htdocs/cache/memcached'
|
||||
.format(WOVariables.wo_webroot),
|
||||
'/usr/bin/pt-query-advisor',
|
||||
'{0}22222/htdocs/db/anemometer'
|
||||
|
||||
@@ -56,21 +56,21 @@ class WOStackMigrateController(CementBaseController):
|
||||
% e)
|
||||
|
||||
Log.debug(self, "Pre-seeding MariaDB")
|
||||
Log.debug(self, "echo \"mariadb-server-10.0 "
|
||||
Log.debug(self, "echo \"mariadb-server-10.3 "
|
||||
"mysql-server/root_password "
|
||||
"password \" | "
|
||||
"debconf-set-selections")
|
||||
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.0 "
|
||||
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.3 "
|
||||
"mysql-server/root_password "
|
||||
"password {chars}\" | "
|
||||
"debconf-set-selections"
|
||||
.format(chars=chars),
|
||||
log=False)
|
||||
Log.debug(self, "echo \"mariadb-server-10.0 "
|
||||
Log.debug(self, "echo \"mariadb-server-10.3 "
|
||||
"mysql-server/root_password_again "
|
||||
"password \" | "
|
||||
"debconf-set-selections")
|
||||
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.0 "
|
||||
WOShellExec.cmd_exec(self, "echo \"mariadb-server-10.3 "
|
||||
"mysql-server/root_password_again "
|
||||
"password {chars}\" | "
|
||||
"debconf-set-selections"
|
||||
|
||||
@@ -13,8 +13,8 @@ class WOStackStatusController(CementBaseController):
|
||||
stacked_type = 'embedded'
|
||||
description = 'Check the stack status'
|
||||
arguments = [
|
||||
(['--memcache'],
|
||||
dict(help='start/stop/restart memcache', action='store_true')),
|
||||
(['--memcached'],
|
||||
dict(help='start/stop/restart memcached', action='store_true')),
|
||||
]
|
||||
|
||||
@expose(help="Start stack services")
|
||||
@@ -22,7 +22,7 @@ class WOStackStatusController(CementBaseController):
|
||||
"""Start services"""
|
||||
services = []
|
||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||
or self.app.pargs.redis):
|
||||
self.app.pargs.nginx = True
|
||||
self.app.pargs.php = True
|
||||
@@ -35,30 +35,20 @@ class WOStackStatusController(CementBaseController):
|
||||
Log.info(self, "Nginx is not installed")
|
||||
|
||||
if self.app.pargs.php:
|
||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "Your platform does not support PHP 7.3")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.mysql:
|
||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||
@@ -78,11 +68,11 @@ class WOStackStatusController(CementBaseController):
|
||||
services = services + ['hhvm']
|
||||
else:
|
||||
Log.info(self, "HHVM is not installed")
|
||||
if self.app.pargs.memcache:
|
||||
if self.app.pargs.memcached:
|
||||
if WOAptGet.is_installed(self, 'memcached'):
|
||||
services = services + ['memcached']
|
||||
else:
|
||||
Log.info(self, "Memcache is not installed")
|
||||
Log.info(self, "Memcached is not installed")
|
||||
|
||||
if self.app.pargs.redis:
|
||||
if WOAptGet.is_installed(self, 'redis-server'):
|
||||
@@ -99,7 +89,7 @@ class WOStackStatusController(CementBaseController):
|
||||
"""Stop services"""
|
||||
services = []
|
||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||
or self.app.pargs.redis):
|
||||
self.app.pargs.nginx = True
|
||||
self.app.pargs.php = True
|
||||
@@ -112,30 +102,21 @@ class WOStackStatusController(CementBaseController):
|
||||
Log.info(self, "Nginx is not installed")
|
||||
|
||||
if self.app.pargs.php:
|
||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "Your platform does not support PHP 7.3")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.mysql:
|
||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||
@@ -155,11 +136,11 @@ class WOStackStatusController(CementBaseController):
|
||||
services = services + ['hhvm']
|
||||
else:
|
||||
Log.info(self, "HHVM is not installed")
|
||||
if self.app.pargs.memcache:
|
||||
if self.app.pargs.memcached:
|
||||
if WOAptGet.is_installed(self, 'memcached'):
|
||||
services = services + ['memcached']
|
||||
else:
|
||||
Log.info(self, "Memcache is not installed")
|
||||
Log.info(self, "Memcached is not installed")
|
||||
|
||||
if self.app.pargs.redis:
|
||||
if WOAptGet.is_installed(self, 'redis-server'):
|
||||
@@ -176,7 +157,7 @@ class WOStackStatusController(CementBaseController):
|
||||
"""Restart services"""
|
||||
services = []
|
||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||
or self.app.pargs.redis):
|
||||
self.app.pargs.nginx = True
|
||||
self.app.pargs.php = True
|
||||
@@ -189,30 +170,21 @@ class WOStackStatusController(CementBaseController):
|
||||
Log.info(self, "Nginx is not installed")
|
||||
|
||||
if self.app.pargs.php:
|
||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "Your platform does not support PHP 7.3")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.mysql:
|
||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||
@@ -232,11 +204,11 @@ class WOStackStatusController(CementBaseController):
|
||||
services = services + ['hhvm']
|
||||
else:
|
||||
Log.info(self, "HHVM is not installed")
|
||||
if self.app.pargs.memcache:
|
||||
if self.app.pargs.memcached:
|
||||
if WOAptGet.is_installed(self, 'memcached'):
|
||||
services = services + ['memcached']
|
||||
else:
|
||||
Log.info(self, "Memcache is not installed")
|
||||
Log.info(self, "Memcached is not installed")
|
||||
|
||||
if self.app.pargs.redis:
|
||||
if WOAptGet.is_installed(self, 'redis-server'):
|
||||
@@ -253,7 +225,7 @@ class WOStackStatusController(CementBaseController):
|
||||
"""Status of services"""
|
||||
services = []
|
||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||
or self.app.pargs.redis):
|
||||
self.app.pargs.nginx = True
|
||||
self.app.pargs.php = True
|
||||
@@ -267,30 +239,21 @@ class WOStackStatusController(CementBaseController):
|
||||
Log.info(self, "Nginx is not installed")
|
||||
|
||||
if self.app.pargs.php:
|
||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "Your platform does not support PHP 7.3")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.mysql:
|
||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||
@@ -310,11 +273,11 @@ class WOStackStatusController(CementBaseController):
|
||||
services = services + ['hhvm']
|
||||
else:
|
||||
Log.info(self, "HHVM is not installed")
|
||||
if self.app.pargs.memcache:
|
||||
if self.app.pargs.memcached:
|
||||
if WOAptGet.is_installed(self, 'memcached'):
|
||||
services = services + ['memcached']
|
||||
else:
|
||||
Log.info(self, "Memcache is not installed")
|
||||
Log.info(self, "Memcached is not installed")
|
||||
|
||||
if self.app.pargs.redis:
|
||||
if WOAptGet.is_installed(self, 'redis-server'):
|
||||
@@ -331,7 +294,7 @@ class WOStackStatusController(CementBaseController):
|
||||
"""Reload service"""
|
||||
services = []
|
||||
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
|
||||
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcached
|
||||
or self.app.pargs.redis):
|
||||
self.app.pargs.nginx = True
|
||||
self.app.pargs.php = True
|
||||
@@ -344,30 +307,21 @@ class WOStackStatusController(CementBaseController):
|
||||
Log.info(self, "Nginx is not installed")
|
||||
|
||||
if self.app.pargs.php:
|
||||
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||
services = services + ['php7.2-fpm']
|
||||
else:
|
||||
Log.info(self, "php7.2-fpm is not installed")
|
||||
Log.info(self, "PHP7.2-FPM is not installed")
|
||||
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.php73:
|
||||
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
if WOAptGet.is_installed(self, 'php7.3-fpm'):
|
||||
services = services + ['php7.3-fpm']
|
||||
else:
|
||||
Log.info(self, "Your platform does not support PHP 7.3")
|
||||
Log.info(self, "PHP7.3-FPM is not installed")
|
||||
|
||||
if self.app.pargs.mysql:
|
||||
if ((WOVariables.wo_mysql_host is "localhost") or
|
||||
@@ -385,11 +339,11 @@ class WOStackStatusController(CementBaseController):
|
||||
if self.app.pargs.hhvm:
|
||||
Log.info(self, "HHVM does not support to reload")
|
||||
|
||||
if self.app.pargs.memcache:
|
||||
if self.app.pargs.memcached:
|
||||
if WOAptGet.is_installed(self, 'memcached'):
|
||||
services = services + ['memcached']
|
||||
else:
|
||||
Log.info(self, "Memcache is not installed")
|
||||
Log.info(self, "Memcached is not installed")
|
||||
|
||||
if self.app.pargs.redis:
|
||||
if WOAptGet.is_installed(self, 'redis-server'):
|
||||
|
||||
@@ -102,20 +102,19 @@ class WOVariables():
|
||||
|
||||
# PHP repo and packages
|
||||
if wo_platform_distro == 'ubuntu':
|
||||
if (wo_platform_codename == 'trusty' or wo_platform_codename == 'xenial' or wo_platform_codename == 'bionic'):
|
||||
wo_php_repo = "ppa:ondrej/php"
|
||||
wo_php = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
|
||||
"php7.2-readline", "php7.2-common", "php7.2-recode",
|
||||
"php7.2-cli", "php7.2-mbstring",
|
||||
wo_php_repo = "ppa:ondrej/php"
|
||||
wo_php = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
|
||||
"php7.2-readline", "php7.2-common", "php7.2-recode",
|
||||
"php7.2-cli", "php7.2-mbstring",
|
||||
"php7.2-bcmath", "php7.2-mysql", "php7.2-opcache",
|
||||
"php7.2-zip", "php7.2-xml", "php7.2-soap"]
|
||||
wo_php73 = ["php7.3-fpm", "php7.3-curl", "php7.3-gd", "php7.3-imap",
|
||||
"php7.3-readline", "php7.3-common", "php7.3-recode",
|
||||
"php7.3-cli", "php7.3-mbstring",
|
||||
wo_php73 = ["php7.3-fpm", "php7.3-curl", "php7.3-gd", "php7.3-imap",
|
||||
"php7.3-readline", "php7.3-common", "php7.3-recode",
|
||||
"php7.3-cli", "php7.3-mbstring",
|
||||
"php7.3-bcmath", "php7.3-mysql", "php7.3-opcache",
|
||||
"php7.3-zip", "php7.3-xml", "php7.3-soap"]
|
||||
wo_php_extra = ["php-memcached", "php-imagick", "memcached",
|
||||
"graphviz", "php-xdebug", "php-msgpack", "php-redis"]
|
||||
wo_php_extra = ["php-memcached", "php-imagick", "memcached",
|
||||
"graphviz", "php-xdebug", "php-msgpack", "php-redis"]
|
||||
elif wo_platform_distro == 'debian':
|
||||
wo_php_repo = (
|
||||
"deb https://packages.sury.org/php/ {codename} main".format(codename=wo_platform_codename))
|
||||
@@ -166,8 +165,7 @@ class WOVariables():
|
||||
wo_redis_repo = ("deb https://packages.sury.org/php/ {codename} all"
|
||||
.format(codename=wo_platform_codename))
|
||||
|
||||
if (wo_platform_codename == 'trusty' or wo_platform_codename == 'xenial' or wo_platform_codename == 'bionic' or wo_platform_distro == 'debian'):
|
||||
wo_redis = ['redis-server', 'php-redis']
|
||||
wo_redis = ['redis-server', 'php-redis']
|
||||
|
||||
# Repo path
|
||||
wo_repo_file = "wo-repo.list"
|
||||
|
||||
Reference in New Issue
Block a user