Source for file your_config.php
Documentation is available at your_config.php
* This file contains an example config file providing default
* connection information and paths for PhpMyObject.
* This file is part of the PhpMyObject project.
* For questions, help, comments, discussion, etc., please join our
* forum at {@link http://www.developpez.net/forums/forumdisplay.php?f=770}
* or our mailing list at {@link http://groups.google.com/group/pmo-dev}.
* PhpMyProject is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* @author Nicolas Boiteux <nicolas_boiteux@yahoo.fr>
* @link http://pmo.developpez.com/
* @since PhpMyObject v0.14
* @copyright Copyright (C) 2007-2008 Nicolas Boiteux
* @license GPLv3 {@link http://www.gnu.org/licenses/gpl}
* setup PMO configuration
* Note: you can name you config file anyway you want. This is just
* <b>the database connection properties</b>
* - 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
* <b>the PMO_MyController.OBJECT_COLLECTOR_NAME property</b>
* Defaults to "collector"
* <b>the PMO_MyDbms.LOG property</b>
* TRUE to activate the logging system, FALSE otherwise.
* If set to TRUE, this will log every query made.
* YOU SHOULD NEVER LEAVE THIS TO TRUE IN PRODUCTION.
* <b>the PMO_MyDbms.LOGFORMAT property</b>
* Format of the date/time tags prefixing the text.
* Defaults to Y-m-d H:i:s
* <b>the PMO_MyObject.CLASSPATH property</b>
* 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
* Defaults to <installdir>/class_loader/
* See {@link class_film_actor.php}
* <b>the PMO_MyObject.CLASS_FILENAME_PREFIX property</b>
* 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
* <b>the PMO_MyTable.CLASS_WRITE_ON_DISK property</b>
* 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.
* <b>the PMO_MyTable.CLASSPATH property</b>
* 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 <installdir>/PMO_core/PMO_MyTable/
* <b>the PMO_MyTable.CLASS_FILENAME_PREFIX property</b>
* 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
* <b>the PMO_MyMemCache.ACTIVE property</b>
* 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.
* <b>the PMO_MyMemCache.HOST property</b>
* The Memcache server name
* <b>the PMO_MyMemCache.PORT property</b>
* <b>the PMO_MyMemCache.TIMEOUT property</b>
* 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
// 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');
$config->set('PMO_MyController.OBJECT_COLLECTOR_NAME', 'collector');
// 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
$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
$config->set('PMO_MyMemCache.ACTIVE', FALSE);
$config->set('PMO_MyMemCache.HOST', '');
$config->set('PMO_MyMemCache.PORT', '');
$config->set('PMO_MyMemCache.TIMEOUT', 10);
|