Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F15620369
Database.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
919 B
Referenced Files
None
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
Thu, Nov 26, 02:38 (1 d, 11 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
22667
Default Alt Text
Database.php (919 B)
Attached To
Mode
rZED Zed
Attached
Detach File
Event Timeline
Log In to Comment