当前位置: 首页>>代码示例>>PHP>>正文


PHP Profiler::render方法代码示例

本文整理汇总了PHP中Profiler::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Profiler::render方法的具体用法?PHP Profiler::render怎么用?PHP Profiler::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profiler的用法示例。


在下文中一共展示了Profiler::render方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Profiler

 static function admin_page_bottom($theme)
 {
     if (Session::instance()->get("profiler", false)) {
         $profiler = new Profiler();
         $profiler->render();
     }
 }
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:7,代码来源:core_theme.php

示例2: Profiler

 static function admin_page_bottom($theme)
 {
     $session = Session::instance();
     if ($session->get("profiler", false)) {
         $profiler = new Profiler();
         $profiler->render();
     }
     if ($session->get("l10n_mode", false)) {
         return L10n_Client_Controller::l10n_form();
     }
 }
开发者ID:scarygary,项目名称:gallery3,代码行数:11,代码来源:gallery_theme.php

示例3: reply

 static function reply($data = array())
 {
     Session::instance()->abort_save();
     header("X-Gallery-API-Version: " . rest::API_VERSION);
     switch (Input::instance()->get("output", "json")) {
         case "json":
             json::reply($data);
             break;
         case "jsonp":
             if (!($callback = Input::instance()->get("callback", ""))) {
                 throw new Rest_Exception("Bad Request", 400, array("errors" => array("callback" => "missing")));
             }
             if (preg_match('/^[$A-Za-z_][0-9A-Za-z_]*$/', $callback) == 1) {
                 header("Content-type: application/javascript; charset=UTF-8");
                 print "{$callback}(" . json_encode($data) . ")";
             } else {
                 throw new Rest_Exception("Bad Request", 400, array("errors" => array("callback" => "invalid")));
             }
             break;
         case "html":
             header("Content-type: text/html; charset=UTF-8");
             if ($data) {
                 $html = preg_replace("#([\\w]+?://[\\w]+[^ \\'\"\n\r\t<]*)#ise", "'<a href=\"\\1\" >\\1</a>'", var_export($data, 1));
             } else {
                 $html = t("Empty response");
             }
             print "<pre>{$html}</pre>";
             if (Session::instance()->get("profiler", false)) {
                 Profiler::enable();
                 $profiler = new Profiler();
                 $profiler->render();
             }
             break;
         default:
             throw new Rest_Exception("Bad Request", 400);
     }
 }
开发者ID:kandsten,项目名称:gallery3,代码行数:37,代码来源:rest.php

示例4: index

 function index()
 {
     $session = Session::instance();
     set_error_handler(array("Scaffold_Controller", "_error_handler"));
     try {
         $this->template->album_count = ORM::factory("item")->where("type", "album")->count_all();
         $this->template->photo_count = ORM::factory("item")->where("type", "photo")->count_all();
         $this->template->album_tree = $this->_load_album_tree();
         $this->template->add_photo_html = $this->_get_add_photo_html();
     } catch (Exception $e) {
         $this->template->album_count = 0;
         $this->template->photo_count = 0;
         $this->template->deepest_photo = null;
         $this->template->album_tree = array();
         $this->template->add_photo_html = "";
     }
     $this->_load_comment_info();
     $this->_load_tag_info();
     restore_error_handler();
     if (!empty($session) && $session->get("profiler", false)) {
         $profiler = new Profiler();
         $profiler->render();
     }
 }
开发者ID:xafr,项目名称:gallery3,代码行数:24,代码来源:scaffold.php

示例5: Profiler

 static function admin_page_bottom($theme)
 {
     $session = Session::instance();
     if ($session->get("profiler", false)) {
         Profiler::enable();
         $profiler = new Profiler();
         $profiler->render();
     }
     // Redirect to the root album when the admin session expires.
     $content = '<script type="text/javascript">
   var adminReauthCheck = function() {
     $.ajax({url: "' . url::site("admin?reauth_check=1") . '",
             dataType: "json",
             success: function(data){
               if ("location" in data) {
                 document.location = data.location;
               }
             }});
   };
   setInterval("adminReauthCheck();", 60 * 1000);
   </script>';
     if (upgrade_checker::should_auto_check()) {
         $content .= '<script type="text/javascript">
     $.ajax({url: "' . url::site("admin/upgrade_checker/check_now?csrf=" . access::csrf_token()) . '"});
     </script>';
     }
     if ($session->get("l10n_mode", false)) {
         $content .= "\n" . L10n_Client_Controller::l10n_form();
     }
     return $content;
 }
开发者ID:Joe7,项目名称:gallery3,代码行数:31,代码来源:gallery_theme.php

示例6: function

        // Enable the profiler.
        \Profiler::disable();
    } else {
        $controller = $chain->next($self, $params, $chain);
        if (Libraries::get('li3_profiler', 'inject')) {
            /**
             * If we have a `Controller` object we will filter it so that we can
             * inject our rendering HTML.
             */
            if (is_a($controller, '\\lithium\\action\\Controller')) {
                $controller->applyFilter('__invoke', function ($self, $params, $chain) {
                    $response = $chain->next($self, $params, $chain);
                    if ($response->type === 'text/html') {
                        /**
                         * Here we tack in our rendering if the `Response` object happens
                         * to be "text/html" and we are enabled.
                         */
                        ob_start();
                        \Profiler::render();
                        $response->body = str_replace('</body>', ob_get_clean() . '</body>', $response->body);
                    }
                    return $response;
                });
            }
        }
        return $controller;
    }
    return $chain->next($self, $params, $chain);
});
// Attach our separate filters to the application.
require __DIR__ . '/bootstrap/filters.php';
开发者ID:joebeeson,项目名称:li3_profiler,代码行数:31,代码来源:bootstrap.php

示例7: __call

 public function __call($function, $args)
 {
     // Force zlib compression off.  Image and movie files are already compressed and
     // recompressing them is CPU intensive.
     if (ini_get("zlib.output_compression")) {
         ini_set("zlib.output_compression", "Off");
     }
     // request_uri: gallery3/var/albums/foo/bar.jpg?m=1234
     $request_uri = rawurldecode(Input::instance()->server("REQUEST_URI"));
     // get rid of query parameters
     // request_uri: gallery3/var/albums/foo/bar.jpg
     $request_uri = preg_replace("/\\?.*/", "", $request_uri);
     // var_uri: gallery3/var/
     $var_uri = url::file("var/");
     // Make sure that the request is for a file inside var
     $offset = strpos(rawurldecode($request_uri), $var_uri);
     if ($offset !== 0) {
         $e = new Kohana_404_Exception();
         $e->test_fail_code = 1;
         throw $e;
     }
     // file_uri: albums/foo/bar.jpg
     $file_uri = substr($request_uri, strlen($var_uri));
     // type: albums
     // path: foo/bar.jpg
     list($type, $path) = explode("/", $file_uri, 2);
     if ($type != "resizes" && $type != "albums" && $type != "thumbs") {
         $e = new Kohana_404_Exception();
         $e->test_fail_code = 2;
         throw $e;
     }
     // Get the item model using the path and type (which corresponds to a var subdir)
     $item = item::find_by_path($path, $type);
     if (!$item->loaded()) {
         $e = new Kohana_404_Exception();
         $e->test_fail_code = 3;
         throw $e;
     }
     // Make sure we have access to the item
     if (!access::can("view", $item)) {
         $e = new Kohana_404_Exception();
         $e->test_fail_code = 4;
         throw $e;
     }
     // Make sure we have view_full access to the original
     if ($type == "albums" && !access::can("view_full", $item)) {
         $e = new Kohana_404_Exception();
         $e->test_fail_code = 5;
         throw $e;
     }
     // Don't try to load a directory
     if ($type == "albums" && $item->is_album()) {
         $e = new Kohana_404_Exception();
         $e->test_fail_code = 6;
         throw $e;
     }
     // Note: this code is roughly duplicated in data_rest, so if you modify this, please look to
     // see if you should make the same change there as well.
     if ($type == "albums") {
         $file = $item->file_path();
     } else {
         if ($type == "resizes") {
             $file = $item->resize_path();
         } else {
             $file = $item->thumb_path();
         }
     }
     if (!file_exists($file)) {
         $e = new Kohana_404_Exception();
         $e->test_fail_code = 7;
         throw $e;
     }
     if (gallery::show_profiler()) {
         Profiler::enable();
         $profiler = new Profiler();
         $profiler->render();
         exit;
     }
     header("Content-Length: " . filesize($file));
     header("Pragma:");
     // Check that the content hasn't expired or it wasn't changed since cached
     expires::check(2592000, $item->updated);
     // We don't need to save the session for this request
     Session::instance()->abort_save();
     expires::set(2592000, $item->updated);
     // 30 days
     // Dump out the image.  If the item is a movie or album, then its thumbnail will be a JPG.
     if (($item->is_movie() || $item->is_album()) && $type == "thumbs") {
         header("Content-Type: image/jpeg");
     } else {
         header("Content-Type: {$item->mime_type}");
     }
     if (TEST_MODE) {
         return $file;
     } else {
         // Don't use Kohana::close_buffers(false) here because that only closes all the buffers
         // that Kohana started.  We want to close *all* buffers at this point because otherwise we're
         // going to buffer up whatever file we're proxying (and it may be very large).  This may
         // affect embedding or systems with PHP's output_buffering enabled.
         while (ob_get_level()) {
//.........这里部分代码省略.........
开发者ID:HarriLu,项目名称:gallery3,代码行数:101,代码来源:file_proxy.php

示例8: Profiler

 static function admin_page_bottom($theme)
 {
     $session = Session::instance();
     if ($session->get("profiler", false)) {
         Profiler::enable();
         $profiler = new Profiler();
         $profiler->render();
     }
     // Redirect to the root album when the admin session expires.
     $admin_session_redirect_check = '<script type="text/javascript">
   var adminReauthCheck = function() {
     $.ajax({url: "' . url::site("admin?reauth_check=1") . '",
             dataType: "json",
             success: function(data){
               if ("location" in data) {
                 document.location = data.location;
               }
             }});
   };
   setInterval("adminReauthCheck();", 60 * 1000);
   </script>';
     print $admin_session_redirect_check;
     if ($session->get("l10n_mode", false)) {
         return L10n_Client_Controller::l10n_form();
     }
 }
开发者ID:andyst,项目名称:gallery3,代码行数:26,代码来源:gallery_theme.php


注:本文中的Profiler::render方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。