PHP Class Jacwright\RestServer\RestServer

Author: jacob
Show file Open project: jacwright/RestServer

Public Properties

Property Type Description
$cacheDir
$format
$jsonAssoc
$method
$mode
$params
$realm
$root
$rootPath
$url @todo add type hint

Protected Properties

Property Type Description
$cached
$errorClasses
$map

Public Methods

Method Description
__construct ( string $mode = 'debug', $realm = 'Rest Server' ) The constructor.
__destruct ( )
addClass ( $class, $basePath = '' )
addErrorClass ( $class )
getData ( )
getFormat ( )
getMethod ( )
getPath ( )
handle ( )
handleError ( $statusCode, $errorMessage = null )
refreshCache ( )
sendData ( $data )
setJsonAssoc ( $value )
setRootPath ( $path )
setStatus ( $code )
unauthorized ( $ask = false )

Protected Methods

Method Description
findUrl ( )
generateMap ( $class, $basePath )
loadCache ( )

Private Methods

Method Description
xml_encode ( $mixed, $domElement = null, $DOMDocument = null )

Method Details

__construct() public method

The constructor.
public __construct ( string $mode = 'debug', $realm = 'Rest Server' )
$mode string The mode, either debug or production

__destruct() public method

public __destruct ( )

addClass() public method

public addClass ( $class, $basePath = '' )

addErrorClass() public method

public addErrorClass ( $class )

findUrl() protected method

protected findUrl ( )

generateMap() protected method

protected generateMap ( $class, $basePath )

getData() public method

public getData ( )

getFormat() public method

public getFormat ( )

getMethod() public method

public getMethod ( )

getPath() public method

public getPath ( )

handle() public method

public handle ( )

handleError() public method

public handleError ( $statusCode, $errorMessage = null )

loadCache() protected method

protected loadCache ( )

refreshCache() public method

public refreshCache ( )

sendData() public method

public sendData ( $data )

setJsonAssoc() public method

public setJsonAssoc ( $value )

setRootPath() public method

public setRootPath ( $path )

setStatus() public method

public setStatus ( $code )

unauthorized() public method

public unauthorized ( $ask = false )

Property Details

$cacheDir public property

public $cacheDir

$cached protected property

protected $cached

$errorClasses protected property

protected $errorClasses

$format public property

public $format

$jsonAssoc public property

public $jsonAssoc

$map protected property

protected $map

$method public property

public $method

$mode public property

public $mode

$params public property

public $params

$realm public property

public $realm

$root public property

public $root

$rootPath public property

public $rootPath

$url public property

@todo add type hint
public $url