protected function getClient($uri)
	{
		// TODO For some reason the Alfresco client goes into an infinite loop when returning
		// the children of an item (when you call getChildren on the company home)
		// it returns itself as its own child, unless you recreate the client. It seems
		// to maintain all the request body... or something weird.
		if (!$this->httpClient || !$this->maintainSession) {
			$this->httpClient = new Zend_Http_Client($uri, array(
	    			'maxredirects' => 0,
	    			'timeout'      => 10
				)
			);

			if ($this->useCookies) {
				$this->httpClient->setCookieJar();
			}
		} else {
			$this->httpClient->setUri($uri);
		}

		// clear it out
		if ($this->maintainSession) {
			$this->httpClient->resetParameters();
		}

		if ($this->authInfo) {
			$this->httpClient->setAuth($this->authInfo['user'], $this->authInfo['pass']);
		}

		return $this->httpClient;
	}
protected function getClient($uri)
	{
		// TODO For some reason the Alfresco client goes into an infinite loop when returning
		// the children of an item (when you call getChildren on the company home)
		// it returns itself as its own child, unless you recreate the client. It seems
		// to maintain all the request body... or something weird.
		if (!$this->httpClient || !$this->maintainSession) {
			$this->httpClient = new Zend_Http_Client($uri, array(
	    			'maxredirects' => 0,
	    			'timeout'      => 10
				)
			);

			if ($this->useCookies) {
				$this->httpClient->setCookieJar();
			}
		} else {
			$this->httpClient->setUri($uri);
		}

		// clear it out
		if ($this->maintainSession) {
			$this->httpClient->resetParameters();
		}

		if ($this->authInfo) {
			$this->httpClient->setAuth($this->authInfo['user'], $this->authInfo['pass']);
		}

		return $this->httpClient;
	}
protected function getClient ( $ uri ) { // TODO For some reason the Alfresco client goes into an infinite loop when returning // the children of an item (when you call getChildren on the company home) // it returns itself as its own child, unless you recreate the client. It seems // to maintain all the request body... or something weird. if ( ! $ this -> httpClient || ! $ this -> maintainSession ) { $ this -> httpClient = new Zend_Http_Client ( $ uri , array ( 'maxredirects' => 0 , 'timeout' => 10 ) ) ; if ( $ this -> useCookies ) { $ this -> httpClient -> setCookieJar ( ) ; } } else { $ this -> httpClient -> setUri ( $ uri ) ; } // clear it out if ( $ this -> maintainSession ) { $ this -> httpClient -> resetParameters ( ) ; } if ( $ this -> authInfo ) { $ this -> httpClient -> setAuth ( $ this -> authInfo [ 'user' ] , $ this -> authInfo [ 'pass' ] ) ; } return $ this -> httpClient ; }
Create and return the http client, defined in a separate method
for testing purposes

@return Zend_Http_Client
Create and return the http client defined in a separate method for testing purposes