Skip to content

Commit

Permalink
Merge pull request #643 from humanmade/backport-634-to-v16-branch
Browse files Browse the repository at this point in the history
[Backport v16-branch] Add Afterburner support to Local Server
  • Loading branch information
joehoyle authored Nov 14, 2023
2 parents 23684d6 + 964e0f4 commit 18f5d0f
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
4 changes: 4 additions & 0 deletions docker/afterburner.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extension=afterburner.so

afterburner.redis_server_info=redis://redis:6379
afterburner.lru_cache_max_items=1000
19 changes: 19 additions & 0 deletions docs/using-afterburner.md
Original file line number Diff line number Diff line change
@@ -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.
11 changes: 8 additions & 3 deletions inc/composer/class-docker-compose-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

Expand Down Expand Up @@ -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' => [
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 18f5d0f

Please sign in to comment.