Merge branch 'hotfix/1.7.4.1'

This commit is contained in:
khongchi 2014-03-12 16:49:31 +09:00
commit 1248578753
11 changed files with 81 additions and 27 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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');

View file

@ -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')

View file

@ -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;
}

View file

@ -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();

View file

@ -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__'))

View file

@ -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);

View file

@ -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;

View file

@ -41,7 +41,7 @@
</div>
<div>
<select name="find_account_question">
<!--@for($i=1,$c=count($lang->find_account_question_items);$i<$c;$i++)-->
<!--@for($i=1,$c=count($lang->find_account_question_items);$i<=$c;$i++)-->
<option value="{$i}">{$lang->find_account_question_items[$i]}</option>
<!--@end-->
</select>

View file

@ -641,7 +641,7 @@ class widgetController extends widget
require_once($class_file);
// Creating Objects
if(!class_exists($widget))
if(!class_exists($widget, false))
{
return sprintf(Context::getLang('msg_widget_object_is_null'), $widget);
}