mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Issue #73 - more array storage cleanup. And useful deprecated message.
This commit is contained in:
parent
117d0e8deb
commit
2f85528ce0
@ -6,18 +6,12 @@
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/arraystorage_class.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
/**
|
||||
* Allows Storage of arrays without use of serialize functions
|
||||
* DEPRECATED: Allows Storage of arrays without use of serialize functions
|
||||
*
|
||||
*/
|
||||
class ArrayData {
|
||||
@ -26,8 +20,16 @@ class ArrayData {
|
||||
function __construct()
|
||||
{
|
||||
// DO Not translate - debug info only.
|
||||
e107::getMessage()->addDebug("Deprecated ArrayStorage Class in use. Please remove references to arraystorage_class.php and use e107::getArrayStorage(); instead.");
|
||||
|
||||
|
||||
if(E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
$dep = debug_backtrace();
|
||||
foreach($dep as $d)
|
||||
{
|
||||
e107::getMessage()->addDebug("Deprecated ArrayStorage Class called by ".str_replace(e_ROOT,"",$d['file'])." on line ".$d['line']);
|
||||
}
|
||||
e107::getMessage()->addDebug("Please remove references to <b>arraystorage_class.php</b> and use e107::getArrayStorage(); instead.");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Return a string containg exported array data.
|
||||
|
@ -2673,13 +2673,14 @@ class e107
|
||||
// Absolute file-path of directory containing class2.php
|
||||
// define("e_ROOT", realpath(dirname(__FILE__)."/../")."/");
|
||||
|
||||
// TODO - We need new way to do this, this file could be located under the web root!
|
||||
$e_ROOT = realpath(dirname(__FILE__)."/../"); // Works in Windows, fails on Linux.
|
||||
if ((substr($e_ROOT,-1) != '/') && (substr($e_ROOT,-1) != '\\'))
|
||||
|
||||
$e_ROOT = realpath(dirname(__FILE__)."/../");
|
||||
if ((substr($e_ROOT,-1) != '/') && (substr($e_ROOT,-1) != '\\') )
|
||||
{
|
||||
$e_ROOT .= '/';
|
||||
$e_ROOT .= (strpos($e_ROOT,':\\')!==false) ? '\\' : '/'; // Should be functioning correctly on both windows and Linux now.
|
||||
}
|
||||
define('e_ROOT', $e_ROOT); // Specified format gives trailing slash already (at least on Windows)
|
||||
|
||||
define('e_ROOT',$e_ROOT);
|
||||
|
||||
$this->relative_base_path = (!self::isCli()) ? $path : e_ROOT;
|
||||
$this->http_path = "http://{$_SERVER['HTTP_HOST']}{$this->server_path}";
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
require_once(e_HANDLER.'arraystorage_class.php');
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_userclass.php');
|
||||
|
||||
@ -123,10 +122,11 @@ class user_class
|
||||
$this->class_tree = array();
|
||||
$this->class_parents = array();
|
||||
|
||||
$array = new ArrayData;
|
||||
|
||||
|
||||
if ($temp = $e107->ecache->retrieve_sys(UC_CACHE_TAG))
|
||||
{
|
||||
$this->class_tree = $array->ReadArray($temp);
|
||||
$this->class_tree = e107::getArrayStorage()->read($temp);
|
||||
unset($temp);
|
||||
}
|
||||
else
|
||||
@ -167,7 +167,7 @@ class user_class
|
||||
}
|
||||
}
|
||||
|
||||
$userCache = $array->WriteArray($this->class_tree, FALSE);
|
||||
$userCache = e107::getArrayStorage()->write($this->class_tree, FALSE);
|
||||
$e107->ecache->set_sys(UC_CACHE_TAG,$userCache);
|
||||
unset($userCache);
|
||||
}
|
||||
|
@ -26,8 +26,6 @@ require_once(e_HANDLER.'form_handler.php');
|
||||
$rs = new form;
|
||||
|
||||
|
||||
//e107_require_once(e_HANDLER.'arraystorage_class.php');
|
||||
//$eArrayStorage = new ArrayData();
|
||||
unset($text);
|
||||
|
||||
include_lan(e_PLUGIN.'pdf/languages/English_admin_pdf.php');
|
||||
|
@ -89,8 +89,8 @@ define('e_CORE', $siteRoot.'core/'); // @TODO: Allow for override
|
||||
define('e107_INIT', TRUE);
|
||||
|
||||
|
||||
require_once('../../'.$HANDLERS_DIRECTORY.'arraystorage_class.php');
|
||||
$eArrayStorage = new ArrayData();
|
||||
require_once('../../'.$HANDLERS_DIRECTORY.'core_functions.php');
|
||||
$eArrayStorage = new e_array();
|
||||
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
Loading…
x
Reference in New Issue
Block a user