Use constant instead of function call.

This commit is contained in:
Konstantin.Myakshin 2016-03-04 15:04:09 +02:00
parent 759f495594
commit c1edbc08bb
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)) {