Ignore:
Timestamp:
2007/06/14 00:09:08 (19 years ago)
Author:
adati
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/html/test/adachi/LLReader/LLReader.php

    r14611 r14612  
    11<?php 
    22require_once('LLReader/Util.php'); 
    3 require_once('LLReader/Feed.php'); 
    43//require_once('LLReader/Constant.php'); 
    54 
     
    87    private $plugins; 
    98    private $feeds; 
    10  
     9     
    1110    public function __construct($config){ 
    12         $this->config = $config; 
     11        $this->config  = $config; 
     12        $this->plugins = array(); 
     13        $this->feeds   = array(); 
    1314    } 
    14  
     15     
    1516    public function run () { 
    1617        $this->load_plugins(); 
    17  
     18         
    1819        $phases = array( 
    1920            'Subscription', 
     
    3031        } 
    3132    } 
    32  
     33     
    3334    private function load_plugins () { 
    3435        foreach ($this->config['plugins'] as $name => $config) { 
     
    3637            $include = preg_replace('/_/', '/', $class) . '.php'; 
    3738            $ret     = include_once($include); 
    38  
     39             
    3940            $err = 0; 
    40  
     41             
    4142            if ($ret) { 
    4243                if ( preg_match("/^(.+?)_/", $name, $matches) ) { 
     
    5152            } 
    5253            else { 
    53                 $this->log('[ERR] ' . $class . " not found"); 
     54                $this->log('[ERR] ' . $class . ' not found'); 
    5455                $err++; 
    5556            } 
    5657        } 
    57  
     58         
    5859        if ($err) { 
    59             $this->log('[Die] ' . 'function load_plugins()'); 
    60             exit(); 
     60            $this->_die('function load_plugins()'); 
    6161        } 
    6262    } 
    63  
     63     
    6464    public function log ($msg) { 
    6565        LLReader_Util::log($msg); 
    6666    } 
    67  
     67     
    6868    public function p ($var) { 
    6969        LLReader_Util::p($var); 
    7070    } 
    71  
     71     
     72    public function _die ($msg) { 
     73        $this->log('[DIE] ' . $msg); 
     74        exit(); 
     75    } 
     76     
    7277    private function get_plugins ($phase) { 
    7378        if ( empty($this->plugins[$phase]) ) { 
    74             return array(); 
     79            return array(); 
    7580        } 
    7681        return $this->plugins[$phase]; 
    7782    } 
    78  
     83     
    7984    public function get_feeds () { 
    8085        return $this->feeds; 
    8186    } 
     87     
     88    public function add_feed ($feed) { 
     89        $this->feeds[] = $feed; 
     90    } 
    8291} 
    8392?> 
Note: See TracChangeset for help on using the changeset viewer.