Copyright 2011-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.
Author: Gunnar Wrobel (wrobel@pardus.de)
Example #1
0
 /**
  * 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;
     }
 }
Example #2
0
 /**
  * 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();
 }