updated packages

This commit is contained in:
2019-05-18 09:06:43 +00:00
parent 901d16349e
commit e9487fa58a
2025 changed files with 30366 additions and 49653 deletions
+27 -6
View File
@@ -16,7 +16,7 @@ class DatabaseManager implements ConnectionResolverInterface
/**
* The application instance.
*
* @var \Illuminate\Foundation\Application
* @var \Illuminate\Contracts\Foundation\Application
*/
protected $app;
@@ -41,10 +41,17 @@ class DatabaseManager implements ConnectionResolverInterface
*/
protected $extensions = [];
/**
* The callback to be executed to reconnect to a database.
*
* @var callable
*/
protected $reconnector;
/**
* Create a new database manager instance.
*
* @param \Illuminate\Foundation\Application $app
* @param \Illuminate\Contracts\Foundation\Application $app
* @param \Illuminate\Database\Connectors\ConnectionFactory $factory
* @return void
*/
@@ -52,6 +59,10 @@ class DatabaseManager implements ConnectionResolverInterface
{
$this->app = $app;
$this->factory = $factory;
$this->reconnector = function ($connection) {
$this->reconnect($connection->getName());
};
}
/**
@@ -140,7 +151,8 @@ class DatabaseManager implements ConnectionResolverInterface
throw new InvalidArgumentException("Database [{$name}] not configured.");
}
return $config;
return (new ConfigurationUrlParser)
->parseConfiguration($config);
}
/**
@@ -164,9 +176,7 @@ class DatabaseManager implements ConnectionResolverInterface
// 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());
});
$connection->setReconnector($this->reconnector);
return $connection;
}
@@ -315,6 +325,17 @@ class DatabaseManager implements ConnectionResolverInterface
return $this->connections;
}
/**
* Set the database reconnector callback.
*
* @param callable $reconnector
* @return void
*/
public function setReconnector(callable $reconnector)
{
$this->reconnector = $reconnector;
}
/**
* Dynamically pass methods to the default connection.
*