Note that there are some explanatory texts on larger screens.

plurals
  1. POAccess cache from batch file in Symfony 1.4
    primarykey
    data
    text
    <p>I'm trying to access the cache from a batch file in Symfony 1.4.</p> <pre><code>//lib/batch/test.php require_once(dirname(__FILE__).'/../../config/ProjectConfiguration.class.php'); $configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', true); // first try $filecache = new sfFileCache(array( 'cache_dir' =&gt; sfConfig::get('sf_template_cache_dir'), 'automatic_cleaning_factor' =&gt; 0, 'prefix' =&gt; '/Library/WebServer/Documents/mywebsite/apps/frontend/template')); $cache = new sfViewCacheManager(sfContext::createInstance($configuration), $filecache); //always false var_dump($cache-&gt;has('chart/index')); //second try $class = sfConfig::get('sf_factory_view_cache', 'sfFileCache'); $filecache = new $class(sfConfig::get('sf_factory_view_cache_parameters', array ( 'automatic_cleaning_factor' =&gt; 0, 'cache_dir' =&gt; '/Library/WebServer/Documents/mywebsite/cache/frontend/dev/template', 'lifetime' =&gt; 86400, 'prefix' =&gt; '/Library/WebServer/Documents/mywebsite/apps/frontend/template', ))); $cache = new sfViewCacheManager(sfContext::createInstance($configuration), $filecache, array ( 'cache_key_use_vary_headers' =&gt; true, 'cache_key_use_host_name' =&gt; true, )); //always false var_dump($cache-&gt;has('chart/index')); </code></pre> <p>The result is different accessing the cache by a module/action (in the same dev environment)</p> <pre><code>public function executeTest() { $cache = $this-&gt;getContext()-&gt;getViewCacheManager(); //always true var_dump($cache-&gt;has('chart/index')); return sfView::NONE; } </code></pre> <p>I have compared the 2 cache objects (batch vs module/action) and they are exactly the same...</p> <p>Any idea?</p> <p>Thank you very much!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload