mirror of
https://github.com/hakasenyang/osu-tournament-php
synced 2026-08-22 03:03:07 +09:00
include 수정
차후를 위해 spl_autoload_register 사용. 물론 사용 할 만한 클래스가 없지만 그래도...
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->Parser = new Parser();
|
||||
$this->Parser = new WEBParser();
|
||||
}
|
||||
/**
|
||||
* SelectMode osu! mode
|
||||
@@ -4,7 +4,7 @@
|
||||
* @author Hakase (contact@hakase.kr)
|
||||
*/
|
||||
namespace OsuTournament;
|
||||
class Parser
|
||||
class WEBParser
|
||||
{
|
||||
private $httph = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36';
|
||||
public function splits($data, $first, $end, $num = 1)
|
||||
+5
-8
@@ -3,11 +3,8 @@
|
||||
* @file include.php
|
||||
* @author Hakase (contact@hakase.kr)
|
||||
*/
|
||||
require_once 'include/db.php';
|
||||
require_once 'include/webparser.php';
|
||||
require_once 'include/check.php';
|
||||
|
||||
/**
|
||||
* In production DB.
|
||||
*/
|
||||
// $DB = new OsuTournament\DB('127.0.0.1', 'example', 'example', 'example');
|
||||
spl_autoload_register(function($classname) {
|
||||
$file = __DIR__.'/class/'.strtolower(str_replace("\\", "/", $classname)).'.php';
|
||||
if(file_exists($file))
|
||||
require_once(__DIR__.'/class/'.strtolower(str_replace("\\", "/", $classname)).'.php');
|
||||
});
|
||||
@@ -1,26 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* @file include/db.php
|
||||
* @author Hakase (contact@hakase.kr)
|
||||
*/
|
||||
namespace OsuTournament;
|
||||
/**
|
||||
* Osu Tournament for PHP
|
||||
* In production.
|
||||
*/
|
||||
|
||||
class DB {
|
||||
public $mysql;
|
||||
public function __construct($ip, $dbid, $dbpw, $dbnm)
|
||||
{
|
||||
$this->mysql = new mysqli($ip, $dbid, $dbpw, $dbnm);
|
||||
}
|
||||
public function Query($query)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
public function Insert($query)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user