: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Cache;
use Nextend\Framework\Cache\Storage\AbstractStorage;
abstract class AbstractCache {
protected $isAccessible = false;
/** @var AbstractStorage */
protected $_storageEngine = 'filesystem';
* @return AbstractStorage
public static function getStorage($engine = "filesystem") {
'filesystem' => new Storage\Filesystem(),
'database' => new Storage\Database()
return $storage[$engine];
public static function clearAll() {
self::getStorage('filesystem')
self::getStorage('filesystem')
public static function clearGroup($group) {
self::getStorage('filesystem')
self::getStorage('filesystem')
self::getStorage('database')
self::getStorage('database')
public function __construct($group, $isAccessible = false) {
$this->isAccessible = $isAccessible;
$this->storage = self::getStorage($this->_storageEngine);
protected function clearCurrentGroup() {
$this->storage->clear($this->group, $this->getScope());
protected function getScope() {
if ($this->isAccessible) {
protected function exists($key) {
return $this->storage->exists($this->group, $key, $this->getScope());
protected function get($key) {
return $this->storage->get($this->group, $key, $this->getScope());
protected function set($key, $value) {
$this->storage->set($this->group, $key, $value, $this->getScope());
protected function getPath($key) {
return $this->storage->getPath($this->group, $key, $this->getScope());
protected function remove($key) {
return $this->storage->remove($this->group, $key, $this->getScope());