Changeset 230
- Timestamp:
- 04/13/08 22:13:20 (7 months ago)
- Files:
-
- trunk/Phergie/Driver/Streams.php (modified) (1 diff)
- trunk/Phergie/Plugin/Sed.php (modified) (2 diffs)
- trunk/Phergie/Plugin/Seen.php (modified) (6 diffs)
- trunk/Phergie/Plugin/Url.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Driver/Streams.php
r223 r230 196 196 $plugin->onTick(); 197 197 } 198 usleep(1000 );198 usleep(10000); 199 199 } 200 200 } trunk/Phergie/Plugin/Sed.php
r223 r230 27 27 * @return void 28 28 */ 29 public function init()29 public function onConnect() 30 30 { 31 31 try { … … 102 102 ':offset' => $offset 103 103 ); 104 $this->select->execute($params); 105 $log = $this->select->fetch(); 104 105 try { 106 $this->select->execute($params); 107 $log = $this->select->fetch(); 108 } catch (PDOException $e) { } 106 109 107 110 if ($log) { trunk/Phergie/Plugin/Seen.php
r227 r230 69 69 * @return void 70 70 */ 71 public function init()71 public function onConnect() 72 72 { 73 73 try { … … 187 187 ); 188 188 189 $this->search->execute($params); 190 $rows = $this->search->fetchAll(PDO::FETCH_ASSOC); 189 try { 190 $this->search->execute($params); 191 $rows = $this->search->fetchAll(PDO::FETCH_ASSOC); 192 } catch (PDOException $e) { } 191 193 192 194 if (count($rows) <= 0) { … … 249 251 ); 250 252 251 $this->seen->execute($params); 252 $row = $this->seen->fetch(PDO::FETCH_ASSOC); 253 try { 254 $this->seen->execute($params); 255 $row = $this->seen->fetch(PDO::FETCH_ASSOC); 256 } catch (PDOException $e) { } 253 257 254 258 // Send the last action if available … … 309 313 ); 310 314 311 $this->heard->execute($params); 312 $row = $this->heard->fetch(PDO::FETCH_ASSOC); 315 try { 316 $this->heard->execute($params); 317 $row = $this->heard->fetch(PDO::FETCH_ASSOC); 318 } catch (PDOException $e) { } 313 319 314 320 // Send the last action if available … … 375 381 ); 376 382 377 $this->willsee->execute($params); 378 $prediction = $this->willsee->fetchColumn(); 383 try { 384 $this->willsee->execute($params); 385 $prediction = $this->willsee->fetchColumn(); 386 } catch (PDOException $e) { } 379 387 380 388 // Return if no results are found … … 442 450 ); 443 451 444 $this->quote->execute($params); 445 $row = $this->quote->fetch(PDO::FETCH_ASSOC); 452 try { 453 $this->quote->execute($params); 454 $row = $this->quote->fetch(PDO::FETCH_ASSOC); 455 } catch (PDOException $e) { } 446 456 447 457 // Send the last action if available trunk/Phergie/Plugin/Url.php
r228 r230 119 119 120 120 /** 121 * Initializes settings 122 * 123 * @return void 124 */ 125 public function onConnect() 126 { 127 // Get a list of valid TLDs 128 if (!is_array($this->tldList) || count($this->tldList) <= 6) { 129 if ($this->pluginLoaded('Tld')) { 130 $this->tldList = Phergie_Plugin_Tld::getTlds(); 131 if (is_array($this->tldList)) { 132 $this->tldList = array_keys($this->tldList); 133 } 134 } 135 if (!is_array($this->tldList) || count($this->tldList) <= 0) { 136 $this->tldList = array('com', 'org', 'net', 'gov', 'us', 'uk'); 137 } 138 rsort($this->tldList); 139 } 140 } 141 142 /** 121 143 * Checks an incoming message for the presence of a URL and, if one is 122 144 * found, responds with its title if it is an HTML document and the … … 142 164 $this->updateSetting('title_length', 'titleLength', true); 143 165 $this->updateSetting('show_errors', 'showErrors'); 144 // Update the valid TLD list145 $this->updateTldList();146 166 147 167 $responses = array(); … … 544 564 } 545 565 546 /**547 * Updates the list of TLDs from the TLD plugin548 *549 * @return void550 */551 protected function updateTldList()552 {553 // Get a list of valid TLDs554 if (!is_array($this->tldList) || count($this->tldList) <= 6) {555 if ($this->pluginLoaded('Tld')) {556 $this->tldList = Phergie_Plugin_Tld::getTlds();557 if (is_array($this->tldList)) {558 $this->tldList = array_keys($this->tldList);559 }560 }561 if (!is_array($this->tldList) || count($this->tldList) <= 0) {562 $this->tldList = array('com', 'org', 'net', 'gov', 'us', 'uk');563 }564 rsort($this->tldList);565 }566 }567 568 566 /* 569 567 * Updates the given variable with the setting