1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-21 00:26:10 +02:00
Files
php-monolog/src/Monolog/Handler/WebRequestRecognizerTrait.php
Pascal 5bb1c5fb4f Check if monolog runs in web context (#1024)
* Check if monolog runs in web context
2018-06-11 17:36:34 +02:00

17 lines
296 B
PHP

<?php declare(strict_types=1);
namespace Monolog\Handler;
trait WebRequestRecognizerTrait
{
/**
* Checks if PHP's serving a web request
* @return bool
*/
protected function isWebRequest(): bool
{
return 'cli' !== \PHP_SAPI && 'phpdbg' !== \PHP_SAPI;
}
}