Skip to content

Commit 4ddcd0a

Browse files
committed
Simplify debug logging logic when running tests standalone
1 parent 5a4778f commit 4ddcd0a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/utils/basic.inc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,11 @@ if (!is_dir(DEBUG_DIR)) {
5656
mkdir(DEBUG_DIR, 0777, true);
5757
}
5858

59-
/* If we are running the .phpt directly, don't mess with the ini settings */
60-
if (substr($_SERVER["PHP_SELF"], -5) != ".phpt") {
59+
/* If the INI option hasn't been changed, then lets set it to the debug log */
60+
$ininame = "phongo.debug_log";
61+
$origin = ini_get($ininame);
62+
ini_restore($ininame);
63+
if ($ininame == $origin) {
6164
ini_set("phongo.debug_log", DEBUG_FILENAME);
6265
file_put_contents(DEBUG_FILENAME, sprintf("===> %s <=== %s\n", date(DATE_ISO8601), $_SERVER["SCRIPT_FILENAME"]), FILE_APPEND);
6366
}

0 commit comments

Comments
 (0)