Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replaced custom isCli() method with Console::isConsole()

  • Loading branch information...
commit 6708871b6369fc6f6dc246905b7f4f42206fb88b 1 parent 4a5af10
@stefankleff authored
Showing with 3 additions and 12 deletions.
  1. +3 −12 library/Zend/Log/Processor/RequestId.php
View
15 library/Zend/Log/Processor/RequestId.php
@@ -10,6 +10,8 @@
namespace Zend\Log\Processor;
+use Zend\Console\Console;
+
/**
* @category Zend
* @package Zend_Log
@@ -43,19 +45,8 @@ public function process(array $event)
protected function getIdentifier()
{
$requestTime = (version_compare(PHP_VERSION, '5.4.0') >= 0) ? $_SERVER['REQUEST_TIME_FLOAT'] : $_SERVER['REQUEST_TIME'];
- $remoteAddr = $this->isCli() ? 'local' : $_SERVER['REMOTE_ADDR'];
+ $remoteAddr = Console::isConsole() ? 'local' : $_SERVER['REMOTE_ADDR'];
return md5($requestTime . $remoteAddr);
}
-
- /**
- * Check if PHP is run from command line
- *
- * @return boolean true if php is run from command line
- */
- protected function isCli()
- {
- return php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']);
- }
-
}
Please sign in to comment.
Something went wrong with that request. Please try again.