Giter Club home page Giter Club logo

thingsdb-php's People

Contributors

stefanak-michal avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

thingsdb-php's Issues

Fatal error on authentication error

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:

  • Docker -> Ubuntu 24.04
  • PHP Version 8.3.6
  • ThingsDB Version 1.6.5
  • thingsdb-php Library Version 1.0.1

Query returns with fatal error

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):

  • OS: Ubuntu 24.04
  • PHP 8.3.6
  • ThingsDB Version 1.5.0-alpha15
  • thingsdb-php Library Version v1.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.