google code issues 547 and 432 regarding cache improvements

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9797 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
dragan-dan 2011-11-03 12:54:11 +00:00
parent 68ee366d1c
commit c5673fb7d5
2 changed files with 10 additions and 5 deletions

View file

@ -12,9 +12,12 @@
var $handler = null;
var $keyGroupVersions = null;
function &getInstance($target='object') {
return new CacheHandler($target);
}
function &getInstance($target='object') {
if(!$GLOBALS['__XE_CACHE_HANDLER__'][$target]) {
$GLOBALS['__XE_CACHE_HANDLER__'][$target] = new CacheHandler($target);
}
return $GLOBALS['__XE_CACHE_HANDLER__'][$target];
}
function CacheHandler($target, $info=null) {
if(!$info) $info = Context::getDBInfo();

View file

@ -152,10 +152,12 @@
* @brief module_srl value, bringing the list of documents
**/
function getDocumentList($obj, $except_notice = false, $load_extra_vars=true, $columnList = array()) {
// cache controll
$sort_check = $this->_setSortIndex($obj, $load_extra_vars);
$obj->sort_index = $sort_check->sort_index;
// cache controll
$oCacheHandler = &CacheHandler::getInstance('object');
if($oCacheHandler->isSupport()){
$object_key = 'object:'.$obj->module_srl.'_category_srl:'.$obj->category_srl.'_list_count:'.$obj->list_count.'_search_target:'.$obj->search_target.'_search_keyword:'.$obj->search_keyword.'_page'.$obj->page;
$object_key = 'object:'.$obj->module_srl.'_category_srl:'.$obj->category_srl.'_list_count:'.$obj->list_count.'_search_target:'.$obj->search_target.'_search_keyword:'.$obj->search_keyword.'_page'.$obj->page.'_sort_index:'.$obj->sort_index;
$cache_key = $oCacheHandler->getGroupKey('documentList', $object_key);
$output = $oCacheHandler->get($cache_key);
}