Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
adodb and php 7 adodb-exceptions.inc.php issue? [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1393

PostPosted: Thu Feb 21, 2019 6:47 pm    Post subject: adodb and php 7 adodb-exceptions.inc.php issue? [SOLVED] Reply with quote

Apologies if this isn't a Gentoo issue, and it's likely it's not, but I'm totally at my wits end with this one: I've used dev-php/adodb with PHP and mysqli for ages. With php 5.6 all I have to do is include adodb-exceptions.inc.php in addition to adodb.inc.php and any SQL errors or connection errors raise exceptions. Here's a simple example:
Code:
$db = get_db_connection();
$a = $db->GetAll('select * from notthere');
var_dump($a);
...with an invalid table name. With php 5.6 I get this as expected:
Code:
php test2.php
PHP Fatal error:  Uncaught exception 'ADODB_Exception' with message 'mysqli error: [1146: Table 'test.notthere' doesn't exist] in EXECUTE("select * from notthere")' in /usr/share/php5/adodb/adodb-exceptions.inc.php:80
Stack trace:
#0 /usr/share/php5/adodb/adodb.inc.php(1264): adodb_throw('mysqli', 'EXECUTE', 1146, 'Table 'test...', 'select * from n...', false, Object(ADODB_mysqli))
...etc...
Yet when I enable php 7.2 is just quietly runs. The result of the call is false as I'd expect but no exception:
Code:
php test2.php
bool(false)
I've tried updating to dev-php/adodb-5.20.12 and it still doesn't work. My php.ini settings are the same as far as I know. I'm aware of the changes where some things cause a Throwable instead of an Exception class, but that doesn't appear to be involved here.

Totally out of ideas. Any suggestions would be welcome.

Tom


Last edited by tld on Thu Feb 21, 2019 7:10 pm; edited 1 time in total
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1393

PostPosted: Thu Feb 21, 2019 6:56 pm    Post subject: Reply with quote

Wow...ok. When I try a simple stripped down version including those adodb libraries this all works as expected...so there's clearly something else in my other code that's breaking this. Need to dig a bit more.

Tom
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1393

PostPosted: Thu Feb 21, 2019 7:12 pm    Post subject: Reply with quote

Oh man...got it. In my actual code I wasn't including the exception code unless display_errors was on, and it appears that the cli default for that changed from on to off between 5.6 and 7.2. Marked as resolved. Sorry for the noise.

Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum