Beispiel #1
0
 /**
  * Detects how to run the binary.
  * Searches in this order:
  * 1. exexcutable in project's root directory
  * 2. XXX ??? vendor directory
  * 3. /home/user/.local/bin.
  *
  * @param string $name
  * @return string path to the binary
  */
 public function detectPath($name)
 {
     $paths = [Yii::getAlias("@root/{$name}", false), Yii::getAlias("@root/env/bin/{$name}", false), "{$_SERVER['HOME']}/.local/bin/{$name}"];
     foreach ($paths as $path) {
         if (file_exists($path)) {
             return $path;
         }
     }
     return parent::detectPath($name);
 }