battles/Database/db.php
2020-06-22 21:22:35 +03:00

31 lines
705 B
PHP

<?php
/**
* Created by PhpStorm.
* User: lopiu
* Date: 28.01.2018
* Time: 16:35
*/
class db
{
private static $_instance = null;
private function __clone() {}
private function __construct() {}
/**
* @return \Krugozor\Database\Mysql\Mysql
*/
public static function c()
{
if (!self::$_instance)
{
self::$_instance = Krugozor\Database\Mysql\Mysql::create("192.168.20.100", "battles", "bottle-neck-horse")
// Выбор базы данных
->setDatabaseName("battles")
// Выбор кодировки
->setCharset("utf8");
}
return self::$_instance;
}
}