Skip to content

Commit d33e05c

Browse files
committed
chore(ci): enable comprehensive PHP error logging and update tests
1 parent 19a68a3 commit d33e05c

4 files changed

Lines changed: 16 additions & 3 deletions

File tree

.github/docker/php-apache-firebird/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@ RUN apt-get update && apt-get install -y \
1717
&& rm -rf /tmp/php-firebird \
1818
&& apt-get purge -y --auto-remove git autoconf build-essential \
1919
&& rm -rf /var/lib/apt/lists/*
20+
21+
RUN { \
22+
echo 'error_reporting = E_ALL'; \
23+
echo 'display_errors = Off'; \
24+
echo 'display_startup_errors = Off'; \
25+
echo 'log_errors = On'; \
26+
echo 'error_log = /dev/stderr'; \
27+
} > /usr/local/etc/php/conf.d/docker-php-logging.ini

inc/functions.inc.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,9 @@ function error_handler($errno, $errmsg, $file, $line, $errstack)
11051105
return;
11061106
}
11071107

1108+
$log_msg = "PHP Error [$errno]: $errmsg in $file on line $line";
1109+
error_log($log_msg);
1110+
11081111
if (E_ERROR & $errno) {
11091112
$php_error .= "$errmsg<br>\n"
11101113
. "in file: $file, line $line<br>\n";

inc/script_start.inc.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
require './inc/configuration.inc.php';
99

10-
if (DEBUG) {
10+
ini_set('log_errors', 'On');
11+
if (defined('DEBUG') && DEBUG) {
12+
ini_set('display_errors', 'On');
1113
$start_time = @microtime();
1214
}
1315

tests/e2e/example.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { test, expect } from '@playwright/test';
22

33
test('has title', async ({ page }) => {
4-
await page.goto('/database.php');
4+
await page.goto('/');
55

66
// Expect a title "to contain" a substring.
77
await expect(page).toHaveTitle(/Firebird Web Admin \/ Database/);
88
});
99

1010
test('login form is visible', async ({ page }) => {
11-
await page.goto('/database.php');
11+
await page.goto('/');
1212

1313
// Expect the login form to be visible
1414
await expect(page.locator('form[action="database.php"]')).toBeVisible();

0 commit comments

Comments
 (0)