Firebird PHP Test Script ibtest
So back to basics. I have this working on PHP7.3 with FB3, but switching to FB5 gives a '502 Bad Gateway', now to build a table of checks to see where we are and perhaps try switching to pdo. The current demo site has been taken down currently but should be live again fairly soon.
PHP Version | Driver | FB3 | FB4 | FB5 | PDO | OODriver |
---|---|---|---|---|---|---|
7.3.33 | Unlisted | Working | 502 Bad Gateway | |||
7.4.33 | 5.0.1 | Working Update OK but ? on one test |
Working Update OK but ? on one test |
|||
8.3.19 | 3.0.1 | Failed on Create Table | Failed on Create Table | |||
8.4.5 | 5.0.1 | Failed on Create Table | Failed on Create Table | Have a working PDO version! | I've got most things working, but updating character fields is being difficult. | |
I still want to go back to address the generic driver, but now I've wrangled the pdo stuff to give me an almost fully functional script I'm a lot happier. The main problem is one that comes from Firebird itself in that creating the table to play with can't be dropped at the end of the tests, but at least the new script copes with that and actually displays all the results on multiple lines. A quick drop back to Flamerobin to kill the table helps ... after I had killed the drop table test line which was blocking it's deletion at all as it was still active. This problem also happened with Firebird 3 so it needs some other way of addressing it going forward. I seem to remember something about 'temporary tables' but perhaps just dropping and reconnecting at the end with just the drop table script?
While PDO makes a start at providing transparent functions across the different databases, a lot of the facilities I use in ADOdb have yet to be replicated, so there is still a strong case for that abstraction layer. The other thing that caused me some agro is the fact that every function needs to be wrapped in Try catch blocks, when simply providing a failure signal as the generic drivers do is a lot easier to work with. Much of the rejig is working out just how to get information from the catch block and as yet that is still a little broken. The error message that ca be displayed in the catch block is lost back in the main thread and so one can't modify flow easily. I am probably doing some of this wrong, but it is at least functional. Now to move back to the generic driver and see if I can work out juct what is going wrong there ... I suspect this also needs catch blocks so I may well laredy have the answers!
I had initially missed the subtile difference between firebird-php which is the generic driver sourced from php itself, and php-firebird, which mlazdans is hosting on github. It is an OO style interface, and I've probably spent more time playing than I should have, but I do now have crib sheets for the various classes and have a firebirdtest.php script that is almost fully functional. Still got the problem of dropping the temporary table at the end, which I've got working in a second script, but adding that at the end of the fisr script is not working. Just how do you drop the existing connection in PDO? close should work in the OO driver, but I'm still dancing around update 'PHP_TEST set c = \'PHP test\'' which is crashing the script, and I'm having my useual problems with finding any error messgages on the development stack.