jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/342028 )

Change subject: Update pear/net_socket from 1.0.14 to 1.1.0
......................................................................


Update pear/net_socket from 1.0.14 to 1.1.0

https://github.com/pear/Net_Socket/releases/tag/v1.1.0
https://github.com/pear/Net_Socket/compare/1.0.14...v1.1.0

Change-Id: Ia2eadd2a35434702d1d748529b76765d6b7de03e
---
M composer.json
M composer.lock
M composer/autoload_namespaces.php
M composer/autoload_static.php
M composer/include_paths.php
M composer/installed.json
M pear/net_socket/.gitignore
A pear/net_socket/.travis.yml
M pear/net_socket/Net/Socket.php
A pear/net_socket/README.md
M pear/net_socket/composer.json
M pear/net_socket/package.xml
A pear/net_socket/phpunit.xml.dist
13 files changed, 286 insertions(+), 162 deletions(-)

Approvals:
  Reedy: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/composer.json b/composer.json
index 39e7340..61a79b2 100644
--- a/composer.json
+++ b/composer.json
@@ -51,7 +51,7 @@
                "pear/mail_mime": "1.10.0",
                "pear/mail_mime-decode": "1.5.5.2",
                "pear/net_smtp": "1.7.3",
-               "pear/net_socket": "1.0.14",
+               "pear/net_socket": "1.1.0",
                "pear/pear-core-minimal": "1.10.3",
                "pear/pear_exception": "1.0.0",
                "php": ">=5.5.9",
diff --git a/composer.lock b/composer.lock
index 830d9a0..1e840b9 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file";,
         "This file is @generated automatically"
     ],
-    "content-hash": "f0a72cf5dd6b98384d94dd3f7590ceb5",
+    "content-hash": "36e131bec2018eba7948377ceb659141",
     "packages": [
         {
             "name": "composer/semver",
@@ -869,23 +869,24 @@
         },
         {
             "name": "pear/net_socket",
-            "version": "1.0.14",
+            "version": "v1.1.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/pear/Net_Socket.git";,
-                "reference": "fcd33efd77e4b35ce85489141ab9145343579fe8"
+                "reference": "960599d403e5e831a4394d48d1f04da2eb2a035b"
             },
             "dist": {
                 "type": "zip",
-                "url": 
"https://api.github.com/repos/pear/Net_Socket/zipball/fcd33efd77e4b35ce85489141ab9145343579fe8";,
-                "reference": "fcd33efd77e4b35ce85489141ab9145343579fe8",
+                "url": 
"https://api.github.com/repos/pear/Net_Socket/zipball/960599d403e5e831a4394d48d1f04da2eb2a035b";,
+                "reference": "960599d403e5e831a4394d48d1f04da2eb2a035b",
                 "shasum": ""
             },
             "require": {
-                "pear/pear_exception": "*"
+                "pear/pear_exception": "@stable",
+                "php": ">=5.4.0"
             },
             "require-dev": {
-                "phpunit/phpunit": "*"
+                "phpunit/phpunit": "^4"
             },
             "type": "library",
             "autoload": {
@@ -918,7 +919,7 @@
                 }
             ],
             "description": "More info available on: 
http://pear.php.net/package/Net_Socket";,
-            "time": "2014-02-20T19:27:06+00:00"
+            "time": "2017-03-08T19:28:35+00:00"
         },
         {
             "name": "pear/pear-core-minimal",
diff --git a/composer/autoload_namespaces.php b/composer/autoload_namespaces.php
index 82e4e70..a067a94 100644
--- a/composer/autoload_namespaces.php
+++ b/composer/autoload_namespaces.php
@@ -9,7 +9,7 @@
     'TextCat' => array($vendorDir . '/wikimedia/textcat'),
     'Pimple' => array($vendorDir . '/pimple/pimple/src'),
     'PEAR' => array($vendorDir . '/pear/pear_exception'),
-    'Net' => array($vendorDir . '/pear/net_socket', $vendorDir . 
'/pear/net_smtp'),
+    'Net' => array($vendorDir . '/pear/net_smtp', $vendorDir . 
'/pear/net_socket'),
     'Mail_mimeDecode' => array($vendorDir . '/pear/mail_mime-decode'),
     'Mail' => array($vendorDir . '/pear/mail_mime', $vendorDir . '/pear/mail'),
     'Liuggio' => array($vendorDir . '/liuggio/statsd-php-client/src'),
diff --git a/composer/autoload_static.php b/composer/autoload_static.php
index bdb9b5f..1941c9b 100644
--- a/composer/autoload_static.php
+++ b/composer/autoload_static.php
@@ -142,8 +142,8 @@
         array (
             'Net' => 
             array (
-                0 => __DIR__ . '/..' . '/pear/net_socket',
-                1 => __DIR__ . '/..' . '/pear/net_smtp',
+                0 => __DIR__ . '/..' . '/pear/net_smtp',
+                1 => __DIR__ . '/..' . '/pear/net_socket',
             ),
         ),
         'M' => 
diff --git a/composer/include_paths.php b/composer/include_paths.php
index 285bd4d..c584514 100644
--- a/composer/include_paths.php
+++ b/composer/include_paths.php
@@ -10,8 +10,8 @@
     $vendorDir . '/pear/console_getopt',
     $vendorDir . '/pear/mail_mime',
     $vendorDir . '/pear/mail_mime-decode',
-    $vendorDir . '/pear/net_socket',
     $vendorDir . '/pear/mail',
     $vendorDir . '/pear/net_smtp',
     $vendorDir . '/pear/pear-core-minimal/src',
+    $vendorDir . '/pear/net_socket',
 );
diff --git a/composer/installed.json b/composer/installed.json
index 389587b..25c2b2c 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -347,61 +347,6 @@
         "description": "More info available on: 
http://pear.php.net/package/Mail_mimeDecode";
     },
     {
-        "name": "pear/net_socket",
-        "version": "1.0.14",
-        "version_normalized": "1.0.14.0",
-        "source": {
-            "type": "git",
-            "url": "https://github.com/pear/Net_Socket.git";,
-            "reference": "fcd33efd77e4b35ce85489141ab9145343579fe8"
-        },
-        "dist": {
-            "type": "zip",
-            "url": 
"https://api.github.com/repos/pear/Net_Socket/zipball/fcd33efd77e4b35ce85489141ab9145343579fe8";,
-            "reference": "fcd33efd77e4b35ce85489141ab9145343579fe8",
-            "shasum": ""
-        },
-        "require": {
-            "pear/pear_exception": "*"
-        },
-        "require-dev": {
-            "phpunit/phpunit": "*"
-        },
-        "time": "2014-02-20T19:27:06+00:00",
-        "type": "library",
-        "installation-source": "dist",
-        "autoload": {
-            "psr-0": {
-                "Net": "./"
-            }
-        },
-        "notification-url": "https://packagist.org/downloads/";,
-        "include-path": [
-            "./"
-        ],
-        "license": [
-            "PHP License"
-        ],
-        "authors": [
-            {
-                "name": "Chuck Hagenbuch",
-                "email": "[email protected]",
-                "role": "Lead"
-            },
-            {
-                "name": "Aleksander Machniak",
-                "email": "[email protected]",
-                "role": "Lead"
-            },
-            {
-                "name": "Stig Bakken",
-                "email": "[email protected]",
-                "role": "Lead"
-            }
-        ],
-        "description": "More info available on: 
http://pear.php.net/package/Net_Socket";
-    },
-    {
         "name": "wikimedia/assert",
         "version": "v0.2.2",
         "version_normalized": "0.2.2.0",
@@ -2192,5 +2137,61 @@
             }
         ],
         "description": "Minimal set of PEAR core files to be used as composer 
dependency"
+    },
+    {
+        "name": "pear/net_socket",
+        "version": "v1.1.0",
+        "version_normalized": "1.1.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/pear/Net_Socket.git";,
+            "reference": "960599d403e5e831a4394d48d1f04da2eb2a035b"
+        },
+        "dist": {
+            "type": "zip",
+            "url": 
"https://api.github.com/repos/pear/Net_Socket/zipball/960599d403e5e831a4394d48d1f04da2eb2a035b";,
+            "reference": "960599d403e5e831a4394d48d1f04da2eb2a035b",
+            "shasum": ""
+        },
+        "require": {
+            "pear/pear_exception": "@stable",
+            "php": ">=5.4.0"
+        },
+        "require-dev": {
+            "phpunit/phpunit": "^4"
+        },
+        "time": "2017-03-08T19:28:35+00:00",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-0": {
+                "Net": "./"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/";,
+        "include-path": [
+            "./"
+        ],
+        "license": [
+            "PHP License"
+        ],
+        "authors": [
+            {
+                "name": "Chuck Hagenbuch",
+                "email": "[email protected]",
+                "role": "Lead"
+            },
+            {
+                "name": "Aleksander Machniak",
+                "email": "[email protected]",
+                "role": "Lead"
+            },
+            {
+                "name": "Stig Bakken",
+                "email": "[email protected]",
+                "role": "Lead"
+            }
+        ],
+        "description": "More info available on: 
http://pear.php.net/package/Net_Socket";
     }
 ]
diff --git a/pear/net_socket/.gitignore b/pear/net_socket/.gitignore
index 869f498..e2b2f02 100644
--- a/pear/net_socket/.gitignore
+++ b/pear/net_socket/.gitignore
@@ -2,3 +2,5 @@
 composer.lock
 composer.phar
 vendor
+
+*.tgz
diff --git a/pear/net_socket/.travis.yml b/pear/net_socket/.travis.yml
new file mode 100644
index 0000000..2acb4d6
--- /dev/null
+++ b/pear/net_socket/.travis.yml
@@ -0,0 +1,21 @@
+language: php
+sudo: false
+php:
+  - 5.4
+  - 5.5
+  - 5.6
+  - 7.0
+  - 7.1
+script:
+  - pear list
+  - pear channel-update pear.php.net
+  - pear upgrade --force pear/pear-1.10.1
+  - pear list
+  - pear install --force package.xml
+  - pear list
+  - pear package
+  - pear package-validate
+  - pear install --force *.tgz
+  - pear list
+  - composer install
+  - ./vendor/bin/phpunit -c phpunit.xml.dist
diff --git a/pear/net_socket/Net/Socket.php b/pear/net_socket/Net/Socket.php
index bf1d1bb..cd5d510 100644
--- a/pear/net_socket/Net/Socket.php
+++ b/pear/net_socket/Net/Socket.php
@@ -2,7 +2,7 @@
 /**
  * Net_Socket
  *
- * PHP Version 4
+ * PHP Version 5
  *
  * Copyright (c) 1997-2013 The PHP Group
  *
@@ -49,71 +49,75 @@
      * Socket file pointer.
      * @var resource $fp
      */
-    var $fp = null;
+    public $fp = null;
 
     /**
      * Whether the socket is blocking. Defaults to true.
      * @var boolean $blocking
      */
-    var $blocking = true;
+    public $blocking = true;
 
     /**
      * Whether the socket is persistent. Defaults to false.
      * @var boolean $persistent
      */
-    var $persistent = false;
+    public $persistent = false;
 
     /**
      * The IP address to connect to.
      * @var string $addr
      */
-    var $addr = '';
+    public $addr = '';
 
     /**
      * The port number to connect to.
      * @var integer $port
      */
-    var $port = 0;
+    public $port = 0;
 
     /**
      * Number of seconds to wait on socket operations before assuming
      * there's no more data. Defaults to no timeout.
      * @var integer|float $timeout
      */
-    var $timeout = null;
+    public $timeout = null;
 
     /**
      * Number of bytes to read at a time in readLine() and
      * readAll(). Defaults to 2048.
      * @var integer $lineLength
      */
-    var $lineLength = 2048;
+    public $lineLength = 2048;
 
     /**
      * The string to use as a newline terminator. Usually "\r\n" or "\n".
      * @var string $newline
      */
-    var $newline = "\r\n";
+    public $newline = "\r\n";
 
     /**
      * Connect to the specified port. If called when the socket is
      * already connected, it disconnects and connects again.
      *
-     * @param string  $addr       IP address or host name (may be with 
protocol prefix).
-     * @param integer $port       TCP port number.
+     * @param string $addr IP address or host name (may be with protocol 
prefix).
+     * @param integer $port TCP port number.
      * @param boolean $persistent (optional) Whether the connection is
      *                            persistent (kept open between requests
      *                            by the web server).
-     * @param integer $timeout    (optional) Connection socket timeout.
-     * @param array   $options    See options for stream_context_create.
+     * @param integer $timeout (optional) Connection socket timeout.
+     * @param array $options See options for stream_context_create.
      *
      * @access public
      *
      * @return boolean|PEAR_Error  True on success or a PEAR_Error on failure.
      */
-    function connect($addr, $port = 0, $persistent = null,
-                     $timeout = null, $options = null)
-    {
+    public function connect(
+        $addr,
+        $port = 0,
+        $persistent = null,
+        $timeout = null,
+        $options = null
+    ) {
         if (is_resource($this->fp)) {
             @fclose($this->fp);
             $this->fp = null;
@@ -121,10 +125,12 @@
 
         if (!$addr) {
             return $this->raiseError('$addr cannot be empty');
-        } else if (strspn($addr, ':.0123456789') == strlen($addr)) {
-            $this->addr = strpos($addr, ':') !== false ? '['.$addr.']' : $addr;
         } else {
-            $this->addr = $addr;
+            if (strspn($addr, ':.0123456789') === strlen($addr)) {
+                $this->addr = strpos($addr, ':') !== false ? '[' . $addr . ']' 
: $addr;
+            } else {
+                $this->addr = $addr;
+            }
         }
 
         $this->port = $port % 65536;
@@ -134,8 +140,8 @@
         }
 
         $openfunc = $this->persistent ? 'pfsockopen' : 'fsockopen';
-        $errno    = 0;
-        $errstr   = '';
+        $errno = 0;
+        $errstr = '';
 
         $old_track_errors = @ini_set('track_errors', 1);
 
@@ -155,27 +161,29 @@
                 }
 
                 $addr = $this->addr . ':' . $this->port;
-                $fp   = stream_socket_client($addr, $errno, $errstr,
-                                             $timeout, $flags, $context);
+                $fp = @stream_socket_client($addr, $errno, $errstr,
+                    $timeout, $flags, $context);
             } else {
                 $fp = @$openfunc($this->addr, $this->port, $errno,
-                                 $errstr, $timeout, $context);
+                    $errstr, $timeout, $context);
             }
         } else {
             $fp = @$openfunc($this->addr, $this->port, $errno, $errstr, 
$timeout);
         }
 
         if (!$fp) {
-            if ($errno == 0 && !strlen($errstr) && isset($php_errormsg)) {
+            if ($errno === 0 && !strlen($errstr) && isset($php_errormsg)) {
                 $errstr = $php_errormsg;
             }
             @ini_set('track_errors', $old_track_errors);
+
             return $this->raiseError($errstr, $errno);
         }
 
         @ini_set('track_errors', $old_track_errors);
         $this->fp = $fp;
         $this->setTimeout();
+
         return $this->setBlocking($this->blocking);
     }
 
@@ -185,7 +193,7 @@
      * @access public
      * @return mixed true on success or a PEAR_Error instance otherwise
      */
-    function disconnect()
+    public function disconnect()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
@@ -193,18 +201,20 @@
 
         @fclose($this->fp);
         $this->fp = null;
+
         return true;
     }
 
     /**
      * Set the newline character/sequence to use.
      *
-     * @param string $newline  Newline character(s)
+     * @param string $newline Newline character(s)
      * @return boolean True
      */
-    function setNewline($newline)
+    public function setNewline($newline)
     {
         $this->newline = $newline;
+
         return true;
     }
 
@@ -214,7 +224,7 @@
      * @access public
      * @return boolean  The current blocking mode.
      */
-    function isBlocking()
+    public function isBlocking()
     {
         return $this->blocking;
     }
@@ -230,7 +240,7 @@
      * @access public
      * @return mixed true on success or a PEAR_Error instance otherwise
      */
-    function setBlocking($mode)
+    public function setBlocking($mode)
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
@@ -238,6 +248,7 @@
 
         $this->blocking = $mode;
         stream_set_blocking($this->fp, (int)$this->blocking);
+
         return true;
     }
 
@@ -245,30 +256,29 @@
      * Sets the timeout value on socket descriptor,
      * expressed in the sum of seconds and microseconds
      *
-     * @param integer $seconds      Seconds.
+     * @param integer $seconds Seconds.
      * @param integer $microseconds Microseconds, optional.
      *
      * @access public
      * @return mixed True on success or false on failure or
      *               a PEAR_Error instance when not connected
      */
-    function setTimeout($seconds = null, $microseconds = null)
+    public function setTimeout($seconds = null, $microseconds = null)
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
         if ($seconds === null && $microseconds === null) {
-            $seconds      = (int) $this->timeout;
-            $microseconds = (int) (($this->timeout - $seconds) * 1000000);
+            $seconds = (int)$this->timeout;
+            $microseconds = (int)(($this->timeout - $seconds) * 1000000);
         } else {
-            $this->timeout = $seconds + $microseconds/1000000;
+            $this->timeout = $seconds + $microseconds / 1000000;
         }
 
         if ($this->timeout > 0) {
-            return stream_set_timeout($this->fp, (int) $seconds, (int) 
$microseconds);
-        }
-        else {
+            return stream_set_timeout($this->fp, (int)$seconds, 
(int)$microseconds);
+        } else {
             return false;
         }
     }
@@ -282,16 +292,17 @@
      * @access public
      * @return mixed on success or an PEAR_Error object otherwise
      */
-    function setWriteBuffer($size)
+    public function setWriteBuffer($size)
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
         $returned = stream_set_write_buffer($this->fp, $size);
-        if ($returned == 0) {
+        if ($returned === 0) {
             return true;
         }
+
         return $this->raiseError('Cannot set write buffer.');
     }
 
@@ -310,7 +321,7 @@
      * @return mixed Array containing information about existing socket
      *               resource or a PEAR_Error instance otherwise
      */
-    function getStatus()
+    public function getStatus()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
@@ -331,13 +342,13 @@
      * @return mixed $size bytes of data from the socket, or a PEAR_Error if
      *         not connected. If an error occurs, FALSE is returned.
      */
-    function gets($size = null)
+    public function gets($size = null)
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
-        if (is_null($size)) {
+        if (null === $size) {
             return @fgets($this->fp);
         } else {
             return @fgets($this->fp, $size);
@@ -353,10 +364,10 @@
      * @param integer $size The number of bytes to read from the socket.
      *
      * @access public
-     * @return $size bytes of data from the socket, or a PEAR_Error if
+     * @return string $size bytes of data from the socket, or a PEAR_Error if
      *         not connected.
      */
-    function read($size)
+    public function read($size)
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
@@ -368,7 +379,7 @@
     /**
      * Write a specified amount of data.
      *
-     * @param string  $data      Data to write.
+     * @param string $data Data to write.
      * @param integer $blocksize Amount of data to write at once.
      *                           NULL means all at once.
      *
@@ -379,17 +390,17 @@
      *               If the write fails, returns false.
      *               If the socket times out, returns an instance of 
PEAR_Error.
      */
-    function write($data, $blocksize = null)
+    public function write($data, $blocksize = null)
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
-        if (is_null($blocksize) && !OS_WINDOWS) {
+        if (null === $blocksize && !OS_WINDOWS) {
             $written = @fwrite($this->fp, $data);
 
             // Check for timeout or lost connection
-            if (!$written) {
+            if ($written === false) {
                 $meta_data = $this->getStatus();
 
                 if (!is_array($meta_data)) {
@@ -403,17 +414,17 @@
 
             return $written;
         } else {
-            if (is_null($blocksize)) {
+            if (null === $blocksize) {
                 $blocksize = 1024;
             }
 
-            $pos  = 0;
+            $pos = 0;
             $size = strlen($data);
             while ($pos < $size) {
                 $written = @fwrite($this->fp, substr($data, $pos, $blocksize));
 
                 // Check for timeout or lost connection
-                if (!$written) {
+                if ($written === false) {
                     $meta_data = $this->getStatus();
 
                     if (!is_array($meta_data)) {
@@ -442,7 +453,7 @@
      * @access public
      * @return mixed fwrite() result, or PEAR_Error when not connected
      */
-    function writeLine($data)
+    public function writeLine($data)
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
@@ -459,7 +470,7 @@
      * @access public
      * @return bool
      */
-    function eof()
+    public function eof()
     {
         return (!is_resource($this->fp) || feof($this->fp));
     }
@@ -468,10 +479,10 @@
      * Reads a byte of data
      *
      * @access public
-     * @return 1 byte of data from the socket, or a PEAR_Error if
+     * @return integer 1 byte of data from the socket, or a PEAR_Error if
      *         not connected.
      */
-    function readByte()
+    public function readByte()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
@@ -484,16 +495,17 @@
      * Reads a word of data
      *
      * @access public
-     * @return 1 word of data from the socket, or a PEAR_Error if
+     * @return integer 1 word of data from the socket, or a PEAR_Error if
      *         not connected.
      */
-    function readWord()
+    public function readWord()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
         $buf = @fread($this->fp, 2);
+
         return (ord($buf[0]) + (ord($buf[1]) << 8));
     }
 
@@ -504,15 +516,16 @@
      * @return integer  1 int of data from the socket, or a PEAR_Error if
      *                  not connected.
      */
-    function readInt()
+    public function readInt()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
         $buf = @fread($this->fp, 4);
+
         return (ord($buf[0]) + (ord($buf[1]) << 8) +
-                (ord($buf[2]) << 16) + (ord($buf[3]) << 24));
+            (ord($buf[2]) << 16) + (ord($buf[3]) << 24));
     }
 
     /**
@@ -522,16 +535,17 @@
      * @return string, or a PEAR_Error if
      *         not connected.
      */
-    function readString()
+    public function readString()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
         $string = '';
-        while (($char = @fread($this->fp, 1)) != "\x00") {
+        while (($char = @fread($this->fp, 1)) !== "\x00") {
             $string .= $char;
         }
+
         return $string;
     }
 
@@ -539,18 +553,19 @@
      * Reads an IP Address and returns it in a dot formatted string
      *
      * @access public
-     * @return Dot formatted string, or a PEAR_Error if
+     * @return string Dot formatted string, or a PEAR_Error if
      *         not connected.
      */
-    function readIPAddress()
+    public function readIPAddress()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
         $buf = @fread($this->fp, 4);
+
         return sprintf('%d.%d.%d.%d', ord($buf[0]), ord($buf[1]),
-                       ord($buf[2]), ord($buf[3]));
+            ord($buf[2]), ord($buf[3]));
     }
 
     /**
@@ -558,11 +573,11 @@
      * comes first. Strips the trailing newline from the returned data.
      *
      * @access public
-     * @return All available data up to a newline, without that
+     * @return string All available data up to a newline, without that
      *         newline, or until the end of the socket, or a PEAR_Error if
      *         not connected.
      */
-    function readLine()
+    public function readLine()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
@@ -578,6 +593,7 @@
                 return rtrim($line, $this->newline);
             }
         }
+
         return $line;
     }
 
@@ -594,16 +610,19 @@
      * @return string  All data until the socket closes, or a PEAR_Error if
      *                 not connected.
      */
-    function readAll()
+    public function readAll()
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
         $data = '';
-        while (!feof($this->fp)) {
+        $timeout = time() + $this->timeout;
+
+        while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) {
             $data .= @fread($this->fp, $this->lineLength);
         }
+
         return $data;
     }
 
@@ -611,22 +630,22 @@
      * Runs the equivalent of the select() system call on the socket
      * with a timeout specified by tv_sec and tv_usec.
      *
-     * @param integer $state   Which of read/write/error to check for.
-     * @param integer $tv_sec  Number of seconds for timeout.
+     * @param integer $state Which of read/write/error to check for.
+     * @param integer $tv_sec Number of seconds for timeout.
      * @param integer $tv_usec Number of microseconds for timeout.
      *
      * @access public
      * @return False if select fails, integer describing which of 
read/write/error
      *         are ready, or PEAR_Error if not connected.
      */
-    function select($state, $tv_sec, $tv_usec = 0)
+    public function select($state, $tv_sec, $tv_usec = 0)
     {
         if (!is_resource($this->fp)) {
             return $this->raiseError('not connected');
         }
 
-        $read   = null;
-        $write  = null;
+        $read = null;
+        $write = null;
         $except = null;
         if ($state & NET_SOCKET_READ) {
             $read[] = $this->fp;
@@ -638,7 +657,8 @@
             $except[] = $this->fp;
         }
         if (false === ($sr = stream_select($read, $write, $except,
-                                          $tv_sec, $tv_usec))) {
+                $tv_sec, $tv_usec))
+        ) {
             return false;
         }
 
@@ -652,15 +672,16 @@
         if (count($except)) {
             $result |= NET_SOCKET_ERROR;
         }
+
         return $result;
     }
 
     /**
      * Turns encryption on/off on a connected socket.
      *
-     * @param bool    $enabled Set this parameter to true to enable encryption
+     * @param bool $enabled Set this parameter to true to enable encryption
      *                         and false to disable encryption.
-     * @param integer $type    Type of encryption. See 
stream_socket_enable_crypto()
+     * @param integer $type Type of encryption. See 
stream_socket_enable_crypto()
      *                         for values.
      *
      * @see    
http://se.php.net/manual/en/function.stream-socket-enable-crypto.php
@@ -670,17 +691,19 @@
      *         A PEAR_Error object is returned if the socket is not
      *         connected
      */
-    function enableCrypto($enabled, $type)
+    public function enableCrypto($enabled, $type)
     {
-        if (version_compare(phpversion(), "5.1.0", ">=")) {
+        if (version_compare(phpversion(), '5.1.0', '>=')) {
             if (!is_resource($this->fp)) {
                 return $this->raiseError('not connected');
             }
+
             return @stream_socket_enable_crypto($this->fp, $enabled, $type);
         } else {
             $msg = 'Net_Socket::enableCrypto() requires php version >= 5.1.0';
+
             return $this->raiseError($msg);
         }
     }
 
-}
+}
\ No newline at end of file
diff --git a/pear/net_socket/README.md b/pear/net_socket/README.md
new file mode 100644
index 0000000..85616a1
--- /dev/null
+++ b/pear/net_socket/README.md
@@ -0,0 +1,41 @@
+# Net_Socket - RSS parser
+
+[![Build 
Status](https://travis-ci.org/pear/Net_Socket.svg?branch=master)](https://travis-ci.org/pear/Net_Socket)
+    
+
+Parser for Resource Description Framework (RDF)
+Site Summary (RSS) documents.
+
+[Homepage](http://pear.php.net/package/Net_Socket/)
+
+
+## Installation
+For a PEAR installation that downloads from the PEAR channel:
+
+`$ pear install pear/net_socket`
+
+For a PEAR installation from a previously downloaded tarball:
+
+`$ pear install Net_Socket-*.tgz`
+
+For a PEAR installation from a code clone:
+
+`$ pear install package.xml`
+
+For a local composer installation:
+
+`$ composer install`
+
+To add as a dependency to your composer-managed application:
+
+`$composer require pear/net_socket`
+
+
+## Tests
+Run  the tests from a local composer installation:
+
+`$ ./vendor/bin/phpunit`
+
+
+## License
+PHP license
diff --git a/pear/net_socket/composer.json b/pear/net_socket/composer.json
index 3fb0393..ed29daa 100644
--- a/pear/net_socket/composer.json
+++ b/pear/net_socket/composer.json
@@ -33,9 +33,10 @@
     },
     "type": "library",
     "require": {
-        "pear/pear_exception": "*"
+        "php": ">=5.4.0",
+        "pear/pear_exception": "@stable"
     },
     "require-dev": {
-        "phpunit/phpunit": "*"
+        "phpunit/phpunit": "^4"
     }
-}
\ No newline at end of file
+}
diff --git a/pear/net_socket/package.xml b/pear/net_socket/package.xml
index d9f4ab1..4801daf 100644
--- a/pear/net_socket/package.xml
+++ b/pear/net_socket/package.xml
@@ -11,7 +11,7 @@
   <name>Chuck Hagenbuch</name>
   <user>chagenbu</user>
   <email>[email protected]</email>
-  <active>yes</active>
+  <active>no</active>
  </lead>
  <lead>
   <name>Stig Bakken</name>
@@ -23,13 +23,12 @@
   <name>Aleksander Machniak</name>
   <user>alec</user>
   <email>[email protected]</email>
-  <active>yes</active>
+  <active>no</active>
  </lead>
- <date>2013-05-24</date>
- <time>20:00:00</time>
+ <date>2017-03-08</date>
  <version>
-  <release>1.0.14</release>
-  <api>1.0.10</api>
+  <release>1.1.0</release>
+  <api>1.1.0</api>
  </version>
  <stability>
   <release>stable</release>
@@ -37,23 +36,29 @@
  </stability>
  <license uri="http://www.php.net/license/2_02.txt";>PHP License</license>
  <notes>
-- Fix connecting when host is specified with protocol prefix e.g. ssl://
+* Set minimum PHP version to 5.4.0
+* Set minimum PEAR version to 1.10.1
+
+* Bug #18262: Incomplete buffer sent with fwrite after bugfix #14619
+* Bug #20113: package.xml does not validate
+* Bug #21031: Warning on connection error(stream_socket_client)
+* PR #7: Fix for "Maximum execution time of 30 seconds exceeded" error
+* PR #8: Make PHP5 compatible
  </notes>
  <contents>
   <dir baseinstalldir="/" name="/">
-   <file baseinstalldir="/" md5sum="057d5c52b2dd9cfb2a458d532d95cfbb" 
name="Net/Socket.php" role="php" />
+   <file baseinstalldir="/" name="Net/Socket.php" role="php" />
   </dir>
  </contents>
  <dependencies>
   <required>
    <php>
-    <min>4.3.0</min>
+    <min>5.4.0</min>
    </php>
    <pearinstaller>
-    <min>1.4.0b1</min>
+    <min>1.10.1</min>
    </pearinstaller>
   </required>
  </dependencies>
  <phprelease />
- <changelog />
 </package>
diff --git a/pear/net_socket/phpunit.xml.dist b/pear/net_socket/phpunit.xml.dist
new file mode 100644
index 0000000..8eaaa2f
--- /dev/null
+++ b/pear/net_socket/phpunit.xml.dist
@@ -0,0 +1,29 @@
+<phpunit bootstrap="vendor/autoload.php"
+         cacheTokens="false"
+         colors="true"
+         convertErrorsToExceptions="true"
+         convertNoticesToExceptions="true"
+         convertWarningsToExceptions="true"
+         stopOnError="false"
+         stopOnFailure="false"
+         stopOnIncomplete="false"
+         stopOnSkipped="false">
+
+    <testsuites>
+        <testsuite name="Test Suite">
+            <directory suffix=".php">tests/</directory>
+        </testsuite>
+    </testsuites>
+
+    <filter>
+        <whitelist>
+            <directory suffix=".php">Net/</directory>
+        </whitelist>
+    </filter>
+
+    <logging>
+        <log type="coverage-clover" target="build/logs/clover.xml"/>
+        <log type="coverage-html" target="build/coverage/"/>
+    </logging>
+
+</phpunit>

-- 
To view, visit https://gerrit.wikimedia.org/r/342028
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia2eadd2a35434702d1d748529b76765d6b7de03e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/vendor
Gerrit-Branch: master
Gerrit-Owner: Reedy <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to