Skip to content

Commit bb9bc81

Browse files
authored
✨ add php 8.4 (#139)
1 parent 281e4c2 commit bb9bc81

File tree

4 files changed

+29
-71
lines changed

4 files changed

+29
-71
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
php: [ '8.0', '8.1', '8.2', '8.3' ]
17+
php: [ '8.0', '8.1', '8.2', '8.3', '8.4' ]
1818
webserver: [ 'apache', 'nginx' ]
1919
distroAddon: [ '', '-alpine' ]
2020
steps:

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ FROM base${DIST_ADDON}
1919
COPY entrypoint.d/* /opt/docker/provision/entrypoint.d/
2020
COPY profiler.php /opt/docker/profiler.php
2121
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/
22-
RUN install-php-extensions @fix_letsencrypt xhprof mongodb pcov && \
22+
RUN install-php-extensions @fix_letsencrypt xhprof pcov && \
2323
echo "auto_prepend_file=/opt/docker/profiler.php" >> /opt/docker/etc/php/php.ini && \
2424
echo "pcov.enabled=0" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini && \
2525
echo "pcov.exclude='~vendor~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini && \
@@ -50,7 +50,7 @@ ENV \
5050
XHGUI_PROFILING="enabled" \
5151
TZ=Europe/Berlin
5252

53-
RUN composer global require davidrjonas/composer-lock-diff perftools/xhgui-collector alcaeus/mongo-php-adapter perftools/php-profiler && \
53+
RUN composer global require davidrjonas/composer-lock-diff perftools/php-profiler && \
5454
composer clear && \
5555
echo "source ~/.additional_bashrc.sh" >> ~/.bashrc && \
5656
curl -L https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh > ~/.bash_git

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ We recommend using [pluswerk/docker-global](https://github.com/pluswerk/docker-g
66

77
# Tags
88

9-
- php versions supported: `8.0`-`8.3`
9+
- php versions supported: `8.0`-`8.4`
1010
- php versions unsupported: `5.6`-`7.4`
1111
- webserver supported: `nginx` and `apache`
1212
- alpine images: `-alpine`
1313
- examples
14-
- `pluswerk/php-dev:nginx-8.3-alpine`
14+
- `pluswerk/php-dev:nginx-8.4-alpine`
1515
- `pluswerk/php-dev:apache-8.0-alpine`
1616
- `pluswerk/php-dev:nginx-8.2`
1717
- list of [all Tags](https://github.com/pluswerk/php-dev/pkgs/container/php-dev/versions?filters%5Bversion_type%5D=tagged)
@@ -56,7 +56,7 @@ Example file: compose/Development/docker-compose.yml
5656
```yaml
5757
services:
5858
web:
59-
image: pluswerk/php-dev:nginx-8.3-alpine
59+
image: pluswerk/php-dev:nginx-8.4-alpine
6060

6161
volumes:
6262
- .:/app
@@ -68,32 +68,32 @@ services:
6868

6969
environment:
7070
# Take a look at VIRTUAL_* in the documentation under Nginx Reverse Proxy
71-
- VIRTUAL_HOST=docker-website.${TLD_DOMAIN:?TLD_DOMAIN is required},sub.docker-website.${TLD_DOMAIN:?TLD_DOMAIN is required}
72-
# - HTTPS_METHOD=noredirect
71+
VIRTUAL_HOST: docker-website.${TLD_DOMAIN:?TLD_DOMAIN is required},sub.docker-website.${TLD_DOMAIN:?TLD_DOMAIN is required}
72+
# HTTPS_METHOD: noredirect
7373

74-
- WEB_DOCUMENT_ROOT=/app/public
75-
- XDEBUG_CLIENT_HOST=${XDEBUG_CLIENT_HOST:-}
76-
- php.xdebug.idekey=${XDEBUG_IDEKEY:-PHPSTORM}
77-
- PHP_IDE_CONFIG=${XDEBUG_IDEKEY:-"serverName=_"}
74+
WEB_DOCUMENT_ROOT: /app/public
75+
XDEBUG_CLIENT_HOST: ${XDEBUG_CLIENT_HOST:-}
76+
php.xdebug.idekey: ${XDEBUG_IDEKEY:-PHPSTORM}
77+
PHP_IDE_CONFIG: ${XDEBUG_IDEKEY:-"serverName=_"}
7878

7979
# Project Env vars (enable what you need)
80-
# - APP_ENV=development_docker
81-
# - PIMCORE_ENVIRONMENT=development_docker
82-
# - TYPO3_CONTEXT=Development/docker
80+
# APP_ENV: development_docker
81+
# PIMCORE_ENVIRONMENT: development_docker
82+
# TYPO3_CONTEXT: Development/docker
8383

8484
# Don't forget to connect via bash start.sh
85-
- APPLICATION_UID=${APPLICATION_UID:-1000}
86-
- APPLICATION_GID=${APPLICATION_GID:-1000}
85+
APPLICATION_UID: ${APPLICATION_UID:-1000}
86+
APPLICATION_GID: ${APPLICATION_GID:-1000}
8787

8888
node:
89-
image: node:18
89+
image: node:24
9090
volumes:
9191
- ./:/app
9292
working_dir: /app
9393
environment:
9494
# Don't forget to connect via bash start.sh
95-
- APPLICATION_UID=${APPLICATION_UID:-1000}
96-
- APPLICATION_GID=${APPLICATION_GID:-1000}
95+
APPLICATION_UID: ${APPLICATION_UID:-1000}
96+
APPLICATION_GID: ${APPLICATION_GID:-1000}
9797
stop_signal: SIGKILL
9898
entrypoint: bash -c 'groupmod -g $$APPLICATION_GID node; usermod -u $$APPLICATION_UID node; sleep infinity'
9999

profiler.php

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,65 +3,23 @@
33
// we do not want the /home/application/.config/composer/vendor/autoload.php
44
// we want minimal file inclusion.
55

6-
if ((isset($_COOKIE['XDEBUG_PROFILE']) || getenv('PROFILING_ENABLED'))) {
6+
if (!isset($_COOKIE['XDEBUG_PROFILE']) && !getenv('PROFILING_ENABLED')) {
7+
return;
8+
}
9+
10+
(function () {
711
$composerVendorDir = '/home/application/.composer/vendor';
812
if (!is_dir($composerVendorDir)) {
913
$composerVendorDir = '/home/application/.config/composer/vendor';
1014
}
1115
require_once $composerVendorDir . '/perftools/php-profiler/autoload.php';
12-
13-
$tmpFile = '/tmp/' . uniqid('xhgui', true) . '.data.jsonl';
14-
1516
$profiler = new \Xhgui\Profiler\Profiler(
1617
[
17-
'profiler' => \Xhgui\Profiler\Profiler::PROFILER_XHPROF,
18-
# 'save.handler' => \Xhgui\Profiler\Profiler::SAVER_MONGODB,
19-
20-
'save.handler' => \Xhgui\Profiler\Profiler::SAVER_FILE,
21-
'save.handler.file' => [
22-
// Appends jsonlines formatted data to this path
23-
'filename' => $tmpFile,
18+
'save.handler.upload' => [
19+
'url' => 'http://' . (getenv('XHGUI_MONGO_HOST') ?: 'global-xhgui') . '/run/import',
2420
],
2521
]
2622
);
27-
$profiler->enable();
28-
29-
30-
register_shutdown_function(static function () use ($composerVendorDir, $tmpFile, $profiler) {
31-
//we want this autoloading only after the main php script executed everything.
32-
require_once $composerVendorDir . '/autoload.php';
33-
$profiler->stop();
34-
35-
//huge performance Optimisation possible:
36-
// do not import into mongodb at this point, do it asyncroniasly in the background
37-
//return;
38-
$saver = \Xhgui\Profiler\SaverFactory::create(
39-
\Xhgui\Profiler\Profiler::SAVER_MONGODB,
40-
new \Xhgui\Profiler\Config(
41-
[
42-
'save.handler.mongodb' => [
43-
'dsn' => 'mongodb://' . str_replace('mongodb://', '', getenv('XHGUI_MONGO_URI') ?: 'global-xhgui:27017'),
44-
'database' => 'xhprof',
45-
// Allows you to pass additional options like replicaSet to MongoClient.
46-
// 'username', 'password' and 'db' (where the user is added)
47-
'options' => [],
48-
// Allows you to pass driver options like ca_file to MongoClient
49-
'driverOptions' => [],
50-
],
51-
]
52-
)
53-
);
54-
if (!$saver) {
55-
throw new RuntimeException("Unable to obtain saver");
56-
}
57-
58-
$importer = new \Xhgui\Profiler\Importer($saver);
59-
$fp = fopen($tmpFile, 'r');
60-
if (!$fp) {
61-
throw new RuntimeException("Can't open " . $tmpFile);
62-
}
63-
$importer->import($fp);
64-
fclose($fp);
65-
unlink($tmpFile);
66-
});
23+
$profiler->start();
6724
}
25+
)();

0 commit comments

Comments
 (0)