mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-13 16:16:07 +00:00
refactor: autoprefixing class includes
This commit is contained in:
@@ -8,13 +8,22 @@
|
||||
## Copyright: TravianZ (c) 2014. All rights reserved. ##
|
||||
#########################################################
|
||||
|
||||
include_once("../../../src/Entity/User.php");
|
||||
use App\Entity\User;
|
||||
|
||||
include_once("../../config.php");
|
||||
include_once("../../Session.php");
|
||||
include_once("../../Automation.php");
|
||||
include_once("../../Database.php");
|
||||
// go max 5 levels up - we don't have folders that go deeper than that
|
||||
$autoprefix = '';
|
||||
for ($i = 0; $i < 5; $i++) {
|
||||
$autoprefix = str_repeat('../', $i);
|
||||
if (file_exists($autoprefix.'autoloader.php')) {
|
||||
// we have our path, let's leave
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
include_once($autoprefix."GameEngine/config.php");
|
||||
include_once($autoprefix."GameEngine/Session.php");
|
||||
include_once($autoprefix."GameEngine/Automation.php");
|
||||
include_once($autoprefix."GameEngine/Database.php");
|
||||
$GLOBALS["link"] = mysqli_connect(SQL_SERVER, SQL_USER, SQL_PASS);
|
||||
mysqli_select_db($GLOBALS["link"], SQL_DB);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user