mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-18 23:46:39 +00:00
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:
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user