Skip to content

Commit

Permalink
Merge pull request #99 from L0RD-ZER0/feature/support-newer-php
Browse files Browse the repository at this point in the history
Add support for newer PHP versions
  • Loading branch information
mrrobot47 authored Apr 26, 2024
2 parents 71423cb + af0ddfb commit 3d0a182
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function __construct() {
* : Create separate db container instead of using global db.
*
* [--php=<php-version>]
* : PHP version for site. Currently only supports PHP 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1 and latest.
* : PHP version for site. Currently only supports PHP 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, and latest.
* ---
* default: latest
* options:
Expand All @@ -92,6 +92,8 @@ public function __construct() {
* - 7.4
* - 8.0
* - 8.1
* - 8.2
* - 8.3
* - latest
* ---
*
Expand Down Expand Up @@ -226,7 +228,7 @@ public function create( $args, $assoc_args ) {
}
$this->site_data['alias_domains'] = substr( $this->site_data['alias_domains'], 0, - 1 );

$supported_php_versions = [ 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 'latest' ];
$supported_php_versions = [ 5.6, 7.0, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 'latest' ];
if ( ! in_array( $this->site_data['php_version'], $supported_php_versions ) ) {
$old_version = $this->site_data['php_version'];
$floor = (int) floor( $this->site_data['php_version'] );
Expand All @@ -244,7 +246,7 @@ public function create( $args, $assoc_args ) {
\EE::confirm( sprintf( 'EEv4 does not support PHP %s. Continue with PHP %s?', $old_version, $this->site_data['php_version'] ) );
}

$this->site_data['php_version'] = ( 7.4 === (double) $this->site_data['php_version'] ) ? 'latest' : $this->site_data['php_version'];
$this->site_data['php_version'] = ( 8.0 === (double) $this->site_data['php_version'] ) ? 'latest' : $this->site_data['php_version'];

if ( $this->cache_type && ! $local_cache ) {
\EE\Service\Utils\init_global_container( GLOBAL_REDIS );
Expand Down
2 changes: 1 addition & 1 deletion src/Site_PHP_Docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
$db['networks'] = $network_default;
}
// PHP configuration.
$php_image_key = ( 'latest' === $filters['php_version'] ? 'easyengine/php' : 'easyengine/php' . $filters['php_version'] );
$php_image_key = ( 'latest' === $filters['php_version'] ? 'easyengine/php8.2' : 'easyengine/php' . $filters['php_version'] );

$php['service_name'] = [ 'name' => 'php' ];
$php['image'] = [ 'name' => $php_image_key . ':' . $img_versions[ $php_image_key ] ];
Expand Down

0 comments on commit 3d0a182

Please sign in to comment.