From fce895bb21e1dc431e774efe98389a3b3a949a1b Mon Sep 17 00:00:00 2001 From: Denny Dai Date: Fri, 26 Jun 2015 13:37:54 +0800 Subject: [PATCH] easy to set config --- BOT.php | 25 ++++++++++++++++++++++--- classes/Telegram/Base.php | 2 +- classes/Telegram/init.php | 15 --------------- config.inc.php => config.php | 1 + 4 files changed, 24 insertions(+), 19 deletions(-) rename config.inc.php => config.php (90%) diff --git a/BOT.php b/BOT.php index 219f1ff..b114e09 100644 --- a/BOT.php +++ b/BOT.php @@ -1,6 +1,25 @@ $value) { + if ($value == PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php') { + unset($load_plugins[$key]); + } + } + foreach ($load_plugins as $value) { + require_once $value; + } + require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php'; + ?> \ No newline at end of file diff --git a/classes/Telegram/Base.php b/classes/Telegram/Base.php index 5d158cf..819bfc2 100644 --- a/classes/Telegram/Base.php +++ b/classes/Telegram/Base.php @@ -1,5 +1,5 @@ exec("msg ".escapePeer(OWNER_NAME)." ".json_encode($_GET)); } -//load plugins - $load_plugins = glob(PATH.'plugins'.DIRECTORY_SEPARATOR.'*.php'); - foreach ($load_plugins as $key => $value) { - if ($value == PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php') { - unset($load_plugins[$key]); - } - } - foreach ($load_plugins as $value) { - require_once $value; - } - require_once PATH.'plugins'.DIRECTORY_SEPARATOR.'help.php'; } \ No newline at end of file diff --git a/config.inc.php b/config.php similarity index 90% rename from config.inc.php rename to config.php index 917dcf2..f595baf 100644 --- a/config.inc.php +++ b/config.php @@ -1,4 +1,5 @@