本文整理汇总了PHP中Profiler::mark_memory方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::mark_memory方法的具体用法?PHP Profiler::mark_memory怎么用?PHP Profiler::mark_memory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Profiler
的用法示例。
在下文中一共展示了Profiler::mark_memory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
/**
* Load every call to the API with this method.
*
* @return void
* @access public
*/
public function action_index()
{
// Profile the loader
\Profiler::mark('Start of loader\'s action_index() function');
\Profiler::mark_memory($this, 'Start of loader\'s action_index() function');
// Make sure we aren't processing crap.
if (in_array($this->format, array('csv', 'php', 'serialize'))) {
$this->format = 'json';
}
// For some reason this value is quoted when set to html.
if (\Input::post('format') === '"html"') {
$this->format = 'html';
}
// Cleanse the session to keep things stable.
\Session::destroy();
// For error handling
\Session::set('response_format', $this->format);
// External error processing through Apache
if (\Uri::segment(1) === 'error' && is_numeric(\Uri::segment(2)) && strlen(\Uri::segment(2)) === 3) {
return $this->response(\Utility::format_error(\Uri::segment(2)));
}
// /loader/index/error/404 style (Due to routing)
if (substr_count(\Uri::current(), 'loader/index/error') === 1 && is_numeric(\Uri::segment(4)) && strlen(\Uri::segment(4)) === 3) {
return $this->response(\Utility::format_error(\Uri::segment(4)));
}
// We need a version number
if (empty(\Uri::segment(1)) || \Module::exists(\Uri::segment(1)) === false) {
$error_data = \Utility::format_error(400, \Err::BAD_OR_NO_VERSION, \Lang::get('errors.bad_version'));
return $this->response($error_data, 400);
}
// We need a request.
if (empty(\Input::post()) || \Input::method() !== 'POST') {
$error_data = \Utility::format_error(405, null, \Lang::get('errors.no_request'));
return $this->response($error_data, 405);
}
// Pass the request to the proper API version request handler. (Module)
if (!empty(\Input::post())) {
\Module::load(\Uri::segment(1));
$response = \Request::forge(\Uri::segment(1) . '/index', false)->execute()->response->body;
// HTML only Data Calls
if (is_string($response)) {
return $this->response($response, 200);
}
return $this->response($response[0], $response[1]);
}
}