Skip to content
Permalink
Browse files

Refactor caching part1

  • Loading branch information...
redaxmedia committed Nov 16, 2018
1 parent aec89b9 commit 1ba0cdeb25a79fdbdb4e90fbd3b29783436245e7
Showing with 8 additions and 8 deletions.
  1. +1 −1 includes/Head/Link.php
  2. +1 −1 includes/Head/Script.php
  3. +1 −1 modules/PageCache/Config.php
  4. +5 −5 modules/PageCache/PageCache.php
@@ -31,7 +31,7 @@ class Link extends HeadAbstract
'directory' => 'cache/styles',
'extension' => 'css',
'attribute' => 'href',
'lifetime' => 86400
'lifetime' => 3600
];
/**
@@ -30,7 +30,7 @@ class Script extends HeadAbstract
'directory' => 'cache/scripts',
'extension' => 'js',
'attribute' => 'src',
'lifetime' => 86400
'lifetime' => 3600
];
/**
@@ -23,7 +23,7 @@ class Config extends Module\Notification
protected $_configArray =
[
'cacheDirectory' => 'cache/pages',
'directory' => 'cache/pages',
'extension' => 'phtml',
'lifetime' => 3600,
'tokenPlaceholder' => '%TOKEN%'
@@ -47,13 +47,13 @@ class PageCache extends Config
public function adminNotification() : ?array
{
if (!is_dir($this->_configArray['cacheDirectory']) && !mkdir($this->_configArray['cacheDirectory']))
if (!is_dir($this->_configArray['directory']) && !mkdir($this->_configArray['directory']))
{
$this->setNotification('error', $this->_language->get('directory_not_found') . $this->_language->get('colon') . ' ' . $this->_configArray['cacheDirectory'] . $this->_language->get('point'));
$this->setNotification('error', $this->_language->get('directory_not_found') . $this->_language->get('colon') . ' ' . $this->_configArray['directory'] . $this->_language->get('point'));
}
else if (!chmod($this->_configArray['cacheDirectory'], 0777))
else if (!chmod($this->_configArray['directory'], 0777))
{
$this->setNotification('error', $this->_language->get('directory_permission_grant') . $this->_language->get('colon') . ' ' . $this->_configArray['cacheDirectory'] . $this->_language->get('point'));
$this->setNotification('error', $this->_language->get('directory_permission_grant') . $this->_language->get('colon') . ' ' . $this->_configArray['directory'] . $this->_language->get('point'));
}
return $this->getNotification();
}
@@ -78,7 +78,7 @@ public function renderTemplate() : ?array
/* cache as needed */
$cacheFilesystem = new Filesystem\Cache();
$cacheFilesystem->init($this->_configArray['cacheDirectory'], $this->_configArray['extension']);
$cacheFilesystem->init($this->_configArray['directory'], $this->_configArray['extension']);
$bundle = $this->_registry->get('root') . $this->_registry->get('fullRoute') . '/' . $this->_registry->get('template') . '/' . $this->_registry->get('language');
$token = $this->_registry->get('token');

0 comments on commit 1ba0cde

Please sign in to comment.
You can’t perform that action at this time.