set proper services names

* rename memcache to memcached
* remove outdated platform checks
This commit is contained in:
VirtuBox
2019-03-07 13:15:15 +01:00
parent 42092d7885
commit 9b3e318121
7 changed files with 109 additions and 166 deletions

View File

@@ -19,14 +19,14 @@ class WOCleanController(CementBaseController):
label = 'clean' label = 'clean'
stacked_on = 'base' stacked_on = 'base'
stacked_type = 'nested' stacked_type = 'nested'
description = ('Clean NGINX FastCGI cache, Opcache, Memcache, Redis Cache') description = ('Clean NGINX FastCGI cache, Opcache, Memcached, Redis Cache')
arguments = [ arguments = [
(['--all'], (['--all'],
dict(help='Clean all cache', action='store_true')), dict(help='Clean all cache', action='store_true')),
(['--fastcgi'], (['--fastcgi'],
dict(help='Clean FastCGI cache', action='store_true')), dict(help='Clean FastCGI cache', action='store_true')),
(['--memcache'], (['--memcached'],
dict(help='Clean MemCache', action='store_true')), dict(help='Clean MemCached', action='store_true')),
(['--opcache'], (['--opcache'],
dict(help='Clean OpCache', action='store_true')), dict(help='Clean OpCache', action='store_true')),
(['--redis'], (['--redis'],
@@ -37,18 +37,18 @@ class WOCleanController(CementBaseController):
@expose(hide=True) @expose(hide=True)
def default(self): def default(self):
if (not (self.app.pargs.all or self.app.pargs.fastcgi or 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.app.pargs.redis)):
self.clean_fastcgi() self.clean_fastcgi()
if self.app.pargs.all: if self.app.pargs.all:
self.clean_memcache() self.clean_memcached()
self.clean_fastcgi() self.clean_fastcgi()
self.clean_opcache() self.clean_opcache()
self.clean_redis() self.clean_redis()
if self.app.pargs.fastcgi: if self.app.pargs.fastcgi:
self.clean_fastcgi() self.clean_fastcgi()
if self.app.pargs.memcache: if self.app.pargs.memcached:
self.clean_memcache() self.clean_memcached()
if self.app.pargs.opcache: if self.app.pargs.opcache:
self.clean_opcache() self.clean_opcache()
if self.app.pargs.redis: if self.app.pargs.redis:
@@ -68,9 +68,9 @@ class WOCleanController(CementBaseController):
try: try:
if(WOAptGet.is_installed(self, "memcached")): if(WOAptGet.is_installed(self, "memcached")):
WOService.restart_service(self, "memcached") WOService.restart_service(self, "memcached")
Log.info(self, "Cleaning MemCache") Log.info(self, "Cleaning MemCached")
else: else:
Log.info(self, "Memcache not installed") Log.info(self, "Memcached not installed")
except Exception as e: except Exception as e:
Log.debug(self, "{0}".format(e)) Log.debug(self, "{0}".format(e))
Log.error(self, "Unable to restart Memcached", False) Log.error(self, "Unable to restart Memcached", False)

View File

@@ -66,19 +66,17 @@ class WOInfoController(CementBaseController):
@expose(hide=True) @expose(hide=True)
def info_php(self): def info_php(self):
"""Display PHP information""" """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 " cut -d'+' -f1 | tr -d '\n'").read
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read('/etc/{0}/fpm/php.ini'.format("php/7.2" if (WOVariables.wo_platform_codename == config.read('/etc/{0}/fpm/php.ini'.format("php/7.2"))
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
expose_php = config['PHP']['expose_php'] expose_php = config['PHP']['expose_php']
memory_limit = config['PHP']['memory_limit'] memory_limit = config['PHP']['memory_limit']
post_max_size = config['PHP']['post_max_size'] post_max_size = config['PHP']['post_max_size']
upload_max_filesize = config['PHP']['upload_max_filesize'] upload_max_filesize = config['PHP']['upload_max_filesize']
max_execution_time = config['PHP']['max_execution_time'] 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 == config.read('/etc/{0}/fpm/pool.d/www.conf'.format("php/7.2"))
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
www_listen = config['www']['listen'] www_listen = config['www']['listen']
www_ping_path = config['www']['ping.path'] www_ping_path = config['www']['ping.path']
www_pm_status_path = config['www']['pm.status_path'] www_pm_status_path = config['www']['pm.status_path']
@@ -96,8 +94,7 @@ class WOInfoController(CementBaseController):
except Exception as e: except Exception as e:
www_xdebug = 'off' www_xdebug = 'off'
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2" if (WOVariables.wo_platform_codename == config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2"))
'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic') else "php5"))
debug_listen = config['debug']['listen'] debug_listen = config['debug']['listen']
debug_ping_path = config['debug']['ping.path'] debug_ping_path = config['debug']['ping.path']
debug_pm_status_path = config['debug']['pm.status_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.php = True
self.app.pargs.mysql = True self.app.pargs.mysql = True
if WOAptGet.is_installed(self, 'php7.3-fpm'): if WOAptGet.is_installed(self, 'php7.3-fpm'):
self.app.pargs.php = True self.app.pargs.php73 = True
if self.app.pargs.nginx: if self.app.pargs.nginx:
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-common'): 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") Log.error(self, "Nginx is not installed")
if self.app.pargs.php: 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'):
if WOAptGet.is_installed(self, 'php7.2-fpm'): self.info_php()
self.info_php()
else:
Log.error(self, "PHP 7.2 is not installed")
else: else:
if WOAptGet.is_installed(self, 'php7.2-fpm'): Log.error(self, "PHP 7.2 is not installed")
self.info_php()
else:
Log.error(self, "PHP 7.2 is not installed")
if self.app.pargs.php73: if self.app.pargs.php73:
if WOAptGet.is_installed(self, 'php7.3-fpm'): if WOAptGet.is_installed(self, 'php7.3-fpm'):

View File

@@ -444,9 +444,9 @@ class WOLogMailController(CementBaseController):
(['--nginx'], (['--nginx'],
dict(help='Mail Nginx Error logs file', action='store_true')), dict(help='Mail Nginx Error logs file', action='store_true')),
(['--php'], (['--php'],
dict(help='Mail PHP Error logs file', action='store_true')), dict(help='Mail PHP 7.2 Error logs file', action='store_true')),
(['--fpm'], (['--fpm'],
dict(help='Mail PHP5-fpm slow logs file', dict(help='Mail PHP 7.2-fpm slow logs file',
action='store_true')), action='store_true')),
(['--mysql'], (['--mysql'],
dict(help='Mail MySQL logs file', action='store_true')), dict(help='Mail MySQL logs file', action='store_true')),

View File

@@ -1218,16 +1218,16 @@ class WOStackController(CementBaseController):
WOVariables.wo_php_user, WOVariables.wo_php_user,
WOVariables.wo_php_user, WOVariables.wo_php_user,
recursive=True) recursive=True)
if any('/tmp/memcache.tar.gz' == x[1] if any('/tmp/memcached.tar.gz' == x[1]
for x in packages): for x in packages):
Log.debug(self, "Extracting memcache.tar.gz to location" Log.debug(self, "Extracting memcached.tar.gz to location"
" {0}22222/htdocs/cache/memcache " " {0}22222/htdocs/cache/memcached "
.format(WOVariables.wo_webroot)) .format(WOVariables.wo_webroot))
WOExtract.extract(self, '/tmp/memcache.tar.gz', WOExtract.extract(self, '/tmp/memcached.tar.gz',
'{0}22222/htdocs/cache/memcache' '{0}22222/htdocs/cache/memcached'
.format(WOVariables.wo_webroot)) .format(WOVariables.wo_webroot))
Log.debug(self, "Setting Privileges to " Log.debug(self, "Setting Privileges to "
"{0}22222/htdocs/cache/memcache file" "{0}22222/htdocs/cache/memcached file"
.format(WOVariables.wo_webroot)) .format(WOVariables.wo_webroot))
WOFileUtils.chown(self, '{0}22222' WOFileUtils.chown(self, '{0}22222'
.format(WOVariables.wo_webroot), .format(WOVariables.wo_webroot),
@@ -1527,7 +1527,7 @@ class WOStackController(CementBaseController):
Log.debug(self, "Setting packages variable for utils") Log.debug(self, "Setting packages variable for utils")
packages = packages + [["https://storage.googleapis.com/google-code-archive-downloads/" packages = packages + [["https://storage.googleapis.com/google-code-archive-downloads/"
"v2/code.google.com/phpmemcacheadmin/" "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'], 'phpMemcachedAdmin'],
["https://raw.githubusercontent.com" ["https://raw.githubusercontent.com"
"/rtCamp/eeadmin/master/cache/nginx/" "/rtCamp/eeadmin/master/cache/nginx/"
@@ -1725,7 +1725,7 @@ class WOStackController(CementBaseController):
.format(WOVariables.wo_webroot), .format(WOVariables.wo_webroot),
'{0}22222/htdocs/cache/nginx/' '{0}22222/htdocs/cache/nginx/'
'clean.php'.format(WOVariables.wo_webroot), 'clean.php'.format(WOVariables.wo_webroot),
'{0}22222/htdocs/cache/memcache' '{0}22222/htdocs/cache/memcached'
.format(WOVariables.wo_webroot), .format(WOVariables.wo_webroot),
'/usr/bin/pt-query-advisor', '/usr/bin/pt-query-advisor',
'{0}22222/htdocs/db/anemometer' '{0}22222/htdocs/db/anemometer'
@@ -1862,7 +1862,7 @@ class WOStackController(CementBaseController):
.format(WOVariables.wo_webroot), .format(WOVariables.wo_webroot),
'{0}22222/htdocs/cache/nginx/' '{0}22222/htdocs/cache/nginx/'
'clean.php'.format(WOVariables.wo_webroot), 'clean.php'.format(WOVariables.wo_webroot),
'{0}22222/htdocs/cache/memcache' '{0}22222/htdocs/cache/memcached'
.format(WOVariables.wo_webroot), .format(WOVariables.wo_webroot),
'/usr/bin/pt-query-advisor', '/usr/bin/pt-query-advisor',
'{0}22222/htdocs/db/anemometer' '{0}22222/htdocs/db/anemometer'

View File

@@ -56,21 +56,21 @@ class WOStackMigrateController(CementBaseController):
% e) % e)
Log.debug(self, "Pre-seeding MariaDB") 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 " "mysql-server/root_password "
"password \" | " "password \" | "
"debconf-set-selections") "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 " "mysql-server/root_password "
"password {chars}\" | " "password {chars}\" | "
"debconf-set-selections" "debconf-set-selections"
.format(chars=chars), .format(chars=chars),
log=False) log=False)
Log.debug(self, "echo \"mariadb-server-10.0 " Log.debug(self, "echo \"mariadb-server-10.3 "
"mysql-server/root_password_again " "mysql-server/root_password_again "
"password \" | " "password \" | "
"debconf-set-selections") "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 " "mysql-server/root_password_again "
"password {chars}\" | " "password {chars}\" | "
"debconf-set-selections" "debconf-set-selections"

View File

@@ -13,8 +13,8 @@ class WOStackStatusController(CementBaseController):
stacked_type = 'embedded' stacked_type = 'embedded'
description = 'Check the stack status' description = 'Check the stack status'
arguments = [ arguments = [
(['--memcache'], (['--memcached'],
dict(help='start/stop/restart memcache', action='store_true')), dict(help='start/stop/restart memcached', action='store_true')),
] ]
@expose(help="Start stack services") @expose(help="Start stack services")
@@ -22,7 +22,7 @@ class WOStackStatusController(CementBaseController):
"""Start services""" """Start services"""
services = [] services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73 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): or self.app.pargs.redis):
self.app.pargs.nginx = True self.app.pargs.nginx = True
self.app.pargs.php = True self.app.pargs.php = True
@@ -35,30 +35,20 @@ class WOStackStatusController(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 (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'): if WOAptGet.is_installed(self, 'php7.2-fpm'):
if WOAptGet.is_installed(self, 'php7.2-fpm'): services = services + ['php7.2-fpm']
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
else: else:
if WOAptGet.is_installed(self, 'php7.2-fpm'): Log.info(self, "PHP7.2-FPM is not installed")
services = services + ['php7.2-fpm'] if WOAptGet.is_installed(self, 'php7.3-fpm'):
else: services = services + ['php7.3-fpm']
Log.info(self, "PHP7.2-FPM is not installed") 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 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'):
if WOAptGet.is_installed(self, 'php7.3-fpm'): services = services + ['php7.3-fpm']
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.3-FPM is not installed")
else: 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 self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or if ((WOVariables.wo_mysql_host is "localhost") or
@@ -78,11 +68,11 @@ class WOStackStatusController(CementBaseController):
services = services + ['hhvm'] services = services + ['hhvm']
else: else:
Log.info(self, "HHVM is not installed") Log.info(self, "HHVM is not installed")
if self.app.pargs.memcache: if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'): if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached'] services = services + ['memcached']
else: else:
Log.info(self, "Memcache is not installed") Log.info(self, "Memcached is not installed")
if self.app.pargs.redis: if self.app.pargs.redis:
if WOAptGet.is_installed(self, 'redis-server'): if WOAptGet.is_installed(self, 'redis-server'):
@@ -99,7 +89,7 @@ class WOStackStatusController(CementBaseController):
"""Stop services""" """Stop services"""
services = [] services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73 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): or self.app.pargs.redis):
self.app.pargs.nginx = True self.app.pargs.nginx = True
self.app.pargs.php = True self.app.pargs.php = True
@@ -112,30 +102,21 @@ class WOStackStatusController(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 (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'): if WOAptGet.is_installed(self, 'php7.2-fpm'):
if WOAptGet.is_installed(self, 'php7.2-fpm'): services = services + ['php7.2-fpm']
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
else: else:
if WOAptGet.is_installed(self, 'php7.2-fpm'): Log.info(self, "PHP7.2-FPM is not installed")
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
if WOAptGet.is_installed(self, 'php7.3-fpm'): if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm'] services = services + ['php7.3-fpm']
else: else:
Log.info(self, "PHP7.3-FPM is not installed") Log.info(self, "PHP7.3-FPM is not installed")
if self.app.pargs.php73: 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'):
if WOAptGet.is_installed(self, 'php7.3-fpm'): services = services + ['php7.3-fpm']
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.3-FPM is not installed")
else: 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 self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or if ((WOVariables.wo_mysql_host is "localhost") or
@@ -155,11 +136,11 @@ class WOStackStatusController(CementBaseController):
services = services + ['hhvm'] services = services + ['hhvm']
else: else:
Log.info(self, "HHVM is not installed") Log.info(self, "HHVM is not installed")
if self.app.pargs.memcache: if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'): if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached'] services = services + ['memcached']
else: else:
Log.info(self, "Memcache is not installed") Log.info(self, "Memcached is not installed")
if self.app.pargs.redis: if self.app.pargs.redis:
if WOAptGet.is_installed(self, 'redis-server'): if WOAptGet.is_installed(self, 'redis-server'):
@@ -176,7 +157,7 @@ class WOStackStatusController(CementBaseController):
"""Restart services""" """Restart services"""
services = [] services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73 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): or self.app.pargs.redis):
self.app.pargs.nginx = True self.app.pargs.nginx = True
self.app.pargs.php = True self.app.pargs.php = True
@@ -189,30 +170,21 @@ class WOStackStatusController(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 (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'): if WOAptGet.is_installed(self, 'php7.2-fpm'):
if WOAptGet.is_installed(self, 'php7.2-fpm'): services = services + ['php7.2-fpm']
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
else: else:
if WOAptGet.is_installed(self, 'php7.2-fpm'): Log.info(self, "PHP7.2-FPM is not installed")
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
if WOAptGet.is_installed(self, 'php7.3-fpm'): if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm'] services = services + ['php7.3-fpm']
else: else:
Log.info(self, "PHP7.3-FPM is not installed") Log.info(self, "PHP7.3-FPM is not installed")
if self.app.pargs.php73: 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'):
if WOAptGet.is_installed(self, 'php7.3-fpm'): services = services + ['php7.3-fpm']
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.3-FPM is not installed")
else: 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 self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or if ((WOVariables.wo_mysql_host is "localhost") or
@@ -232,11 +204,11 @@ class WOStackStatusController(CementBaseController):
services = services + ['hhvm'] services = services + ['hhvm']
else: else:
Log.info(self, "HHVM is not installed") Log.info(self, "HHVM is not installed")
if self.app.pargs.memcache: if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'): if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached'] services = services + ['memcached']
else: else:
Log.info(self, "Memcache is not installed") Log.info(self, "Memcached is not installed")
if self.app.pargs.redis: if self.app.pargs.redis:
if WOAptGet.is_installed(self, 'redis-server'): if WOAptGet.is_installed(self, 'redis-server'):
@@ -253,7 +225,7 @@ class WOStackStatusController(CementBaseController):
"""Status of services""" """Status of services"""
services = [] services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73 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): or self.app.pargs.redis):
self.app.pargs.nginx = True self.app.pargs.nginx = True
self.app.pargs.php = True self.app.pargs.php = True
@@ -267,30 +239,21 @@ class WOStackStatusController(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 (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'): if WOAptGet.is_installed(self, 'php7.2-fpm'):
if WOAptGet.is_installed(self, 'php7.2-fpm'): services = services + ['php7.2-fpm']
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
else: else:
if WOAptGet.is_installed(self, 'php7.2-fpm'): Log.info(self, "PHP7.2-FPM is not installed")
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
if WOAptGet.is_installed(self, 'php7.3-fpm'): if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm'] services = services + ['php7.3-fpm']
else: else:
Log.info(self, "PHP7.3-FPM is not installed") Log.info(self, "PHP7.3-FPM is not installed")
if self.app.pargs.php73: 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'):
if WOAptGet.is_installed(self, 'php7.3-fpm'): services = services + ['php7.3-fpm']
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.3-FPM is not installed")
else: 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 self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or if ((WOVariables.wo_mysql_host is "localhost") or
@@ -310,11 +273,11 @@ class WOStackStatusController(CementBaseController):
services = services + ['hhvm'] services = services + ['hhvm']
else: else:
Log.info(self, "HHVM is not installed") Log.info(self, "HHVM is not installed")
if self.app.pargs.memcache: if self.app.pargs.memcached:
if WOAptGet.is_installed(self, 'memcached'): if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached'] services = services + ['memcached']
else: else:
Log.info(self, "Memcache is not installed") Log.info(self, "Memcached is not installed")
if self.app.pargs.redis: if self.app.pargs.redis:
if WOAptGet.is_installed(self, 'redis-server'): if WOAptGet.is_installed(self, 'redis-server'):
@@ -331,7 +294,7 @@ class WOStackStatusController(CementBaseController):
"""Reload service""" """Reload service"""
services = [] services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73 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): or self.app.pargs.redis):
self.app.pargs.nginx = True self.app.pargs.nginx = True
self.app.pargs.php = True self.app.pargs.php = True
@@ -344,30 +307,21 @@ class WOStackStatusController(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 (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'): if WOAptGet.is_installed(self, 'php7.2-fpm'):
if WOAptGet.is_installed(self, 'php7.2-fpm'): services = services + ['php7.2-fpm']
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
else: else:
if WOAptGet.is_installed(self, 'php7.2-fpm'): Log.info(self, "PHP7.2-FPM is not installed")
services = services + ['php7.2-fpm']
else:
Log.info(self, "php7.2-fpm is not installed")
if WOAptGet.is_installed(self, 'php7.3-fpm'): if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm'] services = services + ['php7.3-fpm']
else: else:
Log.info(self, "PHP7.3-FPM is not installed") Log.info(self, "PHP7.3-FPM is not installed")
if self.app.pargs.php73: 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'):
if WOAptGet.is_installed(self, 'php7.3-fpm'): services = services + ['php7.3-fpm']
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.3-FPM is not installed")
else: 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 self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or if ((WOVariables.wo_mysql_host is "localhost") or
@@ -385,11 +339,11 @@ class WOStackStatusController(CementBaseController):
if self.app.pargs.hhvm: if self.app.pargs.hhvm:
Log.info(self, "HHVM does not support to reload") 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'): if WOAptGet.is_installed(self, 'memcached'):
services = services + ['memcached'] services = services + ['memcached']
else: else:
Log.info(self, "Memcache is not installed") Log.info(self, "Memcached is not installed")
if self.app.pargs.redis: if self.app.pargs.redis:
if WOAptGet.is_installed(self, 'redis-server'): if WOAptGet.is_installed(self, 'redis-server'):

View File

@@ -102,20 +102,19 @@ class WOVariables():
# PHP repo and packages # PHP repo and packages
if wo_platform_distro == 'ubuntu': 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_repo = "ppa:ondrej/php" wo_php = ["php7.2-fpm", "php7.2-curl", "php7.2-gd", "php7.2-imap",
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-readline", "php7.2-common", "php7.2-recode", "php7.2-cli", "php7.2-mbstring",
"php7.2-cli", "php7.2-mbstring",
"php7.2-bcmath", "php7.2-mysql", "php7.2-opcache", "php7.2-bcmath", "php7.2-mysql", "php7.2-opcache",
"php7.2-zip", "php7.2-xml", "php7.2-soap"] "php7.2-zip", "php7.2-xml", "php7.2-soap"]
wo_php73 = ["php7.3-fpm", "php7.3-curl", "php7.3-gd", "php7.3-imap", 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-readline", "php7.3-common", "php7.3-recode",
"php7.3-cli", "php7.3-mbstring", "php7.3-cli", "php7.3-mbstring",
"php7.3-bcmath", "php7.3-mysql", "php7.3-opcache", "php7.3-bcmath", "php7.3-mysql", "php7.3-opcache",
"php7.3-zip", "php7.3-xml", "php7.3-soap"] "php7.3-zip", "php7.3-xml", "php7.3-soap"]
wo_php_extra = ["php-memcached", "php-imagick", "memcached", wo_php_extra = ["php-memcached", "php-imagick", "memcached",
"graphviz", "php-xdebug", "php-msgpack", "php-redis"] "graphviz", "php-xdebug", "php-msgpack", "php-redis"]
elif wo_platform_distro == 'debian': elif wo_platform_distro == 'debian':
wo_php_repo = ( wo_php_repo = (
"deb https://packages.sury.org/php/ {codename} main".format(codename=wo_platform_codename)) "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" wo_redis_repo = ("deb https://packages.sury.org/php/ {codename} all"
.format(codename=wo_platform_codename)) .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 # Repo path
wo_repo_file = "wo-repo.list" wo_repo_file = "wo-repo.list"