PEAR Handbuch | ||
---|---|---|
Zurück | Nach vorne |
DB_DataObject needs to be configured before using it and auto generating classes and definitions. The easiest way to configure DB_DataObject is to use ini files (although you may also like to consider the PEAR::Config class, or your own configuration system)
Beispiel 1. This is a typical configuration file for DB_DataObject
|
To use this ini file with DB_DataObject, (and Possibly any other classes that use options like this)
Beispiel 2. Setting the default options
|
This is the default DSN to connect to your database
The Directory where the DB_DataObject database schema file is store.
DB_DataObject stores the description of the database (Tables and Columns) in an .ini file, in this directory. This information is used to determine if the column is a string and needs quotes, or should be a number (and is checked) at SQL building time. It is quite common to store the schema in the same directory as your DataObject Classes.
The Path absolute, or relative to your default include path(s), where your extended classes can be found.
This is used by the staticGet() method and the getLinks() method to auto load classes,
All the generated Classes are Named {class_prefix}ucfirst($table_name), Use this to alter the prefixed name, this is used by the staticGet() and getLinks() methods
The default debugging level (default 0=off), 1= basic sql logging,2=result logging, 3=everything
if the production option is set, then debugging is totally disabled, this is done to increase performance.
When you have multiple databases you can use the database_* to specify the dsn for each database
Beispiel 3. using multiple databases - database passwords
|
When you have multiple databases you can use the table_* configuration variables to map individual tables to different databases, for example
Beispiel 4. using multiple databases - table settings
|
The Directory where your DataObject extended Classes are.
Used by the Class Auto Builder when updating/writing to your class definitions.
The Name of your Base Class (usually DB_DataObject) is located.
If you wish to add a common layer of useful methods for all classes, you can set the extends_location and extends settings to a different class. the default is 'DB_DataObject'
The Directory where your Base Class (usually DB_DataObject) is located.
If you wish to add a common layer of useful methods for all classes, you can set the extends_location and extends settings to a different class. the default is 'DB/DataObject.php'
Zurück | Zum Anfang | Nach vorne |
Introduction | Nach oben | Auto Building |