Login   Register  
PHP Classes
elePHPant
Icontem

change in unicache-config.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      Unicache  >  All threads  >  change in unicache-config.php  >  (Un) Subscribe thread alerts  
Subject:change in unicache-config.php
Summary:change in config file
Messages:2
Author:Roberto Ramos
Date:2012-06-04 14:47:26
Update:2012-06-04 15:43:58
 

  1. change in unicache-config.php   Reply  
Picture of Roberto Ramos
Roberto Ramos
2012-06-04 14:47:26
Add in the top of the file:

$dir = dirname(__FILE__);


Edit $unicache_config :


$unicache_config=array(
'ttl' => 60, // one minute cache time to live
'cacheType' => 'FILE', // file based cache
'FILE' => array(
'cacheDir'=>$dir.'/cache' // the cache directory
),
'MEMCACHED' => array(
'servers'=>array(
array('host'=>'localhost','port'=>11211,'weight'=>10) // memcached servers
)
),
'filter_func'=>'my_filter', // user defined post cache filter function
'cache_func'=>'my_cache' // user defined function to disable caching
);


And the directory "cache" will always be within the class dir.

  2. Re: change in unicache-config.php   Reply  
Picture of Nikos M.
Nikos M.
2012-06-04 15:43:58 - In reply to message 1 from Roberto Ramos
The change is welcome, however the cacheDir was deliberatelly left to the user to define to have more flexibility.

i understand that this change gives inexperienced users more out-of-the-box
functionality

however flexibility should also be a concern