Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
Zend_Cache_Frontend_Output Class Reference
Inheritance diagram for Zend_Cache_Frontend_Output:
Zend_Cache_Core

Public Member Functions

 __construct (array $options=array())
 
 start ($id, $doNotTestCacheValidity=false, $echoData=true)
 
 end ($tags=array(), $specificLifetime=false, $forcedDatas=null, $echoData=true, $priority=8)
 
- Public Member Functions inherited from Zend_Cache_Core
 __construct ($options=array())
 
 setConfig (Zend_Config $config)
 
 setBackend (Zend_Cache_Backend $backendObject)
 
 getBackend ()
 
 setOption ($name, $value)
 
 getOption ($name)
 
 setLifetime ($newLifetime)
 
 load ($id, $doNotTestCacheValidity=false, $doNotUnserialize=false)
 
 test ($id)
 
 save ($data, $id=null, $tags=array(), $specificLifetime=false, $priority=8)
 
 remove ($id)
 
 clean ($mode='all', $tags=array())
 
 getIdsMatchingTags ($tags=array())
 
 getIdsNotMatchingTags ($tags=array())
 
 getIdsMatchingAnyTags ($tags=array())
 
 getIds ()
 
 getTags ()
 
 getFillingPercentage ()
 
 getMetadatas ($id)
 
 touch ($id, $extraLifetime)
 

Additional Inherited Members

- Data Fields inherited from Zend_Cache_Core
const BACKEND_NOT_SUPPORTS_TAG = 'tags are not supported by the current backend'
 
const BACKEND_NOT_IMPLEMENTS_EXTENDED_IF = 'Current backend doesn\'t implement the Zend_Cache_Backend_ExtendedInterface, so this method is not available'
 
- Protected Member Functions inherited from Zend_Cache_Core
 _validateIdOrTag ($string)
 
 _validateTagsArray ($tags)
 
 _loggerSanity ()
 
 _log ($message, $priority=4)
 
 _id ($id)
 
- Protected Attributes inherited from Zend_Cache_Core
 $_backend = null
 
 $_options
 
 $_specificOptions = array()
 
 $_extendedBackend = false
 
 $_backendCapabilities = array()
 
- Static Protected Attributes inherited from Zend_Cache_Core
static $_directivesList = array('lifetime', 'logging', 'logger')
 

Detailed Description

Definition at line 36 of file Output.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( array  $options = array())

Constructor

Parameters
array$optionsAssociative array of options
Returns
void

Definition at line 47 of file Output.php.

48  {
49  parent::__construct($options);
50  $this->_idStack = array();
51  }

Member Function Documentation

◆ end()

end (   $tags = array(),
  $specificLifetime = false,
  $forcedDatas = null,
  $echoData = true,
  $priority = 8 
)

Stop the cache

Parameters
array$tagsTags array
int$specificLifetimeIf != false, set a specific lifetime for this cache record (null => infinite lifetime)
string$forcedDatasIf not null, force written datas with this
boolean$echoDataIf set to true, datas are sent to the browser
int$priorityinteger between 0 (very low priority) and 10 (maximum priority) used by some particular backends
Returns
void

Definition at line 88 of file Output.php.

89  {
90  if ($forcedDatas === null) {
91  $data = ob_get_clean();
92  } else {
93  $data =& $forcedDatas;
94  }
95  $id = array_pop($this->_idStack);
96  if ($id === null) {
97  Zend_Cache::throwException('use of end() without a start()');
98  }
99  $this->save($data, $id, $tags, $specificLifetime, $priority);
100  if ($echoData) {
101  echo($data);
102  }
103  }
$id
Definition: fieldset.phtml:14
save($data, $id=null, $tags=array(), $specificLifetime=false, $priority=8)
Definition: Core.php:348
static throwException($msg, Exception $e=null)
Definition: Cache.php:205

◆ start()

start (   $id,
  $doNotTestCacheValidity = false,
  $echoData = true 
)

Start the cache

Parameters
string$idCache id
boolean$doNotTestCacheValidityIf set to true, the cache validity won't be tested
boolean$echoDataIf set to true, datas are sent to the browser if the cache is hit (simply returned else)
Returns
mixed True if the cache is hit (false else) with $echoData=true (default) ; string else (datas)

Definition at line 61 of file Output.php.

62  {
63  $data = $this->load($id, $doNotTestCacheValidity);
64  if ($data !== false) {
65  if ( $echoData ) {
66  echo($data);
67  return true;
68  } else {
69  return $data;
70  }
71  }
72  ob_start();
73  ob_implicit_flush(false);
74  $this->_idStack[] = $id;
75  return false;
76  }
$id
Definition: fieldset.phtml:14
load($id, $doNotTestCacheValidity=false, $doNotUnserialize=false)
Definition: Core.php:296

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