[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.118.1.89: ~ $
<?php

/*
 * This file is part of the Monolog package.
 *
 * (c) Jordi Boggiano <j.boggiano@seld.be>
 *
 * 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\Formatter\FormatterInterface;

/**
 * Simple handler wrapper that filters records based on a list of levels
 *
 * It can be configured with an exact list of levels to allow, or a min/max level.
 *
 * @author Hennadiy Verkh
 * @author Jordi Boggiano <j.boggiano@seld.be>
 */
class FilterHandler extends AbstractHandler
{
    /**
     * Handler or factory callable($record, $this)
     *
     * @var callable|\Monolog\Handler\HandlerInterface
     */
    protected $handler;

    /**
     * Minimum level for logs that are passed to handler
     *
     * @var int[]
     */
    protected $acceptedLevels;

    /**
     * Whether the messages that are handled can bubble up the stack or not
     *
     * @var bool
     */
    protected $bubble;

    /**
     * @param callable|HandlerInterface $handler        Handler or factory callable($record|null, $filterHandler).
     * @param int|array                 $minLevelOrList A list of levels to accept or a minimum level if maxLevel is provided
     * @param int                       $maxLevel       Maximum level to accept, only used if $minLevelOrList is not an array
     * @param bool                      $bubble         Whether the messages that are handled can bubble up the stack or not
     */
    public function __construct($handler, $minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY, $bubble = true)
    {
        $this->handler  = $handler;
        $this->bubble   = $bubble;
        $this->setAcceptedLevels($minLevelOrList, $maxLevel);

        if (!$this->handler instanceof HandlerInterface && !is_callable($this->handler)) {
            throw new \RuntimeException("The given handler (".json_encode($this->handler).") is not a callable nor a Monolog\Handler\HandlerInterface object");
        }
    }

    /**
     * @return array
     */
    public function getAcceptedLevels()
    {
        return array_flip($this->acceptedLevels);
    }

    /**
     * @param int|string|array $minLevelOrList A list of levels to accept or a minimum level or level name if maxLevel is provided
     * @param int|string       $maxLevel       Maximum level or level name to accept, only used if $minLevelOrList is not an array
     */
    public function setAcceptedLevels($minLevelOrList = Logger::DEBUG, $maxLevel = Logger::EMERGENCY)
    {
        if (is_array($minLevelOrList)) {
            $acceptedLevels = array_map('Monolog\Logger::toMonologLevel', $minLevelOrList);
        } else {
            $minLevelOrList = Logger::toMonologLevel($minLevelOrList);
            $maxLevel = Logger::toMonologLevel($maxLevel);
            $acceptedLevels = array_values(array_filter(Logger::getLevels(), function ($level) use ($minLevelOrList, $maxLevel) {
                return $level >= $minLevelOrList && $level <= $maxLevel;
            }));
        }
        $this->acceptedLevels = array_flip($acceptedLevels);
    }

    /**
     * {@inheritdoc}
     */
    public function isHandling(array $record)
    {
        return isset($this->acceptedLevels[$record['level']]);
    }

    /**
     * {@inheritdoc}
     */
    public function handle(array $record)
    {
        if (!$this->isHandling($record)) {
            return false;
        }

        if ($this->processors) {
            foreach ($this->processors as $processor) {
                $record = call_user_func($processor, $record);
            }
        }

        $this->getHandler($record)->handle($record);

        return false === $this->bubble;
    }

    /**
     * {@inheritdoc}
     */
    public function handleBatch(array $records)
    {
        $filtered = array();
        foreach ($records as $record) {
            if ($this->isHandling($record)) {
                $filtered[] = $record;
            }
        }

        if (count($filtered) > 0) {
            $this->getHandler($filtered[count($filtered) - 1])->handleBatch($filtered);
        }
    }

    /**
     * Return the nested handler
     *
     * If the handler was provided as a factory callable, this will trigger the handler's instantiation.
     *
     * @return HandlerInterface
     */
    public function getHandler(array $record = null)
    {
        if (!$this->handler instanceof HandlerInterface) {
            $this->handler = call_user_func($this->handler, $record, $this);
            if (!$this->handler instanceof HandlerInterface) {
                throw new \RuntimeException("The factory callable should return a HandlerInterface");
            }
        }

        return $this->handler;
    }

    /**
     * {@inheritdoc}
     */
    public function setFormatter(FormatterInterface $formatter)
    {
        $this->getHandler()->setFormatter($formatter);

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getFormatter()
    {
        return $this->getHandler()->getFormatter();
    }
}

Filemanager

Name Type Size Permission Actions
Curl Folder 0755
FingersCrossed Folder 0755
Slack Folder 0755
SyslogUdp Folder 0755
AbstractHandler.php File 4.29 KB 0644
AbstractProcessingHandler.php File 1.5 KB 0644
AbstractSyslogHandler.php File 3.29 KB 0644
AmqpHandler.php File 3.78 KB 0644
BrowserConsoleHandler.php File 7.23 KB 0644
BufferHandler.php File 3.94 KB 0644
ChromePHPHandler.php File 5.52 KB 0644
CouchDBHandler.php File 1.91 KB 0644
CubeHandler.php File 4.55 KB 0644
DeduplicationHandler.php File 5.35 KB 0644
DoctrineCouchDBHandler.php File 1000 B 0644
DynamoDbHandler.php File 2.43 KB 0644
ElasticSearchHandler.php File 3.33 KB 0644
ErrorLogHandler.php File 2.31 KB 0644
FilterHandler.php File 5.03 KB 0644
FingersCrossedHandler.php File 6.46 KB 0644
FirePHPHandler.php File 5.33 KB 0644
FleepHookHandler.php File 3.28 KB 0644
FlowdockHandler.php File 3.3 KB 0644
FormattableHandlerInterface.php File 923 B 0644
FormattableHandlerTrait.php File 1.36 KB 0644
GelfHandler.php File 1.95 KB 0644
GroupHandler.php File 2.73 KB 0644
HandlerInterface.php File 2.53 KB 0644
HandlerWrapper.php File 2.31 KB 0644
HipChatHandler.php File 10.74 KB 0644
IFTTTHandler.php File 2.09 KB 0644
InsightOpsHandler.php File 1.83 KB 0644
LogEntriesHandler.php File 1.58 KB 0644
LogglyHandler.php File 2.56 KB 0644
MailHandler.php File 1.58 KB 0644
MandrillHandler.php File 2.25 KB 0644
MissingExtensionException.php File 450 B 0644
MongoDBHandler.php File 1.57 KB 0644
NativeMailerHandler.php File 5.08 KB 0644
NewRelicHandler.php File 6.1 KB 0644
NullHandler.php File 953 B 0644
PHPConsoleHandler.php File 9.79 KB 0644
ProcessableHandlerInterface.php File 1017 B 0644
ProcessableHandlerTrait.php File 1.56 KB 0644
PsrHandler.php File 1.4 KB 0644
PushoverHandler.php File 6.47 KB 0644
RavenHandler.php File 7.24 KB 0644
RedisHandler.php File 2.89 KB 0644
RollbarHandler.php File 3.85 KB 0644
RotatingFileHandler.php File 5.8 KB 0644
SamplingHandler.php File 3.21 KB 0644
SlackHandler.php File 6.33 KB 0644
SlackWebhookHandler.php File 3.75 KB 0644
SlackbotHandler.php File 2.32 KB 0644
SocketHandler.php File 9.58 KB 0644
StreamHandler.php File 5.58 KB 0644
SwiftMailerHandler.php File 3.36 KB 0644
SyslogHandler.php File 1.8 KB 0644
SyslogUdpHandler.php File 3.14 KB 0644
TestHandler.php File 5.25 KB 0644
WhatFailureGroupHandler.php File 1.8 KB 0644
ZendMonitorHandler.php File 2.93 KB 0644