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;
     }
 }