mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Improved admin-log message on deprecated save_prefs() function.
This commit is contained in:
@@ -1505,13 +1505,12 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '')
|
|||||||
{
|
{
|
||||||
$backtrace = debug_backtrace(false);
|
$backtrace = debug_backtrace(false);
|
||||||
|
|
||||||
e107::getAdminLog()->log_event(
|
e107::getAdminLog()->add(
|
||||||
'Deprecated call - save_prefs()',
|
'Deprecated call - save_prefs()',
|
||||||
"Call to deprecated function save_prefs() (class2.php). Backtrace:\n".print_r($backtrace, true),
|
"Call to deprecated function save_prefs() (class2.php). Backtrace:\n".print_r($backtrace, true),
|
||||||
E_LOG_INFORMATIVE,
|
E_LOG_INFORMATIVE,
|
||||||
'DEPRECATED'
|
'DEPRECATED'
|
||||||
);
|
);
|
||||||
// TODO - debug screen Deprecated Functions (e107)
|
|
||||||
|
|
||||||
e107::getMessage()->addDebug('Deprecated save_prefs() backtrace:<pre>'."\n".print_r($backtrace, true).'</pre>');
|
e107::getMessage()->addDebug('Deprecated save_prefs() backtrace:<pre>'."\n".print_r($backtrace, true).'</pre>');
|
||||||
}
|
}
|
||||||
|
@@ -136,6 +136,8 @@ class e_admin_log
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Add a Save an event into the admin log.
|
||||||
|
*
|
||||||
* Alternative admin log entry point - compatible with legacy calls, and a bit simpler to use than the generic entry point.
|
* Alternative admin log entry point - compatible with legacy calls, and a bit simpler to use than the generic entry point.
|
||||||
* ($eventcode has been added - give it a reference to identify the source module, such as 'NEWS_12' or 'ECAL_03')
|
* ($eventcode has been added - give it a reference to identify the source module, such as 'NEWS_12' or 'ECAL_03')
|
||||||
* We also log everything (unlike 0.7, where admin log and debug stuff were all mixed up together)
|
* We also log everything (unlike 0.7, where admin log and debug stuff were all mixed up together)
|
||||||
@@ -156,7 +158,7 @@ class e_admin_log
|
|||||||
{
|
{
|
||||||
if ($event_code == '')
|
if ($event_code == '')
|
||||||
{
|
{
|
||||||
if (strlen($event_title) <= 10)
|
if (strlen($event_title) <= 12)
|
||||||
{ // Assume the title is actually a reference to the event
|
{ // Assume the title is actually a reference to the event
|
||||||
$event_code = $event_title;
|
$event_code = $event_title;
|
||||||
$event_title = 'LAN_AL_'.$event_title;
|
$event_title = 'LAN_AL_'.$event_title;
|
||||||
@@ -194,7 +196,7 @@ class e_admin_log
|
|||||||
|
|
||||||
if ($this->_options['backtrace'] == true)
|
if ($this->_options['backtrace'] == true)
|
||||||
{
|
{
|
||||||
$event_detail .= "\n\n".debug_backtrace();
|
$event_detail .= "\n\n".debug_backtrace(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -23,17 +23,18 @@ class ArrayData {
|
|||||||
|
|
||||||
$log = e107::getAdminLog();
|
$log = e107::getAdminLog();
|
||||||
|
|
||||||
if(E107_DEBUG_LEVEL > 0)
|
if(E107_DEBUG_LEVEL > 0 || e107::getPref('developer'))
|
||||||
{
|
{
|
||||||
$dep = debug_backtrace();
|
$dep = debug_backtrace(false);
|
||||||
|
|
||||||
foreach($dep as $d)
|
foreach($dep as $d)
|
||||||
{
|
{
|
||||||
$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->flushMessages('Deprecated ArrayStorage Class used.');
|
$log->save('DEPRECATED');
|
||||||
|
|
||||||
e107::getMessage()->addDebug("Please remove references to <b>arraystorage_class.php</b> and use e107::getArrayStorage(); instead.");
|
e107::getMessage()->addDebug("Please remove references to <b>arraystorage_class.php</b> and use e107::serialize() and e107::unserialize() instead.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -60,7 +61,8 @@ class ArrayData {
|
|||||||
* @param string $ArrayData
|
* @param string $ArrayData
|
||||||
* @return array stored data
|
* @return array stored data
|
||||||
*/
|
*/
|
||||||
function ReadArray($ArrayData) {
|
function ReadArray($ArrayData)
|
||||||
|
{
|
||||||
if ($ArrayData == ""){
|
if ($ArrayData == ""){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user