|
| __construct (array $options=array()) |
|
| setMasterFiles (array $masterFiles) |
|
| setMasterFile ($masterFile) |
|
| setOption ($name, $value) |
|
| load ($id, $doNotTestCacheValidity=false, $doNotUnserialize=false) |
|
| test ($id) |
|
| __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) |
|
Definition at line 36 of file File.php.
◆ __construct()
__construct |
( |
array |
$options = array() | ) |
|
Constructor
- Parameters
-
array | $options | Associative array of options |
- Exceptions
-
- Returns
- void
Definition at line 89 of file File.php.
94 if (!isset($this->_specificOptions[
'master_files'])) {
static throwException($msg, Exception $e=null)
if(!isset($_GET['name'])) $name
◆ load()
load |
( |
|
$id, |
|
|
|
$doNotTestCacheValidity = false , |
|
|
|
$doNotUnserialize = false |
|
) |
| |
Test if a cache is available for the given id and (if yes) return it (false else)
- Parameters
-
string | $id | Cache id |
boolean | $doNotTestCacheValidity | If set to true, the cache validity won't be tested |
boolean | $doNotUnserialize | Do not serialize (even if automatic_serialization is true) => for internal use |
- Returns
- mixed|false Cached datas
Definition at line 175 of file File.php.
177 if (!$doNotTestCacheValidity) {
179 return parent::load(
$id,
true, $doNotUnserialize);
183 return parent::load(
$id,
true, $doNotUnserialize);
◆ setMasterFile()
setMasterFile |
( |
|
$masterFile | ) |
|
Change the master_file option
To keep the compatibility
- Deprecated:
- Parameters
-
string | $masterFile | the complete path and name of the master file |
Definition at line 141 of file File.php.
setMasterFiles(array $masterFiles)
◆ setMasterFiles()
setMasterFiles |
( |
array |
$masterFiles | ) |
|
Change the master_files option
- Parameters
-
array | $masterFiles | the complete paths and name of the master files |
Definition at line 104 of file File.php.
106 $this->_specificOptions[
'master_file'] =
null;
107 $this->_specificOptions[
'master_files'] =
null;
108 $this->_masterFile_mtimes = array();
112 foreach ($masterFiles as $masterFile) {
113 if (file_exists($masterFile)) {
114 $mtime = filemtime($masterFile);
119 if (!$this->_specificOptions[
'ignore_missing_master_files'] && !$mtime) {
123 $this->_masterFile_mtimes[
$i] = $mtime;
124 $this->_specificOptions[
'master_files'][
$i] = $masterFile;
126 $this->_specificOptions[
'master_file'] = $masterFile;
static throwException($msg, Exception $e=null)
◆ setOption()
setOption |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
Public frontend to set an option
Just a wrapper to get a specific behaviour for master_file
- Parameters
-
string | $name | Name of the option |
mixed | $value | Value of the option |
- Exceptions
-
- Returns
- void
Definition at line 156 of file File.php.
158 if (
$name ==
'master_file') {
160 }
else if (
$name ==
'master_files') {
setMasterFile($masterFile)
setMasterFiles(array $masterFiles)
if(!isset($_GET['name'])) $name
◆ test()
Test if a cache is available for the given id
- Parameters
-
- Returns
- int|false Last modified time of cache entry if it is available, false otherwise
Definition at line 192 of file File.php.
194 $lastModified = parent::test(
$id);
196 if ($this->_specificOptions[
'master_files_mode'] == self::MODE_AND) {
198 foreach($this->_masterFile_mtimes as $masterFileMTime) {
199 if ($masterFileMTime) {
200 if ($lastModified > $masterFileMTime) {
201 return $lastModified;
208 foreach($this->_masterFile_mtimes as $masterFileMTime) {
209 if ($masterFileMTime) {
210 if ($lastModified <= $masterFileMTime) {
215 return $lastModified;
◆ $_specificOptions
Initial value:= array(
'master_file' => null,
'master_files' => null,
'master_files_mode' => 'OR',
'ignore_missing_master_files' => false
)
Definition at line 66 of file File.php.
◆ MODE_AND
Consts for master_files_mode
Definition at line 42 of file File.php.
◆ MODE_OR
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Cache/Frontend/File.php