stefanak-michal / thingsdb-php Goto Github PK
View Code? Open in Web Editor NEWPHP connector for ThingsDB
License: Apache License 2.0
PHP connector for ThingsDB
License: Apache License 2.0
When the auth() function is called with invalid credentials this causes now a PHP Fatal error.
I would expect the function to return a boolean value False.
PHP Fatal error:
Uncaught ThingsDB\\error\\PackageException: invalid username or password in /var/www/html/vendor/stefanak-michal/thingsdb-php/src/ThingsDB.php:353
Stack trace:
#0 /var/www/html/vendor/stefanak-michal/thingsdb-php/src/ThingsDB.php(267): ThingsDB\\ThingsDB->read()
#1 /var/www/html/vendor/stefanak-michal/thingsdb-php/src/ThingsDB.php(82): ThingsDB\\ThingsDB->send()
#2 /var/www/html/class/thingsdb.php(9): ThingsDB\\ThingsDB->auth()
...
Config:
Describe the bug
In a script I try to synchronize data from PHP/Mysql into Thingsdb. It runs smooth for many orderlines, but sometimes there is a strange fatal error. Hope you can clearify what is going wrong or for future usage improve the error message.
The error message:
PHP Warning: unpack(): Type v: not enough input values, need 2 values but only 0 were provided in /var/www/html/vendor/stefa
nak-michal/thingsdb-php/src/ThingsDB.php on line 333
PHP Warning: Trying to access array offset on false in /var/www/html/vendor/stefanak-michal/thingsdb-php/src/ThingsDB.php on
line 333
PHP Warning: unpack(): Type c: not enough input values, need 1 values but only 0 were provided in /var/www/html/vendor/stefa
nak-michal/thingsdb-php/src/ThingsDB.php on line 334
PHP Warning: Trying to access array offset on false in /var/www/html/vendor/stefanak-michal/thingsdb-php/src/ThingsDB.php on
line 334
PHP Fatal error: Uncaught ThingsDB\error\ConnectException: Received package type mismatch: 0 != 18 in /var/www/html/vendor/s
tefanak-michal/thingsdb-php/src/ThingsDB.php:338
Stack trace:
#0 /var/www/html/vendor/stefanak-michal/thingsdb-php/src/ThingsDB.php(267): ThingsDB\ThingsDB->read()
#1 /var/www/html/vendor/stefanak-michal/thingsdb-php/src/ThingsDB.php(112): ThingsDB\ThingsDB->send()
#2 /var/www/html/class/thingsdb.php(20): ThingsDB\ThingsDB->query()
#3 /var/www/html/cron/thingsdb.php(35): myThingsDB->query()
#4 /var/www/html/cron/thingsdb.php(15): syncOrders()
#5 {main}
thrown in /var/www/html/vendor/stefanak-michal/thingsdb-php/src/ThingsDB.php on line 338
To Reproduce
Calling $mydb->query("@:dbname", "wse(); set_order('".str_replace("'", "โ", json_encode($ord))."')");
Where set_order is a procedure defined in Thingsdb, $ord contains an array with fieldnames+values from a Mysql record with normal ASCII characters.
Desktop (please complete the following information):
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.