From 7c50aebc15878dcc51247c8198f388a01ad2bdcc Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Wed, 13 Jan 2021 13:58:00 +0100 Subject: Fix caching problem by using it_dbi/it_dbi_postgres in key instead of table name --- it_dbi.class | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index e032a03..71b6c95 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -180,7 +180,7 @@ static function createclass($p) if (substr($classname, 0, 4) != 'PMA_') # It is designed behaviour that an error is generated if this class already exists! { $interface = function_exists("interface_exists") && interface_exists("Iterator", false) ? "implements Iterator" : ""; - $parentname = get_called_class(); + $parentname = static::$_global_key; $code = "class $classname extends $parentname $interface { function __construct(/* \$query ... */) @@ -971,7 +971,7 @@ function _get_field_info() static function _state_get($dbid) { if (!($result = $GLOBALS[static::$_global_key]->_state[$dbid])) - $result = $GLOBALS[static::$_global_key]->_state[$dbid] = (array)it_cache::get(get_called_class() . ":$dbid"); + $result = $GLOBALS[static::$_global_key]->_state[$dbid] = (array)it_cache::get(static::$_global_key . ":$dbid"); #var_dump("get", $dbid, $result); return $result; @@ -982,13 +982,13 @@ static function _state_put($dbid, $state, $shared = true) #var_dump("put", $dbid, $state); $GLOBALS[static::$_global_key]->_state[$dbid] = $state; if ($shared) - it_cache::put(get_called_class() . ":$dbid", array('link' => null) + (array)$state); # link is not transferable + it_cache::put(static::$_global_key . ":$dbid", array('link' => null) + (array)$state); # link is not transferable } static function _state_purgeshared($dbid = null) { #var_dump("purgeshared", $dbid); - it_cache::put(get_called_class(). ":" . ($dbid ? $dbid : $GLOBALS[static::$_global_key]->_dbid), array()); # Nuke shared cache + it_cache::put(static::$_global_key. ":" . ($dbid ? $dbid : $GLOBALS[static::$_global_key]->_dbid), array()); # Nuke shared cache } # -- cgit v1.2.3