1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-12 16:14:16 +02:00

Flextype Slim Integration - next round of integration

This commit is contained in:
Awilum
2019-03-01 23:23:22 +03:00
parent 02bff9c07d
commit a824858736
5 changed files with 20 additions and 19 deletions

View File

@@ -51,9 +51,9 @@ class Cache
private $driver;
/**
* Private construct method to enforce singleton behavior.
* Constructor
*
* @access private
* @access public
*/
public function __construct($flextype)
{
@@ -75,7 +75,6 @@ class Cache
$this->driver->setNamespace($this->key);
}
/**
* Get Cache Driver
*
@@ -291,7 +290,7 @@ class Cache
*/
public function driver()
{
return $this->$driver;
return $this->driver;
}
/**
@@ -302,7 +301,7 @@ class Cache
*/
public function getKey() : string
{
return $this->$key;
return $this->key;
}
/**
@@ -315,7 +314,7 @@ class Cache
public function fetch(string $id)
{
if ($this->flextype['registry']->get('settings.cache.enabled')) {
return $this->$driver->fetch($id);
return $this->driver->fetch($id);
} else {
return false;
}
@@ -330,7 +329,7 @@ class Cache
public function contains($id)
{
if ($this->flextype['registry']->get('settings.cache.enabled')) {
return $this->$driver->contains(($id));
return $this->driver->contains($id);
} else {
return false;
}
@@ -352,7 +351,7 @@ class Cache
if ($lifetime === null) {
$lifetime = $this->getLifetime();
}
$this->$driver->save($id, $data, $lifetime);
$this->driver->save($id, $data, $lifetime);
}
}
@@ -384,10 +383,10 @@ class Cache
return;
}
$interval = $future-$this->$now;
$interval = $future-$this->now;
if ($interval > 0 && $interval < $this->getLifetime()) {
$this->$lifetime = $interval;
$this->lifetime = $interval;
}
}
@@ -399,10 +398,10 @@ class Cache
*/
public function getLifetime()
{
if ($this->$lifetime === null) {
$this->$lifetime = $this->flextype['registry']->get('settings.cache.lifetime') ?: 604800;
if ($this->lifetime === null) {
$this->lifetime = $this->flextype['registry']->get('settings.cache.lifetime') ?: 604800;
}
return $this->$lifetime;
return $this->lifetime;
}
}

View File

@@ -23,7 +23,9 @@ class Entries
private $flextype;
/**
* __construct
* Constructor
*
* @access public
*/
public function __construct($flextype)
{

View File

@@ -22,7 +22,7 @@ class Fieldsets
private $flextype;
/**
* __construct
* Constructor
*
* @access public
*/

View File

@@ -30,7 +30,7 @@ class Plugins
private $locales = [];
/**
* __construct
* Constructor
*
* @access public
*/

View File

@@ -22,7 +22,9 @@ class Snippets
private $flextype;
/**
* __construct
* Constructor
*
* @access public
*/
public function __construct($flextype)
{
@@ -32,8 +34,6 @@ class Snippets
/**
* Get snippet
*
* $this->fetch('snippet-name');
*
* @access public
* @param string $snippet_name Snippet name
* @return string|bool Returns the contents of the output buffer and end output buffering.