__dir__ -> __DIR__
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
define('ROOT', realpath(__dir__.'/..'));
|
||||
define('ROOT', realpath(__DIR__.'/..'));
|
||||
setlocale(LC_ALL, 'ko_KR.UTF-8');
|
||||
date_default_timezone_set('Asia/Seoul');
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
session_start();
|
||||
session_destroy();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
if(!class_exists('\\sammo\\RootDB')){
|
||||
Json::die([
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$host = Util::getReq('db_host');
|
||||
$port = Util::getReq('db_port', 'int');
|
||||
@@ -165,7 +165,7 @@ $rootDB->error_handler = function ($params) {
|
||||
|
||||
$mysqli_obj = $rootDB->get(); //로그인에 실패할 경우 자동으로 dbConnFail()이 실행됨.
|
||||
|
||||
if ($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/common_schema.sql'))) {
|
||||
if ($mysqli_obj->multi_query(file_get_contents(__DIR__.'/sql/common_schema.sql'))) {
|
||||
while (true) {
|
||||
if (!$mysqli_obj->more_results()) {
|
||||
break;
|
||||
@@ -195,7 +195,7 @@ $imageRequestPath = WebUtil::resolveRelativePath($gameImagePath.'/../hook/git_pu
|
||||
$imageKeyInstallPath = WebUtil::resolveRelativePath($gameImagePath.'/../hook/InstallKey.php', $servHost);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/ServConfig.orig.php',
|
||||
__DIR__.'/templates/ServConfig.orig.php',
|
||||
ROOT.'/d_setting/ServConfig.php',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
@@ -219,7 +219,7 @@ if ($result !== true) {
|
||||
}
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/common_path.orig.js',
|
||||
__DIR__.'/templates/common_path.orig.js',
|
||||
ROOT.'/d_shared/common_path.js',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
@@ -230,7 +230,7 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/menu.orig.json',
|
||||
__DIR__.'/templates/menu.orig.json',
|
||||
ROOT.'/d_shared/menu.json',
|
||||
[],
|
||||
true
|
||||
@@ -245,7 +245,7 @@ if ($result !== true) {
|
||||
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/common.orig.css',
|
||||
__DIR__.'/templates/common.orig.css',
|
||||
ROOT.'/d_shared/common.css',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
@@ -264,7 +264,7 @@ if ($result !== true) {
|
||||
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/RootDB.orig.php',
|
||||
__DIR__.'/templates/RootDB.orig.php',
|
||||
ROOT.'/d_setting/RootDB.php',
|
||||
[
|
||||
'host'=>$host,
|
||||
@@ -279,7 +279,7 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
$kakaoRedirectURI = WebUtil::resolveRelativePath('oauth_kakao/oauth.php', $servHost.'/');
|
||||
|
||||
Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/KakaoKey.orig.php',
|
||||
__DIR__.'/templates/KakaoKey.orig.php',
|
||||
ROOT.'/d_setting/KakaoKey.php',
|
||||
[
|
||||
'REST_API_KEY'=>$kakaoRESTKey,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
if($session->userGrade < 6){
|
||||
@@ -27,7 +27,7 @@ if($servHost){
|
||||
$gameImagePath = WebUtil::resolveRelativePath($gameImagePath, $servHost);
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/ServConfig.orig.php',
|
||||
__DIR__.'/templates/ServConfig.orig.php',
|
||||
ROOT.'/d_setting/ServConfig.php',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
@@ -61,7 +61,7 @@ else if($sharedIconPath || $gameImagePath){
|
||||
}
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/ServConfig.orig.php',
|
||||
__DIR__.'/templates/ServConfig.orig.php',
|
||||
ROOT.'/d_setting/ServConfig.php',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
@@ -87,7 +87,7 @@ else{
|
||||
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/common_path.orig.js',
|
||||
__DIR__.'/templates/common_path.orig.js',
|
||||
ROOT.'/d_shared/common_path.js',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
@@ -99,7 +99,7 @@ $result = Util::generateFileUsingSimpleTemplate(
|
||||
|
||||
|
||||
$result = Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/templates/common.orig.css',
|
||||
__DIR__.'/templates/common.orig.css',
|
||||
ROOT.'/d_shared/common.css',
|
||||
[
|
||||
'serverBasePath'=>$servHost,
|
||||
|
||||
@@ -14,7 +14,7 @@ $db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
increaseRefresh("명장일람", 1);
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ increaseRefresh("갱신정보", 2);
|
||||
|
||||
$admin = $gameStor->getValues(['year','month','refresh','maxrefresh','maxonline']);
|
||||
|
||||
$log = getRawFileLogRecent(__dir__.'/logs/'.UniqueConst::$serverID.'/_traffic.txt', 11, 100);
|
||||
$log = getRawFileLogRecent(__DIR__.'/logs/'.UniqueConst::$serverID.'/_traffic.txt', 11, 100);
|
||||
|
||||
$date = [];
|
||||
$year = [];
|
||||
|
||||
+3
-3
@@ -1047,7 +1047,7 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
$date2 = substr($date, 0, 10);
|
||||
$online = getOnlineNum();
|
||||
file_put_contents(
|
||||
__dir__."/logs/".UniqueConst::$serverID."/_{$date2}_refresh.txt",
|
||||
__DIR__."/logs/".UniqueConst::$serverID."/_{$date2}_refresh.txt",
|
||||
sprintf(
|
||||
"%s, %s, %s, %s, %s, %d\n",
|
||||
$date,
|
||||
@@ -1084,7 +1084,7 @@ function increaseRefresh($type="", $cnt=1) {
|
||||
}
|
||||
if($str != "") {
|
||||
file_put_contents(
|
||||
__dir__."/logs/".UniqueConst::$serverID."/_{$date2}_ipcheck.txt",
|
||||
__DIR__."/logs/".UniqueConst::$serverID."/_{$date2}_ipcheck.txt",
|
||||
sprintf(
|
||||
"%s, %s, %s%s\n",
|
||||
$session->userName,
|
||||
@@ -1119,7 +1119,7 @@ function updateTraffic() {
|
||||
|
||||
$date = TimeUtil::now();
|
||||
//일시|년|월|총갱신|접속자|최다갱신자
|
||||
file_put_contents(__dir__."/logs/".UniqueConst::$serverID."/_traffic.txt",
|
||||
file_put_contents(__DIR__."/logs/".UniqueConst::$serverID."/_traffic.txt",
|
||||
Json::encode([
|
||||
$date,
|
||||
$admin['year'],
|
||||
|
||||
+20
-20
@@ -5,7 +5,7 @@ namespace sammo;
|
||||
|
||||
function delStepLog() {
|
||||
$date = date('Y_m_d');
|
||||
@unlink(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt");
|
||||
@unlink(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt");
|
||||
}
|
||||
|
||||
function pushRawFileLog($path, $lines){
|
||||
@@ -50,81 +50,81 @@ function eraseTnmtFightLogAll(){
|
||||
}
|
||||
|
||||
function eraseTnmtFightLog(int $group){
|
||||
$filepath = __dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt";
|
||||
$filepath = __DIR__."/logs/".UniqueConst::$serverID."/fight{$group}.txt";
|
||||
if(file_exists($filepath)){
|
||||
@unlink($filepath);
|
||||
}
|
||||
}
|
||||
|
||||
function pushTnmtFightLog(int $group, $log) {
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/fight{$group}.txt", $log);
|
||||
}
|
||||
|
||||
function getTnmtFightLogAll(int $group) {
|
||||
return join('<br>',getFormattedFileLogAll(__dir__."/logs/".UniqueConst::$serverID."/fight{$group}.txt"));
|
||||
return join('<br>',getFormattedFileLogAll(__DIR__."/logs/".UniqueConst::$serverID."/fight{$group}.txt"));
|
||||
}
|
||||
|
||||
function pushSabotageLog($log) {
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_sabotagelog.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_sabotagelog.txt", $log);
|
||||
}
|
||||
|
||||
function getSabotageLogRecent($count) {
|
||||
return join('<br>', getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/_sabotagelog.txt", $count, 150));
|
||||
return join('<br>', getFormattedFileLogRecent(__DIR__."/logs/".UniqueConst::$serverID."/_sabotagelog.txt", $count, 150));
|
||||
}
|
||||
|
||||
function pushProcessLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_processlog.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_processlog.txt", $log);
|
||||
}
|
||||
|
||||
|
||||
function pushStepLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_steplog.txt", $log);
|
||||
}
|
||||
|
||||
function pushLockLog($log) {
|
||||
$date = date('Y_m_d');
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_{$date}_locklog.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_{$date}_locklog.txt", $log);
|
||||
}
|
||||
|
||||
function pushAdminLog($log) {
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_adminlog.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_adminlog.txt", $log);
|
||||
}
|
||||
|
||||
function pushAuctionLog($log) {
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/_auctionlog.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/_auctionlog.txt", $log);
|
||||
}
|
||||
|
||||
function getAuctionLogRecent(int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/_auctionlog.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__DIR__."/logs/".UniqueConst::$serverID."/_auctionlog.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushGenLog($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/gen{$no}.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/gen{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getGenLogRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/gen{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__DIR__."/logs/".UniqueConst::$serverID."/gen{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushBatRes($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/batres{$no}.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/batres{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getBatResRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/batres{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__DIR__."/logs/".UniqueConst::$serverID."/batres{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushBatLog($general, $log) {
|
||||
$no = Util::toInt($general['no']);
|
||||
pushRawFileLog(__dir__."/logs/".UniqueConst::$serverID."/batlog{$no}.txt", $log);
|
||||
pushRawFileLog(__DIR__."/logs/".UniqueConst::$serverID."/batlog{$no}.txt", $log);
|
||||
}
|
||||
|
||||
function getBatLogRecent(int $no, int $count) {
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__dir__."/logs/".UniqueConst::$serverID."/batlog{$no}.txt", $count, 300)));
|
||||
return join('<br>', array_reverse(getFormattedFileLogRecent(__DIR__."/logs/".UniqueConst::$serverID."/batlog{$no}.txt", $count, 300)));
|
||||
}
|
||||
|
||||
function pushOldNationStop(int $no, int $nationNo){
|
||||
@@ -132,7 +132,7 @@ function pushOldNationStop(int $no, int $nationNo){
|
||||
|
||||
$result = [];
|
||||
foreach($logPrefixList as $logPrefix){
|
||||
$path = __dir__."/logs/".UniqueConst::$serverID."/{$logPrefix}{$no}.txt";
|
||||
$path = __DIR__."/logs/".UniqueConst::$serverID."/{$logPrefix}{$no}.txt";
|
||||
if(file_exists($path)){
|
||||
$fileLen = @filesize($path);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ function pushOldNationStop(int $no, int $nationNo){
|
||||
$result[$logPrefix] = $fileLen;
|
||||
}
|
||||
|
||||
$baseStopPath = __dir__."/logs/".UniqueConst::$serverID."/stop{$no}.txt";
|
||||
$baseStopPath = __DIR__."/logs/".UniqueConst::$serverID."/stop{$no}.txt";
|
||||
if(file_exists($baseStopPath)){
|
||||
$oldValues = Json::decode(file_get_contents($baseStopPath));
|
||||
}
|
||||
|
||||
+11
-11
@@ -15,7 +15,7 @@ function turnTable() {
|
||||
|
||||
$turnList = [];
|
||||
$turnList[] = "<option selected value='0'>1턴</option>";
|
||||
foreach(range(1, GameConst::$maxTurn - 1) as $turnIdx){
|
||||
foreach(\range(1, GameConst::$maxTurn - 1) as $turnIdx){
|
||||
$turnText = $turnIdx + 1;
|
||||
$turnList[] = "<option value='{$turnIdx}'>{$turnText}턴</option>";
|
||||
}
|
||||
@@ -59,7 +59,7 @@ function displayiActionObjInfo(?iAction $action){
|
||||
$text = $action->getName();
|
||||
}
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
@@ -71,7 +71,7 @@ function displayCharInfo(string $type):string{
|
||||
$info = $class->getInfo();
|
||||
$text = $class->getName();
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$text,
|
||||
@@ -84,7 +84,7 @@ function displaySpecialWarInfo(?string $type):string{
|
||||
$info = $class->getInfo();
|
||||
$name = $class->getName();
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$name,
|
||||
@@ -97,7 +97,7 @@ function displaySpecialDomesticInfo(?string $type):string{
|
||||
$info = $class->getInfo();
|
||||
$name = $class->getName();
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
return $templates->render('tooltip', [
|
||||
'text'=>$name,
|
||||
@@ -117,11 +117,11 @@ function allButton() {
|
||||
$call = "설문조사";
|
||||
}
|
||||
|
||||
if(\file_exists(__dir__."/d_setting/templates/allButton.php")){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/d_setting/templates');
|
||||
if(\file_exists(__DIR__."/d_setting/templates/allButton.php")){
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/d_setting/templates');
|
||||
}
|
||||
else{
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
}
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ function commandButton() {
|
||||
$bgColor = Util::array_get($nation['color'])?:'#000000';
|
||||
$fgColor = newColor($bgColor);
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
$showSecret = false;
|
||||
$permission = checkSecretPermission($me);
|
||||
if($permission >= 1){
|
||||
@@ -210,7 +210,7 @@ function formatName(string $name, int $npc): string{
|
||||
}
|
||||
|
||||
function getMapHtml(?string $mapTheme=null){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
if($mapTheme === null){
|
||||
$db = DB::db();
|
||||
@@ -224,7 +224,7 @@ function getMapHtml(?string $mapTheme=null){
|
||||
}
|
||||
|
||||
function getInvitationList(array $nationList){
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
foreach($nationList as &$nation){
|
||||
$nation['textColor'] = newColor($nation['color']);
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ if($lastTurn !== null){
|
||||
if($lastTurn === null){
|
||||
//이미 리셋된 상태임
|
||||
}
|
||||
else if(file_exists(__dir__.'/.htaccess')){
|
||||
else if(file_exists(__DIR__.'/.htaccess')){
|
||||
//일단 서버는 닫혀 있음
|
||||
}
|
||||
else if(
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ if($session->userGrade < 5 && !$allowFullReset){
|
||||
//리셋 가능한 조건인지 테스트
|
||||
$allowReset = false;
|
||||
|
||||
if(file_exists(__dir__.'/.htaccess')){
|
||||
if(file_exists(__DIR__.'/.htaccess')){
|
||||
$allowReset = true;
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -29,7 +29,7 @@ if(!$host || !$port || !$username || !$password || !$dbName){
|
||||
if($fullReset && class_exists('\\sammo\\DB')){
|
||||
$mysqli_obj = DB::db()->get();
|
||||
|
||||
if($mysqli_obj->multi_query(file_get_contents(__dir__.'/sql/reset.sql'))){
|
||||
if($mysqli_obj->multi_query(file_get_contents(__DIR__.'/sql/reset.sql'))){
|
||||
while(true){
|
||||
if (!$mysqli_obj->more_results()) {
|
||||
break;
|
||||
@@ -41,13 +41,13 @@ if($fullReset && class_exists('\\sammo\\DB')){
|
||||
}
|
||||
}
|
||||
if($fullReset){
|
||||
FileUtil::delInDir(__dir__."/logs");
|
||||
FileUtil::delInDir(__dir__."/data");
|
||||
if(file_exists(__dir__.'/d_setting/DB.php')){
|
||||
@unlink(__dir__.'/d_setting/DB.php');
|
||||
FileUtil::delInDir(__DIR__."/logs");
|
||||
FileUtil::delInDir(__DIR__."/data");
|
||||
if(file_exists(__DIR__.'/d_setting/DB.php')){
|
||||
@unlink(__DIR__.'/d_setting/DB.php');
|
||||
}
|
||||
if(file_exists(__dir__.'/d_setting/UniqueConst.php')){
|
||||
@unlink(__dir__.'/d_setting/UniqueConst.php');
|
||||
if(file_exists(__DIR__.'/d_setting/UniqueConst.php')){
|
||||
@unlink(__DIR__.'/d_setting/UniqueConst.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
function getAutorunInfo($autorunOption){
|
||||
global $templates;
|
||||
@@ -54,7 +54,7 @@ if(!class_exists('\\sammo\\DB')){
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
if(file_exists(__dir__.'/.htaccess')){
|
||||
if(file_exists(__DIR__.'/.htaccess')){
|
||||
$reserved = $db->queryFirstRow(
|
||||
'SELECT * FROM reserved_open ORDER BY `date` ASC LIMIT 1'
|
||||
);
|
||||
|
||||
+3
-3
@@ -2,12 +2,12 @@
|
||||
namespace sammo;
|
||||
|
||||
/** @var \Composer\Autoload\ClassLoader $loader */
|
||||
$loader = require __dir__.'/../vendor/autoload.php';
|
||||
$loader = require __DIR__.'/../vendor/autoload.php';
|
||||
$loader->addPsr4('sammo\\', __DIR__.'/sammo', true);
|
||||
|
||||
$loader->addClassMap((function () {
|
||||
$d_settingMap = [];
|
||||
foreach (glob(__dir__.'/d_setting/*.orig.php') as $filepath) {
|
||||
foreach (glob(__DIR__.'/d_setting/*.orig.php') as $filepath) {
|
||||
$filepath = str_replace('.orig.php', '.php', $filepath);
|
||||
$filename = basename($filepath);
|
||||
$classname = explode('.', $filename)[0];
|
||||
@@ -36,7 +36,7 @@ function Error($message='', $url="")
|
||||
$e = new \Exception();
|
||||
logError("aux_err", $message, '', getExceptionTraceAsString($e));
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
ob_get_flush();
|
||||
WebUtil::setHeaderNoCache();
|
||||
|
||||
+1
-1
@@ -215,7 +215,7 @@ function processWar_NG(
|
||||
WarUnitCity $city,
|
||||
int $relYear
|
||||
):bool{
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
$logger = $attacker->getLogger();
|
||||
|
||||
|
||||
@@ -264,7 +264,7 @@ class ActionLogger{
|
||||
return;
|
||||
}
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/../templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/../templates');
|
||||
|
||||
$render_me = [
|
||||
'crewtype' => $me->getCrewTypeShortName(),
|
||||
|
||||
@@ -7,7 +7,7 @@ class ResetHelper{
|
||||
}
|
||||
|
||||
static public function clearDB(){
|
||||
$servRoot = realpath(__dir__.'/../');
|
||||
$servRoot = realpath(__DIR__.'/../');
|
||||
|
||||
if(!file_exists($servRoot.'/logs') || !file_exists($servRoot.'/data')){
|
||||
if(!is_writable($servRoot)){
|
||||
@@ -195,8 +195,8 @@ class ResetHelper{
|
||||
];
|
||||
}
|
||||
Util::generateFileUsingSimpleTemplate(
|
||||
__dir__.'/../templates/base_map.orig.js',
|
||||
__dir__.'/../d_shared/base_map.js',
|
||||
__DIR__.'/../templates/base_map.orig.js',
|
||||
__DIR__.'/../d_shared/base_map.js',
|
||||
[
|
||||
'cityPosition'=>Json::encode($cityPositions),
|
||||
'regionMap'=>Json::encode(CityConst::$regionMap),
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
namespace sammo;
|
||||
|
||||
class Scenario{
|
||||
const SCENARIO_PATH = __dir__.'/../scenario';
|
||||
const SCENARIO_PATH = __DIR__.'/../scenario';
|
||||
|
||||
private $scenarioIdx;
|
||||
private $scenarioPath;
|
||||
@@ -449,10 +449,10 @@ class Scenario{
|
||||
}
|
||||
|
||||
public function buildConf(){
|
||||
$path = __dir__.'/../d_setting';
|
||||
$path = __DIR__.'/../d_setting';
|
||||
|
||||
$mapPath = __dir__.'/../scenario/map';
|
||||
$unitPath = __dir__.'/../scenario/unit';
|
||||
$mapPath = __DIR__.'/../scenario/map';
|
||||
$unitPath = __DIR__.'/../scenario/unit';
|
||||
|
||||
$mapName = $this->gameConf['mapName'];
|
||||
$unitSet = $this->gameConf['unitSet'];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
WebUtil::setHeaderNoCache();
|
||||
$session = Session::requireLogin()->setReadOnly();
|
||||
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
|
||||
$db = RootDB::db();
|
||||
$notice = $db->queryFirstField('SELECT `NOTICE` FROM `system` WHERE `NO`=1');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([]);
|
||||
$userID = Session::getUserID();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$db = RootDB::db();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([
|
||||
'result'=>true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin(null);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
if($session->userGrade < 5 && !$session->acl){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
// 외부 파라미터
|
||||
$response['server'] = [];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin([])->setReadOnly();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
WebUtil::setHeaderNoCache();
|
||||
$category = Util::getReq('category', 'int', 0);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
WebUtil::setHeaderNoCache();//FIXME: 이 파일에는 이럴 이유가 없다. javascript 기반으로 바꿔도 충분
|
||||
|
||||
if($sel == 0) $sel = 1;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/vendor/autoload.php');
|
||||
require(__DIR__.'/vendor/autoload.php');
|
||||
|
||||
if (!class_exists('\\sammo\\RootDB')) {
|
||||
header('Location:install.php');
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/vendor/autoload.php');
|
||||
require(__dir__.'/oauth_kakao/lib.join.php');
|
||||
require(__DIR__.'/vendor/autoload.php');
|
||||
require(__DIR__.'/oauth_kakao/lib.join.php');
|
||||
|
||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/vendor/autoload.php');
|
||||
require(__DIR__.'/vendor/autoload.php');
|
||||
|
||||
function getVersion($target=null){
|
||||
if($target){
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
use \kakao\KakaoKey as KakaoKey;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
$RootDB = RootDB::db();
|
||||
$session = Session::getInstance();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
require('lib.join.php');
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
require('lib.join.php');
|
||||
|
||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
require('lib.join.php');
|
||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
|
||||
WebUtil::setHeaderNoCache();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/../vendor/autoload.php');
|
||||
require(__DIR__.'/../vendor/autoload.php');
|
||||
|
||||
use \kakao\Kakao_REST_API_Helper as Kakao_REST_API_Helper;
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace sammo;
|
||||
|
||||
require(__dir__.'/vendor/autoload.php');
|
||||
require(__DIR__.'/vendor/autoload.php');
|
||||
|
||||
$session = Session::requireLogin('./')->setReadOnly();
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class Setting
|
||||
if (!file_exists($this->basepath) || !is_dir($this->basepath)) {
|
||||
return false;
|
||||
}
|
||||
$templates = new \League\Plates\Engine(__dir__.'/templates');
|
||||
$templates = new \League\Plates\Engine(__DIR__.'/templates');
|
||||
//TODO: .htaccess가 서버 오픈에도 사용될 수 있으니 별도의 방법이 필요함
|
||||
$allow_ip = Util::get_client_ip(false);
|
||||
if (Util::starts_with($allow_ip, '192.168.') ||
|
||||
|
||||
Reference in New Issue
Block a user