29 (defined(
'__OB_GZHANDLER_ENABLE__') && __OB_GZHANDLER_ENABLE__ == 1) &&
30 strpos($_SERVER[
'HTTP_ACCEPT_ENCODING'],
'gzip') !== FALSE &&
31 extension_loaded(
'zlib') &&
32 $oModule->gzhandler_enable
35 $this->gz_enabled = TRUE;
46 if(strpos($_SERVER[
'HTTP_USER_AGENT'],
'MSIE') !== FALSE)
48 $this->gz_enabled = FALSE;
70 $called_position =
'before_display_content';
73 if(file_exists($addon_file)) include($addon_file);
75 if(method_exists(
$handler,
"prepareToPrint"))
82 $httpStatusCode = $oModule->getHttpStatusCode();
83 if($httpStatusCode && $httpStatusCode != 200)
104 $this->content_size = strlen(
$output);
111 $this->gz_enabled = FALSE;
115 if($this->gz_enabled)
117 ini_set(
'zlib.output_compression',
true);
144 if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION,
'6.0.0') === -1)
149 $firephp = FirePHP::getInstance(
true);
152 if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER[
'REMOTE_ADDR'])
154 $firephp->fb(
'Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php',
'The IP address is not allowed.');
164 array(
'Request URI',
'Request method',
'Response method',
'Response contents size',
'Memory peak usage'),
166 sprintf(
"%s:%s%s%s%s", $_SERVER[
'SERVER_NAME'], $_SERVER[
'SERVER_PORT'], $_SERVER[
'PHP_SELF'], $_SERVER[
'QUERY_STRING'] ?
'?' :
'', $_SERVER[
'QUERY_STRING']),
167 $_SERVER[
'REQUEST_METHOD'],
169 $this->content_size .
' byte',
178 'Elapsed time >>> Total : ' . sprintf(
'%0.5f sec', $end - __StartTime__),
179 array(array(
'DB queries',
'class file load',
'Template compile',
'XmlParse compile',
'PHP',
'Widgets',
'Trans Content'),
181 sprintf(
'%0.5f sec',
$GLOBALS[
'__db_elapsed_time__']),
182 sprintf(
'%0.5f sec',
$GLOBALS[
'__elapsed_class_load__']),
183 sprintf(
'%0.5f sec (%d called)',
$GLOBALS[
'__template_elapsed__'],
$GLOBALS[
'__TemplateHandlerCalled__']),
184 sprintf(
'%0.5f sec',
$GLOBALS[
'__xmlparse_elapsed__']),
185 sprintf(
'%0.5f sec', $end - __StartTime__ -
$GLOBALS[
'__template_elapsed__'] -
$GLOBALS[
'__xmlparse_elapsed__'] -
$GLOBALS[
'__db_elapsed_time__'] -
$GLOBALS[
'__elapsed_class_load__']),
186 sprintf(
'%0.5f sec',
$GLOBALS[
'__widget_excute_elapsed__']),
187 sprintf(
'%0.5f sec',
$GLOBALS[
'__trans_content_elapsed__'])
196 if((__DEBUG__ & 4) &&
$GLOBALS[
'__db_queries__'])
198 $queries_output = array(array(
'Result/'.PHP_EOL.
'Elapsed time',
'Query ID',
'Query'));
199 foreach(
$GLOBALS[
'__db_queries__'] as $query)
201 $queries_output[] = array($query[
'result'] . PHP_EOL . sprintf(
'%0.5f', $query[
'elapsed_time']), str_replace(
_XE_PATH_,
'', $query[
'called_file']) . PHP_EOL . $query[
'called_method'] .
'()' . PHP_EOL . $query[
'query_id'], $query[
'query']);
205 'DB Queries >>> ' . count(
$GLOBALS[
'__db_queries__']) .
' Queries, ' . sprintf(
'%0.5f sec',
$GLOBALS[
'__db_elapsed_time__']),
220 if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER[
'REMOTE_ADDR'])
226 $buff[] =
"\n- Request/ Response info";
227 $buff[] = sprintf(
"\tRequest URI \t\t\t: %s:%s%s%s%s", $_SERVER[
'SERVER_NAME'], $_SERVER[
'SERVER_PORT'], $_SERVER[
'PHP_SELF'], $_SERVER[
'QUERY_STRING'] ?
'?' :
'', $_SERVER[
'QUERY_STRING']);
228 $buff[] = sprintf(
"\tRequest method \t\t\t: %s", $_SERVER[
'REQUEST_METHOD']);
230 $buff[] = sprintf(
"\tResponse contents size\t: %d byte", $this->content_size);
233 $buff[] = sprintf(
"\n- Total elapsed time : %0.5f sec", $end - __StartTime__);
235 $buff[] = sprintf(
"\tclass file load elapsed time \t: %0.5f sec",
$GLOBALS[
'__elapsed_class_load__']);
236 $buff[] = sprintf(
"\tTemplate compile elapsed time\t: %0.5f sec (%d called)",
$GLOBALS[
'__template_elapsed__'],
$GLOBALS[
'__TemplateHandlerCalled__']);
237 $buff[] = sprintf(
"\tXmlParse compile elapsed time\t: %0.5f sec",
$GLOBALS[
'__xmlparse_elapsed__']);
238 $buff[] = sprintf(
"\tPHP elapsed time \t\t\t\t: %0.5f sec", $end - __StartTime__ -
$GLOBALS[
'__template_elapsed__'] -
$GLOBALS[
'__xmlparse_elapsed__'] -
$GLOBALS[
'__db_elapsed_time__'] -
$GLOBALS[
'__elapsed_class_load__']);
239 $buff[] = sprintf(
"\tDB class elapsed time \t\t\t: %0.5f sec",
$GLOBALS[
'__dbclass_elapsed_time__'] -
$GLOBALS[
'__db_elapsed_time__']);
242 $buff[] = sprintf(
"\tWidgets elapsed time \t\t\t: %0.5f sec",
$GLOBALS[
'__widget_excute_elapsed__']);
245 $buff[] = sprintf(
"\tLayout compile elapsed time \t: %0.5f sec",
$GLOBALS[
'__layout_compile_elapsed__']);
248 $buff[] = sprintf(
"\tTrans Content \t\t\t\t\t: %0.5f sec",
$GLOBALS[
'__trans_content_elapsed__']);
253 if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER[
'REMOTE_ADDR'])
260 $buff[] = sprintf(
"\n- DB Queries : %d Queries. %0.5f sec", count(
$GLOBALS[
'__db_queries__']),
$GLOBALS[
'__db_elapsed_time__']);
263 foreach(
$GLOBALS[
'__db_queries__'] as $query)
265 if($query[
'result'] ==
'Success')
267 $query_result =
"Query Success";
271 $query_result = sprintf(
"Query $s : %d\n\t\t\t %s", $query[
'result'], $query[
'errno'], $query[
'errstr']);
273 $buff[] = sprintf(
"\t%02d. %s\n\t\t%0.6f sec. %s.", ++$num, $query[
'query'], $query[
'elapsed_time'], $query_result);
274 $buff[] = sprintf(
"\t\tConnection: %s.", $query[
'connection']);
275 $buff[] = sprintf(
"\t\tQuery ID: %s", $query[
'query_id']);
276 $buff[] = sprintf(
"\t\tCalled: %s. %s()", str_replace(
_XE_PATH_,
'', $query[
'called_file']), $query[
'called_method']);
284 $buff = implode(
"\r\n", $buff);
285 $buff = sprintf(
"[%s %s:%d]\r\n%s", date(
'Y-m-d H:i:s'), $file_name, $line_num, print_r($buff,
true));
287 if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER[
'REMOTE_ADDR'])
289 $buff =
'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php';
292 return "<!--\r\n" . $buff .
"\r\n-->";
296 if($buff && __DEBUG_OUTPUT__ == 0)
298 $debug_file =
_XE_PATH_ .
'files/_debug_message.php';
299 $buff = implode(PHP_EOL, $buff);
300 $buff = sprintf(
"[%s]\n%s", date(
'Y-m-d H:i:s'), print_r($buff,
true));
302 $buff = str_repeat(
'=', 80) .
"\n" . $buff .
"\n" . str_repeat(
'-', 80);
303 $buff =
"\n<?php\n/*" . $buff .
"*/\n?>\n";
305 if (!@file_put_contents($debug_file, $buff, FILE_APPEND|LOCK_EX))
319 header(
"Content-Type: text/xml; charset=UTF-8");
320 header(
"Expires: Mon, 26 Jul 1997 05:00:00 GMT");
321 header(
"Last-Modified: " . gmdate(
"D, d M Y H:i:s") .
" GMT");
322 header(
"Cache-Control: no-store, no-cache, must-revalidate");
323 header(
"Cache-Control: post-check=0, pre-check=0",
false);
324 header(
"Pragma: no-cache");
333 header(
"Content-Type: text/html; charset=UTF-8");
334 header(
"Expires: Mon, 26 Jul 1997 05:00:00 GMT");
335 header(
"Last-Modified: " . gmdate(
"D, d M Y H:i:s") .
" GMT");
336 header(
"Cache-Control: no-store, no-cache, must-revalidate");
337 header(
"Cache-Control: post-check=0, pre-check=0",
false);
338 header(
"Pragma: no-cache");
347 header(
"Content-Type: text/html; charset=UTF-8");
348 header(
"Expires: Mon, 26 Jul 1997 05:00:00 GMT");
349 header(
"Last-Modified: " . gmdate(
"D, d M Y H:i:s") .
" GMT");
350 header(
"Cache-Control: no-store, no-cache, must-revalidate");
351 header(
"Cache-Control: post-check=0, pre-check=0",
false);
352 header(
"Pragma: no-cache");
362 header(
"HTTP/1.0 $code $statusMessage");
getController($module_name)
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']
_printHttpStatusCode($code)
triggerCall($trigger_name, $called_position, &$obj)