diff --git a/include/check.php b/class/osutournament/check.php similarity index 99% rename from include/check.php rename to class/osutournament/check.php index c940757..79da622 100644 --- a/include/check.php +++ b/class/osutournament/check.php @@ -66,7 +66,7 @@ public function __construct() { - $this->Parser = new Parser(); + $this->Parser = new WEBParser(); } /** * SelectMode osu! mode diff --git a/include/index.php b/class/osutournament/index.php similarity index 100% rename from include/index.php rename to class/osutournament/index.php diff --git a/include/webparser.php b/class/osutournament/webparser.php similarity index 98% rename from include/webparser.php rename to class/osutournament/webparser.php index 10258b9..421dea6 100644 --- a/include/webparser.php +++ b/class/osutournament/webparser.php @@ -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) diff --git a/include.php b/include.php index 60b0384..91174c1 100644 --- a/include.php +++ b/include.php @@ -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'); + }); diff --git a/include/db.php b/include/db.php deleted file mode 100644 index ae5becf..0000000 --- a/include/db.php +++ /dev/null @@ -1,26 +0,0 @@ -mysql = new mysqli($ip, $dbid, $dbpw, $dbnm); - } - public function Query($query) - { - // ... - } - public function Insert($query) - { - // ... - } - } diff --git a/test.php b/test.php index ab7c79b..d0868ce 100644 --- a/test.php +++ b/test.php @@ -61,3 +61,4 @@ $Check->CheckUser('aergn8i39jf', 1, 1); GetDataTest(); +