PhpMyObject
[ class tree: PhpMyObject ] [ index: PhpMyObject ] [ all elements ]

Source for file your_config.php

Documentation is available at your_config.php

  1. <?php
  2. /**
  3.  * This file contains an example config file providing default
  4.  * connection information and paths for PhpMyObject.
  5.  *
  6.  * This file is part of the PhpMyObject project.
  7.  * 
  8.  * For questions, help, comments, discussion, etc., please join our
  9.  * forum at {@link http://www.developpez.net/forums/forumdisplay.php?f=770}
  10.  * or our mailing list at {@link http://groups.google.com/group/pmo-dev}.
  11.  *
  12.  * PhpMyProject is free software: you can redistribute it and/or modify
  13.  * it under the terms of the GNU General Public License as published by
  14.  * the Free Software Foundation, either version 3 of the License, or
  15.  * (at your option) any later version.
  16.  *
  17.  * This program is distributed in the hope that it will be useful,
  18.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20.  * GNU General Public License for more details.
  21.  *
  22.  * You should have received a copy of the GNU General Public License
  23.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  24.  *
  25.  * @package    PhpMyObject
  26.  * @author     Nicolas Boiteux <nicolas_boiteux@yahoo.fr>
  27.  * @link       http://pmo.developpez.com/
  28.  * @since      PhpMyObject v0.14
  29.  * @version    $Revision: $
  30.  * @copyright  Copyright (C) 2007-2008 Nicolas Boiteux
  31.  * @license    GPLv3 {@link http://www.gnu.org/licenses/gpl}
  32.  * @filesource
  33.  */ 
  34.  
  35. /**
  36.  * setup PMO configuration
  37.  *
  38.  * Note: you can name you config file anyway you want. This is just
  39.  * an example.
  40.  *
  41.  * <b>the database connection properties</b>
  42.  *
  43.  * - PMO_MyDbms.DRIVER:    one of pdo, mysql, mysqli, pgsql
  44.  * - PMO_MyDbms.PDODRIVER: name of the pdodriver
  45.  * - PMO_MyDbms.HOST:      database host name, usually localhost
  46.  * - PMO_MyDbms.USER:      database username account
  47.  * - PMO_MyDbms.PASS:      database user password
  48.  * - PMO_MyDbms.BASE:      the database name
  49.  * - PMO_MyDbms.DSN:       DSN to use with the pdo driver
  50.  *
  51.  * You can also provide
  52.  *
  53.  * <b>the PMO_MyController.OBJECT_COLLECTOR_NAME property</b>
  54.  *
  55.  * Defaults to "collector"
  56.  *
  57.  * <b>the PMO_MyDbms.LOG property</b>
  58.  *
  59.  * TRUE to activate the logging system, FALSE otherwise.
  60.  * Defaults to FALSE.
  61.  *
  62.  * If set to TRUE, this will log every query made.
  63.  * YOU SHOULD NEVER LEAVE THIS TO TRUE IN PRODUCTION.
  64.  *
  65.  * <b>the PMO_MyDbms.LOGFORMAT property</b>
  66.  *
  67.  * Format of the date/time tags prefixing the text.
  68.  *
  69.  * Defaults to Y-m-d H:i:s
  70.  *
  71.  * <b>the PMO_MyObject.CLASSPATH property</b>
  72.  *
  73.  * Defines the location of the class_loader/ directory where you
  74.  * can extend the persistent classes generated by PMO_MyDbms.
  75.  *
  76.  * Use this to specify a different location for your classes if you
  77.  * develop many projects under the same domain. This way,
  78.  * projectA User class won't interfere with projectB User class.
  79.  *
  80.  * You will need to activate PMO_MyTable.CLASS_WRITE_ON_DISK below
  81.  * to use this.
  82.  * 
  83.  * Defaults to <installdir>/class_loader/
  84.  * See {@link class_film_actor.php}
  85.  *
  86.  * <b>the PMO_MyObject.CLASS_FILENAME_PREFIX property</b>
  87.  *
  88.  * What prefix to use in naming the classes in class_loader/. This can be used to
  89.  * discriminate between your projects if you don't change the PMO_MyObject.CLASSPATH
  90.  * property.
  91.  *
  92.  * Defaults to "class_".
  93.  *
  94.  * <b>the PMO_MyTable.CLASS_WRITE_ON_DISK property</b>
  95.  *
  96.  * Set this to TRUE to activate PMO persistence mechanism. This will
  97.  * improve your project performances. You will also be able to use the
  98.  * class_loader extension mechanism.
  99.  * 
  100.  * Defaults to FALSE.
  101.  *
  102.  * <b>the PMO_MyTable.CLASSPATH property</b>
  103.  *
  104.  * Defines the location of the PMO_MyTable/ directory where PMO
  105.  * write persistent classed corresponding to your datyabase tables.
  106.  *
  107.  * Use this to specify a different location for your classes if you
  108.  * develop many projects under the same domain. This way,
  109.  * projectA User class won't interfere with projectB User class.
  110.  * 
  111.  * Defaults to <installdir>/PMO_core/PMO_MyTable/
  112.  *
  113.  * <b>the PMO_MyTable.CLASS_FILENAME_PREFIX property</b>
  114.  *
  115.  * What prefix to use in naming the classes in PMO_MyTable/. This can be used to
  116.  * discriminate between your projects if you don't change the PMO_MyTable.CLASSPATH
  117.  * variable.
  118.  *
  119.  * <b>the PMO_MyMemCache.ACTIVE property</b>
  120.  *
  121.  * set this to TRUE to active the MemCache caching system. YOU DO NEED to have
  122.  * the MemCache extension installed and configured to use this.
  123.  *
  124.  * See the PHP manual page here {@link http://php.net/manual/en/book.memcache.php}
  125.  * to learn how to use this.
  126.  *
  127.  * <b>the PMO_MyMemCache.HOST property</b>
  128.  *
  129.  * The Memcache server name
  130.  *
  131.  * <b>the PMO_MyMemCache.PORT property</b>
  132.  *
  133.  * The port to use.
  134.  *
  135.  * <b>the PMO_MyMemCache.TIMEOUT property</b>
  136.  *
  137.  * How long the server will cache the data.
  138.  *
  139.  * Defaults to 10 seconds.
  140.  *
  141.  *
  142.  * @global object $config         this gets unset once the configuration has been setup
  143.  *
  144.  * @todo                             We need to explain what is the use of the
  145.  *                                      PMO_MyController.OBJECT_COLLECTOR_NAME property
  146.  */
  147. $config PMO_MyConfig::factory();
  148.  
  149. // setup your database connection here
  150. $config->set('PMO_MyDbms.DRIVER','mysql');
  151. $config->set('PMO_MyDbms.PDODRIVER''');
  152. $config->set('PMO_MyDbms.HOST','localhost');
  153. $config->set('PMO_MyDbms.USER','pmo');
  154. $config->set('PMO_MyDbms.PASS','pmo');
  155. $config->set('PMO_MyDbms.BASE','sakila');
  156. $config->set('PMO_MyDbms.DSN','sqlite:pmo.db');
  157.  
  158.  
  159. // collector name
  160. $config->set('PMO_MyController.OBJECT_COLLECTOR_NAME''collector');
  161.  
  162.  
  163. // logging facilities
  164. // NEVER LEAVE THIS TO TRUE IN PRODUCTION
  165. $config->set('PMO_MyDbms.LOG'FALSE);
  166. $config->set('PMO_MyDbms.LOG_FORMAT''Y-m-d H:i:s');
  167.  
  168.  
  169. // this is where your PMO_Object extending classes will live
  170. // you need to activate PMO_MyTable.CLASS_WRITE_ON_DISK below
  171. // to be able to use this
  172. $config->set('PMO_MyObject.CLASSPATH'dirname(__FILE__).'/class_loader/')
  173. $config->set('PMO_MyObject.CLASS_FILENAME_PREFIX''class_');
  174.  
  175.  
  176. // this is where PMO will persist the PMO_object objects.
  177. // this can speed up your project a lot since PMO will use
  178. // the classes stored here instead of having to hit the database
  179. // every time to get the tables schema.
  180. // This is not activated by default because when we start a new
  181. // project, the database schema is very often in flux and persisting
  182. // these classes would force you to delete them every time you
  183. // make a schema change. Forgetting to do it would probably cause 
  184. // a lot of headaches.
  185. $config->set('PMO_MyTable.CLASS_WRITE_ON_DISK'FALSE);
  186. $config->set('PMO_MyTable.CLASSPATH'dirname(__FILE__).'/PMO_core/PMO_MyTable/');
  187. $config->set('PMO_MyTable.CLASS_FILENAME_PREFIX''PMO_MyTable_');
  188.  
  189.  
  190. // if you have MemCache installed and running, you can configure
  191. // your host here
  192. $config->set('PMO_MyMemCache.ACTIVE'FALSE);
  193. $config->set('PMO_MyMemCache.HOST''');
  194. $config->set('PMO_MyMemCache.PORT''');
  195. $config->set('PMO_MyMemCache.TIMEOUT'10);
  196.  
  197. ?>

Documentation generated on Wed, 15 Oct 2008 09:18:21 -0400 by phpDocumentor 1.4.1