function shrinktheweb_getAccountInfo in ShrinkTheWeb 8
Same name and namespace in other branches
- 6 shrinktheweb.api.inc \shrinktheweb_getAccountInfo()
- 7 shrinktheweb.api.inc \shrinktheweb_getAccountInfo()
Get Account Info and return it as array.
Parameters
array|mixed|null $accessKey:
array|mixed|null $secretKey:
Return value
mixed
2 calls to shrinktheweb_getAccountInfo()
- ShrinkTheWebSettingsForm::buildForm in src/
Form/ ShrinkTheWebSettingsForm.php - Form constructor.
- ShrinkTheWebSettingsForm::validateForm in src/
Form/ ShrinkTheWebSettingsForm.php - Form validation handler.
File
- ./
shrinktheweb.api.inc, line 862
Code
function shrinktheweb_getAccountInfo($accessKey = ACCESS_KEY, $secretKey = SECRET_KEY) {
$aArgs['stwaccesskeyid'] = $accessKey;
$aArgs['stwu'] = $secretKey;
$sRequestUrl = PROTOCOL . 'images.shrinktheweb.com/account.php';
$sRemoteData = shrinktheweb_fileGetContent($sRequestUrl, $aArgs);
// Check if we get no response or the maintenance string.
if ($sRemoteData == '' || $sRemoteData == 'offline') {
$aImage = array(
'stw_status' => 'no_response',
);
if ($sRemoteData != '') {
$aImage['message'] = MAINTENANCE;
}
}
else {
$aResponse = shrinktheweb_getAccXMLResponse($sRemoteData);
}
return $aResponse;
}