![]() |
![]() |
This project is not completely dead. I've just started work on localisation. If you're getting a "Deprecated" error message, follow the instructions here URGENT Security Patch for ≤ v2.2.6 A security hole has been discovered, follow the instructions and download the patch at the topic page. Did the patch break your search page? Search Patch
|
![]() UPB Team Member
Posts: 837
Registered: 2006-11-22 |
Currently I have to use setFP at the beginning of each function after using global $link to set file pointers for the database tables.
Is there a way I can create a sort of global variable for each FP so I can just set them once at the beginning of the file and then just include the variables after the global $link It would tidy up the code a bit and save some gnashing of teeth trying to work out why it's not working and then finding it's a FP problem. myUPB Developer |
![]() UPB Team Member
Posts: 893
Registered: 2006-11-14 |
well you could globalize a tdb resource, with those filepointers already defined, or you could create another function "setTextDBFps(&$db)" which takes a tdb resource as it's only argument and runs the setFp() commands there.
As far as debugging, any TextDB function, that needs an fp in it's arguemtns, that you call will check to make sure you set that fp, otherwise it will generate an error. Depending how you setup TextDB to handle errors, it will either print it out or trigger an error. So you might want to check your error_report() settings. --Jerroyd Moore
Bachelors of Science, Computer Science 2011 Jack Baskin School of Engineering University of California, Santa Cruz |
![]() UPB Team Member
Posts: 1036
Registered: 2006-11-14 |
just pass your textdb class variable by reference to all your functions like:
$tdb = new tdb(directory, textdb); $tdb->setFp("blah", "mytable"); function whatever($someVar, &$tdb) { $myQuery = $tdb->query("blah", "name='bob'"); } by doing this, you could even set new file pointers in each of your functions and they would be accessable outside of your functions (as long as the function had been run first) Tim Hoeppner
UPB Programmer B. Sc. in Electrical Engineering |
|
Last edited by: Pilot on Feb 13, 2007 2:35:35 am
| |