protected function _getUniqueFileName($path, $file) { if (!Mage::helper('magefm_cdn')->isEnabled()) { return parent::_moveImageFromTmp($path, $file); } return MageFM_CDN_Model_Uploader::getNewFileName($path, $file); }
protected function _moveImageFromTmp($file) { if ($this->_allowUseRenamedImage && isset($this->_renamedImages[$file])) { return $this->_renamedImages[$file]; } else { return parent::_moveImageFromTmp($file); } }
/** * Move image from temporary directory to file storage * * @param string $file * @return string */ protected function _moveImageFromTmp($file) { if (!Mage::helper('uaudio_storage')->isEnabled()) { return parent::_moveImageFromTmp($file); } if (strrpos($file, '.tmp') == strlen($file) - 4) { $file = substr($file, 0, strlen($file) - 4); } $storageModel = Mage::getSingleton('core/file_storage')->getStorageModel(); $storageModel->setAllowRenameFiles(true); $destFile = $storageModel->renameFile($this->_getConfig()->getTmpMediaPath($file), $this->_getConfig()->getMediaPath($file)); return str_replace($this->_getConfig()->getBaseMediaPathAddition(), '', ltrim($destFile, '/')); }