2018-01-28 16:40:49 +00:00
|
|
|
<?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)
|
|
|
|
{
|
2020-10-26 15:39:27 +00:00
|
|
|
self::$_instance = Krugozor\Database\Mysql\Mysql::create("192.168.20.5", "battles", "bottle-neck-horse", 32101)
|
2018-01-28 16:40:49 +00:00
|
|
|
// Выбор базы данных
|
2020-06-22 18:22:35 +00:00
|
|
|
->setDatabaseName("battles")
|
2018-01-28 16:40:49 +00:00
|
|
|
// Выбор кодировки
|
|
|
|
->setCharset("utf8");
|
|
|
|
}
|
|
|
|
return self::$_instance;
|
|
|
|
}
|
|
|
|
}
|