Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Класс RestClient

Открытые члены

 getServiceHost ()
 
 clearAccessSettings ()
 

Открытые статические члены

static signLicenseRequest (array $request, $licenseKey)
 
static isServerAlive ()
 

Открытые атрибуты

const REST_URI = '/rest/'
 
const REGISTER_URI = '/oauth/register/'
 
const SCOPE = 'sale'
 
const SERVICE_ACCESS_OPTION = 'saleservices_access'
 
const ERROR_WRONG_INPUT = 1
 
const ERROR_WRONG_LICENSE = 2
 
const ERROR_SERVICE_UNAVAILABLE = 3
 
const ERROR_NOTHING_FOUND = 4
 
const UNSUCCESSFUL_CALL_OPTION = 'sale_hda_last_unsuccessful_call'
 
const UNSUCCESSFUL_CALL_TRYINGS = 3
 
const UNSUCCESSFUL_CALL_WAIT_INTERVAL = 300
 

Защищенные члены

 call ($methodName, $additionalParams=null, $licenseCheck=false, $clearAccessSettings=false)
 
 prepareAnswer ($result)
 
 register ()
 
 getLastUnSuccessCount ()
 

Защищенные статические члены

static setAccessSettings (array $params)
 
static getRedirectUri ()
 
static getLicenseHash ()
 
static getLicense ()
 
static getLastUnSuccessCallInfo ()
 
static setLastUnSuccessCallInfo ($reset=false)
 

Защищенные данные

 $httpTimeout = 5
 
 $streamTimeout = 10
 
 $accessSettings = null
 
 $serviceHost = 'https://saleservices.bitrix.info'
 
 $version = 5
 

Подробное описание

См. определение в файле restclient.php строка 19

Методы

◆ call()

call ( $methodName,
$additionalParams = null,
$licenseCheck = false,
$clearAccessSettings = false )
protected

Performs call to the REST method and returns decoded results of the call. define SALE_SRVS_RESTCLIENT_DISABLE_SRV_ALIVE_CHECK to disable server alive checking.

Аргументы
string$methodNameName of the REST method.
array$additionalParamsParameters, that should be passed to the method.
bool$licenseCheckShould client send license key as a parameter of the http request.
bool$clearAccessSettingsShould client clear authorization before performing http request.
Возвращает
Result $result

См. определение в файле restclient.php строка 51

◆ clearAccessSettings()

clearAccessSettings ( )

Drops current stored access credentials.

Возвращает
void

См. определение в файле restclient.php строка 295

◆ getLastUnSuccessCallInfo()

static getLastUnSuccessCallInfo ( )
staticprotected

См. определение в файле restclient.php строка 328

◆ getLastUnSuccessCount()

getLastUnSuccessCount ( )
protected
Возвращает
int Counts

См. определение в файле restclient.php строка 390

◆ getLicense()

static getLicense ( )
staticprotected

См. определение в файле restclient.php строка 323

◆ getLicenseHash()

static getLicenseHash ( )
staticprotected

Returns md5 hash of the license key.

Возвращает
string md5 hash of the license key.

См. определение в файле restclient.php строка 318

◆ getRedirectUri()

static getRedirectUri ( )
staticprotected

Internal method for usage in registration process.

Возвращает
string URL of the host.

См. определение в файле restclient.php строка 304

◆ getServiceHost()

getServiceHost ( )
Возвращает
string Host. Define const SALE_SRVS_RESTCLIENT_SRV_HOST to change server host.

См. определение в файле restclient.php строка 164

◆ isServerAlive()

static isServerAlive ( )
static

Check if server is alive.

Возвращает
bool

См. определение в файле restclient.php строка 371

◆ prepareAnswer()

prepareAnswer ( $result)
protected

Decodes answer of the method.

Аргументы
string$resultJson-encoded answer.
Возвращает
array|bool|mixed|string Decoded answer.

См. определение в файле restclient.php строка 179

◆ register()

register ( )
protected

Registers client on the properties service.

Возвращает
Result

См. определение в файле restclient.php строка 188

◆ setAccessSettings()

static setAccessSettings ( array $params)
staticprotected

Stores access credentials.

Аргументы
array$paramsAccess credentials.
Возвращает
void

См. определение в файле restclient.php строка 253

◆ setLastUnSuccessCallInfo()

static setLastUnSuccessCallInfo ( $reset = false)
staticprotected
Аргументы
bool | false$reset

См. определение в файле restclient.php строка 341

◆ signLicenseRequest()

static signLicenseRequest ( array $request,
$licenseKey )
static

См. определение в файле restclient.php строка 230

Данные класса

◆ $accessSettings

$accessSettings = null
protected

См. определение в файле restclient.php строка 37

◆ $httpTimeout

$httpTimeout = 5
protected

См. определение в файле restclient.php строка 35

◆ $serviceHost

$serviceHost = 'https://saleservices.bitrix.info'
protected

См. определение в файле restclient.php строка 38

◆ $streamTimeout

$streamTimeout = 10
protected

См. определение в файле restclient.php строка 36

◆ $version

$version = 5
protected

См. определение в файле restclient.php строка 40

◆ ERROR_NOTHING_FOUND

const ERROR_NOTHING_FOUND = 4

См. определение в файле restclient.php строка 29

◆ ERROR_SERVICE_UNAVAILABLE

const ERROR_SERVICE_UNAVAILABLE = 3

См. определение в файле restclient.php строка 28

◆ ERROR_WRONG_INPUT

const ERROR_WRONG_INPUT = 1

См. определение в файле restclient.php строка 26

◆ ERROR_WRONG_LICENSE

const ERROR_WRONG_LICENSE = 2

См. определение в файле restclient.php строка 27

◆ REGISTER_URI

const REGISTER_URI = '/oauth/register/'

См. определение в файле restclient.php строка 22

◆ REST_URI

const REST_URI = '/rest/'

См. определение в файле restclient.php строка 21

◆ SCOPE

const SCOPE = 'sale'

См. определение в файле restclient.php строка 23

◆ SERVICE_ACCESS_OPTION

const SERVICE_ACCESS_OPTION = 'saleservices_access'

См. определение в файле restclient.php строка 24

◆ UNSUCCESSFUL_CALL_OPTION

const UNSUCCESSFUL_CALL_OPTION = 'sale_hda_last_unsuccessful_call'

См. определение в файле restclient.php строка 31

◆ UNSUCCESSFUL_CALL_TRYINGS

const UNSUCCESSFUL_CALL_TRYINGS = 3

См. определение в файле restclient.php строка 32

◆ UNSUCCESSFUL_CALL_WAIT_INTERVAL

const UNSUCCESSFUL_CALL_WAIT_INTERVAL = 300

См. определение в файле restclient.php строка 33