Skip to content

Commit

Permalink
Update GetNewrelicCommand.php
Browse files Browse the repository at this point in the history
  • Loading branch information
fusionx1 authored Nov 30, 2017
1 parent 9935ddd commit b33bc33
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Commands/GetNewrelicCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public function org($org_id, $plan = null,
"Service level" => $site['service_level'],
"Framework" => $site['framework'],
"Site created" => $site['created'],
"PHP version" => $site['php_version'],
"Newrelic" => $nr_status,
"Dashboard URL" => $dash_link);

Expand Down Expand Up @@ -387,11 +388,11 @@ public function fetch_newrelic_info($api_key, $nr_id, $env_id)

$result = $this->CallAPI('GET', $url, $api_key, $data = false);
$obj_result = json_decode($result, true);

if(isset($obj_result['applications'])) {
foreach($obj_result['applications'] as $key => $val)
{
$isMatched = strstr($val['name'], '(' . $env_id . ')');
$isMatched = strstr(strtolower($val['name']), '(' . strtolower($env_id) . ')');
if($isMatched != "") {
$url = "https://api.newrelic.com/v2/applications/" . $val['id'] . ".json";
$myresult = $this->CallAPI('GET', $url, $api_key, $data = false);
Expand All @@ -401,4 +402,4 @@ public function fetch_newrelic_info($api_key, $nr_id, $env_id)
}
return false;
}
}
}

0 comments on commit b33bc33

Please sign in to comment.