mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-08 19:42:15 +09:00
#498 document table's cache delete
This commit is contained in:
parent
514c3c3908
commit
17edfdf2cc
1 changed files with 56 additions and 0 deletions
|
|
@ -832,6 +832,14 @@ class documentController extends document
|
||||||
$args->document_srl = $document_srl;
|
$args->document_srl = $document_srl;
|
||||||
$output = executeQuery('document.updateReadedCount', $args);
|
$output = executeQuery('document.updateReadedCount', $args);
|
||||||
|
|
||||||
|
$oCacheHandler = CacheHandler::getInstance('object');
|
||||||
|
if($oCacheHandler->isSupport())
|
||||||
|
{
|
||||||
|
//remove document item from cache
|
||||||
|
$cache_key = 'document_item:'. getNumberingPath($document_srl) . $document_srl;
|
||||||
|
$oCacheHandler->delete($cache_key);
|
||||||
|
}
|
||||||
|
|
||||||
// Register session
|
// Register session
|
||||||
$_SESSION['readed_document'][$document_srl] = true;
|
$_SESSION['readed_document'][$document_srl] = true;
|
||||||
|
|
||||||
|
|
@ -1097,6 +1105,14 @@ class documentController extends document
|
||||||
|
|
||||||
$oDB->commit();
|
$oDB->commit();
|
||||||
|
|
||||||
|
$oCacheHandler = CacheHandler::getInstance('object');
|
||||||
|
if($oCacheHandler->isSupport())
|
||||||
|
{
|
||||||
|
//remove document item from cache
|
||||||
|
$cache_key = 'document_item:'. getNumberingPath($document_srl) . $document_srl;
|
||||||
|
$oCacheHandler->delete($cache_key);
|
||||||
|
}
|
||||||
|
|
||||||
// Leave in the session information
|
// Leave in the session information
|
||||||
$_SESSION['voted_document'][$document_srl] = true;
|
$_SESSION['voted_document'][$document_srl] = true;
|
||||||
|
|
||||||
|
|
@ -1238,6 +1254,14 @@ class documentController extends document
|
||||||
{
|
{
|
||||||
$args->update_order = -1*getNextSequence();
|
$args->update_order = -1*getNextSequence();
|
||||||
$args->last_updater = $last_updater;
|
$args->last_updater = $last_updater;
|
||||||
|
|
||||||
|
$oCacheHandler = CacheHandler::getInstance('object');
|
||||||
|
if($oCacheHandler->isSupport())
|
||||||
|
{
|
||||||
|
//remove document item from cache
|
||||||
|
$cache_key = 'document_item:'. getNumberingPath($document_srl) . $document_srl;
|
||||||
|
$oCacheHandler->delete($cache_key);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return executeQuery('document.updateCommentCount', $args);
|
return executeQuery('document.updateCommentCount', $args);
|
||||||
|
|
@ -1255,6 +1279,14 @@ class documentController extends document
|
||||||
$args->document_srl = $document_srl;
|
$args->document_srl = $document_srl;
|
||||||
$args->trackback_count = $trackback_count;
|
$args->trackback_count = $trackback_count;
|
||||||
|
|
||||||
|
$oCacheHandler = CacheHandler::getInstance('object');
|
||||||
|
if($oCacheHandler->isSupport())
|
||||||
|
{
|
||||||
|
//remove document item from cache
|
||||||
|
$cache_key = 'document_item:'. getNumberingPath($document_srl) . $document_srl;
|
||||||
|
$oCacheHandler->delete($cache_key);
|
||||||
|
}
|
||||||
|
|
||||||
return executeQuery('document.updateTrackbackCount', $args);
|
return executeQuery('document.updateTrackbackCount', $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1358,6 +1390,30 @@ class documentController extends document
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
$this->makeCategoryFile($category_info->module_srl);
|
$this->makeCategoryFile($category_info->module_srl);
|
||||||
|
// remvove cache
|
||||||
|
$oCacheHandler = CacheHandler::getInstance('object');
|
||||||
|
if($oCacheHandler->isSupport())
|
||||||
|
{
|
||||||
|
$page = 0;
|
||||||
|
while(true) {
|
||||||
|
$args = new stdClass();
|
||||||
|
$args->category_srl = $category_srl;
|
||||||
|
$args->page = ++$page;
|
||||||
|
$output = executeQuery('document.getDocumentList', $args, array('document_srl'));
|
||||||
|
|
||||||
|
if($output->data == array())
|
||||||
|
break;
|
||||||
|
|
||||||
|
foreach($output->data as $val)
|
||||||
|
{
|
||||||
|
$document_srl = $val->document_srl;
|
||||||
|
//remove document item from cache
|
||||||
|
$cache_key = 'document_item:'. getNumberingPath($document_srl) . $document_srl;
|
||||||
|
$oCacheHandler->delete($cache_key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update category_srl of the documents in the same category to 0
|
// Update category_srl of the documents in the same category to 0
|
||||||
$args = new stdClass();
|
$args = new stdClass();
|
||||||
$args->target_category_srl = 0;
|
$args->target_category_srl = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue