patch to Net/URL.php to set port as CLI

From: Date: Fri, 08 Mar 2002 18:19:52 +0000
Subject: patch to Net/URL.php to set port as CLI
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-4941@lists.php.net to get a copy of this message
The logic in Net/URL.php to set the port to $HTTP_SERVER_VARS['SERVER_PORT'] if not specified otherwise has the effect of setting the port to 0 in a command-line environment when $HTTP_SERVER_VARS is not set. The getURL() method in Net_URL compensates for this, but if a Net_URL's host and port are passed to Net_Socket to open a connection (as in HTTP_Request), then Net_Socket will think that the port is 0 and the connection will fail. Attached to this message is a patch to Net/URL.php to set the default port to 80 if $HTTP_SERVER_VARS['SERVER_PORT'] is not set. -dave

« previous php.pear.dev (#4941) next »