PDO::ERRMODE_EXCEPTION, PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC]); umask($oldUmask); $pdo->exec('PRAGMA journal_mode=WAL'); $pdo->exec('PRAGMA busy_timeout=5000'); $pdo->exec('PRAGMA foreign_keys=ON'); $pdo->exec((string)file_get_contents(dirname(__DIR__) . '/server/schema.sql')); foreach ([$cfg['database'], $cfg['database'].'-wal', $cfg['database'].'-shm'] as $file) if (is_file($file)) @chmod($file, 0660); return self::$pdo = $pdo; } }