Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F14039308
BlackholeEngine.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
BlackholeEngine.php
View Options
<?php
namespace
Keruald\Database\Engines
;
use
Keruald\Database\DatabaseEngine
;
use
Keruald\Database\Result\DatabaseResult
;
class
BlackholeEngine
extends
DatabaseEngine
{
public
function
escape
(
string
$expression
)
:
string
{
return
$expression
;
}
public
function
query
(
string
$query
)
:
bool
|
DatabaseResult
{
return
true
;
}
public
function
nextId
()
:
int
|
string
{
return
0
;
}
public
function
countAffectedRows
()
:
int
{
return
0
;
}
protected
function
getExceptionContext
()
:
array
{
return
[];
}
public
static
function
load
(
array
$config
):
DatabaseEngine
{
return
new
self
;
}
public
function
getUnderlyingDriver
()
:
null
{
return
null
;
}
public
function
isExistingTable
(
string
$database
,
string
$table
)
:
bool
{
// Everything and nothing exists in a black hole
return
true
;
}
///
/// Error handling
///
public
function
error
()
:
array
{
return
[];
}
///
/// Events
///
protected
function
onCantConnectToHost
()
:
void
{
// We can always connect to a black hole engine.
}
protected
function
onQueryError
(
string
$query
)
:
void
{
// Queries are always valid.
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 28, 17:34 (14 h, 34 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3143577
Default Alt Text
BlackholeEngine.php (1 KB)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment