battles/Database/db.php
2018-01-28 18:40:49 +02:00

31 lines
708 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", "combats_full", "JuUn1hWq4J")
// Выбор базы данных
->setDatabaseName("combats_game")
// Выбор кодировки
->setCharset("utf8");
}
return self::$_instance;
}
}