mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
#242 object cache 정리
This commit is contained in:
parent
d4d43c1382
commit
37c5e114ec
20 changed files with 513 additions and 253 deletions
1
classes/cache/CacheHandler.class.php
vendored
1
classes/cache/CacheHandler.class.php
vendored
|
|
@ -136,6 +136,7 @@ class CacheHandler extends Handler
|
|||
*/
|
||||
function getCacheKey($key)
|
||||
{
|
||||
$key = str_replace('/', ':', $key);
|
||||
return __XE_VERSION__ . ':' . $key;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -859,6 +859,19 @@ function delObjectVars($target_obj, $del_obj)
|
|||
return $return_obj;
|
||||
}
|
||||
|
||||
function getDestroyXeVars(&$vars)
|
||||
{
|
||||
$del_vars = array('error_return_url', 'success_return_url', 'ruleset', 'xe_validator_id');
|
||||
|
||||
foreach($del_vars as $var)
|
||||
{
|
||||
if(is_array($vars)) unset($vars[$var]);
|
||||
else if(is_object($vars)) unset($vars->$var);
|
||||
}
|
||||
|
||||
return $vars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change error_handing to debugPrint on php5 higher
|
||||
*
|
||||
|
|
|
|||
|
|
@ -376,37 +376,22 @@ class commentModel extends comment
|
|||
|
||||
$args->list_count = $obj->list_count;
|
||||
|
||||
// cache controll
|
||||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
if(strpos($args->module_srl, ",") === false)
|
||||
{
|
||||
$object_key = 'object_newest_comment_list:' . $obj->module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('newestCommentsList', $object_key);
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$output)
|
||||
{
|
||||
if(strpos($args->module_srl, ",") === false)
|
||||
if($args->module_srl)
|
||||
{
|
||||
if($args->module_srl)
|
||||
// check if module is using comment validation system
|
||||
$oCommentController = getController("comment");
|
||||
$is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl);
|
||||
if($is_using_validation)
|
||||
{
|
||||
// check if module is using comment validation system
|
||||
$oCommentController = getController("comment");
|
||||
$is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl);
|
||||
if($is_using_validation)
|
||||
{
|
||||
$args->status = 1;
|
||||
}
|
||||
$args->status = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
|
||||
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->put($cache_key, $output);
|
||||
}
|
||||
}
|
||||
|
||||
$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
|
||||
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class counterModel extends counter
|
|||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'object:' . $site_srl . '_' . str_replace('.', '-', $args->ipaddress);
|
||||
$object_key = 'counter:' . $site_srl . '_' . str_replace(array('.', ':'), '-', $args->ipaddress);
|
||||
$cache_key = $oCacheHandler->getGroupKey('counterIpLogged_' . $args->regdate, $object_key);
|
||||
if($oCacheHandler->isValid($cache_key))
|
||||
{
|
||||
|
|
@ -68,7 +68,7 @@ class counterModel extends counter
|
|||
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:insertedTodayStatus:' . $site_srl . '_' . $args->regdate;
|
||||
$cache_key = 'counter:insertedTodayStatus:' . $site_srl . '_' . $args->regdate;
|
||||
if($oCacheHandler->isValid($cache_key))
|
||||
{
|
||||
return $oCacheHandler->get($cache_key);
|
||||
|
|
@ -90,7 +90,7 @@ class counterModel extends counter
|
|||
{
|
||||
$oCacheHandler->put($cache_key, TRUE);
|
||||
$_old_date = date('Ymd', strtotime('-1 day'));
|
||||
$oCacheHandler->delete('object:insertedTodayStatus:' . $site_srl . '_' . $_old_date);
|
||||
$oCacheHandler->delete('counter:insertedTodayStatus:' . $site_srl . '_' . $_old_date);
|
||||
}
|
||||
|
||||
return $result;
|
||||
|
|
|
|||
|
|
@ -280,8 +280,6 @@ class document extends ModuleObject
|
|||
if($oDB->isColumnExists('documents', 'allow_comment') || $oDB->isColumnExists('documents', 'lock_comment'))
|
||||
{
|
||||
$oDB->addColumn('documents', 'comment_status', 'varchar', 20, 'ALLOW');
|
||||
$columnList = array('module_srl');
|
||||
$moduleSrlList = $oModuleModel->getModuleSrlList(null, $columnList);
|
||||
|
||||
$args->commentStatus = 'DENY';
|
||||
|
||||
|
|
|
|||
|
|
@ -904,6 +904,12 @@ class documentController extends document
|
|||
|
||||
$oDB->commit();
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -366,12 +366,13 @@ class documentModel extends document
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:module_extra_keys_' . $module_srl;
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
$object_key = 'module_extra_keys:' . $module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$keys = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
$oExtraVar = &ExtraVar::getInstance($module_srl);
|
||||
if(!$output)
|
||||
if(!$keys)
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->module_srl = $module_srl;
|
||||
|
|
@ -422,15 +423,17 @@ class documentModel extends document
|
|||
{
|
||||
$output = executeQueryArray('document.getDocumentExtraKeys', $obj);
|
||||
}
|
||||
|
||||
$oExtraVar->setExtraVarKeys($output->data);
|
||||
$keys = $oExtraVar->getExtraVars();
|
||||
if(!$keys) $keys = array();
|
||||
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->put($cache_key, $output);
|
||||
$oCacheHandler->put($cache_key, $keys);
|
||||
}
|
||||
}
|
||||
|
||||
$oExtraVar->setExtraVarKeys($output->data);
|
||||
$keys = $oExtraVar->getExtraVars();
|
||||
if(!$keys) $keys = array();
|
||||
|
||||
$GLOBALS['XE_EXTRA_KEYS'][$module_srl] = $keys;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -176,6 +176,12 @@ class layoutAdminController extends layout
|
|||
{
|
||||
$output = executeQuery('layout.updateModuleLayout', $update_args);
|
||||
}
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -260,7 +266,8 @@ class layoutAdminController extends layout
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$args->layout_srl;
|
||||
$object_key = 'layout:' . $args->layout_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
}
|
||||
|
|
@ -333,7 +340,8 @@ class layoutAdminController extends layout
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$layout_srl;
|
||||
$object_key = 'layout:'.$layout_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
if(!$output->toBool()) return $output;
|
||||
|
|
|
|||
|
|
@ -86,6 +86,8 @@ class layout extends ModuleObject
|
|||
$oDB->addColumn('layouts','layout_type','char',1,'P',true);
|
||||
}
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
|
||||
$args->layout = '.';
|
||||
$output = executeQueryArray('layout.getLayoutDotList', $args);
|
||||
if($output->data && count($output->data) > 0)
|
||||
|
|
@ -99,6 +101,13 @@ class layout extends ModuleObject
|
|||
$args->layout = implode('|@|', $layout_path);
|
||||
$args->layout_srl = $layout->layout_srl;
|
||||
$output = executeQuery('layout.updateLayout', $args);
|
||||
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'layout:' . $args->layout_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -262,9 +262,11 @@ class layoutModel extends layout
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$layout_srl;
|
||||
$object_key = 'layout:' . $layout_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$layout_info = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
if(!$layout_info)
|
||||
{
|
||||
// Get information from the DB
|
||||
|
|
@ -272,18 +274,12 @@ class layoutModel extends layout
|
|||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery('layout.getLayout', $args);
|
||||
if(!$output->data) return;
|
||||
|
||||
// Return xml file informaton after listing up the layout and extra_vars
|
||||
$layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
|
||||
|
||||
// If deleted layout files, delete layout instance
|
||||
// if (!$layout_info) {
|
||||
// $oLayoutController = getAdminController('layout');
|
||||
// $oLayoutController->deleteLayout($layout_srl);
|
||||
// return;
|
||||
// }
|
||||
|
||||
//insert in cache
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$layout_info);
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $layout_info);
|
||||
}
|
||||
return $layout_info;
|
||||
}
|
||||
|
|
@ -294,7 +290,9 @@ class layoutModel extends layout
|
|||
$args->layout_srl = $layout_srl;
|
||||
$output = executeQuery('layout.getLayout', $args, $columnList);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
return $output->data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1063,7 +1063,10 @@ class memberAdminController extends member
|
|||
$args->source_group_srl = $source_group_srl;
|
||||
$args->target_group_srl = $target_group_srl;
|
||||
|
||||
return executeQuery('member.changeGroup', $args);
|
||||
$output = executeQuery('member.changeGroup', $args);
|
||||
$this->_deleteMemberGroupCache($site_srl);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1075,7 +1078,7 @@ class memberAdminController extends member
|
|||
{
|
||||
if(!$args->site_srl) $args->site_srl = 0;
|
||||
// Check the value of is_default.
|
||||
if($args->is_default!='Y')
|
||||
if($args->is_default != 'Y')
|
||||
{
|
||||
$args->is_default = 'N';
|
||||
}
|
||||
|
|
@ -1088,6 +1091,7 @@ class memberAdminController extends member
|
|||
if(!$args->group_srl) $args->group_srl = getNextSequence();
|
||||
$output = executeQuery('member.insertGroup', $args);
|
||||
$this->_deleteMemberGroupCache($args->site_srl);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -1126,20 +1130,22 @@ class memberAdminController extends member
|
|||
{
|
||||
// Create a member model object
|
||||
$oMemberModel = getModel('member');
|
||||
|
||||
// Check the group_srl (If is_default == 'Y', it cannot be deleted)
|
||||
$columnList = array('group_srl', 'is_default');
|
||||
$group_info = $oMemberModel->getGroup($group_srl, $columnList);
|
||||
|
||||
if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
|
||||
if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
|
||||
|
||||
// Get groups where is_default == 'Y'
|
||||
$columnList = array('site_srl', 'group_srl');
|
||||
$default_group = $oMemberModel->getDefaultGroup($site_srl, $columnList);
|
||||
$default_group_srl = $default_group->group_srl;
|
||||
|
||||
// Change to default_group_srl
|
||||
$this->changeGroup($group_srl, $default_group_srl);
|
||||
|
||||
|
||||
$args = new stdClass;
|
||||
$args->group_srl = $group_srl;
|
||||
$output = executeQuery('member.deleteGroup', $args);
|
||||
|
|
@ -1236,8 +1242,7 @@ class memberAdminController extends member
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_groups:'.$site_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$oCacheHandler->invalidateGroupKey('member');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1446,7 +1446,6 @@ class memberController extends member
|
|||
$args->member_srl = $member_srl;
|
||||
$args->group_srl = $group_srl;
|
||||
if($site_srl) $args->site_srl = $site_srl;
|
||||
|
||||
$oModel =& getModel('member');
|
||||
$groups = $oModel->getMemberGroups($member_srl, $site_srl, true);
|
||||
if($groups[$group_srl]) return new Object();
|
||||
|
|
@ -1458,7 +1457,12 @@ class memberController extends member
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_member_groups:'.$member_srl.'_'.$site_srl;
|
||||
$object_key = 'member_groups:' . getNumberingPath($args->member_srl) . $args->member_srl . '_'.$args->site_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
|
||||
$object_key = 'member_info:' . getNumberingPath($args->member_srl) . $args->member_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
|
|
@ -1499,14 +1503,20 @@ class memberController extends member
|
|||
$obj->regdate = $date[$obj->member_srl];
|
||||
$output = executeQuery('member.addMemberToGroup', $obj);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'member_groups:' . getNumberingPath($args->member_srl) . $args->member_srl . '_' . $args->site_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
|
||||
$object_key = 'member_info:' . getNumberingPath($args->member_srl) . $args->member_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
}
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_member_groups:'.$member_srl.'_'.$site_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
|
@ -2122,7 +2132,7 @@ class memberController extends member
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:member_info:'.$args->member_srl;
|
||||
$cache_key = 'member:info:'.$args->member_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
|
|
@ -2144,7 +2154,7 @@ class memberController extends member
|
|||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$args->member_srl;
|
||||
$cache_key = 'member:info:'.$args->member_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ class memberModel extends member
|
|||
else
|
||||
{
|
||||
// Register a default group if the site doesn't have a member group
|
||||
if(!count($logged_info->group_list))
|
||||
if(count($logged_info->group_list) === 0)
|
||||
{
|
||||
$default_group = $this->getDefaultGroup(0);
|
||||
$oMemberController = getController('member');
|
||||
|
|
@ -287,7 +287,8 @@ class memberModel extends member
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:member_info:'.$member_srl;
|
||||
$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$GLOBALS['__member_info__'][$member_srl] = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
|
|
@ -296,7 +297,11 @@ class memberModel extends member
|
|||
$args = new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
$output = executeQuery('member.getMemberInfoByMemberSrl', $args, $columnList);
|
||||
if(!$output->data) return;
|
||||
if(!$output->data)
|
||||
{
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, new stdClass);
|
||||
return;
|
||||
}
|
||||
$this->arrangeMemberInfo($output->data, $site_srl);
|
||||
|
||||
//insert in cache
|
||||
|
|
@ -445,25 +450,26 @@ class memberModel extends member
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_member_groups:'.$member_srl.'_'.$site_srl;
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_'.$site_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$group_list = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
static $member_groups = array();
|
||||
|
||||
if(!$member_groups[$member_srl][$site_srl] || $force_reload)
|
||||
{
|
||||
if(!$output)
|
||||
if(!$group_list && !is_array($group_list))
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->member_srl = $member_srl;
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('member.getMemberGroups', $args);
|
||||
$output = executeQueryArray('member.getMemberGroups', $args);
|
||||
$group_list = $output->data;
|
||||
//insert in cache
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
|
||||
}
|
||||
if(!$output->data) return array();
|
||||
|
||||
$group_list = $output->data;
|
||||
if(!is_array($group_list)) $group_list = array($group_list);
|
||||
if(!$group_list) return array();
|
||||
|
||||
foreach($group_list as $group)
|
||||
{
|
||||
|
|
@ -498,10 +504,27 @@ class memberModel extends member
|
|||
*/
|
||||
function getDefaultGroup($site_srl = 0, $columnList = array())
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('member.getDefaultGroup', $args, $columnList);
|
||||
return $output->data;
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'default_group_' . $site_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$default_group = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
if(!$default_group)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->site_srl = $site_srl;
|
||||
$output = executeQuery('member.getDefaultGroup', $args, $columnList);
|
||||
$default_group = $output->data;
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->put($cache_key, $default_group);
|
||||
}
|
||||
}
|
||||
|
||||
return $default_group;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -541,10 +564,11 @@ class memberModel extends member
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_groups:'.$site_srl;
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
$object_key = 'member_groups:site_'.$site_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$group_list = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$output)
|
||||
if(!$group_list)
|
||||
{
|
||||
|
||||
$args = new stdClass();
|
||||
|
|
@ -552,16 +576,16 @@ class memberModel extends member
|
|||
$args->sort_index = 'list_order';
|
||||
$args->order_type = 'asc';
|
||||
$output = executeQueryArray('member.getGroups', $args);
|
||||
$group_list = $output->data;
|
||||
//insert in cache
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $group_list);
|
||||
}
|
||||
|
||||
if(!$output->toBool() || !$output->data)
|
||||
if(!$group_list)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$group_list = $output->data;
|
||||
|
||||
foreach($group_list as $val)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -305,6 +305,12 @@ class module extends ModuleObject
|
|||
$module_info->skin_vars = null;
|
||||
$module_info->admin_id = null;
|
||||
executeQuery('module.updateModule', $module_info);
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
}
|
||||
}
|
||||
// Various column drop
|
||||
|
|
@ -554,6 +560,11 @@ class module extends ModuleObject
|
|||
$output = executeQuery('module.updateModule', $moduleInfo);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@ class moduleController extends module
|
|||
$args->act = $act;
|
||||
|
||||
$output = executeQuery('module.insertActionForward', $args);
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'action_forward';
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -41,6 +49,14 @@ class moduleController extends module
|
|||
$args->act = $act;
|
||||
|
||||
$output = executeQuery('module.deleteActionForward', $args);
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'action_forward';
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -65,8 +81,6 @@ class moduleController extends module
|
|||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('triggers');
|
||||
$cache_key = 'object:'.$trigger_name.'_'.$called_position;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
// Delete all the files which contain trigger information
|
||||
|
|
@ -95,8 +109,6 @@ class moduleController extends module
|
|||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('triggers');
|
||||
$cache_key = 'object:'.$trigger_name.'_'.$called_position;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
// Remove the trigger cache
|
||||
|
|
@ -190,8 +202,7 @@ class moduleController extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:module_config:module_'.$module.'_site_srl_'.$site_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -210,15 +221,15 @@ class moduleController extends module
|
|||
$output = executeQuery('module.deleteModulePartConfig', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$output = executeQuery('module.insertModulePartConfig', $args);
|
||||
|
||||
//remove from cache
|
||||
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_module_part_config:'.$module.'_'.$module_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
$output = executeQuery('module.insertModulePartConfig', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -291,14 +302,9 @@ class moduleController extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
if($args->site_srl == 0)
|
||||
{
|
||||
$cache_key = 'object_default_mid:_';
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
$cache_key = 'object_default_mid:'.$vid.'_'.$mid;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -473,6 +479,12 @@ class moduleController extends module
|
|||
// commit
|
||||
$oDB->commit();
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
$output->add('module_srl',$args->module_srl);
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -581,13 +593,9 @@ class moduleController extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_module_info:'.$args->module_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$cache_key = 'object:'.$args->mid.'_'.$args->site_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$cache_key = 'object:module_extra_vars_'.$args->module_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -600,7 +608,17 @@ class moduleController extends module
|
|||
$args->module_srl = $module_srl;
|
||||
$args->site_srl = $site_srl;
|
||||
$args->layout_srl = $layout_srl;
|
||||
return executeQuery('module.updateModuleSite', $args);
|
||||
$output = executeQuery('module.updateModuleSite', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
//remove from cache
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -721,14 +739,12 @@ class moduleController extends module
|
|||
|
||||
// commit
|
||||
$oDB->commit();
|
||||
|
||||
//remove from cache
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_module_info:'.$args->module_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$cache_key = 'object:module_extra_vars_'.$args->module_srl;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -750,6 +766,12 @@ class moduleController extends module
|
|||
$output = executeQuery('module.clearDefaultModule');
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -758,7 +780,15 @@ class moduleController extends module
|
|||
*/
|
||||
function updateModuleMenu($args)
|
||||
{
|
||||
return executeQuery('module.updateModuleMenu', $args);
|
||||
$output = executeQuery('module.updateModuleMenu', $args);
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -772,6 +802,13 @@ class moduleController extends module
|
|||
$args->layout_srl = $layout_srl;
|
||||
$args->menu_srls = implode(',',$menu_srl_list);
|
||||
$output = executeQuery('module.updateModuleLayout', $args);
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -896,6 +933,7 @@ class moduleController extends module
|
|||
return $output;
|
||||
}
|
||||
|
||||
getDestroyXeVars($obj);
|
||||
if(!$obj || !count($obj)) return new Object();
|
||||
|
||||
$args = new stdClass;
|
||||
|
|
@ -929,6 +967,7 @@ class moduleController extends module
|
|||
}
|
||||
|
||||
$oDB->commit;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
|
|
@ -961,17 +1000,18 @@ class moduleController extends module
|
|||
|
||||
if($mode === 'P')
|
||||
{
|
||||
$cache_key = 'object_module_skin_vars:'.$module_srl;
|
||||
$object_key = 'module_skin_vars:'.$module_srl;
|
||||
$query = 'module.deleteModuleSkinVars';
|
||||
}
|
||||
else
|
||||
{
|
||||
$cache_key = 'object_module_mobile_skin_vars:'.$module_srl;
|
||||
$object_key = 'module_mobile_skin_vars:'.$module_srl;
|
||||
$query = 'module.deleteModuleMobileSkinVars';
|
||||
}
|
||||
|
||||
//remove from cache
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->delete($cache_key);
|
||||
|
|
@ -986,6 +1026,7 @@ class moduleController extends module
|
|||
function insertModuleExtraVars($module_srl, $obj)
|
||||
{
|
||||
$this->deleteModuleExtraVars($module_srl);
|
||||
getDestroyXeVars($obj);
|
||||
if(!$obj || !count($obj)) return;
|
||||
|
||||
foreach($obj as $key => $val)
|
||||
|
|
@ -997,6 +1038,14 @@ class moduleController extends module
|
|||
if(!$args->name || !$args->value) continue;
|
||||
$output = executeQuery('module.insertModuleExtraVars', $args);
|
||||
}
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'module_extra_vars:'.$module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1006,14 +1055,18 @@ class moduleController extends module
|
|||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
return executeQuery('module.deleteModuleExtraVars', $args);
|
||||
$output = executeQuery('module.deleteModuleExtraVars', $args);
|
||||
|
||||
//remove from cache
|
||||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:module_extra_vars_'.$module_srl;
|
||||
$object_key = 'module_extra_vars:'.$module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1317,6 +1370,13 @@ class moduleController extends module
|
|||
$args = new stdClass;
|
||||
$args->site_srls = $site_srls;
|
||||
$output = executeQuery('module.updateModuleInSites', $args);
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,26 +117,40 @@ class moduleModel extends module
|
|||
// If domain is set, look for subsite
|
||||
if($domain !== '')
|
||||
{
|
||||
if($oCacheHandler->isSupport()) $output = $oCacheHandler->get('domain_' . $domain);
|
||||
if(!$output)
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'site_info:' . $domain;
|
||||
$domain_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$site_info = $oCacheHandler->get($domain_cache_key);
|
||||
}
|
||||
|
||||
if(!isset($site_info))
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->domain = $domain;
|
||||
$output = executeQuery('module.getSiteInfoByDomain', $args);
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put('domain_' . $domain, $output);
|
||||
$site_info = $output->data;
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($domain_cache_key, $site_info);
|
||||
}
|
||||
if($output->toBool() && $output->data && $vid)
|
||||
if($site_info && $vid)
|
||||
{
|
||||
Context::set('vid', $output->data->domain, true);
|
||||
if(strtolower($mid)==strtolower($output->data->domain)) Context::set('mid',$output->data->mid,true);
|
||||
Context::set('vid', $site_info->domain, true);
|
||||
if(strtolower($mid)==strtolower($site_info->domain)) Context::set('mid', $site_info->mid,true);
|
||||
}
|
||||
if(!$output || !$output->data) { $domain = ''; unset($output); }
|
||||
if(!$site_info || !$site_info->domain) { $domain = ''; unset($site_info); }
|
||||
}
|
||||
|
||||
// If no virtual website was found, get default website
|
||||
if($domain === '')
|
||||
{
|
||||
if($oCacheHandler->isSupport()) $output = $oCacheHandler->get('default_site');
|
||||
if(!$output)
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'default_site';
|
||||
$default_site_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$module_info = $oCacheHandler->get($default_site_cache_key);
|
||||
}
|
||||
|
||||
if(!$module_info)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->site_srl = 0;
|
||||
|
|
@ -148,6 +162,7 @@ class moduleModel extends module
|
|||
$oDB = &DB::getInstance();
|
||||
if(!$oDB->isTableExists('sites')) $oDB->createTableByXmlFile(_XE_PATH_.'modules/module/schemas/sites.xml');
|
||||
if(!$oDB->isTableExists('sites')) return;
|
||||
|
||||
// Get mid, language
|
||||
$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
|
||||
$db_info = Context::getDBInfo();
|
||||
|
|
@ -172,10 +187,11 @@ class moduleModel extends module
|
|||
}
|
||||
$output = executeQuery('module.getSiteInfo', $args);
|
||||
}
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put('default_site',$output);
|
||||
$module_info = $output->data;
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($default_site_cache_key, $module_info);
|
||||
}
|
||||
}
|
||||
$module_info = $output->data;
|
||||
|
||||
if(!$module_info->module_srl) return $module_info;
|
||||
if(is_array($module_info) && $module_info->data[0]) $module_info = $module_info[0];
|
||||
return $this->addModuleExtraVars($module_info);
|
||||
|
|
@ -197,27 +213,31 @@ class moduleModel extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$mid.'_'.$site_srl;
|
||||
$module_srl = $oCacheHandler->get($cache_key);
|
||||
$object_key = 'module_srl:'.$mid.'_'.$site_srl;
|
||||
$module_srl_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$module_srl = $oCacheHandler->get($module_srl_cache_key);
|
||||
if($module_srl)
|
||||
{
|
||||
$cache_key = 'object_module_info:'.$module_srl;
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
}
|
||||
if(!$output)
|
||||
{
|
||||
$output = executeQuery('module.getMidInfo', $args);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$mid.'_'.$site_srl;
|
||||
$oCacheHandler->put($cache_key,$output->data->module_srl);
|
||||
$cache_key = 'object_module_info:'.$output->data->module_srl;
|
||||
$oCacheHandler->put($cache_key,$output);
|
||||
$object_key = 'module_info:' . $module_srl;
|
||||
$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$module_info = $oCacheHandler->get($module_info_cache_key);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$module_info && !is_array($module_info))
|
||||
{
|
||||
$output = executeQuery('module.getMidInfo', $args);
|
||||
$module_info = $output->data;
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->put($module_srl_cache_key, $module_info->module_srl);
|
||||
|
||||
$object_key = 'module_info:' . $module_info->module_srl;
|
||||
$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$oCacheHandler->put($module_info_cache_key, $module_info);
|
||||
}
|
||||
}
|
||||
|
||||
$module_info = $output->data;
|
||||
$this->applyDefaultSkin($module_info);
|
||||
if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0];
|
||||
return $this->addModuleExtraVars($module_info);
|
||||
|
|
@ -291,20 +311,23 @@ class moduleModel extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$mid.'_'.$site_srl;
|
||||
$module_srl = $oCacheHandler->get($cache_key);
|
||||
$object_key = 'module_srl:'.$mid.'_'.$site_srl;
|
||||
$module_srl_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$module_srl = $oCacheHandler->get($module_srl_cache_key);
|
||||
if($module_srl)
|
||||
{
|
||||
$cache_key = 'object_module_info:'.$module_srl;
|
||||
$coutput = $oCacheHandler->get($cache_key);
|
||||
$object_key = 'module_info:' . $module_srl;
|
||||
$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$coutput = $oCacheHandler->get($module_info_cache_key);
|
||||
}
|
||||
|
||||
if(!$coutput)
|
||||
{
|
||||
$cache_key = 'object:'.$mid.'_'.$site_srl;
|
||||
$oCacheHandler->put($cache_key, $output->data->module_srl);
|
||||
$cache_key = 'object_module_info:'.$output->data->module_srl;
|
||||
$oCacheHandler->put($cache_key, $moduleInfo);
|
||||
$oCacheHandler->put($module_srl_cache_key, $output->data->module_srl);
|
||||
|
||||
$object_key = 'module_info:' . $output->data->module_srl;
|
||||
$module_info_cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$oCacheHandler->put($module_info_cache_key, $moduleInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -336,20 +359,25 @@ class moduleModel extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_module_info:'.$module_srl;
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
$object_key = 'module_info:' . $module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$mid_info = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$output)
|
||||
|
||||
if(!$mid_info && !is_array($mid_info))
|
||||
{
|
||||
$output = executeQuery('module.getMidInfo', $args );
|
||||
if(!$output->data) return;
|
||||
$this->applyDefaultSkin($output->data);
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||
$output = executeQuery('module.getMidInfo', $args);
|
||||
if(!$output->toBool()) return;
|
||||
|
||||
$mid_info = $output->data;
|
||||
$this->applyDefaultSkin($mid_info);
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $mid_info);
|
||||
}
|
||||
if(count($columnList))
|
||||
|
||||
if($mid_info && count($columnList))
|
||||
{
|
||||
$module_info = new stdClass();
|
||||
foreach($output->data as $key => $item)
|
||||
foreach($mid_info as $key => $item)
|
||||
{
|
||||
if(in_array($key, $columnList))
|
||||
{
|
||||
|
|
@ -357,7 +385,8 @@ class moduleModel extends module
|
|||
}
|
||||
}
|
||||
}
|
||||
else $module_info = $output->data;
|
||||
else $module_info = $mid_info;
|
||||
|
||||
return $this->addModuleExtraVars($module_info);
|
||||
}
|
||||
|
||||
|
|
@ -450,10 +479,33 @@ class moduleModel extends module
|
|||
*/
|
||||
function getMidList($args = null, $columnList = array())
|
||||
{
|
||||
$output = executeQuery('module.getMidList', $args, $columnList);
|
||||
if(!$output->toBool()) return $output;
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
if(count($args) === 1 && isset($args->site_srl))
|
||||
{
|
||||
$object_key = 'module:mid_list_' . $args->site_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$list = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
}
|
||||
|
||||
$list = $output->data;
|
||||
if(!$list)
|
||||
{
|
||||
if($oCacheHandler->isSupport() && count($args) === 1 && isset($args->site_srl))
|
||||
{
|
||||
$columnList = array();
|
||||
}
|
||||
|
||||
$output = executeQuery('module.getMidList', $args, $columnList);
|
||||
if(!$output->toBool()) return $output;
|
||||
$list = $output->data;
|
||||
|
||||
if($oCacheHandler->isSupport() && count($args) === 1 && isset($args->site_srl))
|
||||
{
|
||||
$oCacheHandler->put($cache_key, $list);
|
||||
}
|
||||
}
|
||||
if(!$list) return;
|
||||
|
||||
if(!is_array($list)) $list = array($list);
|
||||
|
|
@ -510,14 +562,38 @@ class moduleModel extends module
|
|||
/**
|
||||
* @brief Get forward value by the value of act
|
||||
*/
|
||||
function getActionForward($act, $module = "")
|
||||
function getActionForward($act, $module = '')
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->act = $act;
|
||||
$args->module = ($module)?$module:null;
|
||||
if(strlen ($args->module) > 0) $output = executeQuery ('module.getActionForwardWithModule', $args);
|
||||
else $output = executeQuery('module.getActionForward',$args);
|
||||
return $output->data;
|
||||
// cache controll
|
||||
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'action_forward';
|
||||
$action_forward = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
if(!$action_forward)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->act = $act;
|
||||
$args->module = ($module) ? $module : null;
|
||||
if(strlen($args->module) > 0)
|
||||
{
|
||||
$output = executeQuery('module.getActionForwardWithModule', $args);
|
||||
}
|
||||
else
|
||||
{
|
||||
$output = executeQuery('module.getActionForward',$args);
|
||||
}
|
||||
$action_forward = $output->data;
|
||||
debugPrint($action_forward);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->put($cache_key, $action_forward);
|
||||
}
|
||||
}
|
||||
|
||||
return $action_forward;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -529,25 +605,26 @@ class moduleModel extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', NULL, TRUE);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'object:'.$trigger_name.'_'.$called_position;
|
||||
$object_key = $trigger_name.'_'.$called_position;
|
||||
$cache_key = $oCacheHandler->getGroupKey('triggers', $object_key);
|
||||
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
$triggers = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
if(!$output)
|
||||
if(!isset($triggers))
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->trigger_name = $trigger_name;
|
||||
$args->called_position = $called_position;
|
||||
$output = executeQueryArray('module.getTriggers',$args);
|
||||
$triggers = $output->data;
|
||||
|
||||
if($output->toBool() && $oCacheHandler->isSupport()) {
|
||||
$oCacheHandler->put($cache_key, $output);
|
||||
if($output->toBool() && $oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->put($cache_key, $triggers);
|
||||
}
|
||||
}
|
||||
|
||||
return $output->data;
|
||||
return $triggers;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -641,7 +718,7 @@ class moduleModel extends module
|
|||
$xml_obj = $tmp_xml_obj->module;
|
||||
|
||||
if(!$xml_obj) return;
|
||||
|
||||
|
||||
// Module Information
|
||||
$module_info = new stdClass();
|
||||
$author_obj = new stdClass();
|
||||
|
|
@ -1250,7 +1327,8 @@ class moduleModel extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:module_config:module_'.$module.'_site_srl_'.$site_srl;
|
||||
$object_key = 'module_config:' . $module . '_' . $site_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$config = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$config)
|
||||
|
|
@ -1266,7 +1344,7 @@ class moduleModel extends module
|
|||
//insert in cache
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->put($cache_key,$config);
|
||||
$oCacheHandler->put($cache_key, $config);
|
||||
}
|
||||
$GLOBALS['__ModuleConfig__'][$site_srl][$module] = $config;
|
||||
}
|
||||
|
|
@ -1286,7 +1364,8 @@ class moduleModel extends module
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_module_part_config:'.$module.'_'.$module_srl;
|
||||
$object_key = 'module_part_config:'.$module.'_'.$module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$config = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$config)
|
||||
|
|
@ -1592,43 +1671,63 @@ class moduleModel extends module
|
|||
* @brief Get extra vars of the module
|
||||
* Extra information, not in the modules table
|
||||
*/
|
||||
function getModuleExtraVars($module_srl)
|
||||
function getModuleExtraVars($list_module_srl)
|
||||
{
|
||||
if(is_array($module_srl)) $module_srl = implode(',',$module_srl);
|
||||
$extra_vars = array();
|
||||
$get_module_srls = array();
|
||||
if(!is_array($list_module_srl)) $list_module_srl = array($list_module_srl);
|
||||
|
||||
// cache controll
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:module_extra_vars_'.$module_srl;
|
||||
$vars = $oCacheHandler->get($cache_key);
|
||||
foreach($list_module_srl as $module_srl)
|
||||
{
|
||||
$object_key = 'module_extra_vars:'.$module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$vars = $oCacheHandler->get($cache_key);
|
||||
|
||||
if($vars)
|
||||
{
|
||||
$extra_vars[$module_srl] = $vars;
|
||||
}
|
||||
else
|
||||
{
|
||||
$get_module_srls[] = $module_srl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$vars)
|
||||
|
||||
if(count($get_module_srls))
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQueryArray('module.getModuleExtraVars',$args);
|
||||
if(!$output->toBool() || !$output->data)
|
||||
$args->module_srl = implode(',', $get_module_srls);
|
||||
$output = executeQueryArray('module.getModuleExtraVars', $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,'empty_extra_vars');
|
||||
return;
|
||||
}
|
||||
$vars = array();
|
||||
|
||||
foreach($output->data as $key => $val)
|
||||
{
|
||||
if(in_array($val->name, array('mid','module')) || $val->value == 'Array') continue;
|
||||
if(!isset($vars[$val->module_srl]))
|
||||
|
||||
if(!isset($extra_vars[$val->module_srl]))
|
||||
{
|
||||
$vars[$val->module_srl] = new stdClass();
|
||||
$extra_vars[$val->module_srl] = new stdClass();
|
||||
}
|
||||
$extra_vars[$val->module_srl]->{$val->name} = $val->value;
|
||||
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'module_extra_vars:'.$val->module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$oCacheHandler->put($cache_key, $extra_vars[$val->module_srl]);
|
||||
}
|
||||
$vars[$val->module_srl]->{$val->name} = $val->value;
|
||||
}
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$vars);
|
||||
}
|
||||
else if($vars == 'empty_extra_vars')
|
||||
{
|
||||
return;
|
||||
}
|
||||
return $vars;
|
||||
|
||||
return $extra_vars;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1636,13 +1735,30 @@ class moduleModel extends module
|
|||
*/
|
||||
function getModuleSkinVars($module_srl)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQueryArray('module.getModuleSkinVars',$args);
|
||||
if(!$output->toBool() || !$output->data) return;
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'module_skin_vars:'.$module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$skin_vars = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
if(!$skin_vars)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQueryArray('module.getModuleSkinVars',$args);
|
||||
if(!$output->toBool()) return;
|
||||
|
||||
$skin_vars = array();
|
||||
foreach($output->data as $vars)
|
||||
{
|
||||
$skin_vars[$vars->name] = $vars;
|
||||
}
|
||||
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
|
||||
}
|
||||
|
||||
$skin_vars = array();
|
||||
foreach($output->data as $val) $skin_vars[$val->name] = $val;
|
||||
return $skin_vars;
|
||||
}
|
||||
|
||||
|
|
@ -1707,37 +1823,22 @@ class moduleModel extends module
|
|||
{
|
||||
if(!$module_info->module_srl) return;
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if(Mobile::isFromMobilePhone())
|
||||
{
|
||||
$cache_key = 'object_module_mobile_skin_vars:' . $module_info->module_srl;
|
||||
$query = 'module.getModuleMobileSkinVars';
|
||||
$skin_vars = $this->getModuleMobileSkinVars($module_info->module_srl);
|
||||
}
|
||||
else
|
||||
{
|
||||
$cache_key = 'object_module_skin_vars:' . $module_info->module_srl;
|
||||
$query = 'module.getModuleSkinVars';
|
||||
$skin_vars = $this->getModuleSkinVars($module_info->module_srl);
|
||||
}
|
||||
|
||||
// cache controll
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$output)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_info->module_srl;
|
||||
$output = executeQueryArray($query,$args);
|
||||
//insert in cache
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||
}
|
||||
if(!$output->toBool() || !$output->data) return;
|
||||
if(!$skin_vars) return;
|
||||
|
||||
foreach($output->data as $val)
|
||||
foreach($skin_vars as $name => $val)
|
||||
{
|
||||
if(isset($module_info->{$val->name})) continue;
|
||||
$module_info->{$val->name} = $val->value;
|
||||
if(isset($module_info->{$name})) continue;
|
||||
$module_info->{$name} = $val->value;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1748,13 +1849,30 @@ class moduleModel extends module
|
|||
*/
|
||||
function getModuleMobileSkinVars($module_srl)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQueryArray('module.getModuleMobileSkinVars',$args);
|
||||
if(!$output->toBool() || !$output->data) return;
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$object_key = 'module_mobile_skin_vars:'.$module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$skin_vars = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
if(!$skin_vars)
|
||||
{
|
||||
$args = new stdClass();
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQueryArray('module.getModuleMobileSkinVars',$args);
|
||||
if(!$output->toBool() || !$output->data) return;
|
||||
|
||||
$skin_vars = array();
|
||||
foreach($output->data as $vars)
|
||||
{
|
||||
$skin_vars[$vars->name] = $vars;
|
||||
}
|
||||
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
|
||||
}
|
||||
|
||||
$skin_vars = array();
|
||||
foreach($output->data as $val) $skin_vars[$val->name] = $val;
|
||||
return $skin_vars;
|
||||
}
|
||||
|
||||
|
|
@ -1766,21 +1884,25 @@ class moduleModel extends module
|
|||
{
|
||||
if(!$module_info->module_srl) return;
|
||||
// cache controll
|
||||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object_module_mobile_skin_vars:'.$module_info->module_srl;
|
||||
$output = $oCacheHandler->get($cache_key);
|
||||
$object_key = 'module_mobile_skin_vars:'.$module_info->module_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('site_and_module', $object_key);
|
||||
$skin_vars = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
if(!$output)
|
||||
if(!$skin_vars)
|
||||
{
|
||||
$args = new stdClass;
|
||||
$args->module_srl = $module_info->module_srl;
|
||||
$output = executeQueryArray('module.getModuleMobileSkinVars',$args);
|
||||
if(!$output->toBool()) return;
|
||||
$skin_vars = $output->data;
|
||||
|
||||
//insert in cache
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $skin_vars);
|
||||
}
|
||||
if(!$output->toBool() || !$output->data) return;
|
||||
if(!$skin_vars) return;
|
||||
|
||||
foreach($output->data as $val)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -361,6 +361,12 @@ class pointAdminController extends point
|
|||
executeQuery('module.deleteModulePartConfig', $args);
|
||||
}
|
||||
|
||||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$oCacheHandler->invalidateGroupKey('site_and_module');
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -644,12 +644,13 @@ class pointController extends point
|
|||
$oCacheHandler = CacheHandler::getInstance('object', null, true);
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$member_srl;
|
||||
$GLOBALS['__member_info__'][$member_srl] = null;
|
||||
$object_key = 'member_groups:' . getNumberingPath($member_srl) . $member_srl . '_0';
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
|
||||
$gcache_key = 'object_member_groups:'.$member_srl.'_0';
|
||||
$oCacheHandler->delete($gcache_key);
|
||||
$object_key = 'member_info:' . getNumberingPath($member_srl) . $member_srl;
|
||||
$cache_key = $oCacheHandler->getGroupKey('member', $object_key);
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class sessionController extends session
|
|||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$session_key;
|
||||
$cache_key = 'session:'.$session_key;
|
||||
$cache_vars = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ class sessionController extends session
|
|||
//put session into cache
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$session_key;
|
||||
$cache_key = 'session:'.$session_key;
|
||||
$oCacheHandler->put($cache_key,$args,$this->lifetime);
|
||||
}
|
||||
//put session into db
|
||||
|
|
@ -91,7 +91,7 @@ class sessionController extends session
|
|||
//put session into cache
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$session_key;
|
||||
$cache_key = 'session:'.$session_key;
|
||||
$oCacheHandler->put($cache_key,$args,$this->lifetime);
|
||||
}
|
||||
}
|
||||
|
|
@ -101,7 +101,7 @@ class sessionController extends session
|
|||
//put session into cache
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$session_key;
|
||||
$cache_key = 'session:'.$session_key;
|
||||
$oCacheHandler->put($cache_key,$args,$this->lifetime);
|
||||
}
|
||||
//put session into db
|
||||
|
|
@ -119,7 +119,7 @@ class sessionController extends session
|
|||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$session_key;
|
||||
$cache_key = 'session:'.$session_key;
|
||||
$oCacheHandler->delete($cache_key);
|
||||
}
|
||||
//remove session from db
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class sessionModel extends session
|
|||
$oCacheHandler = CacheHandler::getInstance('object');
|
||||
if($oCacheHandler->isSupport())
|
||||
{
|
||||
$cache_key = 'object:'.$session_key;
|
||||
$cache_key = 'session:'.$session_key;
|
||||
$output->data = $oCacheHandler->get($cache_key);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue