Skip to content

Commit

Permalink
minor #18009 Use constant instead of function call. (Koc)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fabpot committed Mar 4, 2016
2 parents 759f495 + c1edbc0 commit d2e5c4c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Debug/Debug.php
Expand Up @@ -44,7 +44,7 @@ public static function enable($errorReportingLevel = null, $displayErrors = true
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'))) {
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpFoundation/Request.php
Expand Up @@ -242,7 +242,7 @@ public static function createFromGlobals()
// 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'];
}
Expand Down
Expand Up @@ -70,7 +70,7 @@ public function collect(Request $request, Response $response, \Exception $except
'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)) {
Expand Down

0 comments on commit d2e5c4c

Please sign in to comment.