diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php index 433adf527..a03a9d847 100644 --- a/addons/captcha/captcha.addon.php +++ b/addons/captcha/captcha.addon.php @@ -9,7 +9,7 @@ if(!defined("__XE__")) exit(); * @brief Captcha for a particular action * English alphabets and voice verification added * */ -if(!class_exists('AddonCaptcha')) +if(!class_exists('AddonCaptcha', false)) { // On the mobile mode, XE Core does not load jquery and xe.js as normal. Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true); diff --git a/addons/captcha_member/captcha_member.addon.php b/addons/captcha_member/captcha_member.addon.php index ac1e57c5f..211fd8687 100644 --- a/addons/captcha_member/captcha_member.addon.php +++ b/addons/captcha_member/captcha_member.addon.php @@ -9,7 +9,7 @@ if(!defined("__XE__")) exit(); * @brief Captcha for a particular action * English alphabets and voice verification added * */ -if(!class_exists('AddonMemberCaptcha')) +if(!class_exists('AddonMemberCaptcha', false)) { // On the mobile mode, XE Core does not load jquery and xe.js as normal. Context::loadFile(array('./common/js/jquery.min.js', 'head', NULL, -100000), true); diff --git a/classes/cache/CacheApc.class.php b/classes/cache/CacheApc.class.php index a416b1270..b8499d7a6 100644 --- a/classes/cache/CacheApc.class.php +++ b/classes/cache/CacheApc.class.php @@ -84,7 +84,7 @@ class CacheApc extends CacheBase if($modified_time > 0 && $modified_time > $obj[0]) { - $this->_delete($_key); + $this->delete($key); return false; } @@ -110,24 +110,13 @@ class CacheApc extends CacheBase if($modified_time > 0 && $modified_time > $obj[0]) { - $this->_delete($_key); + $this->delete($key); return false; } return $obj[1]; } - /** - * Delete variable from the cache(private) - * - * @param string $_key Used to store the value. - * @return void - */ - function _delete($_key) - { - $this->put($_key, null, 1); - } - /** * Delete variable from the cache * @@ -136,7 +125,8 @@ class CacheApc extends CacheBase */ function delete($key) { - $this->_delete($key); + $_key = md5(_XE_PATH_ . $key); + return apc_delete($_key); } /** @@ -149,7 +139,13 @@ class CacheApc extends CacheBase return apc_clear_cache('user'); } - + /** + * @DEPRECATED + */ + function _delete($key) + { + return $this->delete($key); + } } CacheApc::$isSupport = function_exists('apc_add'); diff --git a/classes/db/DB.class.php b/classes/db/DB.class.php index f23320576..25a7cdb10 100644 --- a/classes/db/DB.class.php +++ b/classes/db/DB.class.php @@ -447,7 +447,7 @@ class DB $log['act'] = Context::get('act'); $log['time'] = date('Y-m-d H:i:s'); - $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + $bt = debug_backtrace(); foreach($bt as $no => $call) { if($call['function'] == 'executeQuery' || $call['function'] == 'executeQueryArray') diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index 802a75126..3b20145e3 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -1021,7 +1021,7 @@ class ModuleHandler extends Handler } // Get base class name and load the file contains it - if(!class_exists($module)) + if(!class_exists($module, false)) { $high_class_file = sprintf('%s%s%s.class.php', _XE_PATH_, $class_path, $module); if(!file_exists($high_class_file)) @@ -1039,7 +1039,7 @@ class ModuleHandler extends Handler // Create an instance with eval function require_once($class_file); - if(!class_exists($instance_name)) + if(!class_exists($instance_name, false)) { return NULL; } diff --git a/classes/validator/Validator.class.php b/classes/validator/Validator.class.php index 11762da50..8ad9d4f13 100644 --- a/classes/validator/Validator.class.php +++ b/classes/validator/Validator.class.php @@ -667,7 +667,7 @@ class Validator } // current language - $lang_type = class_exists('Context') ? Context::getLangType() : 'en'; + $lang_type = class_exists('Context', false) ? Context::getLangType() : 'en'; // check the file $filepath = $dir . '/' . md5($this->_version . ' ' . $this->_xml_path) . ".{$lang_type}.js"; @@ -706,7 +706,7 @@ class Validator list($ruleset) = explode('.', $ruleset); // current language - $lang_type = class_exists('Context') ? Context::getLangType() : 'en'; + $lang_type = class_exists('Context', false) ? Context::getLangType() : 'en'; // custom rulesets $addrules = array(); diff --git a/config/config.inc.php b/config/config.inc.php index 6304f6245..72080042e 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -9,11 +9,11 @@ */ if(version_compare(PHP_VERSION, '5.4.0', '<')) { - @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED); + @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING); } else { - @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT); + @error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNING ^ E_STRICT); } if(!defined('__XE__')) diff --git a/config/func.inc.php b/config/func.inc.php index a3fe25156..a2c4c4d07 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -758,7 +758,7 @@ function debugPrint($debug_output = NULL, $display_option = TRUE, $file = '_debu } static $firephp; - $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + $bt = debug_backtrace(); if(is_array($bt)) { $bt_debug_print = array_shift($bt); diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 338f082d4..3c8f0e9dd 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -801,6 +801,8 @@ class documentController extends document $oCacheHandler = CacheHandler::getInstance('object'); if($oCacheHandler->isSupport()) { + $cache_key = 'document_item:'. getNumberingPath($oDocument->document_srl) . $oDocument->document_srl; + $oCacheHandler->delete($cache_key); } return $output; @@ -840,6 +842,14 @@ class documentController extends document $args->document_srl = $document_srl; $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 $_SESSION['readed_document'][$document_srl] = true; @@ -1105,6 +1115,14 @@ class documentController extends document $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 $_SESSION['voted_document'][$document_srl] = true; @@ -1246,6 +1264,14 @@ class documentController extends document { $args->update_order = -1*getNextSequence(); $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); @@ -1263,6 +1289,14 @@ class documentController extends document $args->document_srl = $document_srl; $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); } @@ -1366,6 +1400,30 @@ class documentController extends document if(!$output->toBool()) return $output; $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->list_count = 100; + $args->page = ++$page; + $output = executeQuery('document.getDocumentList', $args, array('document_srl')); + + if($output->data == array()) + break; + + foreach($output->data as $val) + { + //remove document item from cache + $cache_key = 'document_item:'. getNumberingPath($val->document_srl) . $val->document_srl; + $oCacheHandler->delete($cache_key); + } + } + } + // Update category_srl of the documents in the same category to 0 $args = new stdClass(); $args->target_category_srl = 0; diff --git a/modules/member/skins/default/find_member_account.html b/modules/member/skins/default/find_member_account.html index 70c166b9b..b80312c3b 100644 --- a/modules/member/skins/default/find_member_account.html +++ b/modules/member/skins/default/find_member_account.html @@ -41,7 +41,7 @@