Changeset 20
- Timestamp:
- 02/09/08 00:43:11 (10 months ago)
- Files:
-
- trunk/Phergie/Client.php (modified) (3 diffs)
- trunk/Phergie/Event/Handler/AdminCommand.php (modified) (3 diffs)
- trunk/Phergie/Event/Handler/Autojoin.php (modified) (1 diff)
- trunk/Phergie/Event/Handler/Cron.php (added)
- trunk/Phergie/Event/Handler/Daddy.php (modified) (1 diff)
- trunk/Phergie/Event/Handler/JoinPart.php (added)
- trunk/Phergie/Event/Handler/Quit.php (modified) (1 diff)
- trunk/Phergie/Event/Handler/RSSParser.php (added)
- trunk/Phergie/phergie.ini (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Client.php
r1 r20 42 42 43 43 /** 44 * Associative array mapping configuration setting names to their 44 * Associative array mapping configuration setting names to their 45 45 * respective values 46 46 * … … 85 85 public final function getIni($name) 86 86 { 87 if (!isset($this->_configuration[ $name])) {87 if (!isset($this->_configuration[strtolower($name)])) { 88 88 return null; 89 89 } 90 return $this->_configuration[ $name];90 return $this->_configuration[strtolower($name)]; 91 91 } 92 92 93 93 /** 94 * Sets the value of a specified configuration setting, overwriting any 94 * Sets the value of a specified configuration setting, overwriting any 95 95 * existing value for that setting. 96 96 * … … 100 100 public final function setIni($name, $value) 101 101 { 102 $this->_configuration[ $name] = $value;102 $this->_configuration[strtolower($name)] = $value; 103 103 } 104 104 trunk/Phergie/Event/Handler/AdminCommand.php
r17 r20 36 36 protected $_adminOps = array(); 37 37 38 public function isAdmin(Phergie_Event_Request $event , $__class__ = __CLASS__)38 public function isAdmin(Phergie_Event_Request $event) 39 39 { 40 $class = substr( $__class__, 22);40 $class = substr(get_class($this), 22); 41 41 if (!isset($this->_admins[$class])) { 42 42 $this->initialize($class); … … 59 59 { 60 60 // Set adminOps values 61 $ini = $this->getIni($class.'.admin Ops');61 $ini = $this->getIni($class.'.admin_ops'); 62 62 if ($ini===null) { 63 $ini = $this->getIni(' AdminCommand.adminOps');63 $ini = $this->getIni('admincommand.admin_ops'); 64 64 } 65 65 if ($ini==='true' || $ini==='1') { … … 72 72 $ini = $this->getIni($class.'.admins'); 73 73 if ($ini===null) { 74 $ini = $this->getIni(' AdminCommand.admins');74 $ini = $this->getIni('admincommand.admins'); 75 75 } 76 $admins = explode(',', $ini); 76 $admins = preg_split('#[\s\r\n,]+#', $ini); 77 var_dump($admins); 78 die; 77 79 foreach ($admins as $admin) { 78 80 // Find out which chars are present in the config mask and exclude them from the regex match trunk/Phergie/Event/Handler/Autojoin.php
r18 r20 10 10 if (!empty($channels) 11 11 && $response->getCode() == Phergie_Event_Response::RPL_ENDOFMOTD) { 12 $this->doJoin( $channels);12 $this->doJoin(implode(' ', preg_split('#[, ]+#', $channels))); 13 13 } 14 14 } trunk/Phergie/Event/Handler/Daddy.php
r19 r20 12 12 $bot = $this->getConnection()->getNick(); 13 13 $msg = $event->getArgument(1); 14 echo 'system -> bot: ' . $bot . "\n"; 15 echo 'system -> msg: ' . $msg . "\n"; 16 if (preg_match('/' . $bot . '\s*:?\s+?who\'?s your daddy\\??/iAD', $msg, $match)) { 14 if (preg_match('/' . $bot . '\s*:?\s+?who\'?s your daddy\\??/iAD', $msg)) { 17 15 $this->doPrivmsg($event->getArgument(0), 'You\'re my daddy, ' . $event->getNick() . '!'); 18 16 } trunk/Phergie/Event/Handler/Quit.php
r16 r20 10 10 public function onPrivmsg(Phergie_Event_Request $event) 11 11 { 12 if($event->getArgument(1)=='quit' && $this->isAdmin($event , __CLASS__)) {12 if($event->getArgument(1)=='quit' && $this->isAdmin($event)) { 13 13 $this->doQuit('by request of ' . $event->getNick()); 14 14 } trunk/Phergie/phergie.ini
r18 r20 5 5 plugins = all 6 6 7 nickserv.password = 7 nickserv.password = 8 8 9 autojoin.channels = 9 autojoin.channels = 10 11 ;------------------------ 12 ; Admin Command settings 13 ;------------------------ 14 [admincommand] 15 ; admincommand.admins : 16 ; a list of hostmasks containing wildcards that are 17 ; granted access to the bot's admin features, it must be 18 ; enclosed by double quotes and entries are separated 19 ; by spaces or commas 20 admincommand.admins = "" 21 ; admincommand.admin_ops : 22 ; if set to true, chan operators are given admin rights 23 admincommand.admin_ops = true 24 25 ;------------------------ 26 ; RSSParser settings 27 ;------------------------ 28 [rssparser] 29 ; rssparser.feed0 : 30 ; a feed url, enclosed by double quotes, to have multiple feeds 31 ; you should put them in feed1, feed2, feed3 and so on. be careful 32 ; not to leave a gap in between two feed numbers as it will not 33 ; find those after the gap 34 rssparser.feed0 = "" 35 ; rssparser.chans0 : 36 ; contains a list of channels where the feedN must be advertised 37 ; entries are separated by spaces or commas 38 rssparser.chans0 = "" 39 ; rssparser.time_to_live : 40 ; that's the frequency, in seconds, at which the feeds are checked 41 ; for new data, the default is 1800 (every 30minutes) 42 rssparser.time_to_live = 1800