Example #1
0
 /**
  * This overrides the original function and adds a check, that skips the import if the file
  * in the media/catalog/product directory is newer than the one in media/import.
  * @see Mage_ImportExport_Model_Import_Uploader::_moveFile()
  */
 protected function _moveFile($tmpPath, $destPath)
 {
     if (!$this->_isDuplicateAppendSuffix()) {
         return parent::_moveFile($tmpPath, $destPath);
     }
     $sourceFile = realpath($tmpPath);
     $destinationFile = realpath($destPath);
     if (file_exists($destinationFile)) {
         $sourceStats = stat($sourceFile);
         $destinationStats = stat($destinationFile);
         if ($sourceStats['mtime'] <= $destinationStats['mtime']) {
             return true;
         }
     }
     return $sourceFile !== false ? copy($sourceFile, $destPath) : false;
 }