diff --git a/docker/afterburner.ini b/docker/afterburner.ini new file mode 100644 index 00000000..98dca708 --- /dev/null +++ b/docker/afterburner.ini @@ -0,0 +1,4 @@ +extension=afterburner.so + +afterburner.redis_server_info=redis://redis:6379 +afterburner.lru_cache_max_items=1000 diff --git a/docs/using-afterburner.md b/docs/using-afterburner.md new file mode 100644 index 00000000..027b3ddd --- /dev/null +++ b/docs/using-afterburner.md @@ -0,0 +1,19 @@ +# Using Afterburner + +If your project uses Afterburner in Altis Cloud, you can enable it in Altis Local Service by setting the `altis.modules.local-server.afterburner` value to `true`: + +```json +{ + "extra": { + "altis": { + "modules": { + "local-server": { + "afterburner": true + } + } + } + } +} +``` + +Afterburner is only enabled on PHP versions later than 7.4. diff --git a/inc/composer/class-docker-compose-generator.php b/inc/composer/class-docker-compose-generator.php index b2316318..d03c4753 100644 --- a/inc/composer/class-docker-compose-generator.php +++ b/inc/composer/class-docker-compose-generator.php @@ -90,9 +90,9 @@ public function __construct( string $root_dir, string $project_name, string $tld */ protected function get_php_reusable() : array { $version_map = [ - '8.2' => 'humanmade/altis-local-server-php:8.2.5', - '8.1' => 'humanmade/altis-local-server-php:6.0.7', - '8.0' => 'humanmade/altis-local-server-php:5.0.7', + '8.2' => 'humanmade/altis-local-server-php:8.2.9', + '8.1' => 'humanmade/altis-local-server-php:6.0.10', + '8.0' => 'humanmade/altis-local-server-php:5.0.10', '7.4' => 'humanmade/altis-local-server-php:4.2.5', ]; @@ -123,6 +123,10 @@ protected function get_php_reusable() : array { $volumes[] = "{$this->config_dir}/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini"; } + if ( $this->get_config()['afterburner'] && $version !== '7.4' ) { + $volumes[] = "{$this->config_dir}/afterburner.ini:/usr/local/etc/php/conf.d/afterburner.ini"; + } + $services = [ 'init' => true, 'depends_on' => [ @@ -873,6 +877,7 @@ protected function get_config() : array { 'cavalcade' => $modules['cloud']['cavalcade'] ?? true, 'elasticsearch' => ( $analytics_enabled || $search_enabled ) ? '7' : false, 'kibana' => ( $analytics_enabled || $search_enabled ), + 'afterburner' => false, 'xray' => $modules['cloud']['xray'] ?? true, 'ignore-paths' => [], 'php' => '8.0',