Skip to content

Commit f94de3b

Browse files
authored
Merge pull request #299 from sowbiba/profiler-dot-client
Profiler dot client
2 parents 852f7f9 + 9dd2636 commit f94de3b

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
1515
### Fixed
1616

1717
- Fix deprecated notice when using symfony/config > 4.2
18+
- Profiler does not display stack when client name contains dots
1819

1920
## 1.13.1 - 2018-11-28
2021

Collector/Stack.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,4 +340,12 @@ public function setCurlCommand($curlCommand)
340340
{
341341
$this->curlCommand = $curlCommand;
342342
}
343+
344+
/**
345+
* @return string
346+
*/
347+
public function getClientSlug()
348+
{
349+
return preg_replace('/[^a-zA-Z0-9_-]/u', '_', $this->client);
350+
}
343351
}

Resources/views/stack.html.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="httplug-stack-header httplug-toggle" data-toggle="#httplug-{{ client }}-{{ id }}-details">
1+
<div class="httplug-stack-header httplug-toggle" data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-details">
22
<div>
33
{% if stack.failed %}
44
<span class="httplug-stack-failed">✘</span>
@@ -23,14 +23,14 @@
2323
{% endif %}
2424
</div>
2525
</div>
26-
<div id="httplug-{{ client }}-{{ id }}-details" class="httplug-hidden">
26+
<div id="httplug-{{ stack.clientSlug }}-{{ id }}-details" class="httplug-hidden">
2727
<div class="httplug-toolbar">
2828
<div class="httplug-copy-as-curl">
2929
<input readonly="readonly" type="text" value="{{ stack.curlCommand }}" />
3030
<button class="btn tooltip-toggle" aria-label="Copy to clipboard">Copy to clipboard</button>
3131
</div>
32-
<button data-toggle="#httplug-{{ client }}-{{ id }}-stack" class="httplug-toggle btn" >Toggle plugin stack</button>
33-
<button data-toggle="#httplug-{{ client }}-{{ id }}-details .httplug-http-body" class="httplug-toggle btn">Toggle body</button>
32+
<button data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-stack" class="httplug-toggle btn" >Toggle plugin stack</button>
33+
<button data-toggle="#httplug-{{ stack.clientSlug }}-{{ id }}-details .httplug-http-body" class="httplug-toggle btn">Toggle body</button>
3434
</div>
3535
<div class="httplug-messages">
3636
<div class="httplug-message card">
@@ -43,7 +43,7 @@
4343
</div>
4444
</div>
4545
{% if stack.profiles %}
46-
<div id="httplug-{{ client }}-{{ id }}-stack" class="httplug-hidden card">
46+
<div id="httplug-{{ stack.clientSlug }}-{{ id }}-stack" class="httplug-hidden card">
4747
{% for profile in stack.profiles %}
4848
<h3 class="httplug-plugin-name">{{ profile.plugin }}</h3>
4949
<div class="httplug-messages">

0 commit comments

Comments
 (0)