Page MenuHomeWickedGov Phorge

Driver.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

Driver.php

<?php
namespace Doctrine\DBAL\Driver\SQLite3;
use Doctrine\DBAL\Driver\AbstractSQLiteDriver;
use Doctrine\DBAL\Driver\API\SQLite\UserDefinedFunctions;
use SensitiveParameter;
use SQLite3;
final class Driver extends AbstractSQLiteDriver
{
/**
* {@inheritDoc}
*/
public function connect(
#[SensitiveParameter]
array $params
): Connection {
$isMemory = (bool) ($params['memory'] ?? false);
if (isset($params['path'])) {
if ($isMemory) {
throw new Exception(
'Invalid connection settings: specifying both parameters "path" and "memory" is ambiguous.',
);
}
$filename = $params['path'];
} elseif ($isMemory) {
$filename = ':memory:';
} else {
throw new Exception(
'Invalid connection settings: specify either the "path" or the "memory" parameter for SQLite3.',
);
}
try {
$connection = new SQLite3($filename);
} catch (\Exception $e) {
throw Exception::new($e);
}
$connection->enableExceptions(true);
UserDefinedFunctions::register([$connection, 'createFunction']);
return new Connection($connection);
}
}

File Metadata

Mime Type
text/x-php
Expires
Sun, Nov 22, 14:00 (5 h, 10 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3e/a9/8342c466a63b60e7d3f01391b2c3
Default Alt Text
Driver.php (1 KB)

Event Timeline