XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
config.inc.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) NAVER <http://www.navercorp.com> */
3 
10 if(version_compare(PHP_VERSION, '5.4.0', '<'))
11 {
12  @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING);
13 }
14 else
15 {
16  @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT);
17 }
18 
19 if(!defined('__XE__'))
20 {
21  exit();
22 }
23 
27 define('__ZBXE__', __XE__);
28 
32 define('__XE_VERSION__', '1.11.2');
33 define('__XE_VERSION_ALPHA__', (stripos(__XE_VERSION__, 'alpha') !== false));
34 define('__XE_VERSION_BETA__', (stripos(__XE_VERSION__, 'beta') !== false));
35 define('__XE_VERSION_RC__', (stripos(__XE_VERSION__, 'rc') !== false));
36 define('__XE_VERSION_STABLE__', (!__XE_VERSION_ALPHA__ && !__XE_VERSION_BETA__ && !__XE_VERSION_RC__));
37 
38 define('__XE_MIN_PHP_VERSION__', '5.3.0');
39 define('__XE_RECOMMEND_PHP_VERSION__', '5.6.4');
40 
44 define('__ZBXE_VERSION__', __XE_VERSION__);
45 
49 define('_XE_PATH_', str_replace('config/config.inc.php', '', str_replace('\\', '/', __FILE__)));
50 
51 
52 // Set can use other method instead cookie to store session id(for file upload)
53 ini_set('session.use_only_cookies', 0);
54 
55 if(file_exists(_XE_PATH_ . 'config/package.inc.php'))
56 {
57  require _XE_PATH_ . 'config/package.inc.php';
58 }
59 else
60 {
64  define('_XE_PACKAGE_', 'XE');
65 
69  define('_XE_LOCATION_', 'en');
70 
74  define('_XE_LOCATION_SITE_', 'http://www.xpressengine.com/');
75 
79  define('_XE_DOWNLOAD_SERVER_', 'http://download.xpressengine.com/');
80 }
81 
82 /*
83  * user configuration files which override the default settings
84  * save the following information into config/config.user.inc.php
85  * <?php
86  * define('__DEBUG__', 0);
87  * define('__DEBUG_OUTPUT__', 0);
88  * define('__DEBUG_PROTECT__', 1);
89  * define('__DEBUG_PROTECT_IP__', '127.0.0.1');
90  * define('__DEBUG_DB_OUTPUT__', 0);
91  * define('__LOG_SLOW_QUERY__', 0);
92  * define('__LOG_SLOW_TRIGGER__', 0);
93  * define('__LOG_SLOW_ADDON__', 0);
94  * define('__LOG_SLOW_WIDGET__', 0);
95  * define('__OB_GZHANDLER_ENABLE__', 1);
96  * define('__ENABLE_PHPUNIT_TEST__', 0);
97  * define('__PROXY_SERVER__', 'http://domain:port/path');
98  */
99 if(file_exists(_XE_PATH_ . 'config/config.user.inc.php'))
100 {
101  require _XE_PATH_ . 'config/config.user.inc.php';
102 }
103 
104 if(!defined('__DEBUG__'))
105 {
116  define('__DEBUG__', 0);
117 }
118 
119 if(!defined('__DEBUG_OUTPUT__'))
120 {
130  define('__DEBUG_OUTPUT__', 0);
131 }
132 
133 if(!defined('__DEBUG_PROTECT__'))
134 {
143  define('__DEBUG_PROTECT__', 1);
144 }
145 
146 if(!defined('__DEBUG_PROTECT_IP__'))
147 {
151  define('__DEBUG_PROTECT_IP__', '127.0.0.1');
152 }
153 
154 if(!defined('__DEBUG_DB_OUTPUT__'))
155 {
164  define('__DEBUG_DB_OUTPUT__', 0);
165 }
166 
167 if(!defined('__LOG_SLOW_QUERY__'))
168 {
178  define('__LOG_SLOW_QUERY__', 0);
179 }
180 
181 if(!defined('__LOG_SLOW_TRIGGER__'))
182 {
192  define('__LOG_SLOW_TRIGGER__', 0);
193 }
194 
195 if(!defined('__LOG_SLOW_ADDON__'))
196 {
206  define('__LOG_SLOW_ADDON__', 0);
207 }
208 
209 if(!defined('__LOG_SLOW_WIDGET__'))
210 {
220  define('__LOG_SLOW_WIDGET__', 0);
221 }
222 
223 if(!defined('__DEBUG_QUERY__'))
224 {
233  define('__DEBUG_QUERY__', 0);
234 }
235 
236 if(!defined('__OB_GZHANDLER_ENABLE__'))
237 {
247  define('__OB_GZHANDLER_ENABLE__', 1);
248 }
249 
250 if(!defined('__ENABLE_PHPUNIT_TEST__'))
251 {
260  define('__ENABLE_PHPUNIT_TEST__', 0);
261 }
262 
263 if(!defined('__PROXY_SERVER__'))
264 {
269  define('__PROXY_SERVER__', NULL);
270 }
271 
272 if(!defined('__ERROR_LOG__'))
273 {
280  define('__ERROR_LOG__', 0);
281 }
282 
283 if(!defined('__DISABLE_DEFAULT_CSS__'))
284 {
295  define('__DISABLE_DEFAULT_CSS__', 0);
296 }
297 
298 if(!defined('__AUTO_OPCACHE_INVALIDATE__'))
299 {
309  define('__AUTO_OPCACHE_INVALIDATE__', 1);
310 }
311 
312 // Require specific files when using Firebug console output
313 if((__DEBUG_OUTPUT__ == 2) && version_compare(PHP_VERSION, '6.0.0') === -1)
314 {
315  require _XE_PATH_ . 'libs/FirePHPCore/FirePHP.class.php';
316 }
317 
318 // Set Timezone as server time
319 if(version_compare(PHP_VERSION, '5.3.0') >= 0)
320 {
321  date_default_timezone_set(@date_default_timezone_get());
322 }
323 
324 $GLOBALS['__xe_autoload_file_map'] = array_change_key_case(array(
325  'CacheBase' => 'classes/cache/CacheHandler.class.php',
326  'CacheHandler' => 'classes/cache/CacheHandler.class.php',
327  'Context' => 'classes/context/Context.class.php',
328  'DB' => 'classes/db/DB.class.php',
329  'Query' => 'classes/db/queryparts/Query.class.php',
330  'Subquery' => 'classes/db/queryparts/Subquery.class.php',
331  'Condition' => 'classes/db/queryparts/condition/Condition.class.php',
332  'ConditionGroup' => 'classes/db/queryparts/condition/ConditionGroup.class.php',
333  'ConditionSubquery' => 'classes/db/queryparts/condition/ConditionSubquery.class.php',
334  'ConditionWithArgument' => 'classes/db/queryparts/condition/ConditionWithArgument.class.php',
335  'ConditionWithoutArgument' => 'classes/db/queryparts/condition/ConditionWithoutArgument.class.php',
336  'ClickCountExpression' => 'classes/db/queryparts/expression/ClickCountExpression.class.php',
337  'documentItem' => 'modules/document/document.item.php',
338  'commentItem' => 'modules/comment/comment.item.php',
339  'DeleteExpression' => 'classes/db/queryparts/expression/DeleteExpression.class.php',
340  'Expression' => 'classes/db/queryparts/expression/Expression.class.php',
341  'InsertExpression' => 'classes/db/queryparts/expression/InsertExpression.class.php',
342  'SelectExpression' => 'classes/db/queryparts/expression/SelectExpression.class.php',
343  'StarExpression' => 'classes/db/queryparts/expression/StarExpression.class.php',
344  'UpdateExpression' => 'classes/db/queryparts/expression/UpdateExpression.class.php',
345  'UpdateExpressionWithoutArgument' => 'classes/db/queryparts/expression/UpdateExpressionWithoutArgument.class.php',
346  'Limit' => 'classes/db/queryparts/limit/Limit.class.php',
347  'OrderByColumn' => 'classes/db/queryparts/order/OrderByColumn.class.php',
348  'CubridTableWithHint' => 'classes/db/queryparts/table/CubridTableWithHint.class.php',
349  'IndexHint' => 'classes/db/queryparts/table/IndexHint.class.php',
350  'JoinTable' => 'classes/db/queryparts/table/JoinTable.class.php',
351  'MssqlTableWithHint' => 'classes/db/queryparts/table/MssqlTableWithHint.class.php',
352  'MysqlTableWithHint' => 'classes/db/queryparts/table/MysqlTableWithHint.class.php',
353  'Table' => 'classes/db/queryparts/table/Table.class.php',
354  'DisplayHandler' => 'classes/display/DisplayHandler.class.php',
355  'HTMLDisplayHandler' => 'classes/display/HTMLDisplayHandler.php',
356  'JSCallbackDisplayHandler' => 'classes/display/JSCallbackDisplayHandler.php',
357  'JSONDisplayHandler' => 'classes/display/JSONDisplayHandler.php',
358  'VirtualXMLDisplayHandler' => 'classes/display/VirtualXMLDisplayHandler.php',
359  'XMLDisplayHandler' => 'classes/display/XMLDisplayHandler.php',
360  'EditorHandler' => 'classes/editor/EditorHandler.class.php',
361  'ExtraVar' => 'classes/extravar/Extravar.class.php',
362  'ExtraItem' => 'classes/extravar/Extravar.class.php',
363  'FileHandler' => 'classes/file/FileHandler.class.php',
364  'FileObject' => 'classes/file/FileObject.class.php',
365  'FrontEndFileHandler' => 'classes/frontendfile/FrontEndFileHandler.class.php',
366  'Handler' => 'classes/handler/Handler.class.php',
367  'XEHttpRequest' => 'classes/httprequest/XEHttpRequest.class.php',
368  'Mail' => 'classes/mail/Mail.class.php',
369  'Mobile' => 'classes/mobile/Mobile.class.php',
370  'ModuleHandler' => 'classes/module/ModuleHandler.class.php',
371  'ModuleObject' => 'classes/module/ModuleObject.class.php',
372  'BaseObject' => 'classes/object/BaseObject.class.php',
373  'PageHandler' => 'classes/page/PageHandler.class.php',
374  'EmbedFilter' => 'classes/security/EmbedFilter.class.php',
375  'IpFilter' => 'classes/security/IpFilter.class.php',
376  'Password' => 'classes/security/Password.class.php',
377  'Purifier' => 'classes/security/Purifier.class.php',
378  'Security' => 'classes/security/Security.class.php',
379  'UploadFileFilter' => 'classes/security/UploadFileFilter.class.php',
380  'TemplateHandler' => 'classes/template/TemplateHandler.class.php',
381  'Validator' => 'classes/validator/Validator.class.php',
382  'WidgetHandler' => 'classes/widget/WidgetHandler.class.php',
383  'GeneralXmlParser' => 'classes/xml/GeneralXmlParser.class.php',
384  'Xml_Node_' => 'classes/xml/XmlParser.class.php',
385  'XmlGenerator' => 'classes/xml/XmlGenerator.class.php',
386  'XmlJsFilter' => 'classes/xml/XmlJsFilter.class.php',
387  'XmlLangParser' => 'classes/xml/XmlLangParser.class.php',
388  'XmlParser' => 'classes/xml/XmlParser.class.php',
389  'XmlQueryParser' => 'classes/xml/XmlQueryParser.class.php',
390  'DBParser' => 'classes/xml/xmlquery/DBParser.class.php',
391  'QueryParser' => 'classes/xml/xmlquery/QueryParser.class.php',
392  'Argument' => 'classes/xml/xmlquery/argument/Argument.class.php',
393  'ConditionArgument' => 'classes/xml/xmlquery/argument/ConditionArgument.class.php',
394  'SortArgument' => 'classes/xml/xmlquery/argument/SortArgument.class.php',
395  'DefaultValue' => 'classes/xml/xmlquery/queryargument/DefaultValue.class.php',
396  'QueryArgument' => 'classes/xml/xmlquery/queryargument/QueryArgument.class.php',
397  'SortQueryArgument' => 'classes/xml/xmlquery/queryargument/SortQueryArgument.class.php',
398  'QueryArgumentValidator' => 'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php',
399  'ColumnTag' => 'classes/xml/xmlquery/tags/column/ColumnTag.class.php',
400  'InsertColumnTag' => 'classes/xml/xmlquery/tags/column/InsertColumnTag.class.php',
401  'InsertColumnTagWithoutArgument' => 'classes/xml/xmlquery/tags/column/InsertColumnTagWithoutArgument.class.php',
402  'InsertColumnsTag' => 'classes/xml/xmlquery/tags/column/InsertColumnsTag.class.php',
403  'SelectColumnTag' => 'classes/xml/xmlquery/tags/column/SelectColumnTag.class.php',
404  'SelectColumnsTag' => 'classes/xml/xmlquery/tags/column/SelectColumnsTag.class.php',
405  'UpdateColumnTag' => 'classes/xml/xmlquery/tags/column/UpdateColumnTag.class.php',
406  'UpdateColumnsTag' => 'classes/xml/xmlquery/tags/column/UpdateColumnsTag.class.php',
407  'ConditionGroupTag' => 'classes/xml/xmlquery/tags/condition/ConditionGroupTag.class.php',
408  'ConditionTag' => 'classes/xml/xmlquery/tags/condition/ConditionTag.class.php',
409  'ConditionsTag' => 'classes/xml/xmlquery/tags/condition/ConditionsTag.class.php',
410  'JoinConditionsTag' => 'classes/xml/xmlquery/tags/condition/JoinConditionsTag.class.php',
411  'GroupsTag' => 'classes/xml/xmlquery/tags/group/GroupsTag.class.php',
412  'IndexTag' => 'classes/xml/xmlquery/tags/navigation/IndexTag.class.php',
413  'LimitTag' => 'classes/xml/xmlquery/tags/navigation/LimitTag.class.php',
414  'NavigationTag' => 'classes/xml/xmlquery/tags/navigation/NavigationTag.class.php',
415  'QueryTag' => 'classes/xml/xmlquery/tags/query/QueryTag.class.php',
416  'HintTableTag' => 'classes/xml/xmlquery/tags/table/HintTableTag.class.php',
417  'TableTag' => 'classes/xml/xmlquery/tags/table/TableTag.class.php',
418  'TablesTag' => 'classes/xml/xmlquery/tags/table/TablesTag.class.php',
419 ), CASE_LOWER);
420 
425 $cache_path = _XE_PATH_ . 'files/cache/store/' . __XE_VERSION__;
426 if(
427  __AUTO_OPCACHE_INVALIDATE__ === 1
428  && !is_dir($cache_path)
429  && function_exists('opcache_get_status')
430  && function_exists('opcache_invalidate')
431 )
432 {
433  @mkdir($cache_path, 0755, TRUE);
434  @chmod($cache_path, 0755);
435 
436  foreach($GLOBALS['__xe_autoload_file_map'] as $script) {
437  opcache_invalidate(_XE_PATH_ . $script, true);
438  }
439  opcache_invalidate(_XE_PATH_ . 'config/func.inc.php', true);
440 }
441 
442 // Require a function-defined-file for simple use
443 require(_XE_PATH_ . 'config/func.inc.php');
444 
445 if(__DEBUG__) {
446  define('__StartTime__', getMicroTime());
447 }
448 
449 if(__DEBUG__) {
450  $GLOBALS['__elapsed_class_load__'] = 0;
451 }
452 
453 function __xe_autoload($class_name)
454 {
455  if(__DEBUG__) {
456  $time_at = getMicroTime();
457  }
458 
459  if(isset($GLOBALS['__xe_autoload_file_map'][strtolower($class_name)]))
460  {
461  require _XE_PATH_ . $GLOBALS['__xe_autoload_file_map'][strtolower($class_name)];
462  }
463  elseif(preg_match('/^([a-zA-Z0-9_]+?)(Admin)?(View|Controller|Model|Api|Wap|Mobile)?$/', $class_name, $matches))
464  {
465  $candidate_filename = array();
466  $candidate_filename[] = 'modules/' . $matches[1] . '/' . $matches[1];
467  if(isset($matches[2]) && $matches[2]) $candidate_filename[] = 'admin';
468  $candidate_filename[] = (isset($matches[3]) && $matches[3]) ? strtolower($matches[3]) : 'class';
469  $candidate_filename[] = 'php';
470 
471  $candidate_filename = implode('.', $candidate_filename);
472 
473  if(file_exists(_XE_PATH_ . $candidate_filename))
474  {
475  require _XE_PATH_ . $candidate_filename;
476  }
477  }
478 
479  if(__DEBUG__) {
480  $GLOBALS['__elapsed_class_load__'] += getMicroTime() - $time_at;
481  }
482 }
483 spl_autoload_register('__xe_autoload');
484 
485 if(version_compare(PHP_VERSION, '7.2', '<'))
486 {
487  class_alias('BaseObject', 'Object', true);
488 }
489 
490 if(file_exists(_XE_PATH_ . '/vendor/autoload.php')) {
491  require _XE_PATH_ . '/vendor/autoload.php';
492 }
493 /* End of file config.inc.php */
494 /* Location: ./config/config.inc.php */
const __XE_VERSION_ALPHA__
Definition: config.inc.php:33
const __XE__
Declare constants for generic use and for checking to avoid a direct call from the Web...
Definition: index.php:35
const __XE_VERSION__
Definition: config.inc.php:32
getMicroTime()
Definition: func.inc.php:986
if(file_exists(_XE_PATH_. 'config/config.user.inc.php')) if(!defined('__DEBUG__')) if(!defined('__DEBUG_OUTPUT__')) if(!defined('__DEBUG_PROTECT__')) if(!defined('__DEBUG_PROTECT_IP__')) if(!defined('__DEBUG_DB_OUTPUT__')) if(!defined('__LOG_SLOW_QUERY__')) if(!defined('__LOG_SLOW_TRIGGER__')) if(!defined('__LOG_SLOW_ADDON__')) if(!defined('__LOG_SLOW_WIDGET__')) if(!defined('__DEBUG_QUERY__')) if(!defined('__OB_GZHANDLER_ENABLE__')) if(!defined('__ENABLE_PHPUNIT_TEST__')) if(!defined('__PROXY_SERVER__')) if(!defined('__ERROR_LOG__')) if(!defined('__DISABLE_DEFAULT_CSS__')) if(!defined('__AUTO_OPCACHE_INVALIDATE__')) if((__DEBUG_OUTPUT__==2)&&version_compare(PHP_VERSION, '6.0.0')===-1) if(version_compare(PHP_VERSION, '5.3.0') >=0) $GLOBALS['__xe_autoload_file_map']
Definition: config.inc.php:324
const __XE_VERSION_RC__
Definition: config.inc.php:35
const __XE_VERSION_BETA__
Definition: config.inc.php:34
$cache_path
Definition: config.inc.php:425
const _XE_PATH_
Definition: config.inc.php:49
if(__DEBUG__) if(__DEBUG__) __xe_autoload($class_name)
Definition: config.inc.php:453