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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Tue Nov 12 05:42:31 2002 UTC revision 1.2 by joko, Thu Dec 12 21:37:46 2002 UTC
# Line 3  Line 3 
3  //    $Id$  //    $Id$
4  //    -------------------------------------------------------------------------  //    -------------------------------------------------------------------------
5  //    $Log$  //    $Log$
6    //    Revision 1.2  2002/12/12 21:37:46  joko
7    //    + fixes: now returning success-/error-status
8    //
9  //    Revision 1.1  2002/11/12 05:42:31  joko  //    Revision 1.1  2002/11/12 05:42:31  joko
10  //    + initial checkin  //    + initial checkin
11  //  //
# Line 16  class Site_Loader { Line 19  class Site_Loader {
19    function includeFile($filename) {    function includeFile($filename) {
20    
21      // TODO: try to remove these globals!      // TODO: try to remove these globals!
22        global $site;
23      global $site_state;      global $site_state;
24      global $uservars;      global $uservars;
25      global $request;      global $request;
26        global $http_referer;
27    
28      $this->site->log( get_class($this) . "->includeFile( filename $filename )", LOG_DEBUG);      $this->site->log( get_class($this) . "->includeFile( filename $filename )", LOG_DEBUG);
29      $site = &$this->site;      $site = &$this->site;
30      include($filename);      if (include($filename)) {
31          return 1;
32        }
33        
34    }    }
35        
36    function loadComponent($name, $type = "") {    function loadComponent($name, $type = "") {
# Line 32  class Site_Loader { Line 40  class Site_Loader {
40      switch ($type) {      switch ($type) {
41        case "handler":        case "handler":
42          $prefix = $this->site->config[path][base] . 'core/handler/';          $prefix = $this->site->config[path][base] . 'core/handler/';
43          $postfix = ".handler.php";          //$postfix = ".handler.php";
44            $postfix = ".php";
45          break;          break;
46        case "page":        case "page":
47          $prefix = $this->site->config[path][base] . 'core/pages/';          $prefix = $this->site->config[path][base] . 'core/pages/';
# Line 40  class Site_Loader { Line 49  class Site_Loader {
49          break;          break;
50      }      }
51      $includefile = "$prefix$name$postfix";      $includefile = "$prefix$name$postfix";
52      $this->includeFile($includefile);      return $this->includeFile($includefile);
53    }    }
54        
55    function loadHandler($name) {    function loadHandler($name) {
56      $this->site->log( get_class($this) . "->loadHandler( name $name )", LOG_DEBUG);      $this->site->log( get_class($this) . "->loadHandler( name $name )", LOG_DEBUG);
57      $this->loadComponent($name, "handler");      return $this->loadComponent($name, "handler");
58    }    }
59    
60    function loadPage($name) {    function loadPage($name) {
61      $this->site->log( get_class($this) . "->loadPage( name $name )", LOG_DEBUG);      $this->site->log( get_class($this) . "->loadPage( name $name )", LOG_DEBUG);
62      $this->loadComponent($name, "page");      return $this->loadComponent($name, "page");
63    }    }
64    
65    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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