Find path to the binary.
@return string
504219
public function detectBin()
    {
        $pathes = [
            static::buildPath([$this->plugin->getVendorDir(), 'bin', $this->phpBin]),
            static::buildPath([$this->plugin->getComposer()->getConfig()->get('home'), 'vendor', 'bin', $this->phpBin]),
        ];
        foreach ($pathes as $path) {
            if (file_exists($path)) {
                return $path;
            }
        }

        return $this->name;
    }
262461
public static function getInstallationPath()
    {
        self::setPackageDir();

        $path = realpath( self::$packageDir );
        if ( substr( $path, -1 ) !== DIRECTORY_SEPARATOR )
        {
            $path .= DIRECTORY_SEPARATOR;
        }
        return $path;
    }
1247312
protected static function retrieveInstallPath()
    {
        $path1 = DIRECTORY_SEPARATOR.implode(
                DIRECTORY_SEPARATOR,
                array('src', 'Doozr', 'Installer', 'Base.php')
            );

        $path2 = DIRECTORY_SEPARATOR.implode(
                DIRECTORY_SEPARATOR,
                array('vendor', 'clickalicious', 'doozr')
            );

        $path = str_replace($path1, '', __FILE__);
        $path = str_replace($path2, '', $path);

        return realpath($path);
    }
278071
protected function bin($program = '')
    {
        // Get list of allowed search paths
        if ($location = $this->config()->get('binary_location')) {
            $locations = [$location];
        } else {
            $locations = $this->config()->get('search_binary_locations');
        }

        // Find program in each path
        foreach ($locations as $location) {
            $path = "{$location}/{$program}";
            if (file_exists($path)) {
                return $path;
            }
            if (file_exists($path . '.exe')) {
                return $path . '.exe';
            }
        }

        // Not found
        return null;
    }
1174559
protected function findFilePath()
    {
        $filename = static::FILE_NAME;

        foreach ($this->defaultLocations() as $location) {
            if (file_exists("{$location}/$filename")) {
                return $location;
            }
        }

        return $this->defaultFilePath();
    }
1028279
public static function getPathPHP() {
		
		$manualPHP = Config::getOption("phpBin");
		$autoPHP   = new PhpExecutableFinder();
		$path      = $manualPHP ? $manualPHP : $autoPHP->find();
		
		if (!$path) {
			$configPath = Console::getHumanReadablePath(Config::getOption("configPath"));
			$examplePHP = (DIRECTORY_SEPARATOR === "/") ? "C:\wamp\bin\php\php5.5.12" : "/opt/local/lib/php54";
			Console::writeError("can't find PHP. add the path to PHP by adding the option \"phpBin\" to <path>".$configPath."</path>. it should look like \"phpBin\": \"".$examplePHP."\"");
		}
		
		return $path;
		
	}
991346
public function getBinary()
    {
        $data = '';

        $guid = str_replace('-', '', $this->value);

        foreach ($this->octetSections as $section) {
            $data .= $this->parseSection($guid, $section, true);
        }

        return hex2bin($data);
    }
1144017
public static function getTemplatePath()
    {
        $path = \Phar::running();

    	if (!empty($path)) {
    		return $path . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . '.files';
    	}

    	$root = dirname(dirname(dirname(dirname(__DIR__))));

    	return realpath($root .DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . '.files');
    }
1317303
public function path()
    {
        $dirname = $this->dirname();

        if ($this->parent instanceof Root) { //at root

            return $dirname.$this->basename();
        }

        return sprintf('%s/%s', $dirname, $this->basename());

    }
438691
public function getBuildPath()
    {
        $path = pathinfo($this->relativePath);

        $fingerprint = md5($this->filters->map(function($f) { return $f->getFilter(); })->toJson().$this->getLastModified());

        return "{$path['dirname']}/{$path['filename']}-{$fingerprint}.{$this->getBuildExtension()}";
    }
242827
public function getPath(): string
	{
		if($this->path === null)
		{
			$this->path = dirname((new ReflectionClass($this))->getFileName(), 2);
		}

		return $this->path;
	}
500656
public function getRootPath()
    {
        $appPath = app_path();
        $folders = explode(DIRECTORY_SEPARATOR, $appPath);
        array_pop($folders);
        $rootPath = implode(DIRECTORY_SEPARATOR, $folders);

        return $rootPath . '/';
    }
385946
public function getThumbPath() {

		if( isset( $this->thumb ) ) {

			return Yii::$app->fileManager->uploadDir . '/' . $this->thumb;
		}

		return false;
	}
48543
public function getBaseTmpDir()
    {
        $folders = explode(DIRECTORY_SEPARATOR, $this->getRootDir());
        $foldersCount = count($folders);

        /**
         * Base Path
         */
        $projectDir = '';
        if (true === isset($folders[$foldersCount - 2])) {
            $projectDir = $folders[$foldersCount - 2];
        }

        $tempDirPath = FileUtility::getUserBasedCachedDir(sprintf('%s-%s', $projectDir, $this->getEnvironment()));
        FileUtility::mkdir($tempDirPath);

        return $tempDirPath;
    }
78937
protected function find()
    {
        if (!File::exists($this->workingPath . '/composer.phar'))
        {
            return 'composer';
        }

        $binary = ProcessUtils::escapeArgument((new PhpExecutableFinder)->find(false));

        if (defined('HHVM_VERSION'))
        {
            $binary .= ' --php';
        }

        return "{$binary} composer.phar";
    }
703064
public function getAbsolutePath()
    {
        if (empty($this->mount) && is_null($this->path)) {
            return null;
        }

        if (empty($this->mount)) {
            return $this->path;
        }

        return $this->mount . "/" . $this->path;
    }
68323
public function path(){

        $args = \func_get_args();

        switch (\count($args)){

            case 1:

                $file  = $args[0];

                if ($this->isAbsolutePath($file) && \file_exists($file)) {
                    return $file;
                }

                $parts = \explode(':', $file, 2);

                if (count($parts)==2){
                    if (!isset($this->paths[$parts[0]])) return false;

                    foreach ($this->paths[$parts[0]] as &$path){
                        if (\file_exists($path.$parts[1])){
                            return $path.$parts[1];
                        }
                    }
                }

                return false;

            case 2:

                if (!isset($this->paths[$args[0]])) {
                    $this->paths[$args[0]] = [];
                }
                \array_unshift($this->paths[$args[0]], \rtrim(\str_replace(DIRECTORY_SEPARATOR, '/', $args[1]), '/').'/');

                return $this;
        }

        return null;
    }