/** * Remove a release from package REST * * Removes REST. If $deleteorphaned is true, then * maintainers who no longer maintain a package will be * deleted from package maintainer REST. * @param \PEAR2\Pyrus\Package $release * @param string $deleter handle of maintainer deleting this release * @param bool $deleteorphaned */ function deleteRelease(\PEAR2\Pyrus\Package $release, $deleter, $deleteorphaned = true) { if ($new->channel !== $this->chan) { throw new PEAR2_SimpleChannelServer_Exception('Cannot delete release ' . $new->name . '-' . $new->version['release'] . ', we are managing ' . $this->chan . ' channel, and package is in ' . $new->channel . ' channel'); } if (!isset($this->_admins[$releaser]) && (!isset($new->maintainer[$releaser]) || $new->maintainer[$releaser]->role !== 'lead')) { throw new PEAR2_SimpleChannelServer_Exception($releaser . ' is not a ' . 'lead maintainer of this package, and cannot delete the release'); } $category = new PEAR2_SimpleChannelServer_REST_Category($this->rest, $this->chan, $this->uri); $package = new PEAR2_SimpleChannelServer_REST_Package($this->rest, $this->chan, $this->uri); $maintainer = new PEAR2_SimpleChannelServer_REST_Maintainer($this->rest, $this->chan, $this->uri); $release = new PEAR2_SimpleChannelServer_REST_Release($this->rest, $this->chan, $this->uri); $maintainer->erase($new, $deleteorphaned); $package->erase($new); $release->erase($new); $category->erase($new); }