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


Viewing file:     ReplaceAliasByActualDefinitionPass.php (4.07 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\Compiler;

use 
Symfony\Component\DependencyInjection\ContainerBuilder;
use 
Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use 
Symfony\Component\DependencyInjection\Reference;

/**
 * Replaces aliases with actual service definitions, effectively removing these
 * aliases.
 *
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 */
class ReplaceAliasByActualDefinitionPass implements CompilerPassInterface
{
    private 
$compiler;
    private 
$formatter;
    private 
$sourceId;

    
/**
     * Process the Container to replace aliases with service definitions.
     *
     * @param ContainerBuilder $container
     *
     * @throws InvalidArgumentException if the service definition does not exist
     */
    
public function process(ContainerBuilder $container)
    {
        
$this->compiler $container->getCompiler();
        
$this->formatter $this->compiler->getLoggingFormatter();

        foreach (
$container->getAliases() as $id => $alias) {
            
$aliasId = (string) $alias;

            try {
                
$definition $container->getDefinition($aliasId);
            } catch (
InvalidArgumentException $e) {
                throw new 
InvalidArgumentException(sprintf('Unable to replace alias "%s" with "%s".'$alias$id), null$e);
            }

            if (
$definition->isPublic()) {
                continue;
            }

            
$definition->setPublic(true);
            
$container->setDefinition($id$definition);
            
$container->removeDefinition($aliasId);

            
$this->updateReferences($container$aliasId$id);

            
// we have to restart the process due to concurrent modification of
            // the container
            
$this->process($container);

            break;
        }
    }

    
/**
     * Updates references to remove aliases.
     *
     * @param ContainerBuilder $container The container
     * @param string           $currentId The alias identifier being replaced
     * @param string           $newId     The id of the service the alias points to
     */
    
private function updateReferences($container$currentId$newId)
    {
        foreach (
$container->getAliases() as $id => $alias) {
            if (
$currentId === (string) $alias) {
                
$container->setAlias($id$newId);
            }
        }

        foreach (
$container->getDefinitions() as $id => $definition) {
            
$this->sourceId $id;

            
$definition->setArguments(
                
$this->updateArgumentReferences($definition->getArguments(), $currentId$newId)
            );

            
$definition->setMethodCalls(
                
$this->updateArgumentReferences($definition->getMethodCalls(), $currentId$newId)
            );

            
$definition->setProperties(
                
$this->updateArgumentReferences($definition->getProperties(), $currentId$newId)
            );
        }
    }

    
/**
     * Updates argument references.
     *
     * @param array  $arguments An array of Arguments
     * @param string $currentId The alias identifier
     * @param string $newId     The identifier the alias points to
     *
     * @return array
     */
    
private function updateArgumentReferences(array $arguments$currentId$newId)
    {
        foreach (
$arguments as $k => $argument) {
            if (
is_array($argument)) {
                
$arguments[$k] = $this->updateArgumentReferences($argument$currentId$newId);
            } elseif (
$argument instanceof Reference) {
                if (
$currentId === (string) $argument) {
                    
$arguments[$k] = new Reference($newId$argument->getInvalidBehavior());
                    
$this->compiler->addLogMessage($this->formatter->formatUpdateReference($this$this->sourceId$currentId$newId));
                }
            }
        }

        return 
$arguments;
    }
}

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