/[cvs]/nfo/php/libs/org.netfrag.flib/Site/Loader.php
ViewVC logotype

Contents of /nfo/php/libs/org.netfrag.flib/Site/Loader.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations)
Thu Dec 12 21:37:46 2002 UTC (21 years, 9 months ago) by joko
Branch: MAIN
Changes since 1.1: +16 -7 lines
+ fixes: now returning success-/error-status

1 <?
2 // -------------------------------------------------------------------------
3 // $Id: Loader.php,v 1.1 2002/11/12 05:42:31 joko Exp $
4 // -------------------------------------------------------------------------
5 // $Log: Loader.php,v $
6 // Revision 1.1 2002/11/12 05:42:31 joko
7 // + initial checkin
8 //
9 // -------------------------------------------------------------------------
10
11
12 class Site_Loader {
13
14 var $site;
15
16 function includeFile($filename) {
17
18 // TODO: try to remove these globals!
19 global $site;
20 global $site_state;
21 global $uservars;
22 global $request;
23 global $http_referer;
24
25 $this->site->log( get_class($this) . "->includeFile( filename $filename )", LOG_DEBUG);
26 $site = &$this->site;
27 if (include($filename)) {
28 return 1;
29 }
30
31 }
32
33 function loadComponent($name, $type = "") {
34 $prefix = "";
35 $postfix = "";
36 $this->site->log( get_class($this) . "->loadComponent( name $name, type $type )", LOG_DEBUG);
37 switch ($type) {
38 case "handler":
39 $prefix = $this->site->config[path][base] . 'core/handler/';
40 //$postfix = ".handler.php";
41 $postfix = ".php";
42 break;
43 case "page":
44 $prefix = $this->site->config[path][base] . 'core/pages/';
45 $postfix = ".page";
46 break;
47 }
48 $includefile = "$prefix$name$postfix";
49 return $this->includeFile($includefile);
50 }
51
52 function loadHandler($name) {
53 $this->site->log( get_class($this) . "->loadHandler( name $name )", LOG_DEBUG);
54 return $this->loadComponent($name, "handler");
55 }
56
57 function loadPage($name) {
58 $this->site->log( get_class($this) . "->loadPage( name $name )", LOG_DEBUG);
59 return $this->loadComponent($name, "page");
60 }
61
62
63 function loadClass() {
64 }
65
66 function loadBusinessClass() {
67 }
68
69
70
71 }
72 ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed