Return the composer executable file path

@return string
196312
public static function getComposerExecutor()
    {
        $executor = PHP_BINARY . ' ';
        $composer = static::getComposerLocation();

        if ($composer !== static::DEFAULT_PATH && is_executable($composer)) {
            $file = fopen($composer, 'rb');
            $firstLine = fgets($file);
            fclose($file);

            if (!preg_match('/^#!.+php/i', $firstLine)) {
                $executor = '';
            }
        }

        return $executor . $composer;
    }
409601
public function getFilePath() : ?string 
    {
        if ( ! $this->hasFilePath()) {
            $this->setFilePath($this->getDefaultFilePath());
        }
        return $this->filePath;
    }
1307489
public static function getRootPath()
        {
            if (is_null(static::$_filePath)) {
                if (defined('APPLICATION_PATH')) {
                    static::$_filePath = APPLICATION_PATH;
                } else {
                    static::$_filePath = dirname(dirname(__FILE__));
                }
            }
            return static::$_filePath;
        }
1016333
protected function getComposerCommand()
    {
        static $command = null;

        if (null !== $command) {
            return $command;
        }

        // Detect local composer.phar.
        $pharFile = $this->projectPath . '/composer.phar';

        if (file_exists($pharFile)) {
            return $command = '/usr/bin/env php -d allow_url_fopen=On -d detect_unicode=Off "' . $pharFile . '"';
        }

        // Detect local composer command
        $composerFile = $this->projectPath . '/composer';

        if (file_exists($composerFile)) {
            return $command = './composer';
        }

        // Detect global composer command.
        $process = new Process('hash composer');
        $process->run();
        $isSuccessful = $process->isSuccessful();

        unset($process);

        if ($isSuccessful) {
            return $command = 'composer';
        }

        return $command;
    }
1308424
public function getRuntimePath()
    {
        if (!FileSystemHelper::isAbsolute($this->runtimePath)) {
            if ($this->runtimePath == '') {
                return $this->basePath;
            }
            return $this->basePath . DIRECTORY_SEPARATOR . $this->runtimePath;
        }
        return $this->runtimePath;
    }
1019926
protected function getFileGenerationPath()
	{
		$path = $this->getPathByOptionOrConfig( 'path', 'migration_target_path' );
		$migrationName = str_replace('/', '_', $this->migrationName);
		$fileName = $this->getDatePrefix() . '_' . $migrationName . '.php';

		return "{$path}/{$fileName}";
	}
762002
public function getAbsolutePath()
    {
        if (!$this->isAbsolute()) {
            $filepath = stream_resolve_include_path($this->getPathname());
        } else {
            $filepath = realpath($this->getPathname());
        }
        return $filepath;
    }
214657
public function getDumpFilePath () : string
    {
        $dir = dirname($this->filePath);
        $fileName = \basename($this->filePath, ".{$this->fileType}");

        $dir = "." === $dir
            ? ""
            : "{$dir}/";

        $hash = !empty($this->fileNameHash)
            ? ".{$this->fileNameHash}"
            : "";

        return "{$dir}{$fileName}{$hash}.{$this->fileType}";
    }
963932
public function getRootNamespace(): string
    {
        if (! is_null(static::$namespace)) {
            return static::$namespace;
        }

        $composer = Json::decode(file_get_contents($this->getRootPath() . '/composer.json'));

        foreach ((array) Arr::get($composer, 'autoload.psr-4', []) as $namespace => $paths) {
            foreach ((array) $paths as $path) {
                if (realpath($this->getAppPath()) === realpath($this->getRootPath() . '/' . $path)) {
                    return static::$namespace = $namespace;
                }
            }
        }


        unset($composer);

        return '';
    }
403842
private function guessComposerCommand()
    {
        $candidateNames = array('composer', 'composer.phar');

        $executableFinder = new ExecutableFinder();
        foreach ($candidateNames as $candidateName) {
            if ($composerPath = $executableFinder->find($candidateName, null, array(getcwd()))) {
                return array(realpath($composerPath));
            }
        }

        foreach ($candidateNames as $candidateName) {
            $composerPath = sprintf('%s/%s', getcwd(), $candidateName);
            if (file_exists($composerPath)) {
                $phpFinder = new PhpExecutableFinder();

                return array_merge(
                    array(
                        $phpFinder->find(false),
                        $composerPath,
                    ),
                    $phpFinder->findArguments()
                );
            }
        }

        return;
    }
1011475
public function getFullDb()
    {
        $filesystem = new Filesystem();
        $config = $this->_composer->getConfig();
        $assets_db = $this->_autoloader->getRegistry();
        $vendor_dir = $this->_autoloader->getAssetsInstaller()->getVendorDir();
        $app_base_path = $this->_autoloader->getAssetsInstaller()->getAppBasePath();
        $assets_dir = str_replace($app_base_path . '/', '', $this->_autoloader->getAssetsInstaller()->getAssetsDir());
        $assets_vendor_dir = str_replace($app_base_path . '/' . $assets_dir . '/', '', $this->_autoloader->getAssetsInstaller()->getAssetsVendorDir());
        $document_root = $this->_autoloader->getAssetsInstaller()->getDocumentRoot();
        $extra = $this->_package->getExtra();

        $root_data = $this->_autoloader->getAssetsInstaller()->parseComposerExtra($this->_package, $app_base_path, '');
        if (!empty($root_data)) {
            $root_data['relative_path'] = '../';
            $assets_db[$this->_package->getPrettyName()] = $root_data;
        }

        $vendor_path = strtr(realpath($vendor_dir), '\\', '/');
        $rel_vendor_path = $filesystem->findShortestPath(getcwd(), $vendor_path, true);

        $local_repo = $this->_composer->getRepositoryManager()->getLocalRepository();
        $package_map = $this->buildPackageMap($this->_composer->getInstallationManager(), $this->_package, $local_repo->getPackages());

        foreach ($package_map as $i=>$package) {
            if ($i===0) {
                continue;
            }
            $package_object = $package[0];
            $package_install_path = $package[1];
            if (empty($package_install_path)) {
                $package_install_path = $app_base_path;
            }
            $package_name = $package_object->getPrettyName();
            $data = $this->_autoloader->getAssetsInstaller()->parseComposerExtra(
                $package_object,
                $this->_autoloader->getAssetsInstaller()->getAssetsInstallPath($package_object),
                str_replace($app_base_path . '/', '', $vendor_path) . '/' . $package_object->getPrettyName()
            );
            if (!empty($data)) {
                $assets_db[$package_name] = $data;
            }
        }

        $full_db = array(
            'assets-dir' => $assets_dir,
            'assets-vendor-dir' => $assets_vendor_dir,
            'document-root' => $document_root,
            'packages' => $assets_db
        );
        return $full_db;
    }
166098
public function guessPackagePath()
    {
        $reflection = new ReflectionClass($this);

        $path = $reflection->getFileName();

        return realpath(dirname($path) .'/../');
    }
655983
public static function getComposerVendorPath()
    {
        $reflection = new ReflectionClass(ClassLoader::class);
        $vendorDir = dirname(dirname($reflection->getFileName()));
        if (!$vendorDir) {
            throw new NotFoundException('cannot find composer vendor path');
        }

        return $vendorDir;
    }
1203027
public static function getBundledCaBundlePath()
    {
        $caBundleFile = __DIR__.'/../res/cacert.pem';

        // cURL does not understand 'phar://' paths
        // see https://github.com/composer/ca-bundle/issues/10
        if (0 === strpos($caBundleFile, 'phar://')) {
            file_put_contents(
                $tempCaBundleFile = tempnam(sys_get_temp_dir(), 'openssl-ca-bundle-'),
                file_get_contents($caBundleFile)
            );

            register_shutdown_function(function() use ($tempCaBundleFile) {
                @unlink($tempCaBundleFile);
            });

            $caBundleFile = $tempCaBundleFile;
        }

        return $caBundleFile;
    }
834037
public static function GetPackagePath () {
		$called_class = static::class;
		$offset = strpos($called_class, "\\") + 1;
		return str_replace("\\", '/', substr($called_class, 0, strpos($called_class, "\\", $offset)));
	}
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');
    }
242572
protected function getAppBasePath()
    {
        $path = dirname($_SERVER['SCRIPT_FILENAME']);

        return (is_link($path)) ? dirname(readlink($path)) : dirname($path);
    }