/** * Add a single package to this repo * * @param PackageXML $package */ public function addPackage(PackageXML $package) { // This DOMNode that will be written $node = $package->getPackageDOM(); // The type, this determines where it'll go. if($package->getType() == 'theme'){ $type = 'themes'; } elseif($package->getName() == 'core' || $package->getKeyName() == 'core'){ $type = 'core'; } else{ $type = 'components'; } $newnode = $this->getDOM()->importNode($node, true); $dest = $this->getElement($type); $dest->appendChild($newnode); }