implemented a functional template system, and a simple WORKING template, and other smaller things and fixes...

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@10 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-03-31 22:53:26 +00:00
parent f3a2a9e5b9
commit 05fc88b1d9
11 changed files with 178 additions and 89 deletions

View File

@@ -89,7 +89,6 @@ class dirList {
}
// ==============================================
// ----- [ Internal Functions ] -----------------
// ==============================================
@@ -150,10 +149,9 @@ class dirList {
$types = array('bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
for($n = 0; $bytes >= 1024; $n++) $bytes = $bytes / 1024;
$bytes = number_format($bytes, 2);
if ( !empty($bytes[1]) ) {
$bytes = explode('.', $bytes);
$bytes[1] = rtrim($bytes[1], '0');
$bytes = ( $bytes[1] != '' ) ? $bytes[0].'.'.$bytes[1] : $bytes[0] ;
if ( preg_match("/([0-9]+)\.([0-9]+)/", $bytes, $bytes) ) {
$bytes[2] = rtrim($bytes[2], '0');
$bytes = ( !empty($bytes[2]) ) ? $bytes[1].'.'.$bytes[2] : $bytes[1] ;
}
return $bytes.' '.$types[$n];
}

View File

@@ -4,7 +4,7 @@ class execHandler {
/*
Class: execHandler v0.7.3 beta
Class: execHandler v0.7.4 beta
Copyright © 2006 Jim Myhrberg. All rights reserved.
zynode@gmail.com
@@ -31,17 +31,19 @@ class execHandler {
// Execution Stage Priority
var $default_stages = array(
'init' => 10,
'query' => 20,
'main' => 50,
'render' => 80,
'term' => 90,
'functions' => 5,
'init' => 10,
'query' => 20,
'main' => 50,
'render' => 80,
'term' => 90,
);
// Debug?
var $debug = false;
var $debug = false;
var $show_debug_msg = true;
// Misc. Settings
@@ -110,7 +112,7 @@ class execHandler {
function cache ($force=false) {
if ( $force || $this->debug || !$this->check_cache() ) {
if ( $this->debug ) echo "reloading\n";
if ( $this->debug && $this->show_debug_msg ) echo "reloading\n";
$this->loadFile($this->files_to_load);
$this->compile();
$this->save_cache();
@@ -124,9 +126,11 @@ class execHandler {
} elseif( is_string($input) ) {
$result = glob($input);
}
$result = array_filter($result);
if ( is_array($result) ) $result = array_unique($result);
$this->files_to_load = array_merge($this->files_to_load, $result);
if ( !empty($result) ) {
$result = array_filter($result);
if ( is_array($result) ) $result = array_unique($result);
$this->files_to_load = array_merge($this->files_to_load, $result);
}
}
function loadFile ($input) {