#482: Add PHP 8.2 to WO
This commit is contained in:
@@ -51,6 +51,8 @@ class WOStackController(CementBaseController):
|
||||
dict(help='Install PHP 8.0 stack', action='store_true')),
|
||||
(['--php81'],
|
||||
dict(help='Install PHP 8.1 stack', action='store_true')),
|
||||
(['--php82'],
|
||||
dict(help='Install PHP 8.2 stack', action='store_true')),
|
||||
(['--mysql'],
|
||||
dict(help='Install MySQL stack', action='store_true')),
|
||||
(['--mariadb'],
|
||||
@@ -121,7 +123,7 @@ class WOStackController(CementBaseController):
|
||||
# Default action for stack installation
|
||||
if not (pargs.web or pargs.admin or pargs.nginx or
|
||||
pargs.php or pargs.php72 or pargs.php73 or pargs.php74 or
|
||||
pargs.php80 or pargs.php81 or
|
||||
pargs.php80 or pargs.php81 or pargs.php82 or
|
||||
pargs.mysql or pargs.wpcli or pargs.phpmyadmin or
|
||||
pargs.composer or pargs.netdata or pargs.composer or
|
||||
pargs.dashboard or pargs.fail2ban or pargs.security or
|
||||
@@ -149,6 +151,7 @@ class WOStackController(CementBaseController):
|
||||
pargs.php74 = True
|
||||
pargs.php80 = True
|
||||
pargs.php81 = True
|
||||
pargs.php82 = True
|
||||
pargs.redis = True
|
||||
pargs.proftpd = True
|
||||
|
||||
@@ -166,8 +169,10 @@ class WOStackController(CementBaseController):
|
||||
pargs.php80 = True
|
||||
elif config_php_ver == '8.1':
|
||||
pargs.php81 = True
|
||||
elif config_php_ver == '8.2':
|
||||
pargs.php82 = True
|
||||
else:
|
||||
pargs.php80 = True
|
||||
pargs.php81 = True
|
||||
pargs.nginx = True
|
||||
pargs.mysql = True
|
||||
pargs.wpcli = True
|
||||
@@ -257,6 +262,16 @@ class WOStackController(CementBaseController):
|
||||
Log.debug(self, "PHP 8.1 already installed")
|
||||
Log.info(self, "PHP 8.1 already installed")
|
||||
|
||||
# PHP 8.2
|
||||
if pargs.php82:
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 8.2")
|
||||
if not WOAptGet.is_installed(self, 'php8.2-fpm'):
|
||||
apt_packages = (apt_packages + WOVar.wo_php82 +
|
||||
WOVar.wo_php_extra)
|
||||
else:
|
||||
Log.debug(self, "PHP 8.2 already installed")
|
||||
Log.info(self, "PHP 8.2 already installed")
|
||||
|
||||
# MariaDB 10.3
|
||||
if pargs.mysql:
|
||||
pargs.mysqltuner = True
|
||||
@@ -512,7 +527,8 @@ class WOStackController(CementBaseController):
|
||||
WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
pargs.php80 = True
|
||||
Log.debug(self, "Setting packages variable for utils")
|
||||
packages = packages + [[
|
||||
@@ -610,7 +626,7 @@ class WOStackController(CementBaseController):
|
||||
(not pargs.phpredisadmin) and (not pargs.sendmail) and
|
||||
(not pargs.php73) and (not pargs.php74) and
|
||||
(not pargs.php72) and (not pargs.php80) and
|
||||
(not pargs.php81) and (not pargs.all)):
|
||||
(not pargs.php81) and (not pargs.php82) and (not pargs.all)):
|
||||
self.app.args.print_help()
|
||||
|
||||
if pargs.php:
|
||||
@@ -666,7 +682,8 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 7.2 is not installed")
|
||||
@@ -680,7 +697,8 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 7.3 is not installed")
|
||||
@@ -694,7 +712,8 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 7.4 is not installed")
|
||||
@@ -708,7 +727,8 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 8.0 is not installed")
|
||||
@@ -722,12 +742,30 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 8.1 is not installed")
|
||||
Log.info(self, "PHP 8.1 is not installed")
|
||||
|
||||
# PHP 8.2
|
||||
if pargs.php82:
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 8.2")
|
||||
if WOAptGet.is_installed(self, 'php8.2-fpm'):
|
||||
apt_packages = apt_packages + WOVar.wo_php82
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 8.2 is not installed")
|
||||
Log.info(self, "PHP 8.2 is not installed")
|
||||
|
||||
# REDIS
|
||||
if pargs.redis:
|
||||
if WOAptGet.is_installed(self, 'redis-server'):
|
||||
@@ -961,12 +999,13 @@ class WOStackController(CementBaseController):
|
||||
(not pargs.ufw) and (not pargs.ngxblocker) and
|
||||
(not pargs.phpredisadmin) and (not pargs.sendmail) and
|
||||
(not pargs.php80) and (not pargs.php81) and
|
||||
(not pargs.php82) and
|
||||
(not pargs.php73) and (not pargs.php74) and
|
||||
(not pargs.php72) and (not pargs.all)):
|
||||
self.app.args.print_help()
|
||||
|
||||
if pargs.php:
|
||||
pargs.php72 = True
|
||||
pargs.php81 = True
|
||||
|
||||
if pargs.mariadb:
|
||||
pargs.mysql = True
|
||||
@@ -974,10 +1013,12 @@ class WOStackController(CementBaseController):
|
||||
if pargs.all:
|
||||
pargs.web = True
|
||||
pargs.admin = True
|
||||
pargs.php72 = True
|
||||
pargs.php73 = True
|
||||
pargs.php74 = True
|
||||
pargs.php80 = True
|
||||
pargs.php81 = True
|
||||
pargs.php82 = True
|
||||
pargs.fail2ban = True
|
||||
pargs.proftpd = True
|
||||
pargs.utils = True
|
||||
@@ -1033,7 +1074,8 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 7.3 is not installed")
|
||||
@@ -1047,7 +1089,8 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 7.4 is not installed")
|
||||
@@ -1061,7 +1104,8 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 8.0 is not installed")
|
||||
@@ -1075,12 +1119,33 @@ class WOStackController(CementBaseController):
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm')):
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.2-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 8.1 is not installed")
|
||||
Log.info(self, "PHP 8.1 is not installed")
|
||||
|
||||
Log.info(self, "PHP 8.1 is not installed")
|
||||
|
||||
# PHP 8.2
|
||||
if pargs.php82:
|
||||
Log.debug(self, "Setting apt_packages variable for PHP 8.2")
|
||||
if WOAptGet.is_installed(self, 'php8.2-fpm'):
|
||||
apt_packages = apt_packages + WOVar.wo_php74
|
||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.2-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php7.4-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.0-fpm') or
|
||||
WOAptGet.is_installed(self, 'php8.1-fpm')):
|
||||
apt_packages = apt_packages + WOVar.wo_php_extra
|
||||
else:
|
||||
Log.debug(self, "PHP 8.2 is not installed")
|
||||
Log.info(self, "PHP 8.2 is not installed")
|
||||
|
||||
Log.info(self, "PHP 8.2 is not installed")
|
||||
|
||||
# REDIS
|
||||
if pargs.redis:
|
||||
if WOAptGet.is_installed(self, 'redis-server'):
|
||||
|
||||
Reference in New Issue
Block a user