/home
/forge
/lowcosthotels.com
/vendor
/laravel
/framework
/src
/Illuminate
/Database
/Connection.php
* @param array $bindings
* @param \Closure $callback
* @return mixed
*
* @throws \Illuminate\Database\QueryException
*/
protected function runQueryCallback($query, $bindings, Closure $callback)
{
// To execute the statement, we'll simply call the callback, which will actually
// run the SQL against the PDO connection. Then we can calculate the time it
// took to execute and log the query SQL, bindings and time in our memory.
try {
$result = $callback($query, $bindings);
}
// If an exception occurs when attempting to run a query, we'll format the error
// message to include the bindings with SQL, which will make this exception a
// lot more helpful to the developer instead of just the database's errors.
catch (Exception $e) {
throw new QueryException(
$query, $this->prepareBindings($bindings), $e
);
}
return $result;
}
/**
* Log a query in the connection's query log.
*
* @param string $query
* @param array $bindings
* @param float|null $time
* @return void
*/
public function logQuery($query, $bindings, $time = null)
{
$this->event(new QueryExecuted($query, $bindings, $time, $this));
if ($this->loggingQueries) {
Arguments
"""
SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused\n
\tIs the server running on that host and accepting TCP/IP connections? (SQL: select * from "users" where "robot_name" = Claudebot limit 1)
"""
/home
/forge
/lowcosthotels.com
/vendor
/doctrine
/dbal
/lib
/Doctrine
/DBAL
/Driver
/PDOConnection.php
* Used by all PDO-based drivers.
*/
class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
{
/**
* @param string $dsn
* @param string|null $user
* @param string|null $password
* @param mixed[]|null $options
*
* @throws PDOException In case of an error.
*/
public function __construct($dsn, $user = null, $password = null, ?array $options = null)
{
try {
parent::__construct($dsn, $user, $password, $options);
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, [PDOStatement::class, []]);
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (\PDOException $exception) {
throw new PDOException($exception);
}
}
/**
* {@inheritdoc}
*/
public function exec($statement)
{
try {
return parent::exec($statement);
} catch (\PDOException $exception) {
throw new PDOException($exception);
}
}
/**
* {@inheritdoc}
*/
public function getServerVersion()
{
Arguments
"""
SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused\n
\tIs the server running on that host and accepting TCP/IP connections?
"""
/home
/forge
/lowcosthotels.com
/vendor
/doctrine
/dbal
/lib
/Doctrine
/DBAL
/Driver
/PDOConnection.php
use function func_get_args;
/**
* PDO implementation of the Connection interface.
* Used by all PDO-based drivers.
*/
class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
{
/**
* @param string $dsn
* @param string|null $user
* @param string|null $password
* @param mixed[]|null $options
*
* @throws PDOException In case of an error.
*/
public function __construct($dsn, $user = null, $password = null, ?array $options = null)
{
try {
parent::__construct($dsn, $user, $password, $options);
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, [PDOStatement::class, []]);
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (\PDOException $exception) {
throw new PDOException($exception);
}
}
/**
* {@inheritdoc}
*/
public function exec($statement)
{
try {
return parent::exec($statement);
} catch (\PDOException $exception) {
throw new PDOException($exception);
}
}
/**
Arguments
"""
SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused\n
\tIs the server running on that host and accepting TCP/IP connections?
"""
/home
/forge
/lowcosthotels.com
/vendor
/doctrine
/dbal
/lib
/Doctrine
/DBAL
/Driver
/PDOConnection.php
use function func_get_args;
/**
* PDO implementation of the Connection interface.
* Used by all PDO-based drivers.
*/
class PDOConnection extends PDO implements Connection, ServerInfoAwareConnection
{
/**
* @param string $dsn
* @param string|null $user
* @param string|null $password
* @param mixed[]|null $options
*
* @throws PDOException In case of an error.
*/
public function __construct($dsn, $user = null, $password = null, ?array $options = null)
{
try {
parent::__construct($dsn, $user, $password, $options);
$this->setAttribute(PDO::ATTR_STATEMENT_CLASS, [PDOStatement::class, []]);
$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (\PDOException $exception) {
throw new PDOException($exception);
}
}
/**
* {@inheritdoc}
*/
public function exec($statement)
{
try {
return parent::exec($statement);
} catch (\PDOException $exception) {
throw new PDOException($exception);
}
}
/**
Arguments
"pgsql:host=127.0.0.1;dbname=lowcosthotels;port=5432;sslmode=prefer"
"forge"
"0I7kQGufXlZawCXknhE8"
array:4 [
8 => 0
3 => 2
11 => 0
17 => false
]
/home
/forge
/lowcosthotels.com
/vendor
/laravel
/framework
/src
/Illuminate
/Database
/Connectors
/Connector.php
} catch (Exception $e) {
return $this->tryAgainIfCausedByLostConnection(
$e, $dsn, $username, $password, $options
);
}
}
/**
* Create a new PDO connection instance.
*
* @param string $dsn
* @param string $username
* @param string $password
* @param array $options
* @return \PDO
*/
protected function createPdoConnection($dsn, $username, $password, $options)
{
if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
return new PDOConnection($dsn, $username, $password, $options);
}
return new PDO($dsn, $username, $password, $options);
}
/**
* Determine if the connection is persistent.
*
* @param array $options
* @return bool
*/
protected function isPersistentConnection($options)
{
return isset($options[PDO::ATTR_PERSISTENT]) &&
$options[PDO::ATTR_PERSISTENT];
}
/**
* Handle an exception that occurred during connect execution.
*
Arguments
"pgsql:host=127.0.0.1;dbname=lowcosthotels;port=5432;sslmode=prefer"
"forge"
"0I7kQGufXlZawCXknhE8"
array:4 [
8 => 0
3 => 2
11 => 0
17 => false
]
/home
/forge
/lowcosthotels.com
/vendor
/laravel
/framework
/src
/Illuminate
/Database
/Connectors
/Connector.php
/**
* Create a new PDO connection.
*
* @param string $dsn
* @param array $config
* @param array $options
* @return \PDO
*
* @throws \Exception
*/
public function createConnection($dsn, array $config, array $options)
{
[$username, $password] = [
$config['username'] ?? null, $config['password'] ?? null,
];
try {
return $this->createPdoConnection(
$dsn, $username, $password, $options
);
} catch (Exception $e) {
return $this->tryAgainIfCausedByLostConnection(
$e, $dsn, $username, $password, $options
);
}
}
/**
* Create a new PDO connection instance.
*
* @param string $dsn
* @param string $username
* @param string $password
* @param array $options
* @return \PDO
*/
protected function createPdoConnection($dsn, $username, $password, $options)
{
if (class_exists(PDOConnection::class) && ! $this->isPersistentConnection($options)) {
Arguments
"pgsql:host=127.0.0.1;dbname=lowcosthotels;port=5432;sslmode=prefer"
"forge"
"0I7kQGufXlZawCXknhE8"
array:4 [
8 => 0
3 => 2
11 => 0
17 => false
]