本文整理汇总了PHP中Kohana::save_cache方法的典型用法代码示例。如果您正苦于以下问题:PHP Kohana::save_cache方法的具体用法?PHP Kohana::save_cache怎么用?PHP Kohana::save_cache使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kohana
的用法示例。
在下文中一共展示了Kohana::save_cache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initializes the environment:
*
* - Loads hooks
* - Converts all input variables to the configured character set
*
* @return void
*/
public static function init()
{
if (self::$init === TRUE) {
return;
}
// Test if the current environment is command-line
self::$is_cli = PHP_SAPI === 'cli';
// Test if the current evironment is Windows
self::$is_windows = DIRECTORY_SEPARATOR === '\\';
// Determine if the server supports UTF-8 natively
utf8::$server_utf8 = extension_loaded('mbstring');
// Load the file path cache
self::$file_path = Kohana::cache('kohana_file_paths');
// Load the configuration loader
self::$config = new Kohana_Config_Loader();
// Import the main configuration locally
$config = self::$config->kohana;
// Set the default locale
self::$default_locale = $config->default_locale;
self::$save_cache = $config->save_cache;
self::$charset = $config->charset;
// Localize the environment
self::locale($config->locale);
// Set the enviroment time
self::timezone($config->timezone);
// Enable modules
self::modules($config->modules);
if ($hooks = self::list_files('hooks', TRUE)) {
foreach ($hooks as $hook) {
// Load each hook in the order they appear
require $hook;
}
}
// Convert global variables to current charset.
$_GET = utf8::clean($_GET, self::$charset);
$_POST = utf8::clean($_POST, self::$charset);
$_SERVER = utf8::clean($_SERVER, self::$charset);
// The system has been initialized
self::$init = TRUE;
}