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


PHP Kohana::shutdown方法代码示例

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


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

示例1: _serve_from_cache

 public function _serve_from_cache()
 {
     // Check the expiry time in the request headers and just return
     // Not Modified if appropriate
     if ($this->expiry_time) {
         expires::check($this->expiry_time);
     }
     // If caching is turned on and we're using Kohana's cache library ...
     if ($this->cache and !$this->cache_config_writes_to_docroot()) {
         // Get cache id (calling this cache_id() method if it's not already set)
         $cache_id = isset($this->cache_id) ? $this->cache_id : ($this->cache_id = $this->cache_id());
         // Try to retrive it from the cache
         $content = $this->cache_instance()->get($cache_id);
         if (!empty($content)) {
             // Serve the cached content ...
             echo $content;
             // ... run the shutdown events
             Kohana::shutdown();
             // ... and bail out
             exit;
         }
     }
     // Add handler to cache the output (we check whether caching is
     // turned on at the final moment)
     Event::add('system.display', array($this, '_cache_output'));
 }
开发者ID:evansd-archive,项目名称:kohana-module--assets,代码行数:26,代码来源:assets_base.php

示例2: define

 *
 * ----------------------------------------------------------------------------
 */
// Define the name of the front controller index
define('FCINDEX', basename(__FILE__));
// Define the absolute paths for configured directories
define('DOCROOT', str_replace('\\', '/', realpath(getcwd())) . '/');
define('APPPATH', str_replace('\\', '/', realpath($application)) . '/');
define('MODPATH', str_replace('\\', '/', realpath($modules)) . '/');
define('SYSPATH', str_replace('\\', '/', realpath($system)) . '/');
// Clean up the configuration vars
unset($application, $modules, $system);
if (file_exists('install' . EXT)) {
    // Load the installation check
    return include 'install' . EXT;
}
// Load the main Kohana class
require SYSPATH . 'classes/kohana' . EXT;
// Enable auto-loading of classes
spl_autoload_register(array('Kohana', 'auto_load'));
// Enable the exception handler
// set_exception_handler(array('Kohana', 'exception_handler'));
// Enable the error-to-exception handler
set_error_handler(array('Kohana', 'error_handler'));
// Initialize the environment
Kohana::init();
// Create the main instance
Kohana::instance();
// Shutdown the environment
Kohana::shutdown();
开发者ID:ascseb,项目名称:kohana,代码行数:30,代码来源:index.php


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