minor #18009 Use constant instead of function call. (Koc)

This PR was merged into the 2.3 branch.

Discussion
----------

Use constant instead of function call.

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

Commits
-------

c1edbc0 Use constant instead of function call.
This commit is contained in:
Fabien Potencier 2016-03-04 14:51:11 +01:00
commit d2e5c4c3ab
3 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ class Debug
error_reporting(-1);
ErrorHandler::register($errorReportingLevel, $displayErrors);
if ('cli' !== php_sapi_name()) {
if ('cli' !== PHP_SAPI) {
ExceptionHandler::register();
// CLI - display errors only if they're not already logged to STDERR
} elseif ($displayErrors && (!ini_get('log_errors') || ini_get('error_log'))) {

View File

@ -242,7 +242,7 @@ class Request
// stores the Content-Type and Content-Length header values in
// HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH fields.
$server = $_SERVER;
if ('cli-server' === php_sapi_name()) {
if ('cli-server' === PHP_SAPI) {
if (array_key_exists('HTTP_CONTENT_LENGTH', $_SERVER)) {
$server['CONTENT_LENGTH'] = $_SERVER['HTTP_CONTENT_LENGTH'];
}

View File

@ -70,7 +70,7 @@ class ConfigDataCollector extends DataCollector
'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'),
'zend_opcache_enabled' => extension_loaded('Zend OPcache') && ini_get('opcache.enable'),
'bundles' => array(),
'sapi_name' => php_sapi_name(),
'sapi_name' => PHP_SAPI,
);
if (isset($this->kernel)) {