PHP 클래스 Pantheon\Terminus\Request\Request

Handles requests made by Terminus This is simply a class to manage the interactions between Terminus and Guzzle (the HTTP library Terminus uses). This class should eventually evolve to manage all requests to external resources such. Eventually we could even log requests in debug mode.
상속: implements Robo\Contract\ConfigAwareInterface, implements Pantheon\Terminus\Session\SessionAwareInterface, implements Psr\Log\LoggerAwareInterface, use trait Psr\Log\LoggerAwareTrait, use trait Robo\Common\ConfigAwareTrait, use trait Pantheon\Terminus\Session\SessionAwareTrait
파일 보기 프로젝트 열기: pantheon-systems/terminus 1 사용 예제들

공개 메소드들

메소드 설명
download ( string $url, string $target ) : boolean Download file from target URL
pagedRequest ( string $path, array $options = [] ) : array Make a request to the Dashbord's internal API
request ( string $path, array $arg_options = [] ) : array Simplified request method for Pantheon API

비공개 메소드들

메소드 설명
fillCookieJar ( array $params ) : GuzzleHttp\Cookie\CookieJar Sets up and fills a cookie jar
getBaseUri ( ) : string Parses the base URI for requests
send ( string $uri, string $method, array $arg_params = [] ) : Psr\Http\Message\ResponseInterface Sends a request to the API
userAgent ( ) : string Gives the user-agent string

메소드 상세

download() 공개 정적인 메소드

Download file from target URL
public static download ( string $url, string $target ) : boolean
$url string URL to download from
$target string Target file's name
리턴 boolean True if download succeeded

pagedRequest() 공개 메소드

Make a request to the Dashbord's internal API
public pagedRequest ( string $path, array $options = [] ) : array
$path string API path (URL)
$options array Options for the request [string] method GET is default [mixed] data Native PHP data structure (e.g. int, string array, or simple object) to be sent along with the request. Will be encoded as JSON for you.
리턴 array

request() 공개 메소드

Simplified request method for Pantheon API
public request ( string $path, array $arg_options = [] ) : array
$path string API path (URL)
$arg_options array Options for the request [string] method GET is default [mixed] data Native PHP data structure (e.g. int, string array, or simple object) to be sent along with the request. Will be encoded as JSON for you. [boolean] absolute_url True if URL passed is to be treated as absolute
리턴 array