Compare commits

...
Author SHA1 Message Date
Chirag Aggarwal 601e5a819f strip 500 error html tags in tests 2026-03-16 11:52:41 +05:30
Chirag Aggarwal b65549ac29 chore: update database lib 2026-03-16 11:42:14 +05:30
3 changed files with 31 additions and 14 deletions
+1 -1
View File
@@ -57,7 +57,7 @@
"utopia-php/compression": "0.1.*",
"utopia-php/config": "1.*",
"utopia-php/console": "0.1.*",
"utopia-php/database": "5.*",
"utopia-php/database": "dev-chore/remove-databases as 5.3.12",
"utopia-php/detector": "0.2.*",
"utopia-php/domains": "1.*",
"utopia-php/emails": "0.6.*",
Generated
+22 -12
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "ff0d44c80f0ea7ff7d700533e5d81786",
"content-hash": "ef6c35e2f0de3e1b0311b987688ae023",
"packages": [
{
"name": "adhocore/jwt",
@@ -3850,16 +3850,16 @@
},
{
"name": "utopia-php/database",
"version": "5.3.8",
"version": "dev-chore/remove-databases",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "4920bb60afb98d4bd81f4d331765716ae1d40255"
"reference": "2242d29d815351bad23dfcbce9540280365af0a4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/4920bb60afb98d4bd81f4d331765716ae1d40255",
"reference": "4920bb60afb98d4bd81f4d331765716ae1d40255",
"url": "https://api.github.com/repos/utopia-php/database/zipball/2242d29d815351bad23dfcbce9540280365af0a4",
"reference": "2242d29d815351bad23dfcbce9540280365af0a4",
"shasum": ""
},
"require": {
@@ -3868,9 +3868,10 @@
"ext-pdo": "*",
"php": ">=8.4",
"utopia-php/cache": "1.*",
"utopia-php/framework": "0.33.*",
"utopia-php/console": "0.1.*",
"utopia-php/mongo": "1.*",
"utopia-php/pools": "1.*"
"utopia-php/pools": "1.*",
"utopia-php/validators": "0.2.*"
},
"require-dev": {
"fakerphp/faker": "1.23.*",
@@ -3880,7 +3881,7 @@
"phpunit/phpunit": "9.*",
"rregeer/phpunit-coverage-check": "0.3.*",
"swoole/ide-helper": "5.1.3",
"utopia-php/cli": "0.14.*"
"utopia-php/cli": "0.22.*"
},
"type": "library",
"autoload": {
@@ -3902,9 +3903,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/5.3.8"
"source": "https://github.com/utopia-php/database/tree/chore/remove-databases"
},
"time": "2026-03-11T01:03:34+00:00"
"time": "2026-03-15T15:05:11+00:00"
},
{
"name": "utopia-php/detector",
@@ -8431,9 +8432,18 @@
"time": "2024-11-07T12:36:22+00:00"
}
],
"aliases": [],
"aliases": [
{
"package": "utopia-php/database",
"version": "dev-chore/remove-databases",
"alias": "5.3.12",
"alias_normalized": "5.3.12.0"
}
],
"minimum-stability": "dev",
"stability-flags": {},
"stability-flags": {
"utopia-php/database": 20
},
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
+8 -1
View File
@@ -299,7 +299,14 @@ class Client
$responseHeaders['status-code'] = $responseStatus;
if ($responseStatus === 500) {
echo 'Server error(' . $method . ': ' . $path . '. Params: ' . json_encode($params) . '): ' . json_encode($responseBody) . '\n';
$errorPrefix = 'Server error(' . $method . ': ' . $path . '. Params: ' . json_encode($params) . '): ';
if (str_contains($responseType, 'text/html')) {
preg_match('/<title[^>]*>(.*?)<\/title>/si', is_string($responseBody) ? $responseBody : '', $matches);
$title = strip_tags($matches[1] ?? 'HTML response received');
echo $errorPrefix . '[HTML response] ' . $title . '\n';
} else {
echo $errorPrefix . json_encode($responseBody) . '\n';
}
}
return [