diff options
author | Luke Fitzgerald <lw.fitzgerald@googlemail.com> | 2010-07-27 09:14:07 -0700 |
---|---|---|
committer | Luke Fitzgerald <lw.fitzgerald@googlemail.com> | 2010-07-27 09:14:07 -0700 |
commit | dd882be8032a6fdd70e5a943abe78cdd7e34f49e (patch) | |
tree | 6839d062cf68c36a6f3df23ff937e7ef17fcaa1e /plugins | |
parent | 3c1d7d81cf76fbd358885ed4ec540871236072f8 (diff) |
Merge in Phergie fixes and remove some whitespace
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/Irc/extlib/phergie/Phergie/Driver/Streams.php | 8 | ||||
-rw-r--r-- | plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php | 17 | ||||
-rw-r--r-- | plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php | bin | 1740 -> 47104 bytes | |||
-rw-r--r-- | plugins/Irc/ircmanager.php | 2 |
4 files changed, 21 insertions, 6 deletions
diff --git a/plugins/Irc/extlib/phergie/Phergie/Driver/Streams.php b/plugins/Irc/extlib/phergie/Phergie/Driver/Streams.php index 9f9e2585d..ed64bba2a 100755 --- a/plugins/Irc/extlib/phergie/Phergie/Driver/Streams.php +++ b/plugins/Irc/extlib/phergie/Phergie/Driver/Streams.php @@ -219,6 +219,14 @@ class Phergie_Driver_Streams extends Phergie_Driver_Abstract */ public function getEvent() { + // Check the socket is still active + if (feof($this->socket)) { + throw new Phergie_Driver_Exception( + 'EOF detected on socket', + Phergie_Driver_Exception::ERR_CONNECTION_READ_FAILED + ); + } + // Check for a new event on the current connection $buffer = fgets($this->socket, 512); if ($buffer === false) { diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php index 4b3d29c53..91d375ca6 100644 --- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php +++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/Cookie/db.php @@ -35,15 +35,24 @@ $xpath = new DOMXPath($doc); $cookies = $xpath->query('//table[@width="90%"]/tr/td[1]/a'); foreach ($cookies as $cookie) { - - $name = str_replace(array('(',')',"\n", 'cookies'), array('','', ' ', 'cookie' ), trim( $cookie->textContent)); + $name = $cookie->textContent; + foreach (range(0, mb_strlen($name) - 1) as $index) { + echo mb_strcut($name, $index, 1), PHP_EOL; + } + $name = str_replace( + array('(',')',"\n", 'cookies'), + array('','', ' ', 'cookie'), + $name + ); + $name = iconv('UTF-8', 'ISO-8859-1//TRANSLIT', $name); + $name = trim($name); + $name = rtrim($name, 's'); $link = 'http://en.wikipedia.org' . $cookie->getAttribute('href'); $insert->execute(array($name, $link)); - print 'added ['.$name.'] -> '. $link . PHP_EOL; + echo 'added [' . $name . '] -> '. $link . PHP_EOL; } // Clean up echo 'Cleaning up', PHP_EOL; unlink($file); - diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php Binary files differindex 28f963ad1..364d9a09f 100644 --- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php +++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/Tld/db.php diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/ircmanager.php index 8042ae24c..a54db566a 100644 --- a/plugins/Irc/ircmanager.php +++ b/plugins/Irc/ircmanager.php @@ -64,8 +64,6 @@ class IrcManager extends ImManager { } } - - /** * Idle processing for io manager's execution loop. * Send keepalive pings to server. |