src/MultiCurlManager.php
protected function hydrateCurlFromRequest(Request $request, Curl $curl)
    {
        $curl->setOption(CURLOPT_CUSTOMREQUEST, $request->getMethod())
             ->setOption(CURLOPT_URL, $request->getUrl())
             ->setOption(CURLOPT_RETURNTRANSFER, true)
             ->setOption(CURLOPT_HEADER, true)
             ->setOption(CURLOPT_FOLLOWLOCATION, true)
             ->setOption(CURLOPT_HTTPHEADER, $this->prepareRequestHeader($request->getHeader()));

        if (strlen($request->getRequestData()) > 0) {
            $curl->setOption(CURLOPT_POSTFIELDS, $request->getRequestData());
        }
        if ($request->getTimeout() > 0) {
            $curl->setOption(CURLOPT_TIMEOUT, $request->getTimeout());
        }
        if ($request->getBasicAuthUsername() && $request->getBasicAuthPassword()) {
            $credentials = $request->getBasicAuthUsername() . ':' . $request->getBasicAuthPassword();
            $curl->setOption(CURLOPT_USERPWD, $credentials);
        }
        return $this;
    }
protected function hydrateCurlFromRequest(Request $request, Curl $curl)
    {
        $curl->setOption(CURLOPT_CUSTOMREQUEST, $request->getMethod())
             ->setOption(CURLOPT_URL, $request->getUrl())
             ->setOption(CURLOPT_RETURNTRANSFER, true)
             ->setOption(CURLOPT_HEADER, true)
             ->setOption(CURLOPT_FOLLOWLOCATION, true)
             ->setOption(CURLOPT_HTTPHEADER, $this->prepareRequestHeader($request->getHeader()));

        if (strlen($request->getRequestData()) > 0) {
            $curl->setOption(CURLOPT_POSTFIELDS, $request->getRequestData());
        }
        if ($request->getTimeout() > 0) {
            $curl->setOption(CURLOPT_TIMEOUT, $request->getTimeout());
        }
        if ($request->getBasicAuthUsername() && $request->getBasicAuthPassword()) {
            $credentials = $request->getBasicAuthUsername() . ':' . $request->getBasicAuthPassword();
            $curl->setOption(CURLOPT_USERPWD, $credentials);
        }
        return $this;
    }
protected function hydrateCurlFromRequest ( Request $ request , Curl $ curl ) { $ curl -> setOption ( CURLOPT_CUSTOMREQUEST , $ request -> getMethod ( ) ) -> setOption ( CURLOPT_URL , $ request -> getUrl ( ) ) -> setOption ( CURLOPT_RETURNTRANSFER , true ) -> setOption ( CURLOPT_HEADER , true ) -> setOption ( CURLOPT_FOLLOWLOCATION , true ) -> setOption ( CURLOPT_HTTPHEADER , $ this -> prepareRequestHeader ( $ request -> getHeader ( ) ) ) ; if ( strlen ( $ request -> getRequestData ( ) ) > 0 ) { $ curl -> setOption ( CURLOPT_POSTFIELDS , $ request -> getRequestData ( ) ) ; } if ( $ request -> getTimeout ( ) > 0 ) { $ curl -> setOption ( CURLOPT_TIMEOUT , $ request -> getTimeout ( ) ) ; } if ( $ request -> getBasicAuthUsername ( ) && $ request -> getBasicAuthPassword ( ) ) { $ credentials = $ request -> getBasicAuthUsername ( ) . ':' . $ request -> getBasicAuthPassword ( ) ; $ curl -> setOption ( CURLOPT_USERPWD , $ credentials ) ; } return $ this ; }
Hydrates the cURL instance with the data from the specified request.
@param Request $request
@param Curl $curl
@return $this Implementing fluent interface.
Hydrates the cURL instance with the data from the specified request .