A
A
Anton2015-09-09 06:26:19
css
Anton, 2015-09-09 06:26:19

How to use caching in kohana?

Hello, I decided to enable caching in the kohan, but gave an error.
I open
bootstrap.php
in it where routing
is at the beginning of routing
if ( ! Route::cache()) {
and after
//Route::cache(TRUE);
}
if you remove the slashes, //Route::cache(TRUE);
it throws an error.
What is the problem?
I also added these lines in bootstrap
'cache_dir' => APPPATH.'cache',
'caching' => false
though I don't know if they are needed.

Exception [ 0 ]: Serialization of 'Closure' is not allowed

SYSPATH/classes/kohana/core.php [ 926 ]

921 			// Set permissions (must be manually set to fix umask issues)
922 			chmod($dir, 0777);
923 		}
924 
925 		// Force the data to be a string
926 		$data = serialize($data);
927 
928 		try
929 		{
930 			// Write the cache
931 			return (bool) file_put_contents($dir.$file, $data, LOCK_EX);
    SYSPATH/classes/kohana/core.php [ 926 ] » serialize(arguments)
    SYSPATH/classes/kohana/route.php [ 159 ] » Kohana_Core::cache(arguments)
    APPPATH/bootstrap.php [ 238 ] » Kohana_Route::cache(arguments)
    DOCROOT/index.php [ 102 ] » require(arguments)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question