Skip to content

Commit

Permalink
Merge pull request #642 from humanmade/backport-634-to-v17-branch
Browse files Browse the repository at this point in the history
[Backport v17-branch] Add Afterburner support to Local Server
  • Loading branch information
joehoyle authored Nov 8, 2023
2 parents 0b6e8f3 + ea89444 commit e848702
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 @@ -98,9 +98,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 @@ -131,6 +131,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 @@ -881,6 +885,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.1',
Expand Down

0 comments on commit e848702

Please sign in to comment.