Added constant definition, and other small edits...

git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@5 a5845835-ea0f-0410-a762-dd0bfe9bfde8
This commit is contained in:
jim
2006-03-29 11:44:07 +00:00
parent 15f66fb6a1
commit 3830a5312e
7 changed files with 53 additions and 18 deletions

View File

@@ -8,6 +8,10 @@ $config = array(
'index_files' => array('index', 'default', 'main'),
'debug' => true,
// File system settings
'show_hidden' => true,
// Display settings

View File

@@ -1,10 +1,10 @@
<?php die();
//
// core
// Exec: core
//
// Created on 21-Mar-2006.
// Copyright © Jim Myhrberg. All rights reserved.
// Copyright © 2006 Jim Myhrberg. All rights reserved.
// zynode@gmail.com
//
//_HEAD;
@@ -19,6 +19,17 @@ Author: Jim Myhrberg
//>STAGE> init
//==========================
//>Section> define_constants
define('DIR_URL', $dir_url);
define('DIR_PATH', $dir_path);
define('QUERY_STRING', $query_string);
define('DLIST_URL', $config['url']);
define('TEMPLATE', $config['template']);
define('TPL_URL', DLIST_URL.'templates/'.TEMPLATE.'/');
//>Section> port_correction
if ( stristr($_SERVER['HTTP_HOST'], ':') !== false ) {
$http_host = explode(':', $_SERVER['HTTP_HOST'], 2);
@@ -28,25 +39,30 @@ if ( stristr($_SERVER['HTTP_HOST'], ':') !== false ) {
preg_match("/(.*)Port [0-9]{2,8}(.*)/", $_SERVER['SERVER_SIGNATURE'], $serverinfo);
$_SERVER['SERVER_SIGNATURE'] = $serverinfo[1].'Port '.$_SERVER['SERVER_PORT'].$serverinfo[2];
//>Section> set_vars
$do_readdir = true;
$do_render = true;
//==========================
//>STAGE> main
//==========================
//>Section> init_dList
if ( $do_readdir ) {
$dlist = new dirlist();
// $dlist->show_hidden = true;
$dlist->read($dir_path);
if ($config['show_hidden']) $dlist->show_hidden = true;
$dlist->read(DIR_PATH);
}
//==========================
//>STAGE> render
//==========================
//>Section> echo
print_r($dlist->list);

View File

@@ -4,8 +4,9 @@ class dirlist {
/*
dirlist v2.0 beta
Copyright © 2006 Jim Myhrberg.
Class: dirlist v2.0 beta
Copyright © 2006 Jim Myhrberg. All rights reserved.
zynode@gmail.com
*/

View File

@@ -4,8 +4,9 @@ class execHandler {
/*
execHandler v0.7 beta
Copyright © 2006 Jim Myhrberg.
Class: execHandler v0.7 beta
Copyright © 2006 Jim Myhrberg. All rights reserved.
zynode@gmail.com
*/
@@ -140,11 +141,20 @@ class execHandler {
$this->compiled_code = '';
$this->sort_stage_list();
foreach( $this->stages as $stage => $stage_priority ) {
if( $this->debug ) $this->compiled_code .= "\n\n//==========================\n// Stage: ".$stage."\n//==========================\n";
if( $this->debug ) {
$this->compiled_code
.= "\n\n//==========================\n// Stage: ".$stage.":".$stage_priority."\n//==========================\n";
$new_stage = true;
}
foreach( $this->execution_order[$stage] as $key => $code ) {
if( $this->debug ) {
$this->compiled_code .= "\n// Code Piece: ".$code."\n";
$pr = explode('|', $key, 2);
$pr = $pr[0];
$this->compiled_code
.= ( $new_stage ) ? "\n// Code Piece: ".$code.":".$pr."\n" : "\n\n// Code Piece: ".$code.":".$pr."\n" ;
//$this->compiled_code .= "\n// Code Piece: ".$code."\n";
$this->compiled_code .= $this->clean_up_code($this->code[$stage][$code]);
$new_stage = false;
} else {
$this->compiled_code .= $this->code[$stage][$code];
}

View File

@@ -2,7 +2,7 @@
/*
Copyright © 2006 Jim Myhrberg.
Copyright © 2006 Jim Myhrberg. All rights reserved.
zynode@gmail.com
*/
@@ -37,7 +37,7 @@ if ( !empty($redirect) ) {
$scheme = parse_url($_SERVER['SCRIPT_URI']);
$scheme = $scheme['scheme'];
} else $scheme = $config['default_scheme'];
if($query_string != '') $query_string = '?'.$query_string;
if( !empty($query_string) ) $query_string = '?'.$query_string;
header("Location: ".$scheme.'://'.$_SERVER['HTTP_HOST'].$dir_url.$redirect.$query_string);
exit;
}

View File

@@ -1,10 +1,10 @@
<?php die();
//
// render
// Exec: render
//
// Created on 21-Mar-2006.
// Copyright © Jim Myhrberg. All rights reserved.
// Copyright © 2006 Jim Myhrberg. All rights reserved.
// zynode@gmail.com
//
//_HEAD;
@@ -18,7 +18,8 @@ Author: Jim Myhrberg
//==========================
//>STAGE> init
//==========================
echo "hello";
//_END;
?>

View File

@@ -3,7 +3,8 @@
/*
dList v0.7 beta
Copyright © 2006 Jim Myhrberg.
Copyright © 2006 Jim Myhrberg. All rights reserved.
zynode@gmail.com
*/
@@ -33,6 +34,8 @@ $exec->addPath(
$exec->cache();
include($exec->include_file);
print_r($exec->execution_order);
$time->end();
if ($config['debug']) echo "<br />\npage generated in ".$time->time." sec.<br />\n";