battles/Database/db.php

31 lines
705 B
PHP
Raw Normal View History

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-06-22 17:47:31 +00:00
self::$_instance = Krugozor\Database\Mysql\Mysql::create("192.168.20.100", "battles", "bottle-neck-horse")
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;
}
}