From 532a08763f2df2ac5cfe1ace9baab01e20092e04 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Thu, 26 Dec 2013 15:28:34 +0000 Subject: [PATCH] Use autoload for \Mibew\Tread class --- src/mibew/b.php | 2 +- src/mibew/client.php | 2 +- src/mibew/cron.php | 1 - src/mibew/libs/chat.php | 2 +- src/mibew/libs/classes/{thread.php => Mibew/Thread.php} | 6 +++--- src/mibew/libs/classes/thread_processor.php | 3 ++- src/mibew/libs/classes/users_processor.php | 1 + src/mibew/libs/invitation.php | 1 + src/mibew/libs/statistics.php | 1 + src/mibew/libs/track.php | 1 + src/mibew/mail.php | 2 +- src/mibew/operator/agent.php | 2 +- src/mibew/operator/ban.php | 2 +- src/mibew/operator/history.php | 1 + src/mibew/operator/invite.php | 1 - src/mibew/operator/redirect.php | 2 +- src/mibew/operator/threadprocessor.php | 1 + src/mibew/operator/update.php | 1 - src/mibew/operator/userhistory.php | 1 + src/mibew/thread.php | 1 - src/mibew/widget.php | 1 + 21 files changed, 20 insertions(+), 15 deletions(-) rename src/mibew/libs/classes/{thread.php => Mibew/Thread.php} (99%) diff --git a/src/mibew/b.php b/src/mibew/b.php index 24b938bd..daacd417 100644 --- a/src/mibew/b.php +++ b/src/mibew/b.php @@ -17,13 +17,13 @@ // Import namespaces and classes of the core use Mibew\Settings; +use Mibew\Thread; // Initialize libraries require_once(dirname(__FILE__).'/libs/init.php'); require_once(MIBEW_FS_ROOT.'/libs/chat.php'); require_once(MIBEW_FS_ROOT.'/libs/operator.php'); require_once(MIBEW_FS_ROOT.'/libs/groups.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); $referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ""; if($referer && isset($_SESSION['threadid'])) { diff --git a/src/mibew/client.php b/src/mibew/client.php index 88440868..923eed45 100644 --- a/src/mibew/client.php +++ b/src/mibew/client.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Settings; +use Mibew\Thread; // Initialize libraries require_once(dirname(__FILE__).'/libs/init.php'); @@ -27,7 +28,6 @@ require_once(MIBEW_FS_ROOT.'/libs/expand.php'); require_once(MIBEW_FS_ROOT.'/libs/captcha.php'); require_once(MIBEW_FS_ROOT.'/libs/invitation.php'); require_once(MIBEW_FS_ROOT.'/libs/track.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/interfaces/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/chat_style.php'); diff --git a/src/mibew/cron.php b/src/mibew/cron.php index 97664772..e6f38f50 100644 --- a/src/mibew/cron.php +++ b/src/mibew/cron.php @@ -21,7 +21,6 @@ use Mibew\Settings; // Initialize libraries require_once(dirname(__FILE__).'/libs/init.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/track.php'); require_once(MIBEW_FS_ROOT.'/libs/statistics.php'); require_once(MIBEW_FS_ROOT.'/libs/cron.php'); diff --git a/src/mibew/libs/chat.php b/src/mibew/libs/chat.php index c2f305cf..7e265c50 100644 --- a/src/mibew/libs/chat.php +++ b/src/mibew/libs/chat.php @@ -18,10 +18,10 @@ // Import namespaces and classes of the core use Mibew\Database; use Mibew\Settings; +use Mibew\Thread; // Initialize libraries require_once(MIBEW_FS_ROOT.'/libs/track.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api_interaction.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api_chat_interaction.php'); diff --git a/src/mibew/libs/classes/thread.php b/src/mibew/libs/classes/Mibew/Thread.php similarity index 99% rename from src/mibew/libs/classes/thread.php rename to src/mibew/libs/classes/Mibew/Thread.php index 58bfc0e3..865778f9 100644 --- a/src/mibew/libs/classes/thread.php +++ b/src/mibew/libs/classes/Mibew/Thread.php @@ -15,10 +15,10 @@ * limitations under the License. */ +namespace Mibew; + // Import namespaces and classes of the core -use Mibew\Database; -use Mibew\EventDispatcher; -use Mibew\Settings; +use \ThreadProcessor; /** * Represents a chat thread diff --git a/src/mibew/libs/classes/thread_processor.php b/src/mibew/libs/classes/thread_processor.php index 21210a6c..ac62fde2 100644 --- a/src/mibew/libs/classes/thread_processor.php +++ b/src/mibew/libs/classes/thread_processor.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Settings; +use Mibew\Thread; /** * Incapsulates thread api and thread processing functions. @@ -58,7 +59,7 @@ class ThreadProcessor extends ClientSideProcessor { * * @param int $thread_id Id of the thread * @param int $last_token Last token of the thread - * @return Thread + * @return \Mibew\Thread * @throws ThreadProcessorException */ public static function getThread($thread_id, $last_token) { diff --git a/src/mibew/libs/classes/users_processor.php b/src/mibew/libs/classes/users_processor.php index ce4e2b12..2f5b6172 100644 --- a/src/mibew/libs/classes/users_processor.php +++ b/src/mibew/libs/classes/users_processor.php @@ -19,6 +19,7 @@ use Mibew\Database; use Mibew\EventDispatcher; use Mibew\Settings; +use Mibew\Thread; /** * Incapsulates awaiting users list api related functions. diff --git a/src/mibew/libs/invitation.php b/src/mibew/libs/invitation.php index 7be20eb6..63a2c65b 100644 --- a/src/mibew/libs/invitation.php +++ b/src/mibew/libs/invitation.php @@ -18,6 +18,7 @@ // Import namespaces and classes of the core use Mibew\Database; use Mibew\Settings; +use Mibew\Thread; /** * Check invitation state for specified visitior diff --git a/src/mibew/libs/statistics.php b/src/mibew/libs/statistics.php index ab03a434..8ba3b1d5 100644 --- a/src/mibew/libs/statistics.php +++ b/src/mibew/libs/statistics.php @@ -18,6 +18,7 @@ // Import namespaces and classes of the core use Mibew\Database; use Mibew\Settings; +use Mibew\Thread; function get_statistics_query($type) { diff --git a/src/mibew/libs/track.php b/src/mibew/libs/track.php index 4aa8f487..70b49e6d 100644 --- a/src/mibew/libs/track.php +++ b/src/mibew/libs/track.php @@ -18,6 +18,7 @@ // Import namespaces and classes of the core use Mibew\Database; use Mibew\Settings; +use Mibew\Thread; // Initialize libraries require_once(MIBEW_FS_ROOT.'/libs/chat.php'); diff --git a/src/mibew/mail.php b/src/mibew/mail.php index 5ab8cc2f..26389a4a 100644 --- a/src/mibew/mail.php +++ b/src/mibew/mail.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Settings; +use Mibew\Thread; // Initialize libraries require_once(dirname(__FILE__).'/libs/init.php'); @@ -24,7 +25,6 @@ require_once(MIBEW_FS_ROOT.'/libs/chat.php'); require_once(MIBEW_FS_ROOT.'/libs/expand.php'); require_once(MIBEW_FS_ROOT.'/libs/groups.php'); require_once(MIBEW_FS_ROOT.'/libs/notify.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/interfaces/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/chat_style.php'); diff --git a/src/mibew/operator/agent.php b/src/mibew/operator/agent.php index 3e7086b7..2896c626 100644 --- a/src/mibew/operator/agent.php +++ b/src/mibew/operator/agent.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Settings; +use Mibew\Thread; // Initialize libraries require_once(dirname(dirname(__FILE__)).'/libs/init.php'); @@ -26,7 +27,6 @@ require_once(MIBEW_FS_ROOT.'/libs/groups.php'); require_once(MIBEW_FS_ROOT.'/libs/operator.php'); require_once(MIBEW_FS_ROOT.'/libs/pagination.php'); require_once(MIBEW_FS_ROOT.'/libs/expand.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/interfaces/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/chat_style.php'); diff --git a/src/mibew/operator/ban.php b/src/mibew/operator/ban.php index cd7da435..0cdbcef1 100644 --- a/src/mibew/operator/ban.php +++ b/src/mibew/operator/ban.php @@ -17,13 +17,13 @@ // Import namespaces and classes of the core use Mibew\Database; +use Mibew\Thread; // Initialize libraries require_once(dirname(dirname(__FILE__)).'/libs/init.php'); require_once(MIBEW_FS_ROOT.'/libs/chat.php'); require_once(MIBEW_FS_ROOT.'/libs/operator.php'); require_once(MIBEW_FS_ROOT.'/libs/pagination.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/interfaces/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/page_style.php'); diff --git a/src/mibew/operator/history.php b/src/mibew/operator/history.php index e137b906..7bb8ec7d 100644 --- a/src/mibew/operator/history.php +++ b/src/mibew/operator/history.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Database; +use Mibew\Thread; // Initialize libraries require_once(dirname(dirname(__FILE__)).'/libs/init.php'); diff --git a/src/mibew/operator/invite.php b/src/mibew/operator/invite.php index b46123a2..91e2da28 100644 --- a/src/mibew/operator/invite.php +++ b/src/mibew/operator/invite.php @@ -19,7 +19,6 @@ require_once(dirname(dirname(__FILE__)).'/libs/init.php'); require_once(MIBEW_FS_ROOT.'/libs/invitation.php'); require_once(MIBEW_FS_ROOT.'/libs/track.php'); require_once(MIBEW_FS_ROOT.'/libs/operator.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); $operator = check_login(); diff --git a/src/mibew/operator/redirect.php b/src/mibew/operator/redirect.php index 39198c85..8ed97fa5 100644 --- a/src/mibew/operator/redirect.php +++ b/src/mibew/operator/redirect.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Database; +use Mibew\Thread; // Initialize libraries require_once(dirname(dirname(__FILE__)).'/libs/init.php'); @@ -24,7 +25,6 @@ require_once(MIBEW_FS_ROOT.'/libs/operator.php'); require_once(MIBEW_FS_ROOT.'/libs/chat.php'); require_once(MIBEW_FS_ROOT.'/libs/expand.php'); require_once(MIBEW_FS_ROOT.'/libs/groups.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/interfaces/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/style.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/chat_style.php'); diff --git a/src/mibew/operator/threadprocessor.php b/src/mibew/operator/threadprocessor.php index 0225781f..4cd26d8f 100644 --- a/src/mibew/operator/threadprocessor.php +++ b/src/mibew/operator/threadprocessor.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Database; +use Mibew\Thread; // Initialize libraries require_once(dirname(dirname(__FILE__)).'/libs/init.php'); diff --git a/src/mibew/operator/update.php b/src/mibew/operator/update.php index 868e8ba3..0fa15f91 100644 --- a/src/mibew/operator/update.php +++ b/src/mibew/operator/update.php @@ -22,7 +22,6 @@ require_once(MIBEW_FS_ROOT.'/libs/operator.php'); require_once(MIBEW_FS_ROOT.'/libs/groups.php'); require_once(MIBEW_FS_ROOT.'/libs/invitation.php'); require_once(MIBEW_FS_ROOT.'/libs/track.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api_interaction.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api_users_interaction.php'); diff --git a/src/mibew/operator/userhistory.php b/src/mibew/operator/userhistory.php index 3b471f84..f2c5c6cb 100644 --- a/src/mibew/operator/userhistory.php +++ b/src/mibew/operator/userhistory.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Database; +use Mibew\Thread; // Initialize libraries require_once(dirname(dirname(__FILE__)).'/libs/init.php'); diff --git a/src/mibew/thread.php b/src/mibew/thread.php index 8b239304..3f2ef073 100644 --- a/src/mibew/thread.php +++ b/src/mibew/thread.php @@ -22,7 +22,6 @@ require_once(MIBEW_FS_ROOT.'/libs/invitation.php'); require_once(MIBEW_FS_ROOT.'/libs/groups.php'); require_once(MIBEW_FS_ROOT.'/libs/captcha.php'); require_once(MIBEW_FS_ROOT.'/libs/notify.php'); -require_once(MIBEW_FS_ROOT.'/libs/classes/thread.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api_interaction.php'); require_once(MIBEW_FS_ROOT.'/libs/classes/mibew_api_chat_interaction.php'); diff --git a/src/mibew/widget.php b/src/mibew/widget.php index ca996032..0aefef22 100644 --- a/src/mibew/widget.php +++ b/src/mibew/widget.php @@ -17,6 +17,7 @@ // Import namespaces and classes of the core use Mibew\Settings; +use Mibew\Thread; // Initialize libraries require_once(dirname(__FILE__).'/libs/init.php');