PHP Class Synology_Abstract

显示文件 Open project: zzarbi/synology Class Usage Examples

Public Methods

Method Description
__construct ( string $serviceName, string $namespace, string $address, integer $port = null, string $protocol = self::PROTOCOL_HTTP, integer $version = 1, boolean $verifySSL = false ) Setup API
activateDebug ( ) : Synology_Abstract Activate the debug mode

Protected Methods

Method Description
_getBaseUrl ( ) : string Get the base URL
_request ( string $api, string $path, string $method, array $params = [], integer $version = null, string $httpMethod = 'get' ) : stdClass Process a request
log ( mixed $value, string $key = null ) Log different data

Private Methods

Method Description
_getApiName ( string $api ) Get ApiName
_parseRequest ( $json ) : stdClass

Method Details

__construct() public method

Setup API
public __construct ( string $serviceName, string $namespace, string $address, integer $port = null, string $protocol = self::PROTOCOL_HTTP, integer $version = 1, boolean $verifySSL = false )
$serviceName string
$namespace string
$address string
$port integer
$protocol string
$version integer
$verifySSL boolean

_getBaseUrl() protected method

Get the base URL
protected _getBaseUrl ( ) : string
return string

_request() protected method

Process a request
protected _request ( string $api, string $path, string $method, array $params = [], integer $version = null, string $httpMethod = 'get' ) : stdClass
$api string
$path string
$method string
$params array
$version integer
$httpMethod string
return stdClass array bool

activateDebug() public method

Activate the debug mode
public activateDebug ( ) : Synology_Abstract
return Synology_Abstract

log() protected method

Log different data
protected log ( mixed $value, string $key = null )
$value mixed
$key string