/** * Retrieve the package as specified by the $id from the heartbeat server * * @param category_id the category_id to which the release belongs * @param package_id the package_id to which the release belongs * @param release_id the release_id to download * @return filename - the path to which the zip file was saved */ public function download($category_id, $package_id, $release_id) { $GLOBALS['log']->debug('RELEASE _ID: ' . $release_id); if (!empty($release_id)) { $filename = PackageManagerComm::addDownload($category_id, $package_id, $release_id); if ($filename) { $GLOBALS['log']->debug('RESULT: ' . $filename); PackageManagerComm::errorCheck(); $filepath = PackageManagerComm::performDownload($filename); return $filepath; } } else { return null; } }
/** * Retrieve the package as specified by the $id from the heartbeat server * * @param category_id the category_id to which the release belongs * @param package_id the package_id to which the release belongs * @param release_id the release_id to download * @return filename - the path to which the zip file was saved */ function download($category_id, $package_id, $release_id, $save_dir = '') { $GLOBALS['log']->debug('RELEASE _ID: ' . $release_id); if (!empty($release_id)) { $filename = PackageManagerComm::addDownload($category_id, $package_id, $release_id); if ($filename) { $GLOBALS['log']->debug('RESULT: ' . $filename); PackageManagerComm::errorCheck(); $filepath = PackageManagerComm::performDownload($filename, $save_dir); return $filepath; /*if(!empty($result) && !empty($result['filename']) && !empty($save_dir)){ $GLOBALS['log']->debug('Saving Package to: '.$save_dir); $GLOBALS['log']->debug('Saving package to the local file system:'.$result['filename']); return write_encoded_file ($result, $save_dir); }else{ return null; }*/ } } else { return null; } }