/home/techb158/exp.abdallabala.com/vendor/monolog/monolog/src/Monolog/Handler
NameSizeModeActions
Curl/-0755rm
FingersCrossed/-0755rm
Slack/-0755rm
SyslogUdp/-0755rm
AbstractHandler.php43900644editdlrm
AbstractProcessingHandler.php15320644editdlrm
AbstractSyslogHandler.php33710644editdlrm
AmqpHandler.php38660644editdlrm
BrowserConsoleHandler.php74010644editdlrm
BufferHandler.php40300644editdlrm
ChromePHPHandler.php56540644editdlrm
CouchDBHandler.php19530644editdlrm
CubeHandler.php46620644editdlrm
DeduplicationHandler.php54790644editdlrm
DoctrineCouchDBHandler.php10000644editdlrm
DynamoDbHandler.php24850644editdlrm
ElasticSearchHandler.php34130644editdlrm
ErrorLogHandler.php23680644editdlrm
FilterHandler.php51480644editdlrm
FingersCrossedHandler.php66130644editdlrm
FirePHPHandler.php54620644editdlrm
FleepHookHandler.php33630644editdlrm
FlowdockHandler.php33820644editdlrm
FormattableHandlerInterface.php9230644editdlrm
FormattableHandlerTrait.php13940644editdlrm
GelfHandler.php19940644editdlrm
GroupHandler.php27930644editdlrm
HandlerInterface.php25910644editdlrm
HandlerWrapper.php23660644editdlrm
HipChatHandler.php109990644editdlrm
IFTTTHandler.php21390644editdlrm
InsightOpsHandler.php18740644editdlrm
LogEntriesHandler.php16150644editdlrm
LogglyHandler.php26190644editdlrm
MailHandler.php16220644editdlrm
MandrillHandler.php21560644editdlrm
MissingExtensionException.php4500644editdlrm
MongoDBHandler.php16060644editdlrm
NativeMailerHandler.php52060644editdlrm
NewRelicHandler.php62460644editdlrm
NullHandler.php9530644editdlrm
PHPConsoleHandler.php100270644editdlrm
ProcessableHandlerInterface.php10170644editdlrm
ProcessableHandlerTrait.php15990644editdlrm
PsrHandler.php14330644editdlrm
PushoverHandler.php66260644editdlrm
RavenHandler.php74140644editdlrm
RedisHandler.php29600644editdlrm
RollbarHandler.php39420644editdlrm
RotatingFileHandler.php59360644editdlrm
SamplingHandler.php32840644editdlrm
SlackbotHandler.php23800644editdlrm
SlackHandler.php64790644editdlrm
SlackWebhookHandler.php38450644editdlrm
SocketHandler.php98120644editdlrm
StreamHandler.php53190644editdlrm
SwiftMailerHandler.php34360644editdlrm
SyslogHandler.php18430644editdlrm
SyslogUdpHandler.php32200644editdlrm
TestHandler.php53760644editdlrm
WhatFailureGroupHandler.php18410644editdlrm
ZendMonitorHandler.php30020644editdlrm
Edit: /home/techb158/exp.abdallabala.com/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php (5319B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Monolog\Handler; use Monolog\Logger; use Monolog\Utils; /** * Stores to any stream resource * * Can be used to store into php://stderr, remote and local files, etc. * * @author Jordi Boggiano */ class StreamHandler extends AbstractProcessingHandler { protected $stream; protected $url; private $errorMessage; protected $filePermission; protected $useLocking; private $dirCreated; /** * @param resource|string $stream * @param int $level The minimum logging level at which this handler will be triggered * @param bool $bubble Whether the messages that are handled can bubble up the stack or not * @param int|null $filePermission Optional file permissions (default (0644) are only for owner read/write) * @param bool $useLocking Try to lock log file before doing any writes * * @throws \Exception If a missing directory is not buildable * @throws \InvalidArgumentException If stream is not a resource or string */ public function __construct($stream, $level = Logger::DEBUG, $bubble = true, $filePermission = null, $useLocking = false) { parent::__construct($level, $bubble); if (is_resource($stream)) { $this->stream = $stream; } elseif (is_string($stream)) { $this->url = Utils::canonicalizePath($stream); } else { throw new \InvalidArgumentException('A stream must either be a resource or a string.'); } $this->filePermission = $filePermission; $this->useLocking = $useLocking; } /** * {@inheritdoc} */ public function close() { if ($this->url && is_resource($this->stream)) { fclose($this->stream); } $this->stream = null; $this->dirCreated = null; } /** * Return the currently active stream if it is open * * @return resource|null */ public function getStream() { return $this->stream; } /** * Return the stream URL if it was configured with a URL and not an active resource * * @return string|null */ public function getUrl() { return $this->url; } /** * {@inheritdoc} */ protected function write(array $record) { if (!is_resource($this->stream)) { if (null === $this->url || '' === $this->url) { throw new \LogicException('Missing stream url, the stream can not be opened. This may be caused by a premature call to close().'); } $this->createDir(); $this->errorMessage = null; set_error_handler(array($this, 'customErrorHandler')); $this->stream = fopen($this->url, 'a'); if ($this->filePermission !== null) { @chmod($this->url, $this->filePermission); } restore_error_handler(); if (!is_resource($this->stream)) { $this->stream = null; throw new \UnexpectedValueException(sprintf('The stream or file "%s" could not be opened in append mode: '.$this->errorMessage, $this->url)); } } if ($this->useLocking) { // ignoring errors here, there's not much we can do about them flock($this->stream, LOCK_EX); } $this->streamWrite($this->stream, $record); if ($this->useLocking) { flock($this->stream, LOCK_UN); } } /** * Write to stream * @param resource $stream * @param array $record */ protected function streamWrite($stream, array $record) { fwrite($stream, (string) $record['formatted']); } private function customErrorHandler($code, $msg) { $this->errorMessage = preg_replace('{^(fopen|mkdir)\(.*?\): }', '', $msg); } /** * @param string $stream * * @return null|string */ private function getDirFromStream($stream) { $pos = strpos($stream, '://'); if ($pos === false) { return dirname($stream); } if ('file://' === substr($stream, 0, 7)) { return dirname(substr($stream, 7)); } return null; } private function createDir() { // Do not try to create dir if it has already been tried. if ($this->dirCreated) { return; } $dir = $this->getDirFromStream($this->url); if (null !== $dir && !is_dir($dir)) { $this->errorMessage = null; set_error_handler(array($this, 'customErrorHandler')); $status = mkdir($dir, 0777, true); restore_error_handler(); if (false === $status && !is_dir($dir)) { throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and its not buildable: '.$this->errorMessage, $dir)); } } $this->dirCreated = true; } }