/** * Remove the file entry from the XML. * * @return NULL */ public function delete() { $file = $this->getFileNode(); $dir = $this->_parent->getDirectoryNode(); $this->_xml->removeWhitespace($file->previousSibling); $dir->removeChild($file); }
/** * Remove the directory entry from the XML. * * @return NULL */ public function delete() { $dir = $this->getDirectoryNode(); $this->_xml->removeWhitespace($dir->nextSibling); $this->_xml->removeComment($dir->nextSibling, $this->_path); $this->_xml->removeWhitespace($dir->nextSibling); $dir->parentNode->removeChild($dir); }
/** * Delete a file from the list. * * @param string $file The file name. * * @return NULL */ public function delete($file) { $this->_dir_list->deleteFile($file); if (isset($this->_install_list[$file])) { $this->_xml->removeWhitespace($this->_install_list[$file]->nextSibling); $this->_filelist->removeChild($this->_install_list[$file]); } }
/** * Execute the task. * * @return NULL */ public function run() { $contents = $this->_xml->findNode('/p:package/p:contents/p:dir'); if ($contents && !empty($this->_options['regenerate'])) { $contents = $this->_xml->findNode('/p:package/p:contents'); $this->_xml->removeWhitespace($contents->previousSibling); $this->_xml->findNode('/p:package')->removeChild($contents); $contents = false; } $filelist = $this->_xml->findNode('/p:package/p:phprelease/p:filelist'); if ($filelist && !empty($this->_options['regenerate'])) { $filelist = $this->_xml->findNode('/p:package/p:phprelease'); $this->_xml->removeWhitespace($filelist->previousSibling); $this->_xml->findNode('/p:package')->removeChild($filelist); $filelist = false; } if (!$contents) { $root = $this->_xml->insert(array('contents' => array(), "\n "), $this->_xml->findNode('/p:package/p:dependencies')); $contents = $this->_xml->append(array("\n ", 'dir' => array('baseinstalldir' => '/', 'name' => '/'), ' ', $this->_xml->createComment(' / '), "\n "), $root); $this->_xml->append("\n ", $contents); } if (!$filelist) { $root = $this->_xml->insert(array('phprelease' => array(), "\n "), $this->_xml->findNode('/p:package/p:changelog')); $filelist = $this->_xml->append(array("\n ", 'filelist' => array(), "\n "), $root); $this->_xml->append("\n ", $filelist); } $current = $this->_xml->createContents($this->_xml, $contents, $filelist); $current->update($this->_content); try { if (empty($this->_options['no_timestamp'])) { $this->_xml->timestamp(); } $this->_xml->syncCurrentVersion(); } catch (Horde_Pear_Exception $e) { /** * Ignore errors in this operation as it is not mandatory for * updating the file list. */ } }