forked from code34/phpmyobject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyour_config.php
197 lines (184 loc) · 6.69 KB
/
your_config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?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
* @author Nicolas Boiteux <[email protected]>
* @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.
*
* <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
*
* @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);
?>