Библиотека для cis, online, cms1
This commit is contained in:
commit
3c2e614d87
269 changed files with 39854 additions and 0 deletions
18
core/database.php
Normal file
18
core/database.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* Ïðîñòîé êëàññ(Factory) äëÿ ðàáîòû ñ áàçàìè äàííûõ
|
||||
*/
|
||||
class Database
|
||||
{
|
||||
static function getConnection (array $dsn)
|
||||
{
|
||||
require_once "core/drivers/database." . strtolower($dsn['phptype']) . ".php";
|
||||
$name = "Database_" . strtoupper($dsn['phptype']);
|
||||
$database = new $name();
|
||||
$database->connect($dsn);
|
||||
return $database;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue