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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide 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 joko 1.1 <?
2     // -------------------------------------------------------------------------
3 joko 1.2 // $Id: Loader.php,v 1.1 2002/11/12 05:42:31 joko Exp $
4 joko 1.1 // -------------------------------------------------------------------------
5 joko 1.2 // $Log: Loader.php,v $
6     // Revision 1.1 2002/11/12 05:42:31 joko
7     // + initial checkin
8     //
9 joko 1.1 // -------------------------------------------------------------------------
10    
11    
12     class Site_Loader {
13    
14     var $site;
15    
16     function includeFile($filename) {
17    
18     // TODO: try to remove these globals!
19 joko 1.2 global $site;
20 joko 1.1 global $site_state;
21     global $uservars;
22     global $request;
23 joko 1.2 global $http_referer;
24 joko 1.1
25     $this->site->log( get_class($this) . "->includeFile( filename $filename )", LOG_DEBUG);
26     $site = &$this->site;
27 joko 1.2 if (include($filename)) {
28     return 1;
29     }
30    
31 joko 1.1 }
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 joko 1.2 //$postfix = ".handler.php";
41     $postfix = ".php";
42 joko 1.1 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 joko 1.2 return $this->includeFile($includefile);
50 joko 1.1 }
51    
52     function loadHandler($name) {
53     $this->site->log( get_class($this) . "->loadHandler( name $name )", LOG_DEBUG);
54 joko 1.2 return $this->loadComponent($name, "handler");
55 joko 1.1 }
56    
57     function loadPage($name) {
58     $this->site->log( get_class($this) . "->loadPage( name $name )", LOG_DEBUG);
59 joko 1.2 return $this->loadComponent($name, "page");
60 joko 1.1 }
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