getBinDir() public method

public getBinDir ( ) : string
return string
Ejemplo n.º 1
0
 /**
  * Find the relative bin directory
  *
  * @return string
  */
 public function getBinDir()
 {
     $binDir = $this->config->getBinDir();
     if (!$this->fileSystem->exists($binDir)) {
         throw new RuntimeException('The configured BIN directory could not be found.');
     }
     return $this->getRelativePath($binDir);
 }
Ejemplo n.º 2
0
 /**
  * Make a guess to the bin dir
  *
  * @return string
  */
 protected function guessBinDir()
 {
     $defaultBinDir = $this->config->getBinDir();
     if (!$this->composer()->hasConfiguration()) {
         return $defaultBinDir;
     }
     $config = $this->composer()->getConfiguration();
     if (!$config->has('bin-dir')) {
         return $defaultBinDir;
     }
     return $config->get('bin-dir', Config::RELATIVE_PATHS);
 }
Ejemplo n.º 3
0
 /**
  * Make a guess to the bin dir
  *
  * @return string
  */
 protected function guessBinDir()
 {
     $defaultBinDir = $this->config->getBinDir();
     $composerFile = 'composer.json';
     if (!$this->filesystem->exists($composerFile)) {
         return $defaultBinDir;
     }
     $composer = json_decode(file_get_contents('composer.json'), true);
     if (isset($composer['config']['bin-dir'])) {
         return $composer['config']['bin-dir'];
     }
     return $defaultBinDir;
 }