Jules, Create a ticket with patch in trac and assign to me and I will resolve. I will refactor the plugin for 1.3.
Also, the whole point of using apc/eaccelerator is not to have to read from disk - sqlite requires disk, which defeats the point of the cache. You should just use sfNoCache or request your host installs apc. You really shouldn't be running a symfony app with out apc. - Dustin On 8/24/09 2:28 PM, "ju1ius" <jules.berna...@gmail.com> wrote: > > Hello everyone ! > > I tried to patch the ysfDimensionsPlugin for use with sfSqliteCache, > as neither APC nor eAccelerator are available on my shared host. > At first I thought it was just a matter of applying this patch (http:// > trac.symfony-project.org/ticket/6267) and serializing/unserialising > cache data. But it turned out that I also had to change the cache > directory when the dimension change, which gives me one db file in > each dimension directory... > So I was wondering how to avoid duplicate db files ? > And also if it is possible to avoid serializing cache data ? > > Thanks for your wise advices ! > > Here are my changes: > > in ysfConfigDimension.php: > public function setCache(sfCache $cache){ > $this->cache = $cache; > } > > in ysfProjectConfiguration.php: > /** > * Sets the project dimension. > * > * @param array The configuration dimension as an array > */ > public function setDimension($dimension) > { > if ($dimension === null || $dimension === false) > { > $this->dimension = null; > > // if dimension changes, change cache dir > $this->setCacheDir($this->getRootDir().'/cache'); > } > else > { > try > { > if(!$this->hasDimension()) > { > $this->dimension = new ysfConfigDimension( > $this->getEventDispatcher(), > > (!isset($this->debug) || (isset($this->debug) && $this- >> debug === true)) > ? new sfNoCache() > // Patch to allow other cache handler > : $this->getDimensionCacheHandler() > > ); > } > > // set dimension > $this->dimension->set($dimension); > > sfConfig::set('sf_dimension', $this->dimension->getName()); > > // if dimension changes, change cache dir > $cache_dir = $this->getRootDir().'/cache/'.$this->dimension- >> getName(); > $this->setCacheDir($cache_dir); > // Reconfigure SQLite cache > $this->dimension->setCache( > new sfSQLiteCache( > array( > 'database' => sfConfig::get('sf_cache_dir').'/ > cache.sqlite', > 'automatic_cleaning_factor' => 0, > 'lifetime' => 86400 > ) > ) > ); > } > catch (sfException $e) > { > if(method_exists($e, 'asResponse')) > { > // handle exception early on and exit if something bad happens > $e->asResponse()->send(); exit; > } > else > { > echo $e->getMessage(); exit; > } > } > } > } > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---