mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-09 12:02:24 +09:00
Comment caching improvements.
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9789 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
97470e4d40
commit
41584ccd58
4 changed files with 24 additions and 22 deletions
|
|
@ -79,13 +79,6 @@
|
||||||
|
|
||||||
$oDB->commit();
|
$oDB->commit();
|
||||||
|
|
||||||
//remove from cache
|
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
|
||||||
if($oCacheHandler->isSupport())
|
|
||||||
{
|
|
||||||
$oCacheHandler->invalidateGroupKey('commentList');
|
|
||||||
}
|
|
||||||
|
|
||||||
$msgCode = '';
|
$msgCode = '';
|
||||||
if($isTrash == 'true') $msgCode = 'success_trashed';
|
if($isTrash == 'true') $msgCode = 'success_trashed';
|
||||||
else $msgCode = 'success_deleted';
|
else $msgCode = 'success_deleted';
|
||||||
|
|
@ -169,11 +162,13 @@
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
$output = executeQuery('comment.deleteModuleCommentsList', $args);
|
$output = executeQuery('comment.deleteModuleCommentsList', $args);
|
||||||
|
|
||||||
//remove from cache
|
//remove from cache
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||||
if($oCacheHandler->isSupport())
|
if($oCacheHandler->isSupport())
|
||||||
{
|
{
|
||||||
$oCacheHandler->invalidateGroupKey('commentList');
|
// Invalidate newest comments. Per document cache is invalidated inside document admin controller.
|
||||||
|
$oCacheHandler->invalidateGroupKey('newestCommentsList');
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,8 @@
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||||
if($oCacheHandler->isSupport())
|
if($oCacheHandler->isSupport())
|
||||||
{
|
{
|
||||||
$oCacheHandler->invalidateGroupKey('commentList');
|
$oCacheHandler->invalidateGroupKey('commentList_' . $document_srl);
|
||||||
|
$oCacheHandler->invalidateGroupKey('newestCommentsList');
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
@ -326,7 +327,8 @@
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||||
if($oCacheHandler->isSupport())
|
if($oCacheHandler->isSupport())
|
||||||
{
|
{
|
||||||
$oCacheHandler->invalidateGroupKey('commentList');
|
$oCacheHandler->invalidateGroupKey('commentList_' . $obj->document_srl);
|
||||||
|
$oCacheHandler->invalidateGroupKey('newestCommentsList');
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
@ -395,7 +397,8 @@
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||||
if($oCacheHandler->isSupport())
|
if($oCacheHandler->isSupport())
|
||||||
{
|
{
|
||||||
$oCacheHandler->invalidateGroupKey('commentList');
|
$oCacheHandler->invalidateGroupKey('commentList_' . $document_srl);
|
||||||
|
$oCacheHandler->invalidateGroupKey('newestCommentsList');
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
@ -454,7 +457,8 @@
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||||
if($oCacheHandler->isSupport())
|
if($oCacheHandler->isSupport())
|
||||||
{
|
{
|
||||||
$oCacheHandler->invalidateGroupKey('commentList');
|
$oCacheHandler->invalidateGroupKey('commentList_' . $document_srl);
|
||||||
|
$oCacheHandler->invalidateGroupKey('newestCommentsList');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief get the comment in corresponding with mid.
|
* @brief get the comment in corresponding with mid.
|
||||||
|
* TODO add commentItems to cache too
|
||||||
**/
|
**/
|
||||||
function getNewestCommentList($obj, $columnList = array()) {
|
function getNewestCommentList($obj, $columnList = array()) {
|
||||||
if($obj->mid) {
|
if($obj->mid) {
|
||||||
|
|
@ -190,7 +191,7 @@
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||||
if($oCacheHandler->isSupport()){
|
if($oCacheHandler->isSupport()){
|
||||||
$object_key = 'object_newest_comment_list:'.$obj->module_srl;
|
$object_key = 'object_newest_comment_list:'.$obj->module_srl;
|
||||||
$cache_key = $oCacheHandler->getGroupKey('commentList', $object_key);
|
$cache_key = $oCacheHandler->getGroupKey('newestCommentsList', $object_key);
|
||||||
$output = $oCacheHandler->get($cache_key);
|
$output = $oCacheHandler->get($cache_key);
|
||||||
}
|
}
|
||||||
if(!$output){
|
if(!$output){
|
||||||
|
|
@ -220,11 +221,12 @@
|
||||||
* @brief get a comment list of the doc in corresponding woth document_srl.
|
* @brief get a comment list of the doc in corresponding woth document_srl.
|
||||||
**/
|
**/
|
||||||
function getCommentList($document_srl, $page = 0, $is_admin = false, $count = 0) {
|
function getCommentList($document_srl, $page = 0, $is_admin = false, $count = 0) {
|
||||||
|
if(!isset($document_srl)) return;
|
||||||
// cache controll
|
// cache controll
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||||
if($oCacheHandler->isSupport()){
|
if($oCacheHandler->isSupport()){
|
||||||
$object_key = 'object:'.$document_srl.'_'.$page.'_'.($is_admin ? 'Y' : 'N') .'_' . $count;
|
$object_key = 'object:'.$document_srl.'_'.$page.'_'.($is_admin ? 'Y' : 'N') .'_' . $count;
|
||||||
$cache_key = $oCacheHandler->getGroupKey('commentList', $object_key);
|
$cache_key = $oCacheHandler->getGroupKey('commentList_' . $document_srl, $object_key);
|
||||||
$output = $oCacheHandler->get($cache_key);
|
$output = $oCacheHandler->get($cache_key);
|
||||||
}
|
}
|
||||||
if(!$output){
|
if(!$output){
|
||||||
|
|
|
||||||
|
|
@ -321,6 +321,7 @@
|
||||||
$oCacheHandler->delete($cache_key);
|
$oCacheHandler->delete($cache_key);
|
||||||
$cache_key_item = 'object_document_item:'.$document_srl;
|
$cache_key_item = 'object_document_item:'.$document_srl;
|
||||||
$oCacheHandler->delete($cache_key_item);
|
$oCacheHandler->delete($cache_key_item);
|
||||||
|
$oCacheHandler->invalidateGroupKey('commentList_' . $document_srl);
|
||||||
}
|
}
|
||||||
$oCacheHandler->invalidateGroupKey('documentList');
|
$oCacheHandler->invalidateGroupKey('documentList');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue