Skip to content

Commit

Permalink
Merge pull request #222 from L0RD-ZER0/feature/support-newer-php
Browse files Browse the repository at this point in the history
Feature/support newer php
  • Loading branch information
mrrobot47 authored Apr 26, 2024
2 parents 7ee4b34 + 7cd72ef commit 38da882
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Site_WP_Docker.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ public function generate_docker_compose_yml( array $filters = [], $volumes ) {
$db['sysctls'] = sysctl_parameters();
$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
8 changes: 5 additions & 3 deletions src/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function __construct() {
* : Set custom source directory for site inside htdocs.
*
* [--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 @@ -142,6 +142,8 @@ public function __construct() {
* - 7.4
* - 8.0
* - 8.1
* - 8.2
* - 8.3
* - latest
* ---
*
Expand Down Expand Up @@ -368,7 +370,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 @@ -386,7 +388,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'] ), $assoc_args );
}

$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.2 === (double) $this->site_data['php_version'] ) ? 'latest' : $this->site_data['php_version'];

if ( \EE\Utils\get_flag_value( $assoc_args, 'local-db' ) ) {
$this->site_data['db_host'] = 'db';
Expand Down

0 comments on commit 38da882

Please # to comment.