Skip to content

Commit 2eae4fb

Browse files
committed
Merge branch 'plugin-loader'
2 parents dea5a9c + 98b8708 commit 2eae4fb

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

.github/workflows/image.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ jobs:
8282
|grep 'ADMINER_DEFAULT_SERVER_WORKS'
8383
env:
8484
container_name: adminer_defaultserver
85+
- name: Verify that loading plugins work.
86+
if: ${{ ! contains(steps.build.outputs.image, 'fastcgi') }}
87+
run: |
88+
docker run --name $container_name -d -e ADMINER_PLUGINS="tables-filter version-noverify" ${{ steps.build.outputs.image }}
89+
docker run -i --rm --link $container_name:$container_name buildpack-deps:curl \
90+
curl -fsSL http://$container_name:8080/ \
91+
|grep 'verifyVersion ='
92+
env:
93+
container_name: adminer_plugins
8594
- name: Show Containers and Images
8695
run: |
8796
printf "::group::docker ps -a\n"

5/fastcgi/plugin-loader.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
if (PHP_SAPI !== 'cli') exit;
34
if ($_SERVER['argc'] !== 2) exit;
45

@@ -39,6 +40,10 @@
3940
exit(1);
4041
}
4142

43+
if (!class_exists(\Adminer\Plugin::class)) {
44+
class_alias(stdClass::class, \Adminer\Plugin::class);
45+
}
46+
4247
// Check constructor.
4348
$class = $classes[0];
4449
require($file);

5/plugin-loader.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
if (PHP_SAPI !== 'cli') exit;
34
if ($_SERVER['argc'] !== 2) exit;
45

@@ -39,6 +40,10 @@
3940
exit(1);
4041
}
4142

43+
if (!class_exists(\Adminer\Plugin::class)) {
44+
class_alias(stdClass::class, \Adminer\Plugin::class);
45+
}
46+
4247
// Check constructor.
4348
$class = $classes[0];
4449
require($file);

0 commit comments

Comments
 (0)