Skip to content

Commit

Permalink
Update to latest entry API
Browse files Browse the repository at this point in the history
  • Loading branch information
huwcbjones committed Jun 14, 2020
1 parent 9ab1975 commit fab740f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
12 changes: 7 additions & 5 deletions src/RankingsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class RankingsClient
{
private static $_user = "6719218280CF981A54BFE34E37074B7F";
private static $_pass = "2633963A462E2831B6D5F424B195D2DB";
private static $_pass = "D32FE6EDB994876894DC8CD625D3CE07";
public $_soap_client;
protected $_personal_key;
protected $_personal_key_member_number;
Expand Down Expand Up @@ -56,12 +56,11 @@ public function __construct($personal_key, $membership_number)
$this->_soap_client = new SoapClient(
null,
[
"location" => "https://www.swimmingresults.org/soap/BritSwimWebServ.php",
"uri" => "https://www.swimmingresults.org/soap",
"location" => "https://entriesapi.swimmingresults.org/v1/",
"uri" => "https://entriesapi.swimmingresults.org/v1/",
"trace" => 1
]
);
$this->_soap_client->wsdl = false;
$this->_checkConnection();
} catch (SoapFault $fault) {
throw new ConnectionException("Failed to connect to rankings DB - " . $fault->getMessage());
Expand Down Expand Up @@ -89,7 +88,10 @@ protected function _checkConnection()
try {
$this->getMemberDetails(-1);
} catch (SoapFault $fault) {
if (strpos($fault->getMessage(), "Invalid Personal Key") !== false || strpos($fault->getMessage(), "No Personal Key") !== false) {
if (
strpos($fault->getMessage(), "Invalid Personal Key") !== false
|| strpos($fault->getMessage(), "No Personal Key") !== false
) {
throw new InvalidPersonalKey("Invalid personal key");
}
} catch (MemberNotFound $exception) {
Expand Down
5 changes: 1 addition & 4 deletions src/SoapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ public function __doRequest($request, $location, $action, $version, $one_way = 0

protected function get_user_agent()
{
if ($this->wsdl) {
return "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
}
return "SOAP Toolkit 3.0";
return "Meet Organisation Rev 5.3 Web Services";
}

}

0 comments on commit fab740f

Please sign in to comment.