Add admin template caching

Robert Sesek [2009-01-06 07:43]
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 :-)
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