Thank you very much.
Another relative question is :
if I has a config like below in services.php:
$di->set('cache', function(){
//Cache Data
$frontCache = new Phalcon\Cache\Frontend\Data(array(
'lifetime' => 2592000
));
$cache = new Phalcon\Cache\Backend\File(
$frontCache,
array(
'cacheDir' => DIR.DS.'..'.DS.'dirwritable'.DS.'cache'.DS.'queries'.DS,
'prefix' => 'query_'
)
);
return $cache;
});
I use $this->cache-> ... to create cache, and everything works fine.
But how can I change "cacheDir" option from inside controller? it's protected !!!
Phalcon\Cache\Backend\File Object
(
[_frontend:protected] => Phalcon\Cache\Frontend\Data Object
(
[_frontendOptions:protected] => Array
(
[lifetime] => 2592000
)
)
[_options:protected] => Array
(
[cacheDir] => N:\myp\nc\app\config\..\dirwritable\cache\queries\
[prefix] => query_
)
[_prefix:protected] => query_
[_lastKey:protected] =>
[_lastLifetime:protected] =>
[_fresh:protected] =>
[_started:protected] =>
)
Thanks in advance.