getPDOAttributes
This commit is contained in:
parent
91b53c2a7f
commit
5d41442838
1 changed files with 12 additions and 15 deletions
17
app/init.php
17
app/init.php
|
@ -34,6 +34,7 @@ use Appwrite\OpenSSL\OpenSSL;
|
||||||
use Appwrite\URL\URL as AppwriteURL;
|
use Appwrite\URL\URL as AppwriteURL;
|
||||||
use Appwrite\Usage\Stats;
|
use Appwrite\Usage\Stats;
|
||||||
use Utopia\App;
|
use Utopia\App;
|
||||||
|
use Utopia\Database\Adapter\SQL;
|
||||||
use Utopia\Logger\Logger;
|
use Utopia\Logger\Logger;
|
||||||
use Utopia\Cache\Adapter\Redis as RedisCache;
|
use Utopia\Cache\Adapter\Redis as RedisCache;
|
||||||
use Utopia\Cache\Cache;
|
use Utopia\Cache\Cache;
|
||||||
|
@ -874,16 +875,12 @@ $register->set('db', function () {
|
||||||
$dbPass = App::getEnv('_APP_DB_PASS', '');
|
$dbPass = App::getEnv('_APP_DB_PASS', '');
|
||||||
$dbScheme = App::getEnv('_APP_DB_SCHEMA', '');
|
$dbScheme = App::getEnv('_APP_DB_SCHEMA', '');
|
||||||
|
|
||||||
$pdo = new PDO("mysql:host={$dbHost};port={$dbPort};dbname={$dbScheme};charset=utf8mb4", $dbUser, $dbPass, array(
|
return new PDO(
|
||||||
PDO::ATTR_TIMEOUT => 3, // Seconds
|
"mysql:host={$dbHost};port={$dbPort};dbname={$dbScheme};charset=utf8mb4",
|
||||||
PDO::ATTR_PERSISTENT => true,
|
$dbUser,
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
$dbPass,
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
SQL::getPDOAttributes()
|
||||||
PDO::ATTR_EMULATE_PREPARES => true,
|
);
|
||||||
PDO::ATTR_STRINGIFY_FETCHES => true,
|
|
||||||
));
|
|
||||||
|
|
||||||
return $pdo;
|
|
||||||
});
|
});
|
||||||
$register->set('influxdb', function () {
|
$register->set('influxdb', function () {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue