Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7437464
Driver.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
Driver.php
View Options
<?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
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 14:00 (5 h, 19 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3e/a9/8342c466a63b60e7d3f01391b2c3
Default Alt Text
Driver.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment