Skip to content

Commit

Permalink
update merging in OpenSRS#50
Browse files Browse the repository at this point in the history
  • Loading branch information
detain committed Jan 4, 2023
1 parent 5b52565 commit ad0b6eb
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions opensrs/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Base
* openSRS_base object constructor.
*
* Closes an existing socket connection, if we have one
*
*
* @since 3.1
*/
public function __construct()
Expand Down Expand Up @@ -80,7 +80,7 @@ private function _verifySystemProperties()
* @param string $request Raw XML request
*
* @return string $data Raw XML response
*
*
* @since 3.1
*/
public function send_cmd($request)
Expand All @@ -106,7 +106,7 @@ public function send_cmd($request)
* Method to initialize a socket connection to the OpenSRS server.
*
* @return bool True if connected
*
*
* @since 3.1
*/
private function init_socket()
Expand All @@ -126,7 +126,7 @@ private function init_socket()
* Method to check if a socket connection exists.
*
* @return bool True if connected
*
*
* @since 3.4
*/
public function is_connected()
Expand All @@ -136,7 +136,7 @@ public function is_connected()

/**
* Method to close the socket connection.
*
*
* @since 3.4
*/
private function close_socket()
Expand All @@ -148,7 +148,7 @@ private function close_socket()

/**
* Method to read data from the buffer stream.
*
*
* @return string XML response
*
* @since 3.1
Expand All @@ -171,7 +171,7 @@ private function read_data()

/**
* Method to send data.
*
*
* @param string $message XML request
*
* @return string $message XML response
Expand Down Expand Up @@ -264,11 +264,11 @@ private function readData(&$fh, $timeout = 5)
/* PHP doesn't have timeout for fread ... we just set the timeout for the socket */
socket_set_timeout($fh, $timeout);
$header = $this->readHeader($fh, $timeout);
if (!$header || !isset($header{'content-length'}) || (empty($header{'content-length'}))) {
if (!$header || !isset($header['content-length']) || (empty($header['content-length']))) {
throw new Exception('oSRS Error - UNEXPECTED ERROR: No Content-Length header provided! Please make sure IP is whitelisted in RWI.');
}

$len = (int) $header{'content-length'};
$len = (int) $header['content-length'];
$line = '';
while (strlen($line) < $len) {
$line .= fread($fh, $len);
Expand Down Expand Up @@ -302,13 +302,13 @@ public function convertArray2Formatted($type = '', $data = '')
}

/**
* Get configured tlds for domain call
* Will use (in order of preference)...
* 1. selected tlds
* 2. supplied default tlds
* Get configured tlds for domain call
* Will use (in order of preference)...
* 1. selected tlds
* 2. supplied default tlds
* 3. included default tlds.
*
* @return array tlds
*
* @return array tlds
*/
public function getConfiguredTlds()
{
Expand Down Expand Up @@ -345,7 +345,7 @@ public function setDataObject($format, $dataObject)

/**
* Does the dataObject have a domain set?
*
*
* @return bool
*/
public function hasDomain()
Expand Down

0 comments on commit ad0b6eb

Please sign in to comment.