PHP 클래스 RestComponent, cakephp-rest-plugin

상속: extends Object
파일 보기 프로젝트 열기: kvz/cakephp-rest-plugin

공개 프로퍼티들

프로퍼티 타입 설명
$Controller
$codes
$isActive string Should the rest plugin be active?
$postData
$settings

보호된 프로퍼티들

프로퍼티 타입 설명
$_RestLog
$_View
$_aborting
$_credentials
$_feedback
$_logData

공개 메소드들

메소드 설명
RestLog ( ) : object Return an instance of the log model
View ( boolean $object = true, string $ext = null ) : mixed Returns either string or reference to active View object
__call ( string $name, array $arguments ) Catch & fire callbacks. You can map callbacks to different places using the value parts in $this->settings['callbacks'].
__construct ( ComponentCollection $collection, $settings = [] )
abort ( $params = [], $data = [] ) Could be called by e.g. ->redirect to dump an error & stop further execution.
beforeRedirect ( Controller $Controller, $url, $status = null, $exit = true )
beforeRender ( Controller $Controller ) : Collects viewVars, reformats, and makes them available as viewVar: response for use in REST serialization
controllers ( boolean $cached = true ) : array Returns a list of Controllers where Rest component has been activated uses Cache::read & Cache::write by default to tackle performance issues.
credentials ( $set = false ) : Sets or returns credentials as found in the 'Authorization' header sent by the client.
debug ( $format, $arg1 = null, $arg2 = null )
error ( $format, $arg1 = null, $arg2 = null )
getFeedBack ( boolean $format = false ) : array Returns (optionally) formatted feedback.
headers ( $ext = null ) : Set content-type headers based on extension
info ( $format, $arg1 = null, $arg2 = null )
initialize ( Controller $Controller )
inject ( array $take, array $viewVars ) : array Reformats data according to Xpaths in $take
isActive ( )
log ( mixed $key, mixed $val = null, $scope = null ) : boolean log(true) writes log to disk. otherwise stores key-value pairs in memory for later saving. Can also work recursively by giving an array as the key
numeric ( array $array = [] ) : boolean Determines is an array is numerically indexed
ratelimit ( $time, $max ) : Works together with Logging to ratelimit incomming requests by identfield
response ( array $data = [] ) : array Get an array of everything that needs to go into the Xml / Json
shutdown ( Controller $Controller ) Write the accumulated logentry
startup ( Controller $Controller ) : Controls layout & view files
validate ( $format, $arg1 = null, $arg2 = null )
warning ( $format, $arg1 = null, $arg2 = null )

보호된 메소드들

메소드 설명
_modelizePost ( &$data ) : Prepares REST data for cake interaction

메소드 상세

RestLog() 공개 메소드

Return an instance of the log model
public RestLog ( ) : object
리턴 object

View() 공개 메소드

Returns either string or reference to active View object
public View ( boolean $object = true, string $ext = null ) : mixed
$object boolean
$ext string
리턴 mixed object or string

__call() 공개 메소드

If the resolved callback is a string we assume it's in the controller.
public __call ( string $name, array $arguments )
$name string
$arguments array

__construct() 공개 메소드

public __construct ( ComponentCollection $collection, $settings = [] )
$collection ComponentCollection

_modelizePost() 보호된 메소드

Prepares REST data for cake interaction
protected _modelizePost ( &$data ) :
$data
리턴

abort() 공개 메소드

Could be called by e.g. ->redirect to dump an error & stop further execution.
public abort ( $params = [], $data = [] )
$params
$data

beforeRedirect() 공개 메소드

public beforeRedirect ( Controller $Controller, $url, $status = null, $exit = true )
$Controller Controller

beforeRender() 공개 메소드

Collects viewVars, reformats, and makes them available as viewVar: response for use in REST serialization
public beforeRender ( Controller $Controller ) :
$Controller Controller
리턴

controllers() 공개 메소드

Returns a list of Controllers where Rest component has been activated uses Cache::read & Cache::write by default to tackle performance issues.
public controllers ( boolean $cached = true ) : array
$cached boolean
리턴 array

credentials() 공개 메소드

Have your client set a header like: Authorization: TRUEREST username=john&password=xxx&apikey=247b5a2f72df375279573f2746686daa< http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?RESTAuthentication.html credentials(true) sets credentials credentials() returns full array credentials('username') returns username
public credentials ( $set = false ) :
리턴

debug() 공개 메소드

public debug ( $format, $arg1 = null, $arg2 = null )

error() 공개 메소드

public error ( $format, $arg1 = null, $arg2 = null )

getFeedBack() 공개 메소드

Returns (optionally) formatted feedback.
public getFeedBack ( boolean $format = false ) : array
$format boolean
리턴 array

headers() 공개 메소드

Set content-type headers based on extension
public headers ( $ext = null ) :
$ext
리턴

info() 공개 메소드

public info ( $format, $arg1 = null, $arg2 = null )

initialize() 공개 메소드

public initialize ( Controller $Controller )
$Controller Controller

inject() 공개 메소드

Reformats data according to Xpaths in $take
public inject ( array $take, array $viewVars ) : array
$take array
$viewVars array
리턴 array

isActive() 공개 메소드

public isActive ( )

log() 공개 메소드

log(true) writes log to disk. otherwise stores key-value pairs in memory for later saving. Can also work recursively by giving an array as the key
public log ( mixed $key, mixed $val = null, $scope = null ) : boolean
$key mixed
$val mixed
리턴 boolean

numeric() 공개 메소드

Determines is an array is numerically indexed
public numeric ( array $array = [] ) : boolean
$array array
리턴 boolean

ratelimit() 공개 메소드

Works together with Logging to ratelimit incomming requests by identfield
public ratelimit ( $time, $max ) :
리턴

response() 공개 메소드

Get an array of everything that needs to go into the Xml / Json
public response ( array $data = [] ) : array
$data array optional. Data collected by cake
리턴 array

shutdown() 공개 메소드

Write the accumulated logentry
public shutdown ( Controller $Controller )
$Controller Controller

startup() 공개 메소드

Controls layout & view files
public startup ( Controller $Controller ) :
$Controller Controller
리턴

validate() 공개 메소드

public validate ( $format, $arg1 = null, $arg2 = null )

warning() 공개 메소드

public warning ( $format, $arg1 = null, $arg2 = null )

프로퍼티 상세

$Controller 공개적으로 프로퍼티

public $Controller

$_RestLog 보호되어 있는 프로퍼티

protected $_RestLog

$_View 보호되어 있는 프로퍼티

protected $_View

$_aborting 보호되어 있는 프로퍼티

protected $_aborting

$_credentials 보호되어 있는 프로퍼티

protected $_credentials

$_feedback 보호되어 있는 프로퍼티

protected $_feedback

$_logData 보호되어 있는 프로퍼티

protected $_logData

$codes 공개적으로 프로퍼티

public $codes

$isActive 공개적으로 프로퍼티

Should the rest plugin be active?
public string $isActive
리턴 string

$postData 공개적으로 프로퍼티

public $postData

$settings 공개적으로 프로퍼티

public $settings