Copyright 2010-2016 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.horde.org/licenses/lgpl21.
/** * Try to resolve the given name and channel into a component. * * @param string $name The name of the component. * @param string $channel The channel origin of the component. * @param array $options Additional options. * * @return Components_Component|boolean The component if the name could be * resolved. */ public function resolveName($name, $channel, $options) { foreach ($this->_getAttempts($options) as $attempt) { if ($attempt == 'git' && $channel == 'pear.horde.org') { try { $path = $this->_root->getPackageXml($name); return $this->_factory->createSource(dirname($path)); } catch (Components_Exception $e) { } } if ($attempt == 'snapshot') { if ($local = $this->_identifyMatchingLocalPackage($name, $channel, $options)) { return $this->_factory->createArchive($local); } } if (!empty($options['allow_remote'])) { $remote = $this->_getRemote($channel); if ($remote->getLatestRelease($name, $attempt)) { return $this->_factory->createRemote($name, $attempt, $channel, $remote); } } } return false; }
public function testApplicationComponent() { $path = __DIR__ . '/../../../fixture'; $root = new Components_Helper_Root(array('horde_root' => $path)); $this->assertEquals($path . '/horde/package.xml', $root->getPackageXml('horde')); }
/** * Identify the repository root. * * @param Components_Helper_Root $helper The root helper. * * @return NULL */ public function repositoryRoot(Components_Helper_Root $helper) { if (($result = $helper->traverseHierarchy($this->_directory)) === false) { $this->_errors[] = sprintf('Unable to determine Horde repository root from component path "%s"!', $this->_directory); } return $result; }