Changeset 14612 for branches/dev/html/test/adachi/LLReader/LLReader.php
- Timestamp:
- 2007/06/14 00:09:08 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/dev/html/test/adachi/LLReader/LLReader.php
r14611 r14612 1 1 <?php 2 2 require_once('LLReader/Util.php'); 3 require_once('LLReader/Feed.php');4 3 //require_once('LLReader/Constant.php'); 5 4 … … 8 7 private $plugins; 9 8 private $feeds; 10 9 11 10 public function __construct($config){ 12 $this->config = $config; 11 $this->config = $config; 12 $this->plugins = array(); 13 $this->feeds = array(); 13 14 } 14 15 15 16 public function run () { 16 17 $this->load_plugins(); 17 18 18 19 $phases = array( 19 20 'Subscription', … … 30 31 } 31 32 } 32 33 33 34 private function load_plugins () { 34 35 foreach ($this->config['plugins'] as $name => $config) { … … 36 37 $include = preg_replace('/_/', '/', $class) . '.php'; 37 38 $ret = include_once($include); 38 39 39 40 $err = 0; 40 41 41 42 if ($ret) { 42 43 if ( preg_match("/^(.+?)_/", $name, $matches) ) { … … 51 52 } 52 53 else { 53 $this->log('[ERR] ' . $class . " not found");54 $this->log('[ERR] ' . $class . ' not found'); 54 55 $err++; 55 56 } 56 57 } 57 58 58 59 if ($err) { 59 $this->log('[Die] ' . 'function load_plugins()'); 60 exit(); 60 $this->_die('function load_plugins()'); 61 61 } 62 62 } 63 63 64 64 public function log ($msg) { 65 65 LLReader_Util::log($msg); 66 66 } 67 67 68 68 public function p ($var) { 69 69 LLReader_Util::p($var); 70 70 } 71 71 72 public function _die ($msg) { 73 $this->log('[DIE] ' . $msg); 74 exit(); 75 } 76 72 77 private function get_plugins ($phase) { 73 78 if ( empty($this->plugins[$phase]) ) { 74 return array();79 return array(); 75 80 } 76 81 return $this->plugins[$phase]; 77 82 } 78 83 79 84 public function get_feeds () { 80 85 return $this->feeds; 81 86 } 87 88 public function add_feed ($feed) { 89 $this->feeds[] = $feed; 90 } 82 91 } 83 92 ?>
Note: See TracChangeset
for help on using the changeset viewer.
