Skip to content

Commit

Permalink
make catalog-api name computation more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
grant-g committed Feb 4, 2016
1 parent d872ed0 commit 3c41156
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions getItems.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ function RetrieveItems()
$application_json = json_decode($application, true);
$applicationName = $application_json["name"];
//echo "\r\napplicationName:" . $applicationName;
if (substr($applicationName, -3) === "-ui") { // if suffixed with "-ui", remove trailing "-ui"
$catalogAppName = substr($applicationName, 0, -3) . "-catalog-api";
} else {
$catalogAppName = $applicationName . "-catalog-api";
}
$catalogAppName = str_replace("ui-", "catalog-api-", $applicationName);
$catalogAppName = str_replace("-ui", "-catalog-api", $catalogAppName);
//echo "\r\ncatalogAppName:" . $catalogAppName;
$applicationURI = $application_json["application_uris"][0];
//echo "\r\napplicationURI:" . $applicationURI;
Expand Down

0 comments on commit 3c41156

Please sign in to comment.