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
*
*/
2020-12-21 10:00:28 -08:00
class ArrayData
{
2006-12-02 04:36:16 +00:00
2013-02-26 19:12:17 -08:00
function __construct ()
{
// DO Not translate - debug info only.
2020-12-21 10:00:28 -08:00
trigger_error ( '<b>ArrayData class is deprecated.</b> Use e107::serialize() and e107::unserialize instead of WriteArray() and ReadArray().' , E_USER_DEPRECATED );
2013-02-26 19:53:49 -08:00
2014-01-10 09:32:14 -08:00
if ( E107_DEBUG_LEVEL > 0 || e107 :: getPref ( 'developer' ))
2013-02-26 19:53:49 -08:00
{
2014-01-10 09:32:14 -08:00
$dep = debug_backtrace ( false );
2020-12-21 10:00:28 -08:00
$log = e107 :: getLog ();
2013-02-26 19:53:49 -08:00
foreach ( $dep as $d )
{
2013-05-12 20:56:35 -07:00
$log -> addDebug ( " Deprecated ArrayStorage Class called by " . str_replace ( e_ROOT , " " , $d [ 'file' ]) . " on line " . $d [ 'line' ]);
2013-02-26 19:53:49 -08:00
}
2013-05-12 20:56:35 -07:00
2015-03-08 11:12:42 -07:00
$log -> save ( 'DEPRECATED' , E_LOG_NOTICE , '' , false , LOG_TO_ROLLING );
2013-05-12 20:56:35 -07:00
2014-01-10 09:32:14 -08:00
e107 :: getMessage () -> addDebug ( " Please remove references to <b>arraystorage_class.php</b> and use e107::serialize() and e107::unserialize() instead. " );
2013-02-26 19:53:49 -08:00
}
2013-02-26 19:12:17 -08:00
}
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 )
{
2020-12-21 10:00:28 -08:00
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
*/
2014-01-10 09:32:14 -08:00
function ReadArray ( $ArrayData )
{
2020-12-21 10:00:28 -08:00
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
}
}