Библиотека для cis, online, cms1

This commit is contained in:
Фёдор Подлеснов 2016-06-29 18:51:32 +03:00
commit 3c2e614d87
269 changed files with 39854 additions and 0 deletions

18
core/database.php Normal file
View 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;
}
}
?>