Beispiel #1
0
 /**
  *
  * @param $chanName
  * @param $package
  * @param Mage_Connect_Singleconfig $cacheObj
  * @param Mage_Connect_Ftp $ftp
  * @return unknown_type
  */
 public function processUninstallPackageFtp($chanName, $package, $cacheObj, $ftp)
 {
     $ftpDir = $ftp->getcwd();
     $package = $cacheObj->getPackageObject($chanName, $package);
     $contents = $package->getContents();
     foreach ($contents as $file) {
         $res = $ftp->delete($file);
     }
     $ftp->chdir($ftpDir);
 }
Beispiel #2
0
 /**
  *
  * @param $chanName
  * @param $package
  * @param Mage_Connect_Singleconfig $cacheObj
  * @param Mage_Connect_Ftp $ftp
  * @return unknown_type
  */
 public function processUninstallPackageFtp($chanName, $package, $cacheObj, $ftp)
 {
     $ftpDir = $ftp->getcwd();
     $package = $cacheObj->getPackageObject($chanName, $package);
     $contents = $package->getContents();
     foreach ($contents as $file) {
         $res = $ftp->delete($file);
         $this->removeEmptyDirectory(dirname($file), $ftp);
     }
     $remoteXml = Mage_Connect_Package::PACKAGE_XML_DIR . DS . $package->getReleaseFilename() . '.xml';
     $ftp->delete($remoteXml);
     $ftp->chdir($ftpDir);
 }
Beispiel #3
0
 /**
  * Get remote modified files
  *
  * @param string $chanName
  * @param string $package
  * @param Mage_Connect_Singleconfig $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;
 }