1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-10 16:46:50 +02:00

Improved detection of deprecated functions/methods and display in DEBUG mode: deprecated.

This commit is contained in:
Cameron
2020-12-21 10:00:28 -08:00
parent 63527c4f19
commit 630f3f415f
30 changed files with 224 additions and 82 deletions

View File

@@ -14,19 +14,21 @@ if (!defined('e107_INIT')) { exit; }
* @deprecated: Allows Storage of arrays without use of serialize functions
*
*/
class ArrayData {
class ArrayData
{
function __construct()
{
// DO Not translate - debug info only.
$log = e107::getAdminLog();
trigger_error('<b>ArrayData class is deprecated.</b> Use e107::serialize() and e107::unserialize instead of WriteArray() and ReadArray().', E_USER_DEPRECATED);
if(E107_DEBUG_LEVEL > 0 || e107::getPref('developer'))
{
$dep = debug_backtrace(false);
$log = e107::getLog();
foreach($dep as $d)
{
$log->addDebug("Deprecated ArrayStorage Class called by ".str_replace(e_ROOT,"",$d['file'])." on line ".$d['line']);
@@ -46,6 +48,7 @@ class ArrayData {
*/
function WriteArray($ArrayData, $AddSlashes = true)
{
trigger_error('Method ' . __METHOD__ . ' is deprecated. Use e107::serialize() instead.', E_USER_DEPRECATED);
return e107::serialize($ArrayData, $AddSlashes);
}
@@ -58,6 +61,7 @@ class ArrayData {
*/
function ReadArray($ArrayData)
{
trigger_error('Method ' . __METHOD__ . ' is deprecated. Use e107::unserialize() instead.', E_USER_DEPRECATED);
return e107::unserialize($ArrayData);
}
}