. * * @package PhpMyObject * @author Nicolas Boiteux * @link http://pmo.developpez.com/ * @since PhpMyObject v0.14 * @version $Revision: $ * @copyright Copyright (C) 2007-2008 Nicolas Boiteux * @license GPLv3 {@link http://www.gnu.org/licenses/gpl} * @filesource */ /** * setup PMO configuration * * Note: you can name you config file anyway you want. This is just * an example. * * the database connection properties * * - PMO_MyDbms.DRIVER: one of pdo, mysql, mysqli, pgsql * - PMO_MyDbms.PDODRIVER: name of the pdodriver * - PMO_MyDbms.HOST: database host name, usually localhost * - PMO_MyDbms.USER: database username account * - PMO_MyDbms.PASS: database user password * - PMO_MyDbms.BASE: the database name * - PMO_MyDbms.DSN: DSN to use with the pdo driver * * You can also provide * * the PMO_MyController.OBJECT_COLLECTOR_NAME property * * Defaults to "collector" * * the PMO_MyDbms.LOG property * * TRUE to activate the logging system, FALSE otherwise. * Defaults to FALSE. * * If set to TRUE, this will log every query made. * YOU SHOULD NEVER LEAVE THIS TO TRUE IN PRODUCTION. * * the PMO_MyDbms.LOGFORMAT property * * Format of the date/time tags prefixing the text. * * Defaults to Y-m-d H:i:s * * the PMO_MyObject.CLASSPATH property * * Defines the location of the class_loader/ directory where you * can extend the persistent classes generated by PMO_MyDbms. * * Use this to specify a different location for your classes if you * develop many projects under the same domain. This way, * projectA User class won't interfere with projectB User class. * * You will need to activate PMO_MyTable.CLASS_WRITE_ON_DISK below * to use this. * * Defaults to /class_loader/ * See {@link class_film_actor.php} * * the PMO_MyObject.CLASS_FILENAME_PREFIX property * * What prefix to use in naming the classes in class_loader/. This can be used to * discriminate between your projects if you don't change the PMO_MyObject.CLASSPATH * property. * * Defaults to "class_". * * the PMO_MyTable.CLASS_WRITE_ON_DISK property * * Set this to TRUE to activate PMO persistence mechanism. This will * improve your project performances. You will also be able to use the * class_loader extension mechanism. * * Defaults to FALSE. * * the PMO_MyTable.CLASSPATH property * * Defines the location of the PMO_MyTable/ directory where PMO * write persistent classed corresponding to your datyabase tables. * * Use this to specify a different location for your classes if you * develop many projects under the same domain. This way, * projectA User class won't interfere with projectB User class. * * Defaults to /PMO_core/PMO_MyTable/ * * the PMO_MyTable.CLASS_FILENAME_PREFIX property * * What prefix to use in naming the classes in PMO_MyTable/. This can be used to * discriminate between your projects if you don't change the PMO_MyTable.CLASSPATH * variable. * * the PMO_MyMemCache.ACTIVE property * * set this to TRUE to active the MemCache caching system. YOU DO NEED to have * the MemCache extension installed and configured to use this. * * See the PHP manual page here {@link http://php.net/manual/en/book.memcache.php} * to learn how to use this. * * the PMO_MyMemCache.HOST property * * The Memcache server name * * the PMO_MyMemCache.PORT property * * The port to use. * * the PMO_MyMemCache.TIMEOUT property * * How long the server will cache the data. * * Defaults to 10 seconds. * * * @global object $config this gets unset once the configuration has been setup * * @todo We need to explain what is the use of the * PMO_MyController.OBJECT_COLLECTOR_NAME property */ $config = PMO_MyConfig::factory(); // setup your database connection here $config->set('PMO_MyDbms.DRIVER','mysql'); $config->set('PMO_MyDbms.PDODRIVER', ''); $config->set('PMO_MyDbms.HOST','localhost'); $config->set('PMO_MyDbms.USER','pmo'); $config->set('PMO_MyDbms.PASS','pmo'); $config->set('PMO_MyDbms.BASE','sakila'); $config->set('PMO_MyDbms.DSN','sqlite:pmo.db'); // collector name $config->set('PMO_MyController.OBJECT_COLLECTOR_NAME', 'collector'); // logging facilities // NEVER LEAVE THIS TO TRUE IN PRODUCTION $config->set('PMO_MyDbms.LOG', FALSE); $config->set('PMO_MyDbms.LOG_FORMAT', 'Y-m-d H:i:s'); // this is where your PMO_Object extending classes will live // you need to activate PMO_MyTable.CLASS_WRITE_ON_DISK below // to be able to use this $config->set('PMO_MyObject.CLASSPATH', dirname(__FILE__).'/class_loader/'); $config->set('PMO_MyObject.CLASS_FILENAME_PREFIX', 'class_'); // this is where PMO will persist the PMO_object objects. // this can speed up your project a lot since PMO will use // the classes stored here instead of having to hit the database // every time to get the tables schema. // This is not activated by default because when we start a new // project, the database schema is very often in flux and persisting // these classes would force you to delete them every time you // make a schema change. Forgetting to do it would probably cause // a lot of headaches. $config->set('PMO_MyTable.CLASS_WRITE_ON_DISK', FALSE); $config->set('PMO_MyTable.CLASSPATH', dirname(__FILE__).'/PMO_core/PMO_MyTable/'); $config->set('PMO_MyTable.CLASS_FILENAME_PREFIX', 'PMO_MyTable_'); // if you have MemCache installed and running, you can configure // your host here $config->set('PMO_MyMemCache.ACTIVE', FALSE); $config->set('PMO_MyMemCache.HOST', ''); $config->set('PMO_MyMemCache.PORT', ''); $config->set('PMO_MyMemCache.TIMEOUT', 10); ?>