Add admin template caching
authorRobert Sesek <rsesek@bluestatic.org>
Tue, 6 Jan 2009 07:43:09 +0000 (23:43 -0800)
committerRobert Sesek <rsesek@bluestatic.org>
Tue, 6 Jan 2009 07:43:09 +0000 (23:43 -0800)
* 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
admin/index.php
includes/framework

index 338466ebac0d1e6891d9fbc225abe52018760d01..edaadd8a8786b6642c2ce20878c7a47004994500 100755 (executable)
@@ -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(),
index 2ccd9f1d6c6e72b1165c1cb68b0d0ac54fdb9b3b..e99d1949dd1b8154e22b7de7498fe73152ea3ca7 100755 (executable)
@@ -19,6 +19,8 @@
 || ###################################################################
 \*=====================================================================*/
 
+$fetchtemplates = array('main');
+
 require_once('./global.php');
 
 $template = new BSTemplate('main');
index 5a3fb4c7718dc321eee73921a0f4601618ed6694..c289b359fa57962d635386910b814b4835fa6578 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5a3fb4c7718dc321eee73921a0f4601618ed6694
+Subproject commit c289b359fa57962d635386910b814b4835fa6578