From 78cd626d75a268cfbb0aeb10d9998ff83f9c11a3 Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 7 Nov 2020 21:06:26 +0100 Subject: [PATCH] Set php 7.4 as default php version * `wo stack install` will check php version to install in /etc/wo/wo.conf --- wo/cli/plugins/site_functions.py | 10 +++++----- wo/cli/plugins/stack.py | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 516c9ed..4b0e299 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -810,11 +810,11 @@ def sitebackup(self, data): if data['wo_db_name']: Log.info(self, 'Backing up database \t\t', end='') try: - if not WOShellExec.cmd_exec(self, "mysqldump --single-transaction " - "{0} | zstd -T0 -c" - "> {1}/{0}.zst" - .format(data['wo_db_name'], - backup_path)): + if not WOShellExec.cmd_exec( + self, "mysqldump --single-transaction --hex-blob " + "{0} | zstd -T0 -c > {1}/{0}.zst" + .format(data['wo_db_name'], + backup_path)): Log.info(self, "[" + Log.ENDC + Log.FAIL + "Fail" + Log.OKBLUE + "]") raise SiteError("mysqldump failed to backup database") diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index fd82f11..0053128 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -146,8 +146,18 @@ class WOStackController(CementBaseController): pargs.proftpd = True if pargs.web: + if self.app.config.has_section('php'): + config_php_ver = self.app.config.get( + 'php', 'version') + if config_php_ver == '7.2': + pargs.php72 = True + elif config_php_ver == '7.3': + pargs.php73 = True + elif config_php_ver == '7.4': + pargs.php74 = True + else: + pargs.php74 = True pargs.nginx = True - pargs.php73 = True pargs.mysql = True pargs.wpcli = True pargs.sendmail = True @@ -476,7 +486,7 @@ class WOStackController(CementBaseController): if not (WOAptGet.is_installed(self, 'php7.2-fpm') or WOAptGet.is_installed(self, 'php7.3-fpm') or WOAptGet.is_installed(self, 'php7.4-fpm')): - pargs.php = True + pargs.php74 = True Log.debug(self, "Setting packages variable for utils") packages = packages + [[ "https://raw.githubusercontent.com"