Changeset 3019

Show
Ignore:
Timestamp:
04/10/07 07:19:38 (1 month ago)
Author:
demian
Message:

updating net_socket

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • vendor/pear/.channels/pear.php.net.reg

    r2996 r3019  
    1 a:6:{s:7:"attribs";a:4:{s:7:"version";s:3:"1.0";s:5:"xmlns";s:31:"http://pear.php.net/channel-1.0";s:9:"xmlns:xsi";s:41:"http://www.w3.org/2001/XMLSchema-instance";s:18:"xsi:schemaLocation";s:71:"http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd";}s:4:"name";s:12:"pear.php.net";s:14:"suggestedalias";s:4:"pear";s:7:"summary";s:40:"PHP Extension and Application Repository";s:7:"servers";a:1:{s:7:"primary";a:2:{s:6:"xmlrpc";a:1:{s:8:"function";a:10:{i:0;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:9:"logintest";}i:1;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:26:"package.listLatestReleases";}i:2;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"package.listAll";}i:3;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:12:"package.info";}i:4;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:22:"package.getDownloadURL";}i:5;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:22:"package.getDownloadURL";}i:6;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:7;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:8;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:14:"package.search";}i:9;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"channel.listAll";}}}s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:25:"http://pear.php.net/rest/";}}}}}s:13:"_lastmodified";a:2:{s:4:"ETag";s:21:""c2e943-530-46019e12"";s:13:"Last-Modified";s:29:"Wed, 21 Mar 2007 21:05:22 GMT";}} 
     1a:6:{s:7:"attribs";a:4:{s:7:"version";s:3:"1.0";s:5:"xmlns";s:31:"http://pear.php.net/channel-1.0";s:9:"xmlns:xsi";s:41:"http://www.w3.org/2001/XMLSchema-instance";s:18:"xsi:schemaLocation";s:71:"http://pear.php.net/channel-1.0 http://pear.php.net/dtd/channel-1.0.xsd";}s:4:"name";s:12:"pear.php.net";s:14:"suggestedalias";s:4:"pear";s:7:"summary";s:40:"PHP Extension and Application Repository";s:7:"servers";a:2:{s:7:"primary";a:2:{s:6:"xmlrpc";a:1:{s:8:"function";a:10:{i:0;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:9:"logintest";}i:1;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:26:"package.listLatestReleases";}i:2;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"package.listAll";}i:3;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:12:"package.info";}i:4;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:22:"package.getDownloadURL";}i:5;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:22:"package.getDownloadURL";}i:6;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:7;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.1";}s:8:"_content";s:25:"package.getDepDownloadURL";}i:8;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:14:"package.search";}i:9;a:2:{s:7:"attribs";a:1:{s:7:"version";s:3:"1.0";}s:8:"_content";s:15:"channel.listAll";}}}s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:25:"http://pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:25:"http://pear.php.net/rest/";}}}}s:6:"mirror";a:2:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"host";s:15:"us.pear.php.net";}s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:28:"http://us.pear.php.net/rest/";}}}}i:1;a:2:{s:7:"attribs";a:1:{s:4:"host";s:15:"de.pear.php.net";}s:4:"rest";a:1:{s:7:"baseurl";a:4:{i:0;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.0";}s:8:"_content";s:28:"http://de.pear.php.net/rest/";}i:1;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.1";}s:8:"_content";s:28:"http://de.pear.php.net/rest/";}i:2;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.2";}s:8:"_content";s:28:"http://de.pear.php.net/rest/";}i:3;a:2:{s:7:"attribs";a:1:{s:4:"type";s:7:"REST1.3";}s:8:"_content";s:28:"http://de.pear.php.net/rest/";}}}}}}s:13:"_lastmodified";a:2:{s:4:"ETag";s:21:""c2e9cb-7ce-4607164c"";s:13:"Last-Modified";s:29:"Mon, 26 Mar 2007 00:39:40 GMT";}} 
  • vendor/pear/.registry/net_socket.reg

    r2688 r3019  
    1 a:13:{s:8:"provides";a:0:{}s:8:"filelist";a:2:{s:10:"Socket.php";a:4:{s:4:"role";s:3:"php";s:14:"baseinstalldir";s:3:"Net";s:6:"md5sum";s:32:"1c7a9a28fc3fa78e682200d7540b66d5";s:12:"installed_as";s:51:"/var/www/html/seagull/trunk/lib/pear/Net/Socket.php";}s:7:"dirtree";a:1:{s:40:"/var/www/html/seagull/trunk/lib/pear/Net";b:1;}}s:7:"package";s:10:"Net_Socket";s:7:"summary";s:24:"Network Socket Interface";s:11:"description";s:231:"Net_Socket is a class interface to TCP sockets.  It provides blocking 
    2 and non-blocking operation, with different reading and writing modes 
    3 (byte-wise, block-wise, line-wise and special formats like network 
    4 byte-order ip addresses).";s:11:"maintainers";a:2:{i:0;a:4:{s:6:"handle";s:3:"ssb";s:4:"name";s:11:"Stig Bakken";s:5:"email";s:12:"stig@php.net";s:4:"role";s:4:"lead";}i:1;a:4:{s:6:"handle";s:8:"chagenbu";s:4:"name";s:15:"Chuck Hagenbuch";s:5:"email";s:15:"chuck@horde.org";s:4:"role";s:4:"lead";}}s:7:"version";s:5:"1.0.6";s:12:"release_date";s:10:"2005-02-26";s:15:"release_license";s:11:"PHP License";s:13:"release_state";s:6:"stable";s:13:"release_notes";s:197:"- Make package.xml safe for PEAR 1.4.0. 
     1a:22:{s:7:"attribs";a:6:{s:15:"packagerversion";s:5:"1.5.1";s:7:"version";s:3:"2.0";s:5:"xmlns";s:35:"http://pear.php.net/dtd/package-2.0";s:11:"xmlns:tasks";s:33:"http://pear.php.net/dtd/tasks-1.0";s:9:"xmlns:xsi";s:41:"http://www.w3.org/2001/XMLSchema-instance";s:18:"xsi:schemaLocation";s:147:"http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd";}s:4:"name";s:10:"Net_Socket";s:7:"channel";s:12:"pear.php.net";s:7:"summary";s:24:"Network Socket Interface";s:11:"description";s:237:"Net_Socket is a class interface to TCP sockets.  It provides blocking 
     2  and non-blocking operation, with different reading and writing modes 
     3  (byte-wise, block-wise, line-wise and special formats like network 
     4  byte-order ip addresses).";s:4:"lead";a:2:{i:0;a:4:{s:4:"name";s:11:"Stig Bakken";s:4:"user";s:3:"ssb";s:5:"email";s:12:"stig@php.net";s:6:"active";s:3:"yes";}i:1;a:4:{s:4:"name";s:15:"Chuck Hagenbuch";s:4:"user";s:8:"chagenbu";s:5:"email";s:15:"chuck@horde.org";s:6:"active";s:3:"yes";}}s:4:"date";s:10:"2007-03-30";s:4:"time";s:8:"16:54:43";s:7:"version";a:2:{s:7:"release";s:5:"1.0.7";s:3:"api";s:5:"1.0.7";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:257:"- Fixing bug #6789: Net_Sock::eof() returns false when socket is already disconnected 
     5- Using package.xml v2.0 
     6- Fixing request #3327: Method for setting Socket's write buffer size 
     7- Add enableCrypto() for calling stream_socket_enable_crypto with PHP 5.1.0+";s:8:"contents";a:1:{s:3:"dir";a:2:{s:7:"attribs";a:1:{s:4:"name";s:1:"/";}s:4:"file";a:1:{s:7:"attribs";a:4:{s:14:"baseinstalldir";s:3:"Net";s:6:"md5sum";s:32:"13f2c5fac3327e973adfbe68ff43e5a5";s:4:"name";s:10:"Socket.php";s:4:"role";s:3:"php";}}}}s:12:"dependencies";a:1:{s:8:"required";a:2:{s:3:"php";a:1:{s:3:"min";s:5:"4.0.0";}s:13:"pearinstaller";a:1:{s:3:"min";s:7:"1.4.0b1";}}}s:10:"phprelease";s:0:"";s:9:"changelog";a:1:{s:7:"release";a:8:{i:0;a:5:{s:7:"version";a:2:{s:7:"release";s:5:"1.0.0";s:3:"api";s:5:"1.0.0";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:4:"date";s:10:"2002-04-01";s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:40:"First independent release of Net_Socket.";}i:1;a:5:{s:7:"version";a:2:{s:7:"release";s:5:"1.0.1";s:3:"api";s:5:"1.0.1";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:4:"date";s:10:"2002-04-04";s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:24:"Touch up error handling.";}i:2;a:5:{s:7:"version";a:2:{s:7:"release";s:5:"1.0.2";s:3:"api";s:5:"1.0.2";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:4:"date";s:10:"2004-04-26";s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:134:"Fixes for several longstanding bugs. Allow setting of stream 
     8context. Correctly read lines that only end in \n. Suppress 
     9PHP warnings.";}i:3;a:5:{s:7:"version";a:2:{s:7:"release";s:5:"1.0.3";s:3:"api";s:5:"1.0.3";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:4:"date";s:10:"2004-12-08";s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:141:"Optimize away some duplicate is_resource() calls. 
     10Better solution for eof() on blocking sockets [#1427]. 
     11Add select() implementation [#1428].";}i:4;a:5:{s:7:"version";a:2:{s:7:"release";s:5:"1.0.4";s:3:"api";s:5:"1.0.4";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:4:"date";s:10:"2004-12-13";s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:45:"Restore support for unix sockets (Bug #2961).";}i:5;a:5:{s:7:"version";a:2:{s:7:"release";s:5:"1.0.5";s:3:"api";s:5:"1.0.5";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:4:"date";s:10:"2005-01-11";s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:61:"Don't rely on gethostbyname() for error checking (Bug #3100).";}i:6;a:5:{s:7:"version";a:2:{s:7:"release";s:5:"1.0.6";s:3:"api";s:5:"1.0.6";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:4:"date";s:10:"2005-02-26";s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:197:"- Make package.xml safe for PEAR 1.4.0. 
    512- Chunk socket writes on Windows by default, or if explicitly specified (Bug #980) 
    6 - Don't run any $addr with a '/' in it through gethostbyname() (Bug #3372)";s:9:"changelog";a:6:{i:0;a:4:{s:7:"version";s:5:"1.0.0";s:12:"release_date";s:10:"2002-04-01";s:13:"release_state";s:6:"stable";s:13:"release_notes";s:42:"First independent release of Net_Socket. 
    7  
    8 ";}i:1;a:4:{s:7:"version";s:5:"1.0.1";s:12:"release_date";s:10:"2002-04-04";s:13:"release_state";s:6:"stable";s:13:"release_notes";s:26:"Touch up error handling. 
    9  
    10 ";}i:2;a:4:{s:7:"version";s:5:"1.0.2";s:12:"release_date";s:10:"2004-04-26";s:13:"release_state";s:6:"stable";s:13:"release_notes";s:136:"Fixes for several longstanding bugs. Allow setting of stream 
    11 context. Correctly read lines that only end in \n. Suppress 
    12 PHP warnings. 
    13  
    14 ";}i:3;a:4:{s:7:"version";s:5:"1.0.3";s:12:"release_date";s:10:"2004-12-08";s:13:"release_state";s:6:"stable";s:13:"release_notes";s:143:"Optimize away some duplicate is_resource() calls. 
    15 Better solution for eof() on blocking sockets [#1427]. 
    16 Add select() implementation [#1428]. 
    17  
    18 ";}i:4;a:4:{s:7:"version";s:5:"1.0.4";s:12:"release_date";s:10:"2004-12-13";s:13:"release_state";s:6:"stable";s:13:"release_notes";s:47:"Restore support for unix sockets (Bug #2961). 
    19  
    20 ";}i:5;a:4:{s:7:"version";s:5:"1.0.5";s:12:"release_date";s:10:"2005-01-11";s:13:"release_state";s:6:"stable";s:13:"release_notes";s:63:"Don't rely on gethostbyname() for error checking (Bug #3100). 
    21  
    22 ";}}s:13:"_lastmodified";i:1126950339;} 
     13- Don't run any $addr with a '/' in it through gethostbyname() (Bug #3372)";}i:7;a:5:{s:7:"version";a:2:{s:7:"release";s:5:"1.0.7";s:3:"api";s:5:"1.0.7";}s:9:"stability";a:2:{s:7:"release";s:6:"stable";s:3:"api";s:6:"stable";}s:4:"date";s:10:"2007-03-30";s:7:"license";a:2:{s:7:"attribs";a:1:{s:3:"uri";s:26:"http://www.php.net/license";}s:8:"_content";s:11:"PHP License";}s:5:"notes";s:257:"- Fixing bug #6789: Net_Sock::eof() returns false when socket is already disconnected 
     14- Using package.xml v2.0 
     15- Fixing request #3327: Method for setting Socket's write buffer size 
     16- Add enableCrypto() for calling stream_socket_enable_crypto with PHP 5.1.0+";}}}s:8:"filelist";a:1:{s:10:"Socket.php";a:5:{s:14:"baseinstalldir";s:3:"Net";s:6:"md5sum";s:32:"13f2c5fac3327e973adfbe68ff43e5a5";s:4:"name";s:10:"Socket.php";s:4:"role";s:3:"php";s:12:"installed_as";s:65:"/var/www/html/seagull/branches/0.6-bugfix/lib/pear/Net/Socket.php";}}s:12:"_lastversion";s:5:"1.0.6";s:7:"dirtree";a:1:{s:54:"/var/www/html/seagull/branches/0.6-bugfix/lib/pear/Net";b:1;}s:3:"old";a:7:{s:7:"version";s:5:"1.0.7";s:12:"release_date";s:10:"2007-03-30";s:13:"release_state";s:6:"stable";s:15:"release_license";s:11:"PHP License";s:13:"release_notes";s:257:"- Fixing bug #6789: Net_Sock::eof() returns false when socket is already disconnected 
     17- Using package.xml v2.0 
     18- Fixing request #3327: Method for setting Socket's write buffer size 
     19- Add enableCrypto() for calling stream_socket_enable_crypto with PHP 5.1.0+";s:12:"release_deps";a:2:{i:0;a:4:{s:4:"type";s:3:"php";s:3:"rel";s:2:"ge";s:7:"version";s:5:"4.0.0";s:8:"optional";s:2:"no";}i:1;a:6:{s:4:"type";s:3:"pkg";s:7:"channel";s:12:"pear.php.net";s:4:"name";s:4:"PEAR";s:3:"rel";s:2:"ge";s:7:"version";s:7:"1.4.0b1";s:8:"optional";s:2:"no";}}s:11:"maintainers";a:2:{i:0;a:5:{s:4:"name";s:11:"Stig Bakken";s:5:"email";s:12:"stig@php.net";s:6:"active";s:3:"yes";s:6:"handle";s:3:"ssb";s:4:"role";s:4:"lead";}i:1;a:5:{s:4:"name";s:15:"Chuck Hagenbuch";s:5:"email";s:15:"chuck@horde.org";s:6:"active";s:3:"yes";s:6:"handle";s:8:"chagenbu";s:4:"role";s:4:"lead";}}}s:10:"xsdversion";s:3:"2.0";s:13:"_lastmodified";i:1176207822;} 
  • vendor/pear/Net/Socket.php

    r2688 r3019  
    1818// +----------------------------------------------------------------------+ 
    1919// 
    20 // $Id: Socket.php,v 1.24 2005/02/03 20:40:16 chagenbu Exp $ 
     20// $Id: Socket.php,v 1.29 2007/03/28 04:53:35 chagenbu Exp $ 
    2121 
    2222require_once 'PEAR.php'; 
     
    2424define('NET_SOCKET_READ',  1); 
    2525define('NET_SOCKET_WRITE', 2); 
    26 define('NET_SOCKET_ERROR', 3); 
     26define('NET_SOCKET_ERROR', 4); 
    2727 
    2828/** 
     
    217217 
    218218    /** 
     219     * Sets the file buffering size on the stream. 
     220     * See php's stream_set_write_buffer for more information. 
     221     * 
     222     * @param integer $size     Write buffer size. 
     223     * @access public 
     224     * @return mixed on success or an PEAR_Error object otherwise 
     225     */ 
     226    function setWriteBuffer($size) 
     227    { 
     228        if (!is_resource($this->fp)) { 
     229            return $this->raiseError('not connected'); 
     230        } 
     231 
     232        $returned = stream_set_write_buffer($this->fp, $code); 
     233        if ($returned == 0) { 
     234            return true; 
     235        } 
     236        return $this->raiseError('Cannot set write buffer.'); 
     237    } 
     238 
     239    /** 
    219240     * Returns information about an existing socket resource. 
    220241     * Currently returns four entries in the result array: 
     
    330351     * Tests for end-of-file on a socket descriptor. 
    331352     * 
     353     * Also returns true if the socket is disconnected. 
     354     * 
    332355     * @access public 
    333356     * @return bool 
     
    335358    function eof() 
    336359    { 
    337         return (is_resource($this->fp) && feof($this->fp)); 
     360        return (!is_resource($this->fp) || feof($this->fp)); 
    338361    } 
    339362 
     
    442465        } 
    443466 
     467        ob_start(); 
    444468        $line = ''; 
    445469        $timeout = time() + $this->timeout; 
    446470        while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) { 
    447             $line .= @fgets($this->fp, $this->lineLength); 
     471            $line .= fgets($this->fp, $this->lineLength); 
    448472            if (substr($line, -1) == "\n") { 
     473                ob_end_clean(); 
    449474                return rtrim($line, "\r\n"); 
    450475            } 
    451476        } 
     477        ob_end_clean(); 
    452478        return $line; 
    453479    } 
     
    526552    } 
    527553 
     554    /** 
     555     * Turns encryption on/off on a connected socket. 
     556     * 
     557     * @param bool    $enabled  Set this parameter to true to enable encryption 
     558     *                          and false to disable encryption. 
     559     * @param integer $type     Type of encryption. See 
     560     *                          http://se.php.net/manual/en/function.stream-socket-enable-crypto.php for values. 
     561     * 
     562     * @access public 
     563     * @return false on error, true on success and 0 if there isn't enough data and the 
     564     *         user should try again (non-blocking sockets only). A PEAR_Error object 
     565     *         is returned if the socket is not connected 
     566     */ 
     567    function enableCrypto($enabled, $type) 
     568    { 
     569        if (version_compare(phpversion(), "5.1.0", ">=")) { 
     570            if (!is_resource($this->fp)) { 
     571                return $this->raiseError('not connected'); 
     572            } 
     573            return @stream_socket_enable_crypto($this->fp, $enabled, $type); 
     574        } else { 
     575            return $this->raiseError('Net_Socket::enableCrypto() requires php version >= 5.1.0'); 
     576        } 
     577    } 
     578 
    528579}