/** * Tell which location the specified file should be installed to. * * @param string $file The file name. * @param string $package The package name. * * @return string The install location for the file. */ public function getInstallAs($file, $package) { $elements = explode('/', substr($file, 1)); $basedir = array_shift($elements); switch ($basedir) { case 'bin': case 'docs': case 'test': return join('/', $elements); case 'COPYING': case 'LICENSE': case 'README': return substr($file, 1); default: return $this->_type->getName() . $file; } }
/** * Constructor. * * @param Horde_Pear_Package_Type $type The package type. * * @return NULL */ public function __construct(Horde_Pear_Package_Type $type) { $this->_root = $type->getRootPath(); $this->_include = $type->getInclude(); $this->_ignore = $type->getIgnore(); $this->_role = $type->getRole(); $this->_install_as = $type->getInstallAs(); }