Commit 3d2fedb9 authored by EuroDomenii's avatar EuroDomenii
Browse files

Use specific PHP versions, comma separated, fixing merge conflict

parents e191f672 14875414
...@@ -174,10 +174,30 @@ class ISPConfig { ...@@ -174,10 +174,30 @@ class ISPConfig {
} }
public static function wantsPHP() { public static function wantsPHP() {
// If a new version is added, the getApacheModulesToDisable function should be updated to disable the latest version (this part could be improved)
$available_php_versions = array(
'5.6',
'7.0',
'7.1',
'7.2',
'7.3',
'7.4',
'8.0'
);
if(isset($_GET['use-php']) && $_GET['use-php']) { if(isset($_GET['use-php']) && $_GET['use-php']) {
return $_GET['use-php']; if ($_GET['use-php'] === 'system') {
return $_GET['use-php'];
} else {
$use_php = explode(',',$_GET['use-php']);
$php_versions = array_intersect($use_php, $available_php_versions);
if(!empty($php_versions)) {
return $php_versions;
} else {
return false;
}
}
} else { } else {
return false; return $available_php_versions;
} }
} }
...@@ -224,9 +244,9 @@ Possible arguments are: ...@@ -224,9 +244,9 @@ Possible arguments are:
--use-nginx ->Use nginx webserver instead of apache2 --use-nginx ->Use nginx webserver instead of apache2
--use-amavis ->Use amavis instead of rspamd for mail filtering --use-amavis ->Use amavis instead of rspamd for mail filtering
--use-unbound ->Use unbound instead of bind9 for local resolving. Only allowed if --no-dns is set. --use-unbound ->Use unbound instead of bind9 for local resolving. Only allowed if --no-dns is set.
--use-php ->Use specific PHP version instead of installing multiple PHP, e.g. --use-php=7.3 (5.6, 7.0, 7.1, 7.2 and 7.3 available). --use-php ->Use specific PHP versions, comma separated, instead of installing multiple PHP, e.g. --use-php=7.4,8.0 (5.6, 7.0, 7.1, 7.2, 7.3, 7.4 and 8.0 available).
->--use-php=system disables the sury repository and just installs the system\'s default PHP version. ->--use-php=system disables the sury repository and just installs the system\'s default PHP version.
->CURRENTLY ONLY EITHER --use-php=system OR OMITTING THE ARGUMENT (use all versions) IS SUPPORTED! ->ommiting the argument (use all versions)
--use-ftp-ports ->This option sets the passive port range for pure-ftpd. You have to specify the port range separated by hyphen, e. g. --use-ftp-ports=40110-40210. --use-ftp-ports ->This option sets the passive port range for pure-ftpd. You have to specify the port range separated by hyphen, e. g. --use-ftp-ports=40110-40210.
->If not provided the passive port range will not be configured. ->If not provided the passive port range will not be configured.
--no-web ->Do not use ISPConfig on this server to manage webserver setting and don\'t install nginx/apache or pureftpd. This will also prevent installing an ISPConfig UI and implies --no-roundcube as well as --no-pma --no-web ->Do not use ISPConfig on this server to manage webserver setting and don\'t install nginx/apache or pureftpd. This will also prevent installing an ISPConfig UI and implies --no-roundcube as well as --no-pma
...@@ -279,7 +299,7 @@ Possible arguments are: ...@@ -279,7 +299,7 @@ Possible arguments are:
} elseif(isset($_GET['lang']) && !in_array($_GET['lang'], array('de', 'en'), true)) { } elseif(isset($_GET['lang']) && !in_array($_GET['lang'], array('de', 'en'), true)) {
self::printHelp(); self::printHelp();
exit; exit;
} elseif(isset($_GET['use-php']) && $_GET['use-php'] !== 'system') {//!in_array($_GET['use-php'], array('5.6', '7.0', '7.1', '7.2', '7.3', 'system'), true)) { } elseif(isset($_GET['use-php']) && !self::wantsPHP()) {
self::printHelp(); self::printHelp();
exit; exit;
} elseif(isset($_GET['use-ftp-ports']) && (!preg_match('/^([1-9][0-9]+)-([1-9][0-9]+)$/', $_GET['use-ftp-ports'], $pmatch) || intval($pmatch[1]) >= intval($pmatch[2]))) { } elseif(isset($_GET['use-ftp-ports']) && (!preg_match('/^([1-9][0-9]+)-([1-9][0-9]+)$/', $_GET['use-ftp-ports'], $pmatch) || intval($pmatch[1]) >= intval($pmatch[2]))) {
......
...@@ -808,16 +808,8 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"'; ...@@ -808,16 +808,8 @@ mailman-unsubscribe: "|/var/lib/mailman/mail/mailman unsubscribe mailman"';
if(ISPConfig::wantsPHP() === 'system') { if(ISPConfig::wantsPHP() === 'system') {
$php_versions = array($this->getSystemPHPVersion()); $php_versions = array($this->getSystemPHPVersion());
} else { } else {
// If a new version is added, the getApacheModulesToDisable function should be updated to disable the latest version (this part could be improved) //ISPConfig::run() validations prevent sending here null values
$php_versions = array( $php_versions = ISPConfig::wantsPHP();
'5.6',
'7.0',
'7.1',
'7.2',
'7.3',
'7.4',
'8.0'
);
} }
$php_modules = array( $php_modules = array(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment