PHP 클래스 PEAR_REST

저자: Greg Beaver ([email protected])
파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$_options
$config

공개 메소드들

메소드 설명
PEAR_REST ( &$config, $options = [] )
downloadHttp ( string $url, false | string | array $lastmodified = null, false | array $accept = false, $channel = false ) : string | array Efficiently Download a file through HTTP. Returns downloaded file as a string in-memory This is best used for small files
getCache ( $url )
getCacheId ( $url )
retrieveCacheFirst ( $url, $accept = false, $forcestring = false, $channel = false ) : string | array Retrieve REST data, but always retrieve the local cache if it is available.
retrieveData ( $url, $accept = false, $forcestring = false, $channel = false ) : string | array Retrieve a remote REST resource
saveCache ( $url, $contents, $lastmodified, $nochange = false, $cacheid = null )
saveCacheFile ( $file, $contents )
useLocalCache ( $url, $cacheid = null )

메소드 상세

PEAR_REST() 공개 메소드

public PEAR_REST ( &$config, $options = [] )

downloadHttp() 공개 메소드

If an HTTP proxy has been configured (http_proxy PEAR_Config setting), the proxy will be used.
public downloadHttp ( string $url, false | string | array $lastmodified = null, false | array $accept = false, $channel = false ) : string | array
$url string the URL to download
$lastmodified false | string | array header values to check against for caching use false to return the header values from this download
$accept false | array Accept headers to send
리턴 string | array Returns the contents of the downloaded file or a PEAR error on failure. If the error is caused by socket-related errors, the error object will have the fsockopen error code available through getCode(). If caching is requested, then return the header values.

getCache() 공개 메소드

public getCache ( $url )

getCacheId() 공개 메소드

public getCacheId ( $url )

retrieveCacheFirst() 공개 메소드

This is useful for elements that should never change, such as information on a particular release
public retrieveCacheFirst ( $url, $accept = false, $forcestring = false, $channel = false ) : string | array
리턴 string | array

retrieveData() 공개 메소드

Retrieve a remote REST resource
public retrieveData ( $url, $accept = false, $forcestring = false, $channel = false ) : string | array
리턴 string | array

saveCache() 공개 메소드

public saveCache ( $url, $contents, $lastmodified, $nochange = false, $cacheid = null )

saveCacheFile() 공개 메소드

public saveCacheFile ( $file, $contents )

useLocalCache() 공개 메소드

public useLocalCache ( $url, $cacheid = null )

프로퍼티 상세

$_options 공개적으로 프로퍼티

public $_options

$config 공개적으로 프로퍼티

public $config