1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00
php-e107/e107_handlers/arraystorage_class.php

69 lines
2.0 KiB
PHP
Raw Normal View History

2006-12-02 04:36:16 +00:00
<?php
/*
2009-11-17 10:46:35 +00:00
* e107 website system
*
2009-11-18 01:06:08 +00:00
* Copyright (C) 2008-2009 e107 Inc (e107.org)
2009-11-17 10:46:35 +00:00
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
*/
2006-12-02 04:36:16 +00:00
if (!defined('e107_INIT')) { exit; }
/**
2020-12-20 19:41:16 -08:00
* @deprecated: Allows Storage of arrays without use of serialize functions
2006-12-02 04:36:16 +00:00
*
*/
class ArrayData
{
2006-12-02 04:36:16 +00:00
function __construct()
{
// DO Not translate - debug info only.
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']);
}
$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.");
}
}
2006-12-02 04:36:16 +00:00
/**
* Return a string containg exported array data.
2020-12-20 19:41:16 -08:00
* @deprecated use e107::serialize() instead.
2006-12-02 04:36:16 +00:00
* @param array $ArrayData array to be stored
* @param bool $AddSlashes default true, add slashes for db storage, else false
* @return string
*/
2020-12-20 19:41:16 -08:00
function WriteArray($ArrayData, $AddSlashes = true)
{
trigger_error('Method ' . __METHOD__ . ' is deprecated. Use e107::serialize() instead.', E_USER_DEPRECATED);
2020-12-20 19:41:16 -08:00
return e107::serialize($ArrayData, $AddSlashes);
2006-12-02 04:36:16 +00:00
}
/**
* Returns an array from stored array data.
2020-12-20 19:41:16 -08:00
* @deprecated use e107::unserialize() instead.
2006-12-02 04:36:16 +00:00
* @param string $ArrayData
2020-06-05 11:34:17 -07:00
* @return bool|array stored data
2006-12-02 04:36:16 +00:00
*/
function ReadArray($ArrayData)
{
trigger_error('Method ' . __METHOD__ . ' is deprecated. Use e107::unserialize() instead.', E_USER_DEPRECATED);
2020-12-20 19:41:16 -08:00
return e107::unserialize($ArrayData);
2006-12-02 04:36:16 +00:00
}
}