Exemplo n.º 1
0
 /**
  * Make sure merger dir exists and writeable
  * Also can clean it up
  *
  * @param string $dirRelativeName
  * @param bool $cleanup
  * @return bool|string
  */
 public function initMergerDir($dirRelativeName, $cleanup = false)
 {
     $mediaDir = Mage::getBaseDir('media');
     try {
         $dir = Mage::getBaseDir('media') . DS . $dirRelativeName;
         if ($cleanup) {
             Diglin_Io_File::rmdirRecursive($dir);
         }
         if (!is_dir($dir)) {
             mkdir($dir);
         }
         return is_writeable($dir) ? $dir : false;
     } catch (Exception $e) {
         Mage::logException($e);
     }
     return false;
 }