Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F883449
Database.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
919 B
Subscribers
None
Database.php
View Options
<?php
namespace
Zed\Engines\Database
;
use
Keruald\Database\DatabaseEngine
;
use
Keruald\Database\Database
as
BaseDatabase
;
use
Keruald\Database\Exceptions\EngineSetupException
;
class
Database
{
/**
* Gets the database instance, initializing it if needed
*
* The correct database instance to initialize will be determined from the
* $Config['database']['engine'] preference. Expected value is an instance
* of DatabaseEngine.
*
* Example:
* <code>
* $Config['database']['engine'] = 'Foo\Quux';
* $db = Database::load(); // Database::load() will call Foo\Quux::load();
* </code>
*/
static
function
load
(
array
&
$config
)
:
DatabaseEngine
{
try
{
return
BaseDatabase
::
initialize
(
$config
);
}
catch
(
EngineSetupException
$ex
)
{
message_die
(
GENERAL_ERROR
,
$ex
->
getMessage
(),
"Setup issue :: DB"
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Apr 5, 09:38 (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
22667
Default Alt Text
Database.php (919 B)
Attached To
rZED Zed
Event Timeline
Log In to Comment