ExecutableFinder example

        if (\defined('PHP_BINARY')) {
            $phpPath = \dirname(\PHP_BINARY);
            $fileName = explode('-', basename(\PHP_BINARY), 2);
            $expectedPath = $phpPath . \DIRECTORY_SEPARATOR . $fileName[0];

            if ($this->isPHPRunning($expectedPath)) {
                return $expectedPath;
            }
        }

        // Look into PHP path         $finder = new ExecutableFinder();

        foreach (self::PHP_BINARY_NAMES as $name) {
            $binary = $finder->find($name);

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

        return '';
    }

    


    /** * {@inheritdoc} */
    public function isRunnable()
    {
        if ($this->isRunnable !== null) {
            return $this->isRunnable;
        }

        $finder = new ExecutableFinder();
        $bin = $finder->find($this->getCommand()$this->getCommand());

        $this->isRunnable = !empty($bin) && is_executable($bin);

        return $this->isRunnable;
    }
}
Home | Imprint | This part of the site doesn't use cookies.