Re: DB_DataObject setup question
| From: | Alan Knowles | Date: | Fri, 19 Dec 2003 07:56:40 +0000 |
| Subject: | Re: DB_DataObject setup question | ||
| References: | 1 | Groups: | php.pear.general php.pear.general |
| Request: | Send a blank email to pear-general+get-9698@lists.php.net to get a copy of this message | ||
Can you try updating the DB package - It looks like the query for table info is not returning anything..
Regards
Alan
Rich Ackerman wrote:
I am setting up DB_DataObject with a test postgresql database on a virtual server running under FreeBSD. When I run CreateTables.php it connects with the database and sees the tables in the database but does not list any of the attributes. I've looked all over but don't see what is wrong or and can't find solutions to this type of startup problem. I'm expecting to see lines like:-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.comvar $street; // string var $postcode; // string var $city; // string var $homepage; // string var $email; // stringbut they never appear. Any ideas would be gratefully received! The .ini file: ================== ; INI File for eKAPS ; Configures DB_DataObject to spit out classes for all our tables. Whoohey! [DB_DataObject] database = pgsql://sophil:password@localhost/ekaps; the default database dsnschema_location = /usr/home/sophil/usr/home/ekaps/DataObjects;directory where the database ini files are..; you can also configure manually the ini_file location (and the links is expected to be the ; insame location) for each database by using the syntax ; ini_{databaseName} = /path/to/ini/file class_location = /usr/home/sophil/usr/home/ekaps/DataObjects; directory where the Table classes are..require_prefix = DataObjects/; prefix for the 'require statement'class_prefix = DataObjects_ ; Prefix Mapping of table name to PHP Classdebug = 5; set highest debugging level;debug_ignore_updates = 0; behaviour changed in > 0.10 so that you have to manually turn of updates ; rather than it automatically being done by setting debug to > 1;dont_die = 0; if you set this to true or 1, then dataobjects will not die ; on major errors like database connection etc. or programming errors ; -you probably want to do this on a live server - and ; write a pear error handler.. - to send you an email!====================== The class it creates: <?php /** * Table Definition for SALESCALL */ require_once 'DB/DataObject.php'; class DataObjects_SALESCALL extends DB_DataObject { ###START_AUTOCODE /* the code below is auto generated do not remove the above tag */var $__table = 'SALESCALL'; // table name/* ZE2 compatibility trick*/ function __clone() { return $this;} /* Static get */ function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_SALESCALL',$k,$v); } /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE } ?> ========================= The debug dump: CREATING FOR pgsql://sophil:password@localhost/ekapsCONNECT : NEW CONNECTION CONNECT : pgsql://sophil:password@localhost/ekaps 433b907b764dede570457b20f52c41c4 CONNECT : a:1:{s:32:"433b907b764dede570457b20f52c41c4";O:8:"db_pgsql":27:{s:10:"connection";i:0;s:7:"phptype";s:5:"pgsql";s:8:"dbsyntax";s:5:"pgsql";s:14:"prepare_tokens";a:0:{}s:13:"prepare_types";a:0:{}s:19:"transaction_opcount";i:0;s:3:"dsn";a:9:{s:7:"phptype";s:5:"pgsql";s:8:"dbsyntax";s:5:"pgsql";s:8:"username";s:6:"sophil";s:8:"password";s:8:"password";s:8:"protocol";s:3:"tcp";s:8:"hostspec";s:9:"localhost";s:4:"port";b:0;s:6:"socket";b:0;s:8:"database";s:5:"ekaps";}s:3:"row";a:0:{}s:8:"num_rows";a:0:{}s:8:"affected";i:0;s:10:"autocommit";b:1;s:9:"fetchmode";i:1;s:6:"_debug";b:0;s:19:"_default_error_mode";N;s:22:"_default_error_options";N;s:22:"_default_error_handler";s:0:"";s:12:"_error_class";s:8:"DB_Error";s:16:"_expected_errors";a:0:{}s:8:"features";a:4:{s:7:"prepare";b:0;s:8:"pconnect";b:1;s:12:"transactions";b:1;s:5:"limit";s:5:"alter";}s:13:"errorcode_map";a:0:{}s:4:"type";N;s:16:"prepared_queries";N;s:15:"prepare_maxstmt";i:0;s:10:"last_query";s:0:"";s:22:"fetchmode_obj ect_class";s:8:"stdClass";s:7:"options";a:5:{s:10:"persistent";b:0;s:8:"optimize";s:11:"performance";s:5:"debug";i:0;s:14:"seqname_format";s:6:"%s_seq";s:8:"autofree";b:0;}s:3:"dbh";N;}} Generating Definitions file: /usr/home/sophil/usr/home/ekaps/DataObjects/ekaps.ini Generating Class files: writing DataObjects_SALESCALLDON E