Skip to content

Commit

Permalink
Fixed Bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
592472116 committed Sep 25, 2024
1 parent 84ae5f3 commit d20ff8a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Config/Database/MysqliDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MysqliDatabase extends Database
* @param int $wait_timeout
*/
public function __construct(public string $host, public int $port, public string $dbName, public string $user,
public string $password, public string $tablePrefix = 'p_', public string $charset = 'utf8mb4', public int $wait_timeout = 3600)
public string $password, public string $tablePrefix = 'p_', public string $charset = 'utf8mb4',public bool $persistent = false, public int $wait_timeout = 3600)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/Config/Database/PdoMysqlDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PdoMysqlDatabase extends Database
* @param int $wait_timeout
*/
public function __construct(public string $host, public int $port, public string $dbName, public string $user,
public string $password,public string $tablePrefix = 'p_',public string $charset='utf8mb4',public int $wait_timeout = 3600)
public string $password, public string $tablePrefix = 'p_', public string $charset = 'utf8mb4', public bool $persistent = false, public int $wait_timeout = 3600)
{
}

Expand Down
6 changes: 6 additions & 0 deletions src/ORM/Connector/MysqliConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
class MysqliConnector extends \QApi\ORM\Connector\Connection implements ConnectorInterface
{

/**
* @param MysqliDatabase $config
* @return Connection
* @throws \Doctrine\DBAL\Exception
*/
public function getConnector(mixed $config): Connection
{
$this->config = $config;
Expand All @@ -28,6 +33,7 @@ public function getConnector(mixed $config): Connection
'port' => $config->port,
'driverClass' => Driver::class,
'charset' => $config->charset,
'persistent' => true,
], $this->getConfiguration(), $this->getEventManager());
}
}
1 change: 1 addition & 0 deletions src/ORM/Connector/PdoMysqlConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function getConnector(mixed $config): Connection
'port' => $config->port,
'driverClass' => Driver::class,
'charset' => $config->charset,
'persistent' => $config->persistent,
], $this->getConfiguration(), $this->getEventManager());
}
}

0 comments on commit d20ff8a

Please sign in to comment.