From edc4aaa998bf2d463b0f87387e985eddcaaaced9 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sat, 14 May 2016 00:22:47 +0200 Subject: [PATCH] Update constants.php with new Smarty variables and used them where needed. --- Changelog | 2 ++ app/extensions/command/Update.php | 8 ++++---- constants.php | 9 +++++++++ www/pages/BasePage.php | 6 +++--- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Changelog b/Changelog index 3985bd8ae..68931db51 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2016-05-14 DariusIII + * Fix: Update constants.php with new Smarty variables and used them where needed. 2016-05-13 DariusIII * Fix: Smarty cleaning of templates_c folder on nntmux update * Upd: Improve the speed of fixrelnames work queries diff --git a/app/extensions/command/Update.php b/app/extensions/command/Update.php index 0ccc11b6f..1d43509ba 100644 --- a/app/extensions/command/Update.php +++ b/app/extensions/command/Update.php @@ -19,7 +19,7 @@ namespace app\extensions\command; use \Exception; -use \SmartyBC; +use \Smarty; use \app\extensions\util\Git; use \app\extensions\util\Versions; use \lithium\console\command\Help; @@ -124,9 +124,9 @@ class Update extends \app\extensions\console\Command }; } - $smarty = new SmartyBC(); - $smarty->setCompileDir(NN_RES . DS . 'smarty' . DS . 'templates_c/'); - $cleared = $smarty->clear_compiled_tpl(); + $smarty = new Smarty(); + $smarty->setCompileDir(NN_SMARTY_TEMPLATES); + $cleared = $smarty->clearCompiledTemplate(); if ($cleared) { $this->out('The Smarty compiled template cache has been cleaned for you', 'primary'); } else { diff --git a/constants.php b/constants.php index d3377f7a3..f4272ca72 100755 --- a/constants.php +++ b/constants.php @@ -49,6 +49,15 @@ define('NN_RES', NN_ROOT . 'resources' . DS); // Used to refer to the covers folder define('NN_COVERS', NN_RES . 'covers' . DS); +// Smarty's cache. +define('NN_SMARTY_CACHE', NN_RES . 'smarty' . DS . 'cache/'); + +// Smarty's configuration files. +define('NN_SMARTY_CONFIGS', NN_RES .'smarty' . DS . 'configs/'); + +// Smarty's compiled template cache. +define('NN_SMARTY_TEMPLATES', NN_RES . 'smarty' . DS . 'templates_c/'); + // Used to refer to the tmp folder define('NN_TMP', NN_RES . 'tmp' . DS); diff --git a/www/pages/BasePage.php b/www/pages/BasePage.php index b8fcc418e..8dba3684c 100644 --- a/www/pages/BasePage.php +++ b/www/pages/BasePage.php @@ -98,9 +98,9 @@ class BasePage $this->settings = new Settings(); $this->smarty = new Smarty(); - $this->smarty->setCompileDir(NN_RES . DS . 'smarty' . DS . 'templates_c/'); - $this->smarty->setConfigDir(NN_RES . DS . 'smarty' . DS . 'configs/'); - $this->smarty->setCacheDir(NN_RES . DS . 'smarty' . DS . 'cache/'); + $this->smarty->setCompileDir(NN_SMARTY_TEMPLATES); + $this->smarty->setConfigDir(NN_SMARTY_CONFIGS); + $this->smarty->setCacheDir(NN_SMARTY_CACHE); $this->smarty->setPluginsDir([ NN_WWW . 'plugins/', SMARTY_DIR . 'plugins/',