help with configuring DB_DataObject
| From: | Wesley Furgiuele | Date: | Sun, 11 Sep 2005 18:58:50 +0000 |
| Subject: | help with configuring DB_DataObject | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-20900@lists.php.net to get a copy of this message | ||
I don't know if I'm missing something obvious, but I can't seem to get DB_DataObject configured.
------------CURRENT SETUP-----------------
Mac OS X Server 10.4.2
PHP 5.0.4 (module from Marc Liyanage)
MySQL 4.0.18 (Apple default installation)
Apache 1.3.33 (Apple default installation)
/Library/WebServer/Documents <-- web root
.:/usr/local/php5/lib/php <-- include_path
PEAR 1.3.5 stable
DB_DataObject 1.7.15 stable
DB 1.7.6 stable
-----------------END SETUP----------------------
As I understand it, the steps are
(1) create the .ini file
(2) create the classes with the .ini file
(3) before use, configure DB_DataObject with the .ini file
I have several databases I want to access with DB_DataObject. So, here is my config file, saved at /Library/WebServer/Documents/includes/DataObject/db_dataobject.ini:
----------------db_dataobject.ini------------------------
[DB_DataObject]
database_first = mysql//root_username:root_password@localhost/first
database_second = mysql//root_username:root_password@localhost/second
database_the_third = mysql//root_username:root_password@localhost/the_third
schema_location = /Library/WebServer/Documents/includes/DataObject/
class_location = /Library/WebServer/Documents/includes/DataObject/
require_prefix = /Library/WebServer/Documents/includes/DataObject/
class_prefix = DataObject_
debug = 3
---------------------------------------------------------------
At this point, I change directories to the DataObject directory and try to create the classes, like so:
grok: /Library/WebServer/Documents/includes/DataObject grok$ cd /usr/local/php5/lib/php/DB/DataObject
grok: /usr/local/php5/lib/php/DB/DataObject grok$ php createTables.php /Library/WebServer/Documents/includes/DataObject/db_dataobject.ini
DB_DataObject_Geneator : 0 : CREATING FOR firstPHP Fatal error: Class 'DB' not found in /usr/local/php5/lib/php/DB/DataObject/Generator.php on line 112 Fatal Error: Class 'DB' not found in /usr/local/php5/lib/php/DB/DataObject/Generator.php on line 112 I don't understand, am I missing a step or something here? I have been using DB without incident. Is there another step I am missing? I also don't really understand where parsing the ini file comes into the process. If I create a PHP file with <?php $config = parse_ini_file( "/Library/WebServer/Documents/includes/DataObject/db_dataobject.ini", TRUE ); foreach( $config as $class=>$values ) {
$options = &PEAR::getStaticProperty( $class, "options" );
$options = $values;
}
?>
and run it at the command line, it echoes the contents of the .ini file and that's pretty much it. Trying to run the createTables.php file after that still results in the above-listed error message about DB not being found.
Any help would be greatly appreciated.
Wes