battles/Database/db.php
2020-10-26 17:39:27 +02:00

31 lines
710 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.5", "battles", "bottle-neck-horse", 32101)
// Выбор базы данных
->setDatabaseName("battles")
// Выбор кодировки
->setCharset("utf8");
}
return self::$_instance;
}
}