From 6dcc929ebd9f004c3fe17a22b5f09db6c719a9c5 Mon Sep 17 00:00:00 2001 From: Alexey Kachayev Date: Sat, 10 Oct 2009 18:48:50 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D1=80=D0=B0=D0=B7=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=B8=20=D0=BC=D0=BE?= =?UTF-8?q?=D0=BD=D0=BE=D0=BB=D0=B8=D1=82=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BA?= =?UTF-8?q?=D0=B5=D1=88=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D0=BE=D1=82=D0=B4?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D1=85=20=D0=BE=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- classes/modules/blog/Blog.class.php | 4 ++-- classes/modules/comment/Comment.class.php | 2 +- classes/modules/favourite/Favourite.class.php | 2 +- classes/modules/topic/Topic.class.php | 6 +++--- classes/modules/user/User.class.php | 6 +++--- classes/modules/vote/Vote.class.php | 2 +- config/config.php | 20 ++++++++++++++++--- 7 files changed, 28 insertions(+), 14 deletions(-) diff --git a/classes/modules/blog/Blog.class.php b/classes/modules/blog/Blog.class.php index ab51415e..cb16e819 100644 --- a/classes/modules/blog/Blog.class.php +++ b/classes/modules/blog/Blog.class.php @@ -129,7 +129,7 @@ class LsBlog extends Module { if (!$aBlogId) { return array(); } - if (1) { + if (Config::Get('cache.solid.blog.get_by_ids')) { return $this->GetBlogsByArrayIdSolid($aBlogId); } if (!is_array($aBlogId)) { @@ -481,7 +481,7 @@ class LsBlog extends Module { if (!$aBlogId) { return array(); } - if (1) { + if (Config::Get('cache.solid.blog.users')) { return $this->GetBlogUsersByArrayBlogSolid($aBlogId,$sUserId); } if (!is_array($aBlogId)) { diff --git a/classes/modules/comment/Comment.class.php b/classes/modules/comment/Comment.class.php index dd8b9a72..72ec27d6 100644 --- a/classes/modules/comment/Comment.class.php +++ b/classes/modules/comment/Comment.class.php @@ -157,7 +157,7 @@ class LsComment extends Module { if (!$aCommentId) { return array(); } - if (1) { + if (Config::Get('cache.solid.comment.get_by_ids')) { return $this->GetCommentsByArrayIdSolid($aCommentId); } if (!is_array($aCommentId)) { diff --git a/classes/modules/favourite/Favourite.class.php b/classes/modules/favourite/Favourite.class.php index fd267299..905e6575 100644 --- a/classes/modules/favourite/Favourite.class.php +++ b/classes/modules/favourite/Favourite.class.php @@ -60,7 +60,7 @@ class LsFavourite extends Module { if (!$aTargetId) { return array(); } - if (1) { + if (Config::Get('cache.solid.favourite.get_by_ids')) { return $this->GetFavouritesByArraySolid($aTargetId,$sTargetType,$sUserId); } if (!is_array($aTargetId)) { diff --git a/classes/modules/topic/Topic.class.php b/classes/modules/topic/Topic.class.php index 2f73351f..4e1a36ed 100644 --- a/classes/modules/topic/Topic.class.php +++ b/classes/modules/topic/Topic.class.php @@ -251,7 +251,7 @@ class LsTopic extends Module { if (!$aTopicId) { return array(); } - if (1) { + if (Config::Get('cache.solid.topic.get_by_ids')) { return $this->GetTopicsByArrayIdSolid($aTopicId); } @@ -956,7 +956,7 @@ class LsTopic extends Module { if (!$aTopicId) { return array(); } - if (1) { + if (Config::Get('cache.solid.topic.read')) { return $this->GetTopicsReadByArraySolid($aTopicId,$sUserId); } if (!is_array($aTopicId)) { @@ -1058,7 +1058,7 @@ class LsTopic extends Module { if (!$aTopicId) { return array(); } - if (1) { + if (Config::Get('cache.solid.topic.question_vote')) { return $this->GetTopicsQuestionVoteByArraySolid($aTopicId,$sUserId); } if (!is_array($aTopicId)) { diff --git a/classes/modules/user/User.class.php b/classes/modules/user/User.class.php index ccf09c09..51812ab7 100644 --- a/classes/modules/user/User.class.php +++ b/classes/modules/user/User.class.php @@ -130,7 +130,7 @@ class LsUser extends Module { if (!$aUserId) { return array(); } - if (1) { + if (Config::Get('cache.solid.user.get_by_ids')) { return $this->GetUsersByArrayIdSolid($aUserId); } if (!is_array($aUserId)) { @@ -211,7 +211,7 @@ class LsUser extends Module { if (!$aUserId) { return array(); } - if (1) { + if (Config::Get('cache.solid.user.session')) { return $this->GetSessionsByArrayIdSolid($aUserId); } if (!is_array($aUserId)) { @@ -651,7 +651,7 @@ class LsUser extends Module { if (!$aUserId) { return array(); } - if (1) { + if (Config::Get('cache.solid.user.friend')) { return $this->GetFriendsByArraySolid($aUserId,$sUserId); } if (!is_array($aUserId)) { diff --git a/classes/modules/vote/Vote.class.php b/classes/modules/vote/Vote.class.php index 0b40a4f1..e5bfc355 100644 --- a/classes/modules/vote/Vote.class.php +++ b/classes/modules/vote/Vote.class.php @@ -74,7 +74,7 @@ class LsVote extends Module { if (!$aTargetId) { return array(); } - if (1) { + if (Config::Get('cache.solid.vote.get_by_ids')) { return $this->GetVoteByArraySolid($aTargetId,$sTargetType,$sUserId); } if (!is_array($aTargetId)) { diff --git a/config/config.php b/config/config.php index 8775a9bd..d9198d1a 100644 --- a/config/config.php +++ b/config/config.php @@ -282,14 +282,13 @@ $config['router']['config']['action_not_found'] = 'error'; /** * Настройки вывода блоков */ -$config['block']['index'] = array( +$config['block']['rule_index_blog'] = array( 'action' => array( 'index' => array('index'), 'blog', ), 'blocks' => array( 'right' => array('stream','tags','blogs'=>array('params'=>array(),'priority'=>1)) - ), - 'extends' => null + ) ); /** @@ -354,6 +353,21 @@ $config['compress']['css']['template'] = "highest_compression"; */ $config['compress']['js']['use'] = true; +/** + * Настройка использования раздельного и монолитного кеша для отдельных операций + */ +$config['cache']['solid']['blog']['get_by_ids'] = true; +$config['cache']['solid']['blog']['users'] = true; +$config['cache']['solid']['comment']['get_by_ids'] = true; +$config['cache']['solid']['vote']['get_by_ids'] = true; +$config['cache']['solid']['user']['get_by_ids'] = true; +$config['cache']['solid']['user']['session'] = true; +$config['cache']['solid']['user']['friend'] = true; +$config['cache']['solid']['favourite']['get_by_ids'] = true; +$config['cache']['solid']['topic']['get_by_ids'] = true; +$config['cache']['solid']['topic']['read'] = true; +$config['cache']['solid']['topic']['question_vote'] = true; + /** * Установка локали */