/** * Writes a cache file. * * @param string An absolute filesystem path to a configuration file * @param string An absolute filesystem path to the cache file that will be written * @param string Data to be written to the cache file * * @throws sfCacheException If the cache file cannot be written */ protected function writeCacheFile($config, $cache, &$data) { $fileCache = new sfFileCache(dirname($cache)); $fileCache->initialize(array('lifeTime' => 86400 * 365 * 10, 'automaticCleaningFactor' => 0)); $fileCache->setWriteControl(true); $fileCache->setSuffix(''); if (!$fileCache->set(basename($cache), '', $data)) { $fileCache->remove(basename($cache), ''); throw new sfConfigurationException(sprintf('Unable to write config cache for "%s".', $config)); } }