Client
extends Client
in package
CNR API Client
Table of Contents
Properties
- $isOTE : bool
- is connected to OT&E
- $settings : array<string|int, mixed>
- registrar api settings
- $curlopts : array<string|int, string>
- additional curl options to use
- $debugMode : bool
- activity flag for debug mode
- $logger : LoggerInterface
- logger function name for debug mode
- $socketConfig : SocketConfig
- Object covering API connection data
- $socketURL : string
- API connection url
- $ua : string
- user agent
Methods
- __construct() : mixed
- Constructor
- disableDebugMode() : $this
- Disable Debug Output
- enableDebugMode() : $this
- Enable Debug Output to STDOUT
- getPOSTData() : string
- Serialize given command for POST request including connection configuration data
- getProxy() : string|null
- Get proxy configuration for API communication
- getReferer() : string|null
- Get Referer configuration for API communication
- getSession() : string|null
- Get the API Session ID that is currently set
- getURL() : string
- Get the API connection url that is currently set
- getUserAgent() : string
- Get the user agent string
- getVersion() : string
- Get the current module version
- IDNConvert() : array<string|int, mixed>
- Convert domain names to idn + punycode if necessary
- request() : Response
- Perform API request using the given command
- requestAllResponsePages() : array<string|int, Response>
- Request all pages/entries for the given query command
- requestNextResponsePage() : Response|null
- Request the next page of list entries for the current list query Useful for tables
- setCredentials() : $this
- Set Credentials to be used for API communication
- setCustomLogger() : $this
- set custom logger to use instead of default one create your own class implementing \CNIC\LoggerInterface
- setDefaultLogger() : $this
- set default logger to use
- setOTP() : $this
- Set one time password to be used for API communication
- setProxy() : $this
- Set proxy to use for API communication
- setReferer() : $this
- Set Referer to use for API communication
- setRemoteIPAddress() : $this
- Set an Remote IP Address to be used for API communication To be used in case you have an active ip filter setting.
- setRoleCredentials() : $this
- Set Credentials to be used for API communication
- setSession() : $this
- Set an API session id to be used for API communication
- setURL() : $this
- Set another connection url to be used for API communication
- setUserAgent() : $this
- Set a custom user agent (for platforms that use this SDK)
- setUserView() : $this
- Set a data view to a given subuser
- useHighPerformanceConnectionSetup() : $this
- Activate High Performance Setup
- useLIVESystem() : $this
- Set LIVE System for API communication (this is the default setting)
- useOTESystem() : $this
- Set OT&E System for API communication
- autoIDNConvert() : array<string|int, string>
- Auto convert API command parameters to punycode, if necessary.
- flattenCommand() : array<string|int, mixed>
- Flatten API command's nested arrays for easier handling
Properties
$isOTE
is connected to OT&E
public
bool
$isOTE
= false
$settings
registrar api settings
public
array<string|int, mixed>
$settings
$curlopts
additional curl options to use
protected
array<string|int, string>
$curlopts
= []
$debugMode
activity flag for debug mode
protected
bool
$debugMode
$logger
logger function name for debug mode
protected
LoggerInterface
$logger
$socketConfig
Object covering API connection data
protected
SocketConfig
$socketConfig
$socketURL
API connection url
protected
string
$socketURL
$ua
user agent
protected
string
$ua
Methods
__construct()
Constructor
public
__construct([string $path = "" ]) : mixed
Parameters
- $path : string = ""
-
Path to the configuration file
disableDebugMode()
Disable Debug Output
public
disableDebugMode() : $this
Return values
$thisenableDebugMode()
Enable Debug Output to STDOUT
public
enableDebugMode() : $this
Return values
$thisgetPOSTData()
Serialize given command for POST request including connection configuration data
public
getPOSTData(string|array<string, mixed> $cmd[, bool $secured = false ]) : string
Parameters
- $cmd : string|array<string, mixed>
-
API command to encode
- $secured : bool = false
-
secure password (when used for output)
Return values
string —encoded POST data string
getProxy()
Get proxy configuration for API communication
public
getProxy() : string|null
Return values
string|nullgetReferer()
Get Referer configuration for API communication
public
getReferer() : string|null
Return values
string|nullgetSession()
Get the API Session ID that is currently set
public
getSession() : string|null
Return values
string|null —API Session ID currently in use
getURL()
Get the API connection url that is currently set
public
getURL() : string
Return values
string —API connection url currently in use
getUserAgent()
Get the user agent string
public
getUserAgent() : string
Return values
string —user agent string
getVersion()
Get the current module version
public
getVersion() : string
Return values
string —module version
IDNConvert()
Convert domain names to idn + punycode if necessary
public
IDNConvert(array<string|int, string> $domains) : array<string|int, mixed>
Parameters
- $domains : array<string|int, string>
-
list of domain names (or tlds)
Return values
array<string|int, mixed>request()
Perform API request using the given command
public
request([array<string|int, mixed> $cmd = [] ]) : Response
Parameters
- $cmd : array<string|int, mixed> = []
-
API command to request
Return values
Response —Response
requestAllResponsePages()
Request all pages/entries for the given query command
public
requestAllResponsePages(array<string, mixed> $cmd) : array<string|int, Response>
Parameters
- $cmd : array<string, mixed>
-
API list command to use
Return values
array<string|int, Response> —Responses
requestNextResponsePage()
Request the next page of list entries for the current list query Useful for tables
public
requestNextResponsePage(Response $rr) : Response|null
Parameters
- $rr : Response
-
API Response of current page
Tags
Return values
Response|null —Response or null in case there are no further list entries
setCredentials()
Set Credentials to be used for API communication
public
setCredentials([string $uid = "" ][, string $pw = "" ]) : $this
Parameters
- $uid : string = ""
-
account name (optional, for reset)
- $pw : string = ""
-
account password (optional, for reset)
Return values
$thissetCustomLogger()
set custom logger to use instead of default one create your own class implementing \CNIC\LoggerInterface
public
setCustomLogger(LoggerInterface $customLogger) : $this
Parameters
- $customLogger : LoggerInterface
Return values
$thissetDefaultLogger()
set default logger to use
public
setDefaultLogger() : $this
Return values
$thissetOTP()
Set one time password to be used for API communication
public
setOTP([string $value = "" ]) : $this
Parameters
- $value : string = ""
-
one time password (optional, for reset)
Tags
Return values
$thissetProxy()
Set proxy to use for API communication
public
setProxy([string $proxy = "" ]) : $this
Parameters
- $proxy : string = ""
-
proxy to use (optional, for reset)
Return values
$thissetReferer()
Set Referer to use for API communication
public
setReferer([string $referer = "" ]) : $this
Parameters
- $referer : string = ""
-
Referer (optional, for reset)
Return values
$thissetRemoteIPAddress()
Set an Remote IP Address to be used for API communication To be used in case you have an active ip filter setting.
public
setRemoteIPAddress([string $value = "" ]) : $this
Parameters
- $value : string = ""
-
Remote IP Address (optional, for reset)
Tags
Return values
$thissetRoleCredentials()
Set Credentials to be used for API communication
public
setRoleCredentials([string $uid = "" ][, string $role = "" ][, string $pw = "" ]) : $this
Parameters
- $uid : string = ""
-
account name (optional, for reset)
- $role : string = ""
-
role user id (optional, for reset)
- $pw : string = ""
-
role user password (optional, for reset)
Return values
$thissetSession()
Set an API session id to be used for API communication
public
setSession([string $value = "" ]) : $this
Parameters
- $value : string = ""
-
API session id (optional, for reset)
Return values
$thissetURL()
Set another connection url to be used for API communication
public
setURL(string $value) : $this
Parameters
- $value : string
-
API connection url to set
Return values
$thissetUserAgent()
Set a custom user agent (for platforms that use this SDK)
public
setUserAgent(string $str, string $rv[, array<string|int, string> $modules = [] ]) : $this
Parameters
- $str : string
-
user agent label
- $rv : string
-
user agent revision
- $modules : array<string|int, string> = []
-
further modules to add to user agent string, format: ["
/ ", " / ", ... ]
Return values
$thissetUserView()
Set a data view to a given subuser
public
setUserView([string $uid = "" ]) : $this
Parameters
- $uid : string = ""
-
subuser account name
Return values
$thisuseHighPerformanceConnectionSetup()
Activate High Performance Setup
public
useHighPerformanceConnectionSetup() : $this
Return values
$thisuseLIVESystem()
Set LIVE System for API communication (this is the default setting)
public
useLIVESystem() : $this
Return values
$thisuseOTESystem()
Set OT&E System for API communication
public
useOTESystem() : $this
Return values
$thisautoIDNConvert()
Auto convert API command parameters to punycode, if necessary.
protected
autoIDNConvert(array<string|int, string> $cmd) : array<string|int, string>
Parameters
- $cmd : array<string|int, string>
-
API command
Return values
array<string|int, string>flattenCommand()
Flatten API command's nested arrays for easier handling
protected
flattenCommand(array<string|int, mixed> $cmd) : array<string|int, mixed>
Parameters
- $cmd : array<string|int, mixed>
-
API Command