Skip to content

Commit

Permalink
Use constant instead of function call.
Browse files Browse the repository at this point in the history
  • Loading branch information
Koc committed Mar 4, 2016
1 parent 759f495 commit c1edbc0
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 c1edbc0

Please sign in to comment.