HTTP_Request suggestion

From: Date: Thu, 26 Sep 2002 15:13:58 +0000
Subject: HTTP_Request suggestion
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-9541@lists.php.net to get a copy of this message
what do you think of passing a Net_URL object optionally to the HTTP_Request class, instead of the URL itself? So that HTTP_Request doesnt have to create an object itself in case it gets an Net_URL object passed? so instead of this, as it is now
    function HTTP_Request($url, $params = array())
    {
        $this->_url    =& new Net_URL($url);
        $this->_sock   =& new Net_Socket();
we could maybe have this:
    function HTTP_Request(&$url, $params = array())
    {
if( get_class($url) == 'Net_URL' )
	    $this->_url    = $url;
else
            $this->_url    =& new Net_URL($url);
        $this->_sock   =& new Net_Socket();
i know this would make it impossible to use something like:
    new HTTP_Request('pear.php.net');
since the parameter would have to be a reference ... ZE2 should solve this, i think. so we wouldnt need the reference anymore, right? maybe _not_ as a refernce is better, since HTTP_Request changes the data! -- Wolfram ... translating template engine .... http://sf.net/projects/simpletpl ... authentication system .... http://sf.net/projects/auth

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