Commit | Line | Data |
---|---|---|
eb049397 DL |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
232624b1 | 4 | | CiviCRM version 4.4 | |
eb049397 DL |
5 | +--------------------------------------------------------------------+ |
6 | | Copyright CiviCRM LLC (c) 2004-2013 | | |
7 | +--------------------------------------------------------------------+ | |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | ||
28 | /** | |
29 | * CiviCRM Configuration File. | |
30 | */ | |
31 | ||
32 | /** | |
33 | * Content Management System (CMS) Host: | |
34 | * | |
35 | * CiviCRM can be hosted in either Drupal 6 or 7, Joomla or WordPress. | |
36 | * | |
37 | * Settings for Drupal 7.x: | |
38 | * define( 'CIVICRM_UF' , 'Drupal' ); | |
39 | * | |
40 | * Settings for Drupal 6.x: | |
41 | * define( 'CIVICRM_UF' , 'Drupal6' ); | |
42 | * | |
43 | * Settings for Joomla 1.7.x - 2.5.x: | |
44 | * define( 'CIVICRM_UF' , 'Joomla' ); | |
45 | * | |
46 | * Settings for WordPress 3.3.x: | |
47 | * define( 'CIVICRM_UF' , 'WordPress' ); | |
48 | * | |
49 | * You may have issues with images in CiviCRM. If this is the case, be sure | |
50 | * to update the CiviCRM Resource URL field to your CiviCRM root directory | |
51 | * (Administer::System Settings::Resource URLs). | |
52 | */ | |
53 | define( 'CIVICRM_UF' , '%%cms%%' ); | |
54 | ||
55 | /** | |
56 | * Content Management System (CMS) Datasource: | |
57 | * | |
58 | * Update this setting with your CMS (Drupal or Joomla) database username, server and DB name. | |
59 | * Datasource (DSN) format: | |
60 | * define( 'CIVICRM_UF_DSN', 'mysql://cms_db_username:cms_db_password@db_server/cms_database?new_link=true'); | |
61 | */ | |
62 | define( 'CIVICRM_UF_DSN' , 'mysql://%%CMSdbUser%%:%%CMSdbPass%%@%%CMSdbHost%%/%%CMSdbName%%?new_link=true' ); | |
63 | ||
64 | /** | |
65 | * CiviCRM Database Settings | |
66 | * | |
67 | * Database URL (CIVICRM_DSN) for CiviCRM Data: | |
68 | * Database URL format: | |
69 | * define( 'CIVICRM_DSN', 'mysql://crm_db_username:crm_db_password@db_server/crm_database?new_link=true'); | |
70 | * | |
71 | * Drupal and CiviCRM can share the same database, or can be installed into separate databases. | |
72 | * | |
73 | * EXAMPLE: Drupal and CiviCRM running in the same database... | |
74 | * DB Name = drupal, DB User = drupal | |
75 | * define( 'CIVICRM_DSN' , 'mysql://drupal:YOUR_PASSWORD@localhost/drupal?new_link=true' ); | |
76 | * | |
77 | * EXAMPLE: Drupal and CiviCRM running in separate databases... | |
78 | * Drupal DB Name = drupal, DB User = drupal | |
79 | * CiviCRM DB Name = civicrm, CiviCRM DB User = civicrm | |
80 | * define( 'CIVICRM_DSN' , 'mysql://civicrm:YOUR_PASSWORD@localhost/civicrm?new_link=true' ); | |
81 | * | |
82 | */ | |
83 | define( 'CIVICRM_DSN' , 'mysql://%%dbUser%%:%%dbPass%%@%%dbHost%%/%%dbName%%?new_link=true' ); | |
84 | ||
85 | /** | |
86 | * CiviCRM Logging Database | |
87 | * | |
88 | * Used to point to a different database to use for logging (if desired). If unset defaults to equal CIVICRM_DSN. | |
89 | * The CIVICRM_DSN user needs to have the rights to modify the below database schema and be able to write to it. | |
90 | */ | |
91 | define('CIVICRM_LOGGING_DSN', CIVICRM_DSN); | |
92 | ||
93 | /** | |
94 | * File System Paths: | |
95 | * | |
96 | * $civicrm_root is the file system path on your server where the civicrm | |
97 | * code is installed. Use an ABSOLUTE path (not a RELATIVE path) for this setting. | |
98 | * | |
99 | * CIVICRM_TEMPLATE_COMPILEDIR is the file system path where compiled templates are stored. | |
100 | * These sub-directories and files are temporary caches and will be recreated automatically | |
101 | * if deleted. | |
102 | * | |
103 | * IMPORTANT: The COMPILEDIR directory must exist, | |
104 | * and your web server must have read/write access to these directories. | |
105 | * | |
106 | * | |
107 | * EXAMPLE - Drupal: | |
108 | * If the path to the Drupal home directory is /var/www/htdocs/drupal | |
109 | * the $civicrm_root setting would be: | |
110 | * $civicrm_root = '/var/www/htdocs/drupal/sites/all/modules/civicrm/'; | |
111 | * | |
112 | * the CIVICRM_TEMPLATE_COMPILEDIR would be: | |
113 | * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/drupal/sites/default/files/civicrm/templates_c/' ); | |
114 | * | |
115 | * EXAMPLE - Joomla Installations: | |
116 | * If the path to the Joomla home directory is /var/www/htdocs/joomla | |
117 | * the $civicrm_root setting would be: | |
118 | * $civicrm_root = '/var/www/htdocs/joomla/administrator/components/com_civicrm/civicrm/'; | |
119 | * | |
120 | * the CIVICRM_TEMPLATE_COMPILEDIR would be: | |
121 | * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/joomla/media/civicrm/templates_c/' ); | |
122 | * | |
123 | * EXAMPLE - WordPress Installations: | |
124 | * If the path to the WordPress home directory is /var/www/htdocs/wordpress | |
125 | * the $civicrm_root setting would be: | |
126 | * $civicrm_root = '/var/www/htdocs/wordpress/wp-content/plugins/civicrm/civicrm/'; | |
127 | * | |
128 | * the CIVICRM_TEMPLATE_COMPILEDIR would be: | |
129 | * define( 'CIVICRM_TEMPLATE_COMPILEDIR', '/var/www/htdocs/wordpress/wp-content/plugins/files/civicrm/templates_c/' ); | |
130 | * | |
131 | */ | |
132 | ||
133 | global $civicrm_root; | |
134 | ||
135 | $civicrm_root = '%%crmRoot%%'; | |
136 | define( 'CIVICRM_TEMPLATE_COMPILEDIR', '%%templateCompileDir%%' ); | |
137 | ||
138 | /** | |
139 | * Site URLs: | |
140 | * | |
141 | * This section defines absolute and relative URLs to access the host CMS (Drupal or Joomla) resources. | |
142 | * | |
143 | * IMPORTANT: Trailing slashes should be used on all URL settings. | |
144 | * | |
145 | * | |
146 | * EXAMPLE - Drupal Installations: | |
147 | * If your site's home url is http://www.example.com/drupal/ | |
148 | * these variables would be set as below. Modify as needed for your install. | |
149 | * | |
150 | * CIVICRM_UF_BASEURL - home URL for your site: | |
151 | * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/drupal/' ); | |
152 | * | |
153 | * EXAMPLE - Joomla Installations: | |
154 | * If your site's home url is http://www.example.com/joomla/ | |
155 | * | |
156 | * CIVICRM_UF_BASEURL - home URL for your site: | |
157 | * Administration site: | |
158 | * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/administrator/' ); | |
159 | * Front-end site: | |
160 | * define( 'CIVICRM_UF_BASEURL' , 'http://www.example.com/joomla/' ); | |
161 | * | |
162 | */ | |
163 | define( 'CIVICRM_UF_BASEURL' , '%%baseURL%%' ); | |
164 | ||
165 | /* | |
166 | * If you are using any CiviCRM script in the bin directory that | |
167 | * requires authentication, then you also need to set this key. | |
168 | * We recommend using a 16-32 bit alphanumeric/punctuation key. | |
169 | * More info at http://wiki.civicrm.org/confluence/display/CRMDOC/Command-line+Script+Configuration | |
170 | */ | |
171 | define( 'CIVICRM_SITE_KEY', '%%siteKey%%' ); | |
172 | ||
173 | /** | |
174 | * Enable this constant, if you want to send your email through the smarty | |
175 | * templating engine(allows you to do conditional and more complex logic) | |
176 | * | |
177 | */ | |
178 | define( 'CIVICRM_MAIL_SMARTY', 0 ); | |
179 | ||
180 | /** | |
181 | * This setting logs all emails to a file. Useful for debugging any mail (or civimail) issues. | |
182 | * Enabling this setting will not send any email, ensure this is commented out in production | |
183 | * The CIVICRM_MAIL_LOG is a debug option which disables MTA (mail transport agent) interaction. | |
184 | * You must disable CIVICRM_MAIL_LOG before CiviCRM will talk to your MTA. | |
185 | */ | |
186 | // define( 'CIVICRM_MAIL_LOG', '%%templateCompileDir%%/mail.log' ); | |
187 | ||
188 | define( 'CIVICRM_DOMAIN_ID' , 1 ); | |
189 | ||
190 | /** | |
191 | * Settings to enable external caching using a Memcache server. This is an | |
192 | * advanced feature, and you should read and understand the documentation | |
193 | * before you turn it on. We cannot store these settings in the DB since the | |
194 | * config could potentially also be cached and we need to avoid an infinite | |
195 | * recursion scenario. | |
196 | * | |
197 | * @see http://civicrm.org/node/126 | |
198 | */ | |
199 | ||
200 | /** | |
201 | * If you have a memcache server configured and want CiviCRM to make use of it, | |
202 | * set the following constant. You should only set this once you have your memcache | |
203 | * server up and working, because CiviCRM will not start up if your server is | |
204 | * unavailable on the host and port that you specify. By default CiviCRM will use | |
205 | * an in-memory array cache | |
206 | * | |
207 | * To use the php extension memcache use a value of 'Memcache' | |
208 | * To use the php extension memcached use a value of 'Memcached' | |
209 | * To use the php extension apc use a value of 'APCcache' | |
210 | * To not use any caching (not recommended), use a value of 'NoCache' | |
211 | * | |
212 | */ | |
213 | define( 'CIVICRM_DB_CACHE_CLASS', 'ArrayCache' ); | |
214 | ||
215 | /** | |
216 | * Change this to the IP address of your cache server if it is not on the | |
217 | * same machine (Unix). | |
218 | */ | |
219 | define( 'CIVICRM_DB_CACHE_HOST', 'localhost' ); | |
220 | ||
221 | /** | |
222 | * Change this if you are not using the standard port for memcache or apccache (11211) | |
223 | */ | |
224 | define( 'CIVICRM_DB_CACHE_PORT', 11211 ); | |
225 | ||
226 | /** | |
227 | * Items in cache will expire after the number of seconds specified here. | |
228 | * Default value is 3600 (i.e., after an hour) | |
229 | */ | |
230 | define( 'CIVICRM_DB_CACHE_TIMEOUT', 3600 ); | |
231 | ||
232 | /** | |
233 | * If you are sharing the same memcache instance with more than one CiviCRM | |
234 | * database, you will need to set a different value for the following argument | |
235 | * so that each copy of CiviCRM will not interfere with other copies. If you only | |
236 | * have one copy of CiviCRM, you may leave this set to ''. A good value for | |
237 | * this if you have two servers might be 'server1_' for the first server, and | |
238 | * 'server2_' for the second server. | |
239 | */ | |
240 | define( 'CIVICRM_MEMCACHE_PREFIX', '' ); | |
241 | ||
242 | /** | |
243 | * If you have multilingual site and you are using the "inherit CMS language" | |
244 | * configuration option, but wish to, for example, use fr_CA instead of the | |
245 | * default fr_FR (for French), set one or more of the constants below to an | |
246 | * appropriate regional value. | |
247 | */ | |
248 | // define('CIVICRM_LANGUAGE_MAPPING_FR', 'fr_CA'); | |
249 | // define('CIVICRM_LANGUAGE_MAPPING_EN', 'en_CA'); | |
250 | // define('CIVICRM_LANGUAGE_MAPPING_ES', 'es_MX'); | |
251 | // define('CIVICRM_LANGUAGE_MAPPING_PT', 'pt_BR'); | |
252 | // define('CIVICRM_LANGUAGE_MAPPING_ZH', 'zh_TW'); | |
253 | ||
de67bc86 ML |
254 | /** |
255 | * Native gettext improves performance of localized CiviCRM installations | |
256 | * significantly. However, your host must enable the locale (language). | |
257 | * On most GNU/Linux, Unix or MacOSX systems, you may view them with | |
258 | * the command line by typing: "locale -a". | |
259 | * | |
260 | * On Debian or Ubuntu, you may reconfigure locales with: | |
261 | * # dpkg-reconfigure locales | |
262 | * | |
263 | * For more information: | |
264 | * http://wiki.civicrm.org/confluence/x/YABFBQ | |
265 | */ | |
266 | // define('CIVICRM_GETTEXT_NATIVE', 1); | |
267 | ||
eb049397 DL |
268 | /** |
269 | * Configure MySQL to throw more errors when encountering unusual SQL expressions. | |
270 | * | |
271 | * If undefined, the value is determined automatically. For CiviCRM tarballs, it defaults | |
272 | * to FALSE; for SVN checkouts, it defaults to TRUE. | |
273 | */ | |
274 | // define( 'CIVICRM_MYSQL_STRICT', TRUE ); | |
275 | ||
276 | /** | |
277 | * | |
278 | * Do not change anything below this line. Keep as is | |
279 | * | |
280 | */ | |
281 | ||
282 | $include_path = '.' . PATH_SEPARATOR . | |
283 | $civicrm_root . PATH_SEPARATOR . | |
284 | $civicrm_root . DIRECTORY_SEPARATOR . 'packages' . PATH_SEPARATOR . | |
285 | get_include_path( ); | |
286 | if ( set_include_path( $include_path ) === false ) { | |
287 | echo "Could not set the include path<p>"; | |
288 | exit( ); | |
289 | } | |
290 | ||
291 | if ( function_exists( 'variable_get' ) && variable_get('clean_url', '0') != '0' ) { | |
292 | define( 'CIVICRM_CLEANURL', 1 ); | |
293 | } else { | |
294 | define( 'CIVICRM_CLEANURL', 0 ); | |
295 | } | |
296 | ||
297 | // force PHP to auto-detect Mac line endings | |
298 | ini_set('auto_detect_line_endings', '1'); | |
299 | ||
300 | // make sure the memory_limit is at least 64 MB | |
301 | $memLimitString = trim(ini_get('memory_limit')); | |
302 | $memLimitUnit = strtolower(substr($memLimitString, -1)); | |
303 | $memLimit = (int) $memLimitString; | |
304 | switch ($memLimitUnit) { | |
305 | case 'g': $memLimit *= 1024; | |
306 | case 'm': $memLimit *= 1024; | |
307 | case 'k': $memLimit *= 1024; | |
308 | } | |
309 | if ($memLimit >= 0 and $memLimit < 134217728) { | |
310 | ini_set('memory_limit', '128M'); | |
311 | } | |
312 | ||
313 | require_once 'CRM/Core/ClassLoader.php'; | |
314 | CRM_Core_ClassLoader::singleton()->register(); |