<?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/>.
 *
 * @package			PhpMyObject
 * @subpackage		PMO_Tests
 * @author			Nicolas Boiteux <nicolas_boiteux@yahoo.fr>
 * @author			Louis Lapointe <laplix@gmail.com>
 * @link				http://pmo.developpez.com/
 * @since			PhpMyObject v0.14
 * @version			$Revision$
 * @copyright		Copyright (C) 2007-2008 Nicolas Boiteux 
 * @copyright		Copyright (C) 2008 Louis Lapointe
 * @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.
 *
 * <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
 *
 * You can also provide 
 *
 * <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.
 * Defaults to FALSE.
 *
 * 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
 * to use this. 
 * 
 * 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
 * property. 
 *
 * Defaults to "class_".
 *
 * <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.
 * 
 * Defaults to FALSE.
 *
 * <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
 * variable. 
 *
 * <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>
 *
 * The port to use.
 *
 * <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
 *
 */
$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');


// for the pdo sqlite driver
//$config->set('PMO_MyDbms.DRIVER','pdo');
//$config->set('PMO_MyDbms.PDODRIVER', 'sqlite');
$config->set('PMO_MyDbms.DSN','sqlite:'.dirname(dirname(__FILE__)).DS.'__db'.DS.'pmo.db');


// collector name
// todo	need to explain what is the use of the
//			PMO_MyController.OBJECT_COLLECTOR_NAME property 
$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__).DS.'class_loader'.DS); 
$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 so would probably cause you
// a lot of headaches.
$config->set('PMO_MyTable.CLASS_WRITE_ON_DISK', FALSE);
$config->set('PMO_MyTable.CLASSPATH', dirname(__FILE__).DS.'PMO_MyTable'.DS);
$config->set('PMO_MyTable.CLASS_FILENAME_PREFIX', 'PMO_MyTable_');


// if you have MemCache installed and running, you can configure
// your host here
// Note : I didn't test this ince I can't seem to activate MemCache
//			 on my system. You mileage may vary.
$config->set('PMO_MyMemCache.ACTIVE', FALSE);
$config->set('PMO_MyMemCache.HOST', '');
$config->set('PMO_MyMemCache.PORT', '');
$config->set('PMO_MyMemCache.TIMEOUT', 10);

