From c3cb10094706c1f735ab55c26f077257f455d30f Mon Sep 17 00:00:00 2001 From: hide_d Date: Sun, 25 Mar 2018 00:45:23 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=BC=EB=B6=80=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20-=20index.php=EC=97=90=EC=84=9C=20javascri?= =?UTF-8?q?pt=20string=20=EC=9D=B4=EC=96=B4=EB=B6=99=EC=9D=B4=EA=B8=B0=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20-=20RestAPIHelper=20=ED=81=B4=EB=9E=98?= =?UTF-8?q?=EC=8A=A4=20-=20=EC=84=B8=EB=B6=80=20=EC=84=9C=EB=B2=84=20Autol?= =?UTF-8?q?oad=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 6 +++--- .../{kakao.php => Kakao_REST_API_Helper.php} | 2 +- src/sammo/Session.php | 4 ++-- twe/lib.php | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 6 deletions(-) rename src/kakao/{kakao.php => Kakao_REST_API_Helper.php} (99%) diff --git a/index.php b/index.php index 29f84a6a..5e1e0465 100644 --- a/index.php +++ b/index.php @@ -39,9 +39,9 @@ var oauthMode = null; function getOAuthToken(mode='login', scope_list = null){ oauthMode = mode; - var url = 'https://kauth.kakao.com/oauth/authorize?'\ - 'client_id=&'\ - 'redirect_uri=&'\ + var url = 'https://kauth.kakao.com/oauth/authorize?'+ + 'client_id=&'+ + 'redirect_uri=&'+ 'response_type=code'; if(Array.isArray(scope_list)){ url += '&scope='+scope_list.join(','); diff --git a/src/kakao/kakao.php b/src/kakao/Kakao_REST_API_Helper.php similarity index 99% rename from src/kakao/kakao.php rename to src/kakao/Kakao_REST_API_Helper.php index 79642535..b50a0350 100644 --- a/src/kakao/kakao.php +++ b/src/kakao/Kakao_REST_API_Helper.php @@ -1,7 +1,7 @@ set($name, $value); } - private function set(string $name, mixed $value){ + private function set(string $name, $value){ if($value === null){ unset($_SESSION[$name]); } diff --git a/twe/lib.php b/twe/lib.php index 785c4588..d50fd93d 100644 --- a/twe/lib.php +++ b/twe/lib.php @@ -11,6 +11,11 @@ class Autoloader { public static function register() { + static $isRegisterd = false; + if($isRegisterd){ + return; + } + $isRegisterd = true; spl_autoload_register(function ($class) { $file = __DIR__.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php'; if (file_exists($file)) { @@ -19,6 +24,16 @@ class Autoloader } return false; }); + + spl_autoload_register(function ($class) { + $class = Util::array_last(explode('\\', $class)); + $file = __DIR__."/d_setting/{$class}.php"; + if (file_exists($file)) { + require $file; + return true; + } + return false; + }); } } Autoloader::register();