1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 07:06:30 +02:00

Closes #5486 Added custom dbg() helper function for quick output to console.

This commit is contained in:
camer0n
2025-05-02 03:36:28 -07:00
parent cc5725d8c2
commit 08b3c6f2b1
2 changed files with 101 additions and 52 deletions

112
e107_tests/composer.lock generated
View File

@@ -365,22 +365,22 @@
},
{
"name": "codeception/module-asserts",
"version": "3.0.0",
"version": "3.1.0",
"source": {
"type": "git",
"url": "https://github.com/Codeception/module-asserts.git",
"reference": "1b6b150b30586c3614e7e5761b31834ed7968603"
"reference": "c58281f3d741599c81676bcb92996cf1e22d9ffd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/module-asserts/zipball/1b6b150b30586c3614e7e5761b31834ed7968603",
"reference": "1b6b150b30586c3614e7e5761b31834ed7968603",
"url": "https://api.github.com/repos/Codeception/module-asserts/zipball/c58281f3d741599c81676bcb92996cf1e22d9ffd",
"reference": "c58281f3d741599c81676bcb92996cf1e22d9ffd",
"shasum": ""
},
"require": {
"codeception/codeception": "*@dev",
"codeception/lib-asserts": "^2.0",
"php": "^8.0"
"php": "^8.1"
},
"conflict": {
"codeception/codeception": "<5.0"
@@ -416,9 +416,9 @@
],
"support": {
"issues": "https://github.com/Codeception/module-asserts/issues",
"source": "https://github.com/Codeception/module-asserts/tree/3.0.0"
"source": "https://github.com/Codeception/module-asserts/tree/3.1.0"
},
"time": "2022-02-16T19:48:08+00:00"
"time": "2025-04-24T17:18:25+00:00"
},
{
"name": "codeception/module-db",
@@ -1092,16 +1092,16 @@
},
{
"name": "myclabs/deep-copy",
"version": "1.13.0",
"version": "1.13.1",
"source": {
"type": "git",
"url": "https://github.com/myclabs/DeepCopy.git",
"reference": "024473a478be9df5fdaca2c793f2232fe788e414"
"reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414",
"reference": "024473a478be9df5fdaca2c793f2232fe788e414",
"url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/1720ddd719e16cf0db4eb1c6eca108031636d46c",
"reference": "1720ddd719e16cf0db4eb1c6eca108031636d46c",
"shasum": ""
},
"require": {
@@ -1140,7 +1140,7 @@
],
"support": {
"issues": "https://github.com/myclabs/DeepCopy/issues",
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.0"
"source": "https://github.com/myclabs/DeepCopy/tree/1.13.1"
},
"funding": [
{
@@ -1148,7 +1148,7 @@
"type": "tidelift"
}
],
"time": "2025-02-12T12:17:51+00:00"
"time": "2025-04-29T12:36:36+00:00"
},
{
"name": "nikic/php-parser",
@@ -1394,16 +1394,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "12.1.0",
"version": "12.1.2",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "d331a5ced3d9a2b917baa9841b2211e72f9e780d"
"reference": "05c33d01a856f9f62488d144bafddc3d7b7a4ebb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/d331a5ced3d9a2b917baa9841b2211e72f9e780d",
"reference": "d331a5ced3d9a2b917baa9841b2211e72f9e780d",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/05c33d01a856f9f62488d144bafddc3d7b7a4ebb",
"reference": "05c33d01a856f9f62488d144bafddc3d7b7a4ebb",
"shasum": ""
},
"require": {
@@ -1459,7 +1459,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.1.0"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/12.1.2"
},
"funding": [
{
@@ -1467,7 +1467,7 @@
"type": "github"
}
],
"time": "2025-03-17T13:56:07+00:00"
"time": "2025-04-03T14:34:39+00:00"
},
{
"name": "phpunit/php-file-iterator",
@@ -1716,16 +1716,16 @@
},
{
"name": "phpunit/phpunit",
"version": "12.0.10",
"version": "12.1.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "6075843014de23bcd6992842d69ca99d25d6a433"
"reference": "5ee57ad690bda2c487594577600931a99053436c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6075843014de23bcd6992842d69ca99d25d6a433",
"reference": "6075843014de23bcd6992842d69ca99d25d6a433",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5ee57ad690bda2c487594577600931a99053436c",
"reference": "5ee57ad690bda2c487594577600931a99053436c",
"shasum": ""
},
"require": {
@@ -1735,11 +1735,11 @@
"ext-mbstring": "*",
"ext-xml": "*",
"ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.13.0",
"myclabs/deep-copy": "^1.13.1",
"phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1",
"php": ">=8.3",
"phpunit/php-code-coverage": "^12.1.0",
"phpunit/php-code-coverage": "^12.1.2",
"phpunit/php-file-iterator": "^6.0.0",
"phpunit/php-invoker": "^6.0.0",
"phpunit/php-text-template": "^5.0.0",
@@ -1761,7 +1761,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-main": "12.0-dev"
"dev-main": "12.1-dev"
}
},
"autoload": {
@@ -1793,7 +1793,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.0.10"
"source": "https://github.com/sebastianbergmann/phpunit/tree/12.1.4"
},
"funding": [
{
@@ -1804,12 +1804,20 @@
"url": "https://github.com/sebastianbergmann",
"type": "github"
},
{
"url": "https://liberapay.com/sebastianbergmann",
"type": "liberapay"
},
{
"url": "https://thanks.dev/u/gh/sebastianbergmann",
"type": "thanks_dev"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
"type": "tidelift"
}
],
"time": "2025-03-23T16:03:59+00:00"
"time": "2025-05-02T07:01:56+00:00"
},
{
"name": "psr/container",
@@ -3132,16 +3140,16 @@
},
{
"name": "symfony/console",
"version": "v7.2.5",
"version": "v7.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "e51498ea18570c062e7df29d05a7003585b19b88"
"reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/e51498ea18570c062e7df29d05a7003585b19b88",
"reference": "e51498ea18570c062e7df29d05a7003585b19b88",
"url": "https://api.github.com/repos/symfony/console/zipball/0e2e3f38c192e93e622e41ec37f4ca70cfedf218",
"reference": "0e2e3f38c192e93e622e41ec37f4ca70cfedf218",
"shasum": ""
},
"require": {
@@ -3205,7 +3213,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v7.2.5"
"source": "https://github.com/symfony/console/tree/v7.2.6"
},
"funding": [
{
@@ -3221,7 +3229,7 @@
"type": "tidelift"
}
],
"time": "2025-03-12T08:11:12+00:00"
"time": "2025-04-07T19:09:28+00:00"
},
{
"name": "symfony/css-selector",
@@ -4106,16 +4114,16 @@
},
{
"name": "symfony/string",
"version": "v7.2.0",
"version": "v7.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "446e0d146f991dde3e73f45f2c97a9faad773c82"
"reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82",
"reference": "446e0d146f991dde3e73f45f2c97a9faad773c82",
"url": "https://api.github.com/repos/symfony/string/zipball/a214fe7d62bd4df2a76447c67c6b26e1d5e74931",
"reference": "a214fe7d62bd4df2a76447c67c6b26e1d5e74931",
"shasum": ""
},
"require": {
@@ -4173,7 +4181,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v7.2.0"
"source": "https://github.com/symfony/string/tree/v7.2.6"
},
"funding": [
{
@@ -4189,20 +4197,20 @@
"type": "tidelift"
}
],
"time": "2024-11-13T13:31:26+00:00"
"time": "2025-04-20T20:18:16+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v7.2.3",
"version": "v7.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "82b478c69745d8878eb60f9a049a4d584996f73a"
"reference": "9c46038cd4ed68952166cf7001b54eb539184ccb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/82b478c69745d8878eb60f9a049a4d584996f73a",
"reference": "82b478c69745d8878eb60f9a049a4d584996f73a",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/9c46038cd4ed68952166cf7001b54eb539184ccb",
"reference": "9c46038cd4ed68952166cf7001b54eb539184ccb",
"shasum": ""
},
"require": {
@@ -4256,7 +4264,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v7.2.3"
"source": "https://github.com/symfony/var-dumper/tree/v7.2.6"
},
"funding": [
{
@@ -4272,20 +4280,20 @@
"type": "tidelift"
}
],
"time": "2025-01-17T11:39:41+00:00"
"time": "2025-04-09T08:14:01+00:00"
},
{
"name": "symfony/yaml",
"version": "v7.2.5",
"version": "v7.2.6",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912"
"reference": "0feafffb843860624ddfd13478f481f4c3cd8b23"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
"reference": "4c4b6f4cfcd7e52053f0c8bfad0f7f30fb924912",
"url": "https://api.github.com/repos/symfony/yaml/zipball/0feafffb843860624ddfd13478f481f4c3cd8b23",
"reference": "0feafffb843860624ddfd13478f481f4c3cd8b23",
"shasum": ""
},
"require": {
@@ -4328,7 +4336,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v7.2.5"
"source": "https://github.com/symfony/yaml/tree/v7.2.6"
},
"funding": [
{
@@ -4344,7 +4352,7 @@
"type": "tidelift"
}
],
"time": "2025-03-03T07:12:39+00:00"
"time": "2025-04-04T10:10:11+00:00"
},
{
"name": "theseer/tokenizer",

View File

@@ -147,4 +147,45 @@ class E107TestSuiteBootstrap
}
}
if(!function_exists('dbg'))
{
/**
* Custom Debug To Console function - Part of _bootstrap.php
*
* @param mixed $data
* @return void
*/
function dbg($data): void
{
$bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
$line = $bt[0]['line'] ?? '?';
if(is_array($data) || is_object($data))
{
$output = print_r($data, true) . PHP_EOL;
}
elseif(is_bool($data))
{
$output = ($data ? 'true' : 'false') . PHP_EOL;
}
elseif(is_null($data))
{
$output = 'null' . PHP_EOL;
}
elseif(is_string($data))
{
$output = "\"" . $data . "\"" . PHP_EOL; // wrap string in double quotes
}
else
{
$output = $data . PHP_EOL; // other scalars (ints, floats) as-is
}
fwrite(STDERR, "DEBUG (Line: $line): " . $output);
}
}
new E107TestSuiteBootstrap;