/** * Get remote modified files * * @param $chanName * @param $package * @param $cacheObj * @param Mage_Connect_Ftp $ftp * @return array */ public function getRemoteModifiedFiles($chanName, $package, $cacheObj, $ftp) { $p = $cacheObj->getPackageObject($chanName, $package); $hashContents = $p->getHashContents(); $listModified = array(); foreach ($hashContents as $file => $hash) { $localFile = uniqid("temp_remote_"); if (!$ftp->fileExists($file)) { continue; } $ftp->get($localFile, $file); if (file_exists($localFile) && md5_file($localFile) !== $hash) { $listModified[] = $file; } @unlink($localFile); } return $listModified; }