1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 15:16:30 +02:00

Admin-log speed optimization and minor enhancements.

This commit is contained in:
Cameron
2015-03-08 11:12:42 -07:00
parent 6af0a2901b
commit 3ed8e426e0
4 changed files with 13 additions and 11 deletions

View File

@@ -141,8 +141,9 @@ class admin_log_ui extends e_admin_ui
protected $table = 'admin_log'; protected $table = 'admin_log';
protected $pid = 'dblog_id'; protected $pid = 'dblog_id';
protected $perPage = 10; protected $perPage = 10;
// protected $listQry = "SELECT f.*, u.* FROM #admin_log AS f LEFT JOIN #user AS u ON f.dblog_user_id = u.user_id "; // Should not be necessary.
protected $listQry = "SELECT f.*, u.* FROM #admin_log AS f LEFT JOIN #user AS u ON f.dblog_user_id = u.user_id "; // Should not be necessary. protected $listQry = "SELECT SQL_CALC_FOUND_ROWS f.*, u.user_id, u.user_name FROM #admin_log AS f LEFT JOIN #user AS u ON f.dblog_user_id = u.user_id "; // Should not be required but be auto-calculated.
protected $listOrder = 'f.dblog_id DESC'; protected $listOrder = 'f.dblog_id DESC';
protected $batchDelete = false; protected $batchDelete = false;
@@ -662,7 +663,7 @@ class admin_log_form_ui extends e_admin_form_ui
class audit_log_ui extends e_admin_ui class audit_log_ui extends e_admin_ui
{ {
protected $pluginTitle = 'adminlog'; protected $pluginTitle = ADLAN_155;
protected $pluginName = 'adminlog'; protected $pluginName = 'adminlog';
protected $table = 'audit_log'; protected $table = 'audit_log';
protected $pid = 'dblog_id'; protected $pid = 'dblog_id';
@@ -713,7 +714,7 @@ class audit_log_ui extends e_admin_ui
class dblog_ui extends e_admin_ui class dblog_ui extends e_admin_ui
{ {
protected $pluginTitle = 'adminlog'; protected $pluginTitle = ADLAN_155;
protected $pluginName = 'adminlog'; protected $pluginName = 'adminlog';
protected $table = 'dblog'; protected $table = 'dblog';
protected $pid = 'dblog_id'; protected $pid = 'dblog_id';

View File

@@ -125,11 +125,12 @@ class e_admin_log
* @param int $logImportance [optional] default E_LOG_INFORMATIVE - passed directly to admin log * @param int $logImportance [optional] default E_LOG_INFORMATIVE - passed directly to admin log
* @param string $logEventCode [optional] - passed directly to admin log * @param string $logEventCode [optional] - passed directly to admin log
* @param string $mstack [optional] message stack passed to message handler * @param string $mstack [optional] message stack passed to message handler
* @param int LOG_TO_ADMIN|LOG_TO_ROLLING|LOG_TO_AUDIT
* @return \e_admin_log * @return \e_admin_log
*/ */
public function save($logTitle, $logImportance = E_LOG_INFORMATIVE, $logEventCode = '', $mstack = false) public function save($logTitle, $logImportance = E_LOG_INFORMATIVE, $logEventCode = '', $mstack = false, $target = LOG_TO_ADMIN)
{ {
return $this->flushMessages($logTitle, $logImportance, $logEventCode, $mstack); return $this->flushMessages($logTitle, $logImportance, $logEventCode, $mstack, $target);
} }
@@ -683,7 +684,7 @@ class e_admin_log
* @param string $mstack [optional] message stack passed to message handler * @param string $mstack [optional] message stack passed to message handler
* @return e_admin_log * @return e_admin_log
*/ */
public function flushMessages($logTitle, $logImportance = E_LOG_INFORMATIVE, $logEventCode = '', $mstack = false) public function flushMessages($logTitle, $logImportance = E_LOG_INFORMATIVE, $logEventCode = '', $mstack = false, $target =LOG_TO_ADMIN)
{ {
$mes = e107::getMessage(); $mes = e107::getMessage();
@@ -714,7 +715,7 @@ class e_admin_log
else $mes->add($m['message'], $m['dislevel'], $m['session']); else $mes->add($m['message'], $m['dislevel'], $m['session']);
} }
} }
e107::getAdminLog()->add($logTitle, $logString, $logImportance, $logEventCode); $this->add($logTitle, $logString, $logImportance, $logEventCode, $target);
$this->_messages = array(); // Clear the memory for reuse $this->_messages = array(); // Clear the memory for reuse
return $this; return $this;

View File

@@ -32,7 +32,7 @@ class ArrayData {
$log->addDebug("Deprecated ArrayStorage Class called by ".str_replace(e_ROOT,"",$d['file'])." on line ".$d['line']); $log->addDebug("Deprecated ArrayStorage Class called by ".str_replace(e_ROOT,"",$d['file'])." on line ".$d['line']);
} }
$log->save('DEPRECATED'); $log->save('DEPRECATED',E_LOG_NOTICE,'',false, LOG_TO_ROLLING);
e107::getMessage()->addDebug("Please remove references to <b>arraystorage_class.php</b> and use e107::serialize() and e107::unserialize() instead."); e107::getMessage()->addDebug("Please remove references to <b>arraystorage_class.php</b> and use e107::serialize() and e107::unserialize() instead.");
} }

View File

@@ -27,7 +27,7 @@ class parseXml extends xmlClass // BC with v1.x
$log->addDebug('Deprecated XML Parser Used'); $log->addDebug('Deprecated XML Parser Used');
$log->addArray($data); $log->addArray($data);
$log->save('DEPRECATED',E_LOG_NOTICE); $log->save('DEPRECATED',E_LOG_NOTICE,'',false, LOG_TO_ROLLING);
} }