Skip to content
This repository was archived by the owner on Mar 25, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

<service id="guzzle.plugin.log.array" class="%guzzle.plugin.log.class%" public="false">
<argument type="service" id="guzzle.plugin.log.array.adapter" />
<argument type="string">15</argument>
</service>

<service id="guzzle.plugin.log.array.adapter" class="%guzzle.plugin.log.array.adapter.class%" public="false">
Expand Down
Binary file added Resources/public/images/guzzle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/public/images/profiler/guzzle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 42 additions & 9 deletions Resources/views/Collector/guzzle.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,23 @@
{% block toolbar %}
{% if collector.countLogs %}
{% set icon %}
Guzzle
<img width="18" height="28" alt="Guzzle"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAcCAYAAABsxO8nAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9wJFA0kAmx9x5QAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAsRJREFUOMvdlL1vXUUQxc+ZXV/HJCSiQRRBdOHDEYVrR5Gf3vWHrMjPtHTQ5m9IRQtI/AE0NDS2sYSc5+cPCSwUKVKE5BRBKD1ShEgsEM593pmh2Wvte3kE6kxz9652f3PmzNwLvLLBdrGwsPAGyTkRaQAYACVZkUyDweDe/wJ1Op2eiGzFGEESIQSYGcwMAODup7u7u6/9J6jb7T6cmpq6XlXVdRG5TDK6u6rqM1X9xszmRGQ2pfRrVVX3qqr6dGNj4/gF0PLy8o/T09M3tre3OZ5pbW1tXVU3U0pz/X7/59XVVQ8hIMb44ebm5sP2nAAAyQsvUf02SZAc5vebqorhcHjc6/XeHQEBeK6qk2sn/zAzkEzZr5OU0klKCSml+yOglNJTd58IOjs7g6rC3U8BwMwigGMz+0VVL7fnIgCo6pOmabCysrKVWz/j7n8COBsOhx+TRIzxBAD6/f6DxcXF70h+nlLCOOiZmUFVeyTbks7bH2PEzs7OSXtpMBh80e12ZwB8NgIys6chBLg7Wq/cHdlkmBnquva8t7W3t/eRiNwv7Yj5kpsZRKQ0Ga26lBJIfk/yfQDrnU6n0zTNkxDCKKj8VEqYmSGEgJQSjo6ObuWv4CcAKyQPyk7HfPnvdqOUKyJQ1XNluYtBRC4AuFruS87srbHt8yXxG8lHAJpSfbu6KCIY96lVV8JJXnL3d0IId0miruvZc5CI/KuMcXgI4UqM8drh4eHvuaOzZWnPW0/GSyshOU4BXCwUflAq4qTs7g4RGW9AjDFWWd0PJN8rPZqZVJaIjMxTvvy6u7fz97W7r5dzdGmSNyGEF0DufiWEMJ3XjbtXpaLZcqJLv8wMMUbUdf1mVnQHwLW6rp3ktyLy6Hyi5+fnr4rIbRF5bGZ/5Z+YAJgRkbdCCGl/f//LNtnS0tJNVf3E3R8cHBx8hVc7/gEz5WHvMjpIQQAAAABJRU5ErkJggg=="/>
<span class="sf-toolbar-status{% if 10 < collector.countLogs %} sf-toolbar-status-yellow{% endif %}">{{ collector.countLogs }}</span>
{% endset %}
{% set text %}
<span title="{{ collector.countLogs }} messages">{{ collector.countLogs }}</span>
<div class="sf-toolbar-info-piece">
<b>HTTP Requests</b>
<span>{{ collector.countLogs }}</span>
</div>
{% endset %}
{% include 'WebProfilerBundle:Profiler:toolbar_item.html.twig' with { 'link': profiler_url } %}
{% endif %}
{% endblock %}

{% block menu %}
<span class="label">
<span class="icon">&nbsp;</span>
<span class="label">
<span class="icon"><img src="{{ asset('bundles/ddeboerguzzle/images/profiler/guzzle.png') }}" alt=""/></span>
<strong>Guzzle</strong>
<span class="count">
<span>{{ collector.countLogs }}</span>
Expand All @@ -23,20 +28,48 @@
{% endblock %}

{% block panel %}
<h2>Requests</h2>
<h2>HTTP requests</h2>

{% if not collector.countLogs %}
<p>
<em>No requests sent.</em>
</p>
{% else %}
<ul class="alt">
{% for i, log in collector.logs %}
<li class="{{ i is odd ? 'odd' : 'even' }}">
{% for i, log in collector.logs %}
<li class="{{ i is odd ? 'odd' : 'even' }} {% if log.extras.response.isError %}error{% endif %}">
<div>
<code>{{ log.message }}</code>
<a href="#" onclick="return explain(this);" style="text-decoration: none;" title="Explains" data-target-id="explain-{{ i }}">
<img alt="+" src="{{ asset('bundles/framework/images/blue_picto_more.gif') }}" style="display: inline;"/>
<img alt="-" src="{{ asset('bundles/framework/images/blue_picto_less.gif') }}" style="display: none;"/>
</a>
<code>{{ log.extras.request.method }} {{ log.extras.request.url }}</code>
</div>
<small>
<strong>Response</strong>: {{ log.extras.response.statusCode }} {{ log.extras.response.reasonPhrase }}
<br><strong>Time</strong>: {{ log.extras.response.getInfo('total_time')*1000 }} ms
{% if log.extras.response.getInfo('redirect_count') > 0 %}
<br><strong>Redirects:</strong> {{ log.extras.response.getInfo('redirect_count') }}
{% endif %}
</small>

<div id="explain-{{ i }}" style="display:none; padding-top: 1em;">
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">{{ log.message }}</pre>
</div>
</li>
{% endfor %}
{% endif %}
{% endblock %}

<script type="text/javascript">//<![CDATA[
function explain(link) {
"use strict";

var imgs = link.children,
target = link.getAttribute('data-target-id');

Sfjs.toggle(target, imgs[0], imgs[1]);

return false;
}
//]]></script>
{% endblock %}