Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
1. Include the module in bootstrap.php
2. Initialization $cache = Cache::instance();
3. Add something to the cache $cache->set('foo', 'bar', 1800)
(add bar to the cache for 1800 sec.)
4. Get something from the cache $cache->get('foo')
kohanaframework.org/3.3/guide/cache/usage SQl
caching -requests (we cache the result for 1800 seconds):
Route caching:
if ( ! Route::cache())
{
// Роуты
if (Kohana::$environment === Kohana::PRODUCTION)
Route::cache(true);
}
Added caching of routes, it seems to work, it does not write errors.
if ( ! Route::cache())
{
// Роуты
if (Kohana::$environment === Kohana::PRODUCTION)
Route::cache(true);
}
$cache->set('foo', 'bar', 1800)
(add bar to the cache for 1800 sec.) $cache->get('foo')
$version = 'new';
if (UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "MSIE")){
if(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "MSIE 5")) $version = 'UPDATE';
elseif(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "MSIE 6.0")) $version = 'UPDATE';
elseif(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "MSIE 7.0")) $version = 'ie';
elseif(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "MSIE 8.0")) $version = 'ie';
}
elseif (UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Firefox")){
if (UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Firefox/1")) $version = 'UPDATE';
elseif (UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Firefox/2")) $version = 'UPDATE';
elseif (UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Firefox/3")) $version = 'old';
}
elseif (UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Safari")){
if(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Version/2")) $version = 'UPDATE';
elseif(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Version/3")) $version = 'UPDATE';
elseif(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Version/4")) $version = 'old';
}
elseif (UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Presto")){
if(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Version/9")) $version = 'UPDATE';
elseif(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Version/10")) $version = 'old';
elseif(UTF8::stristr($_SERVER["HTTP_USER_AGENT"], "Version/11")) $version = 'old';
}
define('BROWSER', $version);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question