10 if(version_compare(PHP_VERSION,
'5.4.0',
'<'))
12 @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING);
16 @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT);
19 if(!defined(
'__XE__'))
32 define(
'__XE_VERSION__',
'1.11.2');
33 define(
'__XE_VERSION_ALPHA__', (stripos(
__XE_VERSION__,
'alpha') !==
false));
38 define(
'__XE_MIN_PHP_VERSION__',
'5.3.0');
39 define(
'__XE_RECOMMEND_PHP_VERSION__',
'5.6.4');
49 define(
'_XE_PATH_', str_replace(
'config/config.inc.php',
'', str_replace(
'\\',
'/', __FILE__)));
53 ini_set(
'session.use_only_cookies', 0);
55 if(file_exists(
_XE_PATH_ .
'config/package.inc.php'))
57 require
_XE_PATH_ .
'config/package.inc.php';
64 define(
'_XE_PACKAGE_',
'XE');
69 define(
'_XE_LOCATION_',
'en');
74 define(
'_XE_LOCATION_SITE_',
'http://www.xpressengine.com/');
79 define(
'_XE_DOWNLOAD_SERVER_',
'http://download.xpressengine.com/');
99 if(file_exists(
_XE_PATH_ .
'config/config.user.inc.php'))
101 require
_XE_PATH_ .
'config/config.user.inc.php';
104 if(!defined(
'__DEBUG__'))
116 define(
'__DEBUG__', 0);
119 if(!defined(
'__DEBUG_OUTPUT__'))
130 define(
'__DEBUG_OUTPUT__', 0);
133 if(!defined(
'__DEBUG_PROTECT__'))
143 define(
'__DEBUG_PROTECT__', 1);
146 if(!defined(
'__DEBUG_PROTECT_IP__'))
151 define(
'__DEBUG_PROTECT_IP__',
'127.0.0.1');
154 if(!defined(
'__DEBUG_DB_OUTPUT__'))
164 define(
'__DEBUG_DB_OUTPUT__', 0);
167 if(!defined(
'__LOG_SLOW_QUERY__'))
178 define(
'__LOG_SLOW_QUERY__', 0);
181 if(!defined(
'__LOG_SLOW_TRIGGER__'))
192 define(
'__LOG_SLOW_TRIGGER__', 0);
195 if(!defined(
'__LOG_SLOW_ADDON__'))
206 define(
'__LOG_SLOW_ADDON__', 0);
209 if(!defined(
'__LOG_SLOW_WIDGET__'))
220 define(
'__LOG_SLOW_WIDGET__', 0);
223 if(!defined(
'__DEBUG_QUERY__'))
233 define(
'__DEBUG_QUERY__', 0);
236 if(!defined(
'__OB_GZHANDLER_ENABLE__'))
247 define(
'__OB_GZHANDLER_ENABLE__', 1);
250 if(!defined(
'__ENABLE_PHPUNIT_TEST__'))
260 define(
'__ENABLE_PHPUNIT_TEST__', 0);
263 if(!defined(
'__PROXY_SERVER__'))
269 define(
'__PROXY_SERVER__', NULL);
272 if(!defined(
'__ERROR_LOG__'))
280 define(
'__ERROR_LOG__', 0);
283 if(!defined(
'__DISABLE_DEFAULT_CSS__'))
295 define(
'__DISABLE_DEFAULT_CSS__', 0);
298 if(!defined(
'__AUTO_OPCACHE_INVALIDATE__'))
309 define(
'__AUTO_OPCACHE_INVALIDATE__', 1);
313 if((__DEBUG_OUTPUT__ == 2) && version_compare(PHP_VERSION,
'6.0.0') === -1)
315 require
_XE_PATH_ .
'libs/FirePHPCore/FirePHP.class.php';
319 if(version_compare(PHP_VERSION,
'5.3.0') >= 0)
321 date_default_timezone_set(@date_default_timezone_get());
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',
427 __AUTO_OPCACHE_INVALIDATE__ === 1
429 && function_exists(
'opcache_get_status')
430 && function_exists(
'opcache_invalidate')
436 foreach(
$GLOBALS[
'__xe_autoload_file_map'] as $script) {
437 opcache_invalidate(
_XE_PATH_ . $script,
true);
439 opcache_invalidate(
_XE_PATH_ .
'config/func.inc.php',
true);
443 require(
_XE_PATH_ .
'config/func.inc.php');
450 $GLOBALS[
'__elapsed_class_load__'] = 0;
459 if(isset(
$GLOBALS[
'__xe_autoload_file_map'][strtolower($class_name)]))
463 elseif(preg_match(
'/^([a-zA-Z0-9_]+?)(Admin)?(View|Controller|Model|Api|Wap|Mobile)?$/', $class_name, $matches))
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';
471 $candidate_filename = implode(
'.', $candidate_filename);
473 if(file_exists(
_XE_PATH_ . $candidate_filename))
483 spl_autoload_register(
'__xe_autoload');
485 if(version_compare(PHP_VERSION,
'7.2',
'<'))
487 class_alias(
'BaseObject',
'Object',
true);
490 if(file_exists(
_XE_PATH_ .
'/vendor/autoload.php')) {
491 require
_XE_PATH_ .
'/vendor/autoload.php';
const __XE_VERSION_ALPHA__
const __XE__
Declare constants for generic use and for checking to avoid a direct call from the Web...
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']
const __XE_VERSION_BETA__
if(__DEBUG__) if(__DEBUG__) __xe_autoload($class_name)