src/Support/Web/WebRequest.php
/**
     * Returns an array of all options to use for the request.
     *
     * @param array $userOptions
     * @param string $method
     * @param callback $headerFunction
     * @return array
     */
Returns an array of all options to use for the request.
@param array $userOptions
@param string $method
@param callback $headerFunction
@return array
Returns an array of all options to use for the request . @param array $userOptions @param string $method @param callback $headerFunction @return array
protected function calculateOptions($userOptions, $method, $headerFunction) {
        $options = $this->getOptionsArray();
        $options[CURLOPT_CUSTOMREQUEST] = strtoupper($method);
        $options = array_replace($options, $userOptions);
        $options[CURLOPT_FOLLOWLOCATION] = false;
        if (isset($options[CURLOPT_HEADERFUNCTION])) {
            $this->customHeaderFunction = $options[CURLOPT_HEADERFUNCTION];
        }
        $options[CURLOPT_HEADERFUNCTION] = $headerFunction;
        if (!is_null($this->referer)) $options[CURLOPT_REFERER] = $this->referer;
        if (!is_null($this->userAgent)) $options[CURLOPT_USERAGENT] = $this->getUserAgent();
        return $options;
    }
protected function calculateOptions ( $ userOptions , $ method , $ headerFunction ) { $ options = $ this -> getOptionsArray ( ) ; $ options [ CURLOPT_CUSTOMREQUEST ] = strtoupper ( $ method ) ; $ options = array_replace ( $ options , $ userOptions ) ; $ options [ CURLOPT_FOLLOWLOCATION ] = false ; if ( isset ( $ options [ CURLOPT_HEADERFUNCTION ] ) ) { $ this -> customHeaderFunction = $ options [ CURLOPT_HEADERFUNCTION ] ; } $ options [ CURLOPT_HEADERFUNCTION ] = $ headerFunction ; if ( ! is_null ( $ this -> referer ) ) $ options [ CURLOPT_REFERER ] = $ this -> referer ; if ( ! is_null ( $ this -> userAgent ) ) $ options [ CURLOPT_USERAGENT ] = $ this -> getUserAgent ( ) ; return $ options ; }
Returns an array of all options to use for the request.
Returns an array of all options to use for the request .
// Add the request method // Add user options // Set the followlocation option to false, we'll do this manually to prevent errors // Record a custom header function // Get response headers // Referer // User agent