Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Data Fields | Static Protected Member Functions | Static Protected Attributes
Zend_Session_Abstract Class Reference
Inheritance diagram for Zend_Session_Abstract:
Zend_Session Zend_Session_Namespace

Data Fields

const _THROW_NOT_WRITABLE_MSG = 'Zend_Session is currently marked as read-only.'
 
const _THROW_NOT_READABLE_MSG = 'Zend_Session is not marked as readable.'
 

Static Protected Member Functions

static _namespaceIsset ($namespace, $name=null)
 
static _namespaceUnset ($namespace, $name=null)
 
static & _namespaceGet ($namespace, $name=null)
 
static _namespaceGetAll ($namespace)
 

Static Protected Attributes

static $_writable = false
 
static $_readable = false
 
static $_expiringData = array()
 

Detailed Description

Definition at line 33 of file Abstract.php.

Member Function Documentation

◆ _namespaceGet()

static& _namespaceGet (   $namespace,
  $name = null 
)
staticprotected

namespaceGet() - Get $name variable from $namespace, returning by reference.

Parameters
string$namespace
string$name
Returns
mixed
See also
Zend_Session_Exception

Definition at line 140 of file Abstract.php.

141  {
142  if (self::$_readable === false) {
146  #require_once 'Zend/Session/Exception.php';
147  throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
148  }
149 
150  if ($name === null) {
151  if (isset($_SESSION[$namespace])) { // check session first for data requested
152  return $_SESSION[$namespace];
153  } elseif (isset(self::$_expiringData[$namespace])) { // check expiring data for data reqeusted
154  return self::$_expiringData[$namespace];
155  } else {
156  return $_SESSION[$namespace]; // satisfy return by reference
157  }
158  } else {
159  if (isset($_SESSION[$namespace][$name])) { // check session first
160  return $_SESSION[$namespace][$name];
161  } elseif (isset(self::$_expiringData[$namespace][$name])) { // check expiring data
162  return self::$_expiringData[$namespace][$name];
163  } else {
164  return $_SESSION[$namespace][$name]; // satisfy return by reference
165  }
166  }
167  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ _namespaceGetAll()

static _namespaceGetAll (   $namespace)
staticprotected

namespaceGetAll() - Get an array containing $namespace, including expiring data.

Parameters
string$namespace
string$name
Returns
mixed

Definition at line 177 of file Abstract.php.

178  {
179  $currentData = (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) ?
180  $_SESSION[$namespace] : array();
181  $expiringData = (isset(self::$_expiringData[$namespace]) && is_array(self::$_expiringData[$namespace])) ?
182  self::$_expiringData[$namespace] : array();
183  return array_merge($currentData, $expiringData);
184  }

◆ _namespaceIsset()

static _namespaceIsset (   $namespace,
  $name = null 
)
staticprotected

namespaceIsset() - check to see if a namespace or a variable within a namespace is set

Parameters
string$namespace
string$name
Returns
bool
See also
Zend_Session_Exception

Definition at line 79 of file Abstract.php.

80  {
81  if (self::$_readable === false) {
85  #require_once 'Zend/Session/Exception.php';
86  throw new Zend_Session_Exception(self::_THROW_NOT_READABLE_MSG);
87  }
88 
89  if ($name === null) {
90  return ( isset($_SESSION[$namespace]) || isset(self::$_expiringData[$namespace]) );
91  } else {
92  return ( isset($_SESSION[$namespace][$name]) || isset(self::$_expiringData[$namespace][$name]) );
93  }
94  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ _namespaceUnset()

static _namespaceUnset (   $namespace,
  $name = null 
)
staticprotected

namespaceUnset() - unset a namespace or a variable within a namespace

Parameters
string$namespace
string$name
Exceptions
Zend_Session_Exception
Returns
void
See also
Zend_Session_Exception

Definition at line 105 of file Abstract.php.

106  {
107  if (self::$_writable === false) {
111  #require_once 'Zend/Session/Exception.php';
112  throw new Zend_Session_Exception(self::_THROW_NOT_WRITABLE_MSG);
113  }
114 
115  $name = (string) $name;
116 
117  // check to see if the api wanted to remove a var from a namespace or a namespace
118  if ($name === '') {
119  unset($_SESSION[$namespace]);
120  unset(self::$_expiringData[$namespace]);
121  } else {
122  unset($_SESSION[$namespace][$name]);
123  unset(self::$_expiringData[$namespace][$name]);
124  }
125 
126  // if we remove the last value, remove namespace.
127  if (empty($_SESSION[$namespace])) {
128  unset($_SESSION[$namespace]);
129  }
130  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

Field Documentation

◆ $_expiringData

$_expiringData = array()
staticprotected

Definition at line 55 of file Abstract.php.

◆ $_readable

$_readable = false
staticprotected

Definition at line 47 of file Abstract.php.

◆ $_writable

$_writable = false
staticprotected

Definition at line 40 of file Abstract.php.

◆ _THROW_NOT_READABLE_MSG

const _THROW_NOT_READABLE_MSG = 'Zend_Session is not marked as readable.'

Error message thrown when an action requires reading session data, but current Zend_Session is not marked as readable.

Definition at line 69 of file Abstract.php.

◆ _THROW_NOT_WRITABLE_MSG

const _THROW_NOT_WRITABLE_MSG = 'Zend_Session is currently marked as read-only.'

Error message thrown when an action requires modification, but current Zend_Session has been marked as read-only.

Definition at line 62 of file Abstract.php.


The documentation for this class was generated from the following file: