From 178db23e2055b59a318016b73c7a0d755f8fd2f8 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 5 Jan 2009 23:43:09 -0800 Subject: [PATCH] Add admin template caching * admin/global.php: Start caching templates * admin/index.php: Add the templates to cache * includes/framework/: Of course this is a new framework thing :-) --- admin/global.php | 14 +++++++++++++- admin/index.php | 2 ++ includes/framework | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/admin/global.php b/admin/global.php index 338466e..edaadd8 100755 --- a/admin/global.php +++ b/admin/global.php @@ -28,8 +28,20 @@ require_once('./includes/functions.php'); // setup admin templates require_once ISSO . '/Template.php'; -// BSTemplate::$dbCacheTable = TABLE_PREFIX . 'admintemplate'; +BSTemplate::$dbCacheTable = TABLE_PREFIX . 'template'; BSTemplate::$templatePath = 'admin/templates/%s.html'; + +$globaltemplates = array( + 'doctype', + 'nav', + 'headinclude', + 'footer', +); + +$start = microtime(); +BSTemplate::cache(array_merge($globaltemplates, (array)$fetchtemplates)); +BSApp::debug('time for tpl cache: ' . BSFunctions::fetch_microtime_diff($start)); + BSTemplate::$globalVars = array( 'templates' => array( 'doctype' => BSTemplate::fetch('doctype')->evaluate()->getTemplate(), diff --git a/admin/index.php b/admin/index.php index 2ccd9f1..e99d194 100755 --- a/admin/index.php +++ b/admin/index.php @@ -19,6 +19,8 @@ || ################################################################### \*=====================================================================*/ +$fetchtemplates = array('main'); + require_once('./global.php'); $template = new BSTemplate('main'); diff --git a/includes/framework b/includes/framework index 5a3fb4c..c289b35 160000 --- a/includes/framework +++ b/includes/framework @@ -1 +1 @@ -Subproject commit 5a3fb4c7718dc321eee73921a0f4601618ed6694 +Subproject commit c289b359fa57962d635386910b814b4835fa6578 -- 2.43.5