Skip to content

Commit

Permalink
bug symfony#9938 [Process] Add support SAPI cli-server (peter-gribanov)
Browse files Browse the repository at this point in the history
This PR was submitted for the 2.3-dev branch but it was merged into the 2.3 branch instead (closes symfony#9938).

Discussion
----------

[Process] Add support SAPI cli-server

As of PHP 5.4.0, the CLI SAPI provides a built-in web server.
```php
PHP_SAPI == 'cli-server'
```
PHP can be used portable without installation on PC. For example, the [assembly](http://windows.php.net/download/) does not require installation in the system on Windows. In this case `PHP_BINARY` contains the path to the PHP executor, and all the other search methods will not return result.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

92d8323 Add support SAPI cli-server
  • Loading branch information
fabpot committed Jan 5, 2014
2 parents 8fc0cfa + 3065f24 commit 5a3a844
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Process/PhpExecutableFinder.php
Expand Up @@ -39,7 +39,7 @@ public function find()
}

// PHP_BINARY return the current sapi executable
if (defined('PHP_BINARY') && PHP_BINARY && ('cli' === PHP_SAPI) && is_file(PHP_BINARY)) {
if (defined('PHP_BINARY') && PHP_BINARY && in_array(PHP_SAPI, array('cli', 'cli-server')) && is_file(PHP_BINARY)) {
return PHP_BINARY;
}

Expand Down

0 comments on commit 5a3a844

Please sign in to comment.