/**
  * Checks if CacheDirectory exists, if
  * not, then create it.
  *
  * @param $cache_directory Path to cache_dir.
  * @throws sfFilebasePluginException
  * @return sfFilebasePluginFile $cache_directory
  */
 protected function initCache($cache_directory)
 {
     $this->cacheDirectory = $this->getFilebaseFile($cache_directory);
     if (!$this->cacheDirectory->fileExists()) {
         self::mkDir($this->cacheDirectory, 0777);
     }
     return $this->cacheDirectory;
 }