49 $this->error =
'msg_invalid_request';
66 if($this->
module && !preg_match(
"/^([a-z0-9\_\-]+)$/i", $this->
module))
70 if($this->mid && !preg_match(
"/^([a-z0-9\_\-]+)$/i", $this->mid))
74 if($this->act && !preg_match(
"/^([a-z0-9\_\-]+)$/i", $this->act))
87 if(isset($this->act) && (strlen($this->act) >= 4 && substr_compare($this->act,
'disp', 0, 4) === 0))
92 header(
'location:https://' . $_SERVER[
'HTTP_HOST'] .
':' .
Context::get(
'_https_port') . $_SERVER[
'REQUEST_URI']);
94 header(
'location:https://' . $_SERVER[
'HTTP_HOST'] . $_SERVER[
'REQUEST_URI']);
102 if(__ERROR_LOG__ == 1 && __DEBUG_OUTPUT__ == 0)
104 if(__DEBUG_PROTECT__ === 0 || __DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ == $_SERVER[
'REMOTE_ADDR'])
106 set_error_handler(array($this,
'xeErrorLog'), E_WARNING);
107 register_shutdown_function(array($this,
'shutdownHandler'));
112 $called_position =
'before_module_init';
115 if(file_exists($addon_file)) include($addon_file);
118 public static function xeErrorLog($errnumber, $errormassage, $errorfile, $errorline, $errorcontext)
120 if(($errnumber & 3) == 0 || error_reporting() == 0)
125 set_error_handler(
function() { }, ~0);
127 $debug_file =
_XE_PATH_ .
'files/_debug_message.php';
128 if(!file_exists($debug_file))
130 $print[] =
'<?php exit() ?>';
133 $errorname = self::getErrorType($errnumber);
134 $print[] =
'['.date(
'Y-m-d H:i:s').
'] ' . $errorname .
' : ' . $errormassage;
135 $backtrace_args = defined(
'DEBUG_BACKTRACE_IGNORE_ARGS') ? \DEBUG_BACKTRACE_IGNORE_ARGS : 0;
136 $backtrace = debug_backtrace($backtrace_args);
137 if(count($backtrace) > 1 && $backtrace[1][
'function'] ===
'xeErrorLog' && !$backtrace[1][
'class'])
139 array_shift($backtrace);
142 foreach($backtrace as $key => $value)
144 $message =
' - ' . $value[
'file'] .
' : ' . $value[
'line'];
148 @file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND|LOCK_EX);
149 restore_error_handler();
156 $errinfo = error_get_last();
157 if ($errinfo === null || ($errinfo[
'type'] != 1 && $errinfo[
'type'] != 4))
162 set_error_handler(
function() { }, ~0);
164 $debug_file =
_XE_PATH_ .
'files/_debug_message.php';
165 if(!file_exists($debug_file))
167 $print[] =
'<?php exit() ?>';
170 $errorname = self::getErrorType($errinfo[
'type']);
171 $print[] =
'['.date(
'Y-m-d H:i:s').
']';
172 $print[] = $errorname .
' : ' . $errinfo[
'message'];
174 $message =
' - ' . $errinfo[
'file'] .
' : ' . $errinfo[
'line'];
178 @file_put_contents($debug_file, implode(PHP_EOL, $print), FILE_APPEND|LOCK_EX);
179 set_error_handler(array($this,
'dummyHandler'), ~0);
188 case E_ERROR:
return 'Fatal Error';
189 case E_WARNING:
return 'Warning';
190 case E_NOTICE:
return 'Notice';
191 case E_CORE_ERROR:
return 'Core Error';
192 case E_CORE_WARNING:
return 'Core Warning';
193 case E_COMPILE_ERROR:
return 'Compile Error';
194 case E_COMPILE_WARNING:
return 'Compile Warning';
195 case E_USER_ERROR:
return 'User Error';
196 case E_USER_WARNING:
return 'User Warning';
197 case E_USER_NOTICE:
return 'User Notice';
198 case E_STRICT:
return 'Strict Standards';
199 case E_PARSE:
return 'Parse Error';
200 case E_DEPRECATED:
return 'Deprecated';
201 case E_USER_DEPRECATED:
return 'User Deprecated';
202 case E_RECOVERABLE_ERROR:
return 'Catchable Fatal Error';
203 default:
return 'Error';
219 $defaultUrlInfo = parse_url($dbInfo->default_url);
220 $defaultHost = $defaultUrlInfo[
'host'];
222 foreach($urls as $url)
229 $urlInfo = parse_url($url);
230 $host = $urlInfo[
'host'];
232 if($host && ($host != $defaultHost && $host != $site_module_info->domain))
234 throw new Exception(
'msg_default_url_is_null');
238 if(!$this->document_srl && $this->mid && $this->entry)
241 $this->document_srl =
$oDocumentModel->getDocumentSrlByAlias($this->mid, $this->entry);
242 if($this->document_srl)
249 if($this->document_srl)
256 unset($this->document_srl);
268 header(
'location:' .
getNotEncodedSiteUrl($site_module_info->domain,
'mid', $this->mid,
'document_srl', $this->document_srl));
295 if(!$this->
module && !
$module_info && $site_module_info->site_srl == 0 && $site_module_info->module_site_srl > 0)
297 $site_info =
$oModuleModel->getSiteInfo($site_module_info->module_site_srl);
326 if(!$db_info->default_url)
335 header(
"location:" . $redirect_url);
354 $layoutSrl = $oLayoutAdminModel->getSiteDefaultLayout($viewType,
$module_info->site_srl);
364 $part_config =
$oModuleModel->getModulePartConfig(
'layout', $layoutSrl);
369 if(!isset($this->module_info))
371 $this->module_info =
new stdClass();
373 $this->module_info->module = $this->module;
374 $this->module_info->mid = $this->mid;
377 $this->module_info->site_srl = $site_module_info->site_srl;
382 $this->error =
'msg_module_is_not_exists';
383 $this->httpStatusCode =
'404';
396 $this->error =
$output->getMessage();
401 Context::set(
'current_module_info', $this->module_info);
418 $this->_setInputErrorToContext();
420 $oMessageObject->setError(-1);
421 $oMessageObject->setMessage($this->error);
422 $oMessageObject->dispMessage();
423 if($this->httpStatusCode)
425 $oMessageObject->setHttpStatusCode($this->httpStatusCode);
427 return $oMessageObject;
434 if($this->
module ==
"install")
436 if(!$this->act || !$xml_info->action->{$this->act})
438 $this->act = $xml_info->default_index_act;
445 $this->act = $xml_info->default_index_act;
451 $this->error =
'msg_module_is_not_exists';
452 $this->httpStatusCode =
'404';
454 $this->_setInputErrorToContext();
456 $oMessageObject->setError(-1);
457 $oMessageObject->setMessage($this->error);
458 $oMessageObject->dispMessage();
459 if($this->httpStatusCode)
461 $oMessageObject->setHttpStatusCode($this->httpStatusCode);
463 return $oMessageObject;
467 $type = $xml_info->action->{$this->act}->type;
468 $ruleset = $xml_info->action->{$this->act}->ruleset;
469 $meta_noindex = $xml_info->action->{$this->act}->meta_noindex;
470 $kind = stripos($this->act,
'admin') !== FALSE ?
'admin' :
'';
472 if ($meta_noindex ===
'true')
477 if(!$kind && $this->
module ==
'admin')
483 if($type ==
'controller')
485 $allowedMethod = $xml_info->action->{$this->act}->method;
489 $allowedMethodList[0] =
'POST';
493 $allowedMethodList = explode(
'|', strtoupper($allowedMethod));
496 if(!in_array(strtoupper($_SERVER[
'REQUEST_METHOD']), $allowedMethodList))
498 $this->error =
"msg_invalid_request";
500 $oMessageObject->setError(-1);
501 $oMessageObject->setMessage($this->error);
502 $oMessageObject->dispMessage();
503 return $oMessageObject;
507 if($this->module_info->use_mobile !=
"Y")
515 $use_check_csrf = isset($xml_info->action->{$this->act}) && $xml_info->action->{$this->act}->check_csrf !==
'false';
518 $this->error =
'msg_invalid_request';
520 $oMessageObject->setError(-1);
521 $oMessageObject->setMessage($this->error);
522 $oMessageObject->dispMessage();
523 return $oMessageObject;
527 if($kind ==
'admin' && $_SESSION[
'denied_admin'] ==
'Y')
529 $this->_setInputErrorToContext();
530 $this->error =
"msg_not_permitted_act";
532 $oMessageObject->setError(-1);
533 $oMessageObject->setMessage($this->error);
534 $oMessageObject->dispMessage();
535 return $oMessageObject;
544 $oModule = $this->getModuleInstance($this->
module, $type, $kind);
545 if(!is_object($oModule) || !method_exists($oModule, $this->act))
549 $oModule = $this->getModuleInstance($this->
module, $type, $kind);
555 $oModule = $this->getModuleInstance($this->
module, $type, $kind);
558 if(!is_object($oModule))
560 $this->_setInputErrorToContext();
562 $oMessageObject->setError(-1);
563 $oMessageObject->setMessage($this->error);
564 $oMessageObject->dispMessage();
565 if($this->httpStatusCode)
567 $oMessageObject->setHttpStatusCode($this->httpStatusCode);
569 return $oMessageObject;
573 if(!isset($xml_info->action->{$this->act}) || !method_exists($oModule, $this->act))
578 $this->_setInputErrorToContext();
579 $this->error =
'msg_invalid_request';
581 $oMessageObject->setError(-1);
582 $oMessageObject->setMessage($this->error);
583 $oMessageObject->dispMessage();
584 if($this->httpStatusCode)
586 $oMessageObject->setHttpStatusCode($this->httpStatusCode);
588 return $oMessageObject;
593 if(preg_match(
'/^([a-z]+)([A-Z])([a-z0-9\_]+)(.*)$/', $this->act, $matches))
595 $module = strtolower($matches[2] . $matches[3]);
598 if($xml_info->action->{$this->act} && ((stripos($this->act,
'admin') !== FALSE) || $xml_info->action->{$this->act}->standalone !=
'false'))
600 $forward =
new stdClass();
601 $forward->module = $module;
602 $forward->type = $xml_info->action->{$this->act}->type;
603 $forward->ruleset = $xml_info->action->{$this->act}->ruleset;
604 $forward->meta_noindex = $xml_info->action->{$this->act}->meta_noindex;
605 $forward->act = $this->act;
609 $this->error =
'msg_invalid_request';
611 $oMessageObject->setError(-1);
612 $oMessageObject->setMessage($this->error);
613 $oMessageObject->dispMessage();
615 return $oMessageObject;
624 if($forward->module && $forward->type && $forward->act && $forward->act == $this->act)
626 $kind = stripos($forward->act,
'admin') !== FALSE ?
'admin' :
'';
627 $type = $forward->type;
628 $ruleset = $forward->ruleset;
629 $tpl_path = $oModule->getTemplatePath();
630 $orig_module = $oModule;
632 if($forward->meta_noindex ===
'true') {
636 $xml_info =
$oModuleModel->getModuleActionXml($forward->module);
639 $use_check_csrf = isset($xml_info->action->{$this->act}) && $xml_info->action->{$this->act}->check_csrf !==
'false';
642 $this->error =
'msg_invalid_request';
644 $oMessageObject->setError(-1);
645 $oMessageObject->setMessage($this->error);
646 $oMessageObject->dispMessage();
647 return $oMessageObject;
652 if($type ==
'controller')
654 $allowedMethod = $xml_info->action->{$forward->act}->method;
658 $allowedMethodList[0] =
'POST';
662 $allowedMethodList = explode(
'|', strtoupper($allowedMethod));
665 if(!in_array(strtoupper($_SERVER[
'REQUEST_METHOD']), $allowedMethodList))
667 $this->error =
"msg_invalid_request";
669 $oMessageObject->setError(-1);
670 $oMessageObject->setMessage($this->error);
671 $oMessageObject->dispMessage();
672 return $oMessageObject;
681 $oModule = $this->getModuleInstance($forward->module, $type, $kind);
682 if(!is_object($oModule) || !method_exists($oModule, $this->act))
686 $oModule = $this->getModuleInstance($forward->module, $type, $kind);
691 $oModule = $this->getModuleInstance($forward->module, $type, $kind);
694 if(!is_object($oModule))
696 $this->_setInputErrorToContext();
698 $oMessageObject->setError(-1);
699 $oMessageObject->setMessage(
'msg_module_is_not_exists');
700 $oMessageObject->dispMessage();
701 if($this->httpStatusCode)
703 $oMessageObject->setHttpStatusCode($this->httpStatusCode);
705 return $oMessageObject;
708 if($this->
module ==
"admin" && $type ==
"view")
712 if($this->act !=
'dispLayoutAdminLayoutModify')
715 $oAdminView->makeGnbUrl($forward->module);
716 $oModule->setLayoutPath(
"./modules/admin/tpl");
717 $oModule->setLayoutFile(
"layout.html");
722 $this->_setInputErrorToContext();
724 $this->error =
'msg_is_not_administrator';
726 $oMessageObject->setError(-1);
727 $oMessageObject->setMessage($this->error);
728 $oMessageObject->dispMessage();
729 return $oMessageObject;
737 $this->_setInputErrorToContext();
738 $this->error =
'msg_is_not_manager';
740 $oMessageObject->setError(-1);
741 $oMessageObject->setMessage($this->error);
742 $oMessageObject->dispMessage();
743 return $oMessageObject;
747 if(!$grant->is_admin && $this->module != $this->orig_module->module && $xml_info->permission->{$this->act} !=
'manager')
749 $this->_setInputErrorToContext();
750 $this->error =
'msg_is_not_administrator';
752 $oMessageObject->setError(-1);
753 $oMessageObject->setMessage($this->error);
754 $oMessageObject->dispMessage();
755 return $oMessageObject;
760 else if($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act))
762 $this->act = $xml_info->default_index_act;
766 $this->error =
'msg_invalid_request';
767 $oModule->setError(-1);
768 $oModule->setMessage($this->error);
776 $rulesetModule = $forward->module ? $forward->module : $this->module;
777 $rulesetFile =
$oModuleModel->getValidatorFilePath($rulesetModule, $ruleset, $this->mid);
778 if(!empty($rulesetFile))
780 if($_SESSION[
'XE_VALIDATOR_ERROR_LANG'])
782 $errorLang = $_SESSION[
'XE_VALIDATOR_ERROR_LANG'];
783 foreach($errorLang as $key => $val)
787 unset($_SESSION[
'XE_VALIDATOR_ERROR_LANG']);
790 $Validator =
new Validator($rulesetFile);
791 $result = $Validator->validate();
794 $lastError = $Validator->getLastError();
796 $errorMsg = $lastError[
'msg'] ? $lastError[
'msg'] :
'validation error';
799 $oModule->setError(-1);
800 $oModule->setMessage($errorMsg);
802 $this->error = $errorMsg;
803 $_SESSION[
'XE_VALIDATOR_ERROR'] = -1;
804 $_SESSION[
'XE_VALIDATOR_MESSAGE'] = $this->error;
805 $_SESSION[
'XE_VALIDATOR_MESSAGE_TYPE'] =
'error';
806 $_SESSION[
'XE_VALIDATOR_RETURN_URL'] = $returnUrl;
807 $_SESSION[
'XE_VALIDATOR_ID'] =
Context::get(
'xe_validator_id');
808 $this->_setInputValueToSession();
814 $oModule->setAct($this->act);
816 $this->module_info->module_type = $type;
817 $oModule->setModuleInfo($this->module_info, $xml_info);
820 'dispEditorConfigPreview' => 1,
821 'dispLayoutPreviewWithModule' => 1
827 $header =
'<style>div.xe_mobile{opacity:0.7;margin:1em 0;padding:.5em;background:#333;border:1px solid #666;border-left:0;border-right:0}p.xe_mobile{text-align:center;margin:1em 0}a.xe_mobile{color:#ff0;font-weight:bold;font-size:24px}@media only screen and (min-width:500px){a.xe_mobile{font-size:15px}}</style>';
828 $footer =
'<div class="xe_mobile"><p class="xe_mobile"><a class="xe_mobile" href="' .
getUrl(
'm',
'1') .
'">' . $lang->msg_pc_to_mobile .
'</a></p></div>';
833 if(($type ==
'view' || $type ==
'mobile') && $kind !=
'admin')
836 if($module_config->htmlFooter)
840 if($module_config->siteTitle)
850 if ($kind ===
'admin') {
855 $this->_setInputErrorToContext();
857 $procResult = $oModule->proc();
859 $methodList = array(
'XMLRPC' => 1,
'JSON' => 1,
'JS_CALLBACK' => 1);
862 $error = $oModule->getError();
863 $message = $oModule->getMessage();
864 $messageType = $oModule->getMessageType();
865 $redirectUrl = $oModule->getRedirectUrl();
866 if($messageType ==
'error')
debugPrint($message,
'ERROR');
870 $this->error = $message;
875 $this->_setInputValueToSession();
882 $_SESSION[
'XE_VALIDATOR_ERROR'] = $error;
883 $_SESSION[
'XE_VALIDATOR_ID'] =
Context::get(
'xe_validator_id');
884 if($message !=
'success')
886 $_SESSION[
'XE_VALIDATOR_MESSAGE'] = $message;
888 $_SESSION[
'XE_VALIDATOR_MESSAGE_TYPE'] = $messageType;
892 $_SESSION[
'XE_VALIDATOR_RETURN_URL'] = $redirectUrl;
906 if($_SESSION[
'XE_VALIDATOR_ERROR'] && !
Context::get(
'XE_VALIDATOR_ERROR'))
908 Context::set(
'XE_VALIDATOR_ERROR', $_SESSION[
'XE_VALIDATOR_ERROR']);
910 if($_SESSION[
'XE_VALIDATOR_MESSAGE'] && !
Context::get(
'XE_VALIDATOR_MESSAGE'))
912 Context::set(
'XE_VALIDATOR_MESSAGE', $_SESSION[
'XE_VALIDATOR_MESSAGE']);
914 if($_SESSION[
'XE_VALIDATOR_MESSAGE_TYPE'] && !
Context::get(
'XE_VALIDATOR_MESSAGE_TYPE'))
916 Context::set(
'XE_VALIDATOR_MESSAGE_TYPE', $_SESSION[
'XE_VALIDATOR_MESSAGE_TYPE']);
918 if($_SESSION[
'XE_VALIDATOR_RETURN_URL'] && !
Context::get(
'XE_VALIDATOR_RETURN_URL'))
920 Context::set(
'XE_VALIDATOR_RETURN_URL', $_SESSION[
'XE_VALIDATOR_RETURN_URL']);
922 if($_SESSION[
'XE_VALIDATOR_ID'] && !
Context::get(
'XE_VALIDATOR_ID'))
924 Context::set(
'XE_VALIDATOR_ID', $_SESSION[
'XE_VALIDATOR_ID']);
926 if(count($_SESSION[
'INPUT_ERROR']))
931 $this->_clearErrorSession();
940 $_SESSION[
'XE_VALIDATOR_ERROR'] =
'';
941 $_SESSION[
'XE_VALIDATOR_MESSAGE'] =
'';
942 $_SESSION[
'XE_VALIDATOR_MESSAGE_TYPE'] =
'';
943 $_SESSION[
'XE_VALIDATOR_RETURN_URL'] =
'';
944 $_SESSION[
'XE_VALIDATOR_ID'] =
'';
945 $_SESSION[
'INPUT_ERROR'] =
'';
955 unset($requestVars->act, $requestVars->mid, $requestVars->vid, $requestVars->success_return_url, $requestVars->error_return_url);
956 foreach($requestVars AS $key => $value)
958 $_SESSION[
'INPUT_ERROR'][$key] = $value;
970 if(!$oModule || !is_object($oModule))
972 $this->error =
'msg_module_is_not_exists';
973 $this->httpStatusCode =
'404';
979 $this->error =
'msg_dbconnect_failed';
986 $this->error =
$output->getMessage();
990 $methodList = array(
'XMLRPC' => 1,
'JSON' => 1,
'JS_CALLBACK' => 1);
994 if($_SESSION[
'XE_VALIDATOR_RETURN_URL'])
997 $display_handler->_debugOutput();
999 header(
'location:' . $_SESSION[
'XE_VALIDATOR_RETURN_URL']);
1009 $oMessageObject->setError(-1);
1010 $oMessageObject->setMessage($this->error);
1011 $oMessageObject->dispMessage();
1013 if($oMessageObject->getHttpStatusCode() && $oMessageObject->getHttpStatusCode() !=
'200')
1015 $this->_setHttpStatusMessage($oMessageObject->getHttpStatusCode());
1016 $oMessageObject->setTemplateFile(
'http_status_code');
1022 $oModule->setTemplatePath($oMessageObject->getTemplatePath());
1023 $oModule->setTemplateFile($oMessageObject->getTemplateFile());
1028 $oModule = $oMessageObject;
1031 $this->_clearErrorSession();
1049 $layout_srl = $oLayoutAdminModel->getSiteDefaultLayout($viewType, $oModule->module_info->site_srl);
1056 $oLayoutModel =
getModel(
'layout');
1057 $layout_info = $oLayoutModel->getLayout(
$layout_srl);
1062 if($layout_info->extra_var_count)
1065 foreach($layout_info->extra_var as $var_id => $val)
1067 if($val->type ==
'image')
1069 if(strncmp(
'./files/attach/images/', $val->value, 22) === 0)
1074 $layout_info->{$var_id} = $val->value;
1078 if($layout_info->menu_count)
1080 foreach($layout_info->menu as $menu_id => $menu)
1083 if(!$menu->menu_srl || $menu->menu_srl == -1)
1090 include($homeMenuCacheFile);
1093 if(!$menu->menu_srl)
1095 $menu->xml_file = str_replace(
'.xml.php', $homeMenuSrl .
'.xml.php', $menu->xml_file);
1096 $menu->php_file = str_replace(
'.php', $homeMenuSrl .
'.php', $menu->php_file);
1097 $layout_info->menu->{$menu_id}->menu_srl = $homeMenuSrl;
1101 $menu->xml_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->xml_file);
1102 $menu->php_file = str_replace($menu->menu_srl, $homeMenuSrl, $menu->php_file);
1118 $oModule->setLayoutPath($layout_info->path);
1119 $oModule->setLayoutFile(
'layout');
1122 $edited_layout = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl);
1123 if(file_exists($edited_layout))
1125 $oModule->setEditedLayoutFile($edited_layout);
1132 $kind = stripos($this->act,
'admin') !== FALSE ?
'admin' :
'';
1133 if($kind ==
'admin')
1135 $oModule->setLayoutFile(
'popup_layout');
1139 $oModule->setLayoutPath(
'common/tpl');
1140 $oModule->setLayoutFile(
'default_layout');
1147 $oDisplayHandler->printContent($oModule);
1157 return sprintf(
'./modules/%s/', $module);
1176 $parent_module = $module;
1177 $kind = strtolower($kind);
1178 $type = strtolower($type);
1180 $kinds = array(
'svc' => 1,
'admin' => 1);
1181 if(!isset($kinds[$kind]))
1186 $key = $module .
'.' . ($kind !=
'admin' ?
'' :
'admin') .
'.' . $type;
1188 if(is_array(
$GLOBALS[
'__MODULE_EXTEND__']) && array_key_exists($key,
$GLOBALS[
'__MODULE_EXTEND__']))
1190 $module = $extend_module =
$GLOBALS[
'__MODULE_EXTEND__'][$key];
1194 if(!isset(
$GLOBALS[
'_loaded_module'][$module][$type][$kind]))
1198 if($extend_module && (!is_readable($high_class_file) || !is_readable($class_file)))
1200 $module = $parent_module;
1205 if(!class_exists($module,
true))
1209 if(!class_exists($instance_name,
true))
1215 $oModule =
new $instance_name();
1216 if(!is_object($oModule))
1229 $oModule->setModule($module);
1230 $oModule->setModulePath($class_path);
1233 if(!isset(
$GLOBALS[
'_called_constructor'][$instance_name]))
1235 $GLOBALS[
'_called_constructor'][$instance_name] = TRUE;
1236 if(@method_exists($oModule, $instance_name))
1238 $oModule->{$instance_name}();
1243 $GLOBALS[
'_loaded_module'][$module][$type][$kind] = $oModule;
1252 return $GLOBALS[
'_loaded_module'][$module][$type][$kind];
1255 function _getModuleFilePath($module, $type, $kind, &$classPath, &$highClassFile, &$classFile, &$instanceName)
1259 $highClassFile = sprintf(
'%s%s%s.class.php',
_XE_PATH_, $classPath, $module);
1262 $types = array(
'view',
'controller',
'model',
'api',
'wap',
'mobile',
'class');
1263 if(!in_array($type, $types))
1267 if($type ==
'class')
1269 $instanceName =
'%s';
1270 $classFile =
'%s%s.%s.php';
1272 elseif($kind ==
'admin' && array_search($type, $types) < 3)
1274 $instanceName =
'%sAdmin%s';
1275 $classFile =
'%s%s.admin.%s.php';
1279 $instanceName =
'%s%s';
1280 $classFile =
'%s%s.%s.php';
1283 $instanceName = sprintf($instanceName, $module, ucfirst($type));
1303 $triggers =
$oModuleModel->getTriggers($trigger_name, $called_position);
1304 if(!$triggers || count($triggers) < 1)
1310 $before_trigger_time = NULL;
1311 if(__LOG_SLOW_TRIGGER__> 0)
1313 $before_trigger_time = microtime(
true);
1316 foreach($triggers as $item)
1318 $module = $item->module;
1319 $type = $item->type;
1320 $called_method = $item->called_method;
1324 if(!$oModule || !method_exists($oModule, $called_method))
1329 $before_each_trigger_time = microtime(
true);
1333 $after_each_trigger_time = microtime(
true);
1334 $elapsed_time_trigger = $after_each_trigger_time - $before_each_trigger_time;
1336 $slowlog =
new stdClass;
1337 $slowlog->caller = $trigger_name .
'.' . $called_position;
1338 $slowlog->called = $module .
'.' . $called_method;
1339 $slowlog->called_extension = $module;
1340 if($trigger_name !=
'XE.writeSlowlog')
writeSlowlog(
'trigger', $elapsed_time_trigger, $slowlog);
1359 $statusMessageList = array(
1361 '100' =>
'Continue',
1362 '101' =>
'Switching Protocols',
1363 '102' =>
'Processing',
1367 '202' =>
'Accepted',
1368 '203' =>
'Non-authoritative Information',
1369 '204' =>
'No Content',
1370 '205' =>
'Reset Content',
1371 '206' =>
'Partial Content',
1372 '207' =>
'Multi-Status',
1373 '208' =>
'Already Reported',
1376 '300' =>
'Multiple Choices',
1377 '301' =>
'Moved Permanently',
1379 '303' =>
'See Other',
1380 '304' =>
'Not Modified',
1381 '305' =>
'Use Proxy',
1382 '307' =>
'Temporary Redirect',
1383 '308' =>
'Permanent Redirect',
1385 '400' =>
'Bad Request',
1386 '401' =>
'Unauthorized',
1387 '402' =>
'Payment Required',
1388 '403' =>
'Forbidden',
1389 '404' =>
'Not Found',
1390 '405' =>
'Method Not Allowed',
1391 '406' =>
'Not Acceptable',
1392 '407' =>
'Proxy Authentication Required',
1393 '408' =>
'Request Timeout',
1394 '409' =>
'Conflict',
1396 '411' =>
'Length Required',
1397 '412' =>
'Precondition Failed',
1398 '413' =>
'Payload Too Large',
1399 '414' =>
'Request-URI Too Long',
1400 '415' =>
'Unsupported Media Type',
1401 '416' =>
'Requested Range Not Satisfiable',
1402 '417' =>
'Expectation Failed',
1403 '418' =>
'I\'m a teapot',
1404 '421' =>
'Misdirected Request',
1405 '422' =>
'Unprocessable Entity',
1407 '424' =>
'Failed Dependency',
1408 '426' =>
'Upgrade Required',
1409 '428' =>
'Precondition Required',
1410 '429' =>
'Too Many Requests',
1411 '431' =>
'Request Header Fields Too Large',
1412 '451' =>
'Unavailable For Legal Reasons',
1414 '500' =>
'Internal Server Error',
1415 '501' =>
'Not Implemented',
1416 '502' =>
'Bad Gateway',
1417 '503' =>
'Service Unavailable',
1418 '504' =>
'Gateway Timeout',
1419 '505' =>
'HTTP Version Not Supported',
1420 '506' =>
'Variant Also Negotiates',
1421 '507' =>
'Insufficient Storage',
1422 '508' =>
'Loop Detected',
1423 '510' =>
'Not Extended',
1424 '511' =>
'Network Authentication Required',
1426 $statusMessage = $statusMessageList[$code];
1429 $statusMessage =
'HTTP ' . $code;
& getModuleInstance($module, $type= 'view', $kind= '')
getController($module_name)
displayContent($oModule=NULL)
$module_info
Module Info. Object.
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']
_setInputErrorToContext()
debugPrint($debug_output=NULL, $display_option=TRUE, $file= '_debug_message.php')
$document_srl
Document Number.
set($key, $val, $set_to_get_vars=0)
setBrowserTitle($site_title)
_setHttpStatusMessage($code)
$oContext
Include the necessary configuration files.
__construct($module= '', $act= '', $mid= '', $document_srl= '', $module_srl= '')
getAdminModel($module_name)
$httpStatusCode
http status code.
_getModuleFilePath($module, $type, $kind, &$classPath, &$highClassFile, &$classFile, &$instanceName)
getAdminView($module_name)
getRequestUri($ssl_mode=FOLLOW_REQUEST_SSL, $domain=null)
$module_srl
Module Number.
getAdminController($module_name)
writeSlowlog($type, $elapsed_time, $obj)
static getErrorType($errno)
static xeErrorLog($errnumber, $errormassage, $errorfile, $errorline, $errorcontext)
_setInputValueToSession()
addMetaTag($name, $content, $is_http_equiv=FALSE)
getModule($module_name, $type= 'view', $kind= '')
triggerCall($trigger_name, $called_position, &$obj)
high class of the module module
if(isset($_REQUEST['encode'])) if(isset($_REQUEST['decode'])) $lang
isExistsSSLAction($action)