src/Client.php
public function makeOAuthCall(
		/*Token*/ $token, $url, $isPost = false, array $postFields = null
	) {
		// Figure out if there is a file in postFields
		$hasFile = false;
		if ( is_array( $postFields ) ) {
			foreach ( $postFields as $field ) {
				if ( is_a( $field, 'CurlFile' ) ) {
					$hasFile = true;
					break;
				}
			}
		}

		$params = [];
		// Get any params from the url
		if ( strpos( $url, '?' ) ) {
			$parsed = parse_url( $url );
			parse_str( $parsed['query'], $params );
		}
		$params += $this->extraParams;
		if ( $isPost && $postFields && !$hasFile ) {
			$params += $postFields;
		}
		$method = $isPost ? 'POST' : 'GET';
		$req = Request::fromConsumerAndToken(
			$this->config->consumer,
			$token,
			$method,
			$url,
			$params
		);
		$req->signRequest(
			new HmacSha1(),
			$this->config->consumer,
			$token
		);
		$this->lastNonce = $req->getParameter( 'oauth_nonce' );
		return $this->makeCurlCall(
			$url,
			$req->toHeader(),
			$isPost,
			$postFields,
			$hasFile
		);
	}
public function makeOAuthCall(
		/*Token*/ $token, $url, $isPost = false, array $postFields = null
	) {
		// Figure out if there is a file in postFields
		$hasFile = false;
		if ( is_array( $postFields ) ) {
			foreach ( $postFields as $field ) {
				if ( is_a( $field, 'CurlFile' ) ) {
					$hasFile = true;
					break;
				}
			}
		}

		$params = [];
		// Get any params from the url
		if ( strpos( $url, '?' ) ) {
			$parsed = parse_url( $url );
			parse_str( $parsed['query'], $params );
		}
		$params += $this->extraParams;
		if ( $isPost && $postFields && !$hasFile ) {
			$params += $postFields;
		}
		$method = $isPost ? 'POST' : 'GET';
		$req = Request::fromConsumerAndToken(
			$this->config->consumer,
			$token,
			$method,
			$url,
			$params
		);
		$req->signRequest(
			new HmacSha1(),
			$this->config->consumer,
			$token
		);
		$this->lastNonce = $req->getParameter( 'oauth_nonce' );
		return $this->makeCurlCall(
			$url,
			$req->toHeader(),
			$isPost,
			$postFields,
			$hasFile
		);
	}
public function makeOAuthCall ( /*Token*/ $ token , $ url , $ isPost = false , array $ postFields = null ) { // Figure out if there is a file in postFields $ hasFile = false ; if ( is_array ( $ postFields ) ) { foreach ( $ postFields as $ field ) { if ( is_a ( $ field , 'CurlFile' ) ) { $ hasFile = true ; break ; } } } $ params = [ ] ; // Get any params from the url if ( strpos ( $ url , '?' ) ) { $ parsed = parse_url ( $ url ) ; parse_str ( $ parsed [ 'query' ] , $ params ) ; } $ params += $ this -> extraParams ; if ( $ isPost && $ postFields && ! $ hasFile ) { $ params += $ postFields ; } $ method = $ isPost ? 'POST' : 'GET' ; $ req = Request :: fromConsumerAndToken ( $ this -> config -> consumer , $ token , $ method , $ url , $ params ) ; $ req -> signRequest ( new HmacSha1 ( ) , $ this -> config -> consumer , $ token ) ; $ this -> lastNonce = $ req -> getParameter ( 'oauth_nonce' ) ; return $ this -> makeCurlCall ( $ url , $ req -> toHeader ( ) , $ isPost , $ postFields , $ hasFile ) ; }
Make a signed request to MediaWiki

@param Token $token additional token to use in signature, besides
the consumer token. In most cases, this will be the access token you
got from complete(), but we set it to the request token when
finishing the handshake.
@param string $url URL to call
@param bool $isPost true if this should be a POST request
@param array|null $postFields POST parameters, only if $isPost is also true
@return string Body from the curl request
@throws Exception On curl failure
Make a signed request to MediaWiki