/app/cache/dev/twig/2f/13/e1f239fb9ff288c11658d2360d17.php
PHP | 813 lines | 608 code | 91 blank | 114 comment | 37 complexity | 828a9f7e0ffe7eacc81e063ed8b5c574 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-3.0, BSD-3-Clause, BSD-2-Clause
- <?php
- /* WebProfilerBundle:Collector:time.html.twig */
- class __TwigTemplate_2f13e1f239fb9ff288c11658d2360d17 extends Twig_Template
- {
- public function __construct(Twig_Environment $env)
- {
- parent::__construct($env);
- $this->parent = $this->env->loadTemplate("WebProfilerBundle:Profiler:layout.html.twig");
- $this->blocks = array(
- 'toolbar' => array($this, 'block_toolbar'),
- 'menu' => array($this, 'block_menu'),
- 'panel' => array($this, 'block_panel'),
- 'panelContent' => array($this, 'block_panelContent'),
- );
- }
- protected function doGetParent(array $context)
- {
- return "WebProfilerBundle:Profiler:layout.html.twig";
- }
- protected function doDisplay(array $context, array $blocks = array())
- {
- // line 3
- if ((!array_key_exists("colors", $context))) {
- // line 4
- $context["colors"] = array("default" => "#aacd4e", "section" => "#666", "event_listener" => "#3dd", "event_listener_loading" => "#add", "template" => "#dd3", "doctrine" => "#d3d", "propel" => "#f4d", "child_sections" => "#eed");
- }
- $this->parent->display($context, array_merge($this->blocks, $blocks));
- }
- // line 16
- public function block_toolbar($context, array $blocks = array())
- {
- // line 17
- echo " ";
- $context["total_time"] = ((twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "collector"), "events"))) ? (sprintf("%.0f ms", $this->getAttribute($this->getContext($context, "collector"), "totaltime"))) : ("n/a"));
- // line 18
- echo " ";
- ob_start();
- // line 19
- echo " <img width=\"16\" height=\"28\" alt=\"Time\" src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAcCAYAAABoMT8aAAABqUlEQVR42t2Vv0sCYRyHX9OmEhsMx/YKGlwLQ69DTEUSBJEQEy5J3FRc/BsuiFqEIIcQIRo6ysUhoaBBWhoaGoJwiMJLglRKrs8bXgienmkQdPDAwX2f57j3fhFJkkbiPwTK5bIiFoul3kmPud8MqKMewDXpwuGww+12n9hsNhFnlijYf/Z4PDmO45Yxo+10ZFGTyWRMEItU6AdCx7lczkgd6n7J2Wx2xm63P6jJMk6n80YQBBN1aUDv9XqvlAbbm2LE7/cLODRB0un0VveAeoDC8/waCQQC18MGQqHQOcEKvw8bcLlcL6TfYnVtCrGRAlartUUYhmn1jKg/E3USjUYfhw3E4/F7ks/nz4YNFIvFQ/ogbUYikdefyqlU6gnuOg2YK5XKvs/n+xhUDgaDTVEUt+HO04ABOBA5isViDTU5kUi81Wq1AzhWMEkDGmAEq2C3UCjcYXGauDvfEsuyUjKZbJRKpVvM8IABU9SVX+cxYABmwIE9cFqtVi9xtgvsC2AHbIAFoKey0gdlHEyDObAEWLACFsEsMALdIJ80+dK0bTS95v7+v/AJnis0eO906QwAAAAASUVORK5CYII=\"/>
- <span>";
- // line 20
- echo twig_escape_filter($this->env, $this->getContext($context, "total_time"), "html", null, true);
- echo "</span>
- ";
- $context["icon"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
- // line 22
- echo " ";
- ob_start();
- // line 23
- echo " <div class=\"sf-toolbar-info-piece\">
- <b>Total time</b>
- <span>";
- // line 25
- echo twig_escape_filter($this->env, $this->getContext($context, "total_time"), "html", null, true);
- echo "</span>
- </div>
- ";
- $context["text"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
- // line 28
- echo " ";
- $this->env->loadTemplate("WebProfilerBundle:Profiler:toolbar_item.html.twig")->display(array_merge($context, array("link" => $this->getContext($context, "profiler_url"))));
- }
- // line 31
- public function block_menu($context, array $blocks = array())
- {
- // line 32
- echo "<span class=\"label\">
- <span class=\"icon\"><img src=\"";
- // line 33
- echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/webprofiler/images/profiler/time.png"), "html", null, true);
- echo "\" alt=\"Timeline\" /></span>
- <strong>Timeline</strong>
- </span>
- ";
- }
- // line 38
- public function block_panel($context, array $blocks = array())
- {
- // line 39
- echo " <h2>Timeline</h2>
- ";
- // line 40
- if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "collector"), "events"))) {
- // line 41
- echo " ";
- $this->displayBlock("panelContent", $context, $blocks);
- echo "
- ";
- } else {
- // line 43
- echo " <p>
- <em>No timing events have been recorded. Are you sure that debugging is enabled in the kernel ?</em>
- </p>
- ";
- }
- }
- // line 49
- public function block_panelContent($context, array $blocks = array())
- {
- // line 50
- echo " <form id=\"timeline-control\" action=\"\" method=\"get\">
- <input type=\"hidden\" name=\"panel\" value=\"time\" />
- <table>
- <tr>
- <th style=\"width: 20%\">Total time</th>
- <td>";
- // line 55
- echo twig_escape_filter($this->env, sprintf("%.0f", $this->getAttribute($this->getContext($context, "collector"), "totaltime")), "html", null, true);
- echo " ms</td>
- </tr>
- <tr>
- <th>Initialization time</th>
- <td>";
- // line 59
- echo twig_escape_filter($this->env, sprintf("%.0f", $this->getAttribute($this->getContext($context, "collector"), "inittime")), "html", null, true);
- echo " ms</td>
- </tr>
- <tr>
- <th>Threshold</th>
- <td><input type=\"number\" size=\"3\" name=\"threshold\" value=\"1\" min=\"0\" /> ms</td>
- </tr>
- </table>
- </form>
- <h3>
- ";
- // line 69
- echo (($this->getAttribute($this->getContext($context, "profile"), "parent")) ? ("Request") : ("Main Request"));
- echo "
- <small>
- - ";
- // line 71
- echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "totaltime"), "html", null, true);
- echo " ms
- ";
- // line 72
- if ($this->getAttribute($this->getContext($context, "profile"), "parent")) {
- // line 73
- echo " - <a href=\"";
- echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => $this->getAttribute($this->getAttribute($this->getContext($context, "profile"), "parent"), "token"), "panel" => "time")), "html", null, true);
- echo "\">parent</a>
- ";
- }
- // line 75
- echo " </small>
- </h3>
- ";
- // line 78
- $context["max"] = $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "endtime");
- // line 79
- echo "
- ";
- // line 80
- echo $this->getAttribute($this, "display_timeline", array(0 => ("timeline_" . $this->getContext($context, "token")), 1 => $this->getAttribute($this->getContext($context, "collector"), "events"), 2 => $this->getContext($context, "colors")), "method");
- echo "
- ";
- // line 82
- if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "profile"), "children"))) {
- // line 83
- echo " ";
- $context['_parent'] = (array) $context;
- $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "profile"), "children"));
- foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
- // line 84
- echo " ";
- $context["events"] = $this->getAttribute($this->getAttribute($this->getContext($context, "child"), "getcollector", array(0 => "time"), "method"), "events");
- // line 85
- echo " <h3>
- Sub-request \"<a href=\"";
- // line 86
- echo twig_escape_filter($this->env, $this->env->getExtension('routing')->getPath("_profiler", array("token" => $this->getAttribute($this->getContext($context, "child"), "token"), "panel" => "time")), "html", null, true);
- echo "\">";
- echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "child"), "getcollector", array(0 => "request"), "method"), "requestattributes"), "get", array(0 => "_controller"), "method"), "html", null, true);
- echo "</a>\"
- <small> - ";
- // line 87
- echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "events"), "__section__"), "totaltime"), "html", null, true);
- echo " ms</small>
- </h3>
- ";
- // line 90
- echo $this->getAttribute($this, "display_timeline", array(0 => ("timeline_" . $this->getAttribute($this->getContext($context, "child"), "token")), 1 => $this->getContext($context, "events"), 2 => $this->getContext($context, "colors")), "method");
- echo "
- ";
- }
- $_parent = $context['_parent'];
- unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
- $context = array_merge($_parent, array_intersect_key($context, $_parent));
- // line 92
- echo " ";
- }
- // line 93
- echo "
- <script type=\"text/javascript\">//<![CDATA[
- /**
- * In-memory key-value cache manager
- */
- var cache = new function() {
- \"use strict\";
- var dict = {};
- this.get = function(key) {
- return dict.hasOwnProperty(key)
- ? dict[key]
- : null;
- }
- this.set = function(key, value) {
- dict[key] = value;
- return value;
- }
- };
- /**
- * Query an element with a CSS selector.
- *
- * @param string selector a CSS-selector-compatible query string.
- *
- * @return DOMElement|null
- */
- function query(selector)
- {
- \"use strict\";
- var key = 'SELECTOR: ' + selector;
- return cache.get(key) || cache.set(key, document.querySelector(selector));
- }
- /**
- * Canvas Manager
- */
- function CanvasManager(requests, maxRequestTime) {
- \"use strict\";
- var _drawingColors = ";
- // line 136
- echo twig_jsonencode_filter($this->getContext($context, "colors"));
- echo ",
- _storagePrefix = 'sf2/profiler/timeline',
- _threshold = 1,
- _requests = requests,
- _maxRequestTime = maxRequestTime;
- /**
- * Check whether this event is a child event.
- *
- * @return true if it is.
- */
- function isChildEvent(event)
- {
- return '__section__.child' === event.name;
- }
- /**
- * Check whether this event is categorized in 'section'.
- *
- * @return true if it is.
- */
- function isSectionEvent(event)
- {
- return 'section' === event.category;
- }
- /**
- * Get the width of the container.
- */
- function getContainerWidth()
- {
- return query('#collector_content h2').clientWidth;
- }
- /**
- * Draw one canvas.
- *
- * @param request the request object
- * @param max <subjected for removal>
- * @param threshold the threshold (lower bound) of the length of the timeline (in miliseconds).
- * @param width the width of the canvas.
- */
- this.drawOne = function(request, max, threshold, width)
- {
- \"use strict\";
- var text,
- ms,
- xc,
- drawableEvents,
- mainEvents,
- elementId = 'timeline_' + request.id,
- canvasHeight = 0,
- gapPerEvent = 38,
- colors = _drawingColors,
- space = 10.5,
- ratio = (width - space * 2) / max,
- h = space,
- x = request.left * ratio + space, // position
- canvas = cache.get(elementId) || cache.set(elementId, document.getElementById(elementId)),
- ctx = canvas.getContext(\"2d\");
- // Filter events whose total time is below the threshold.
- drawableEvents = request.events.filter(function(event) {
- return event.totaltime >= threshold;
- });
- canvasHeight += gapPerEvent * drawableEvents.length;
- canvas.width = width;
- canvas.height = canvasHeight;
- ctx.textBaseline = \"middle\";
- ctx.lineWidth = 0;
- // For each event, draw a line.
- ctx.strokeStyle = \"#dfdfdf\";
- drawableEvents.forEach(function(event) {
- event.periods.forEach(function(period) {
- var timelineHeadPosition = x + period.begin * ratio;
- if (isChildEvent(event)) {
- ctx.fillStyle = colors.child_sections;
- ctx.fillRect(timelineHeadPosition, 0, (period.end - period.begin) * ratio, canvasHeight);
- } else if (isSectionEvent(event)) {
- var timelineTailPosition = x + period.end * ratio;
- ctx.beginPath();
- ctx.moveTo(timelineHeadPosition, 0);
- ctx.lineTo(timelineHeadPosition, canvasHeight);
- ctx.moveTo(timelineTailPosition, 0);
- ctx.lineTo(timelineTailPosition, canvasHeight);
- ctx.fill();
- ctx.closePath();
- ctx.stroke();
- }
- });
- });
- // Filter for main events.
- mainEvents = drawableEvents.filter(function(event) {
- return ! isChildEvent(event)
- });
- // For each main event, draw the visual presentation of timelines.
- mainEvents.forEach(function(event) {
- h += 8;
- // For each sub event, ...
- event.periods.forEach(function(period) {
- // Set the drawing style.
- ctx.fillStyle = colors['default'];
- ctx.strokeStyle = colors['default'];
- if (colors[event.name]) {
- ctx.fillStyle = colors[event.name];
- ctx.strokeStyle = colors[event.name];
- } else if (colors[event.category]) {
- ctx.fillStyle = colors[event.category];
- ctx.strokeStyle = colors[event.category];
- }
- // Draw the timeline
- var timelineHeadPosition = x + period.begin * ratio;
- if ( ! isSectionEvent(event)) {
- ctx.fillRect(timelineHeadPosition, h + 3, 2, 6);
- ctx.fillRect(timelineHeadPosition, h, (period.end - period.begin) * ratio || 2, 6);
- } else {
- var timelineTailPosition = x + period.end * ratio;
- ctx.beginPath();
- ctx.moveTo(timelineHeadPosition, h);
- ctx.lineTo(timelineHeadPosition, h + 11);
- ctx.lineTo(timelineHeadPosition + 8, h);
- ctx.lineTo(timelineHeadPosition, h);
- ctx.fill();
- ctx.closePath();
- ctx.stroke();
- ctx.beginPath();
- ctx.moveTo(timelineTailPosition, h);
- ctx.lineTo(timelineTailPosition, h + 11);
- ctx.lineTo(timelineTailPosition - 8, h);
- ctx.lineTo(timelineTailPosition, h);
- ctx.fill();
- ctx.closePath();
- ctx.stroke();
- ctx.beginPath();
- ctx.moveTo(timelineHeadPosition, h);
- ctx.lineTo(timelineTailPosition, h);
- ctx.lineTo(timelineTailPosition, h + 2);
- ctx.lineTo(timelineHeadPosition, h + 2);
- ctx.lineTo(timelineHeadPosition, h);
- ctx.fill();
- ctx.closePath();
- ctx.stroke();
- }
- });
- h += 30;
- ctx.beginPath();
- ctx.strokeStyle = \"#dfdfdf\";
- ctx.moveTo(0, h - 10);
- ctx.lineTo(width, h - 10);
- ctx.closePath();
- ctx.stroke();
- });
- h = space;
- // For each event, draw the label.
- mainEvents.forEach(function(event) {
- ctx.fillStyle = \"#444\";
- ctx.font = \"12px sans-serif\";
- text = event.name;
- ms = \" ~ \" + (event.totaltime < 1 ? event.totaltime : parseInt(event.totaltime, 10)) + \" ms\";
- if (x + event.starttime * ratio + ctx.measureText(text + ms).width > width) {
- ctx.textAlign = \"end\";
- ctx.font = \"10px sans-serif\";
- xc = x + event.endtime * ratio - 1;
- ctx.fillText(ms, xc, h);
- xc -= ctx.measureText(ms).width;
- ctx.font = \"12px sans-serif\";
- ctx.fillText(text, xc, h);
- } else {
- ctx.textAlign = \"start\";
- ctx.font = \"12px sans-serif\";
- xc = x + event.starttime * ratio + 1;
- ctx.fillText(text, xc, h);
- xc += ctx.measureText(text).width;
- ctx.font = \"10px sans-serif\";
- ctx.fillText(ms, xc, h);
- }
- h += gapPerEvent;
- });
- };
- this.drawAll = function(width, threshold)
- {
- \"use strict\";
- width = width || getContainerWidth();
- threshold = threshold || this.getThreshold();
- var self = this;
- _requests.forEach(function(request) {
- self.drawOne(request, maxRequestTime, threshold, width);
- });
- };
- this.getThreshold = function() {
- var threshold = localStorage.getItem(_storagePrefix + '/threshold');
- if (threshold === null) {
- return _threshold;
- }
- _threshold = parseInt(threshold);
- return _threshold;
- };
- this.setThreshold = function(threshold)
- {
- _threshold = threshold;
- localStorage.setItem(_storagePrefix + '/threshold', threshold);
- return this;
- };
- };
- function canvasAutoUpdateOnResizeAndSubmit(e) {
- e.preventDefault();
- canvasManager.drawAll();
- }
- function canvasAutoUpdateOnThresholdChange(e) {
- canvasManager
- .setThreshold(query('input[name=\"threshold\"]').value)
- .drawAll();
- }
- var requests_data = {
- \"max\": ";
- // line 389
- echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "endtime")), "html", null, true);
- echo ",
- \"requests\": [
- ";
- // line 391
- echo $this->getAttribute($this, "dump_request_data", array(0 => $this->getContext($context, "token"), 1 => $this->getContext($context, "profile"), 2 => $this->getAttribute($this->getContext($context, "collector"), "events"), 3 => $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "origin")), "method");
- echo "
- ";
- // line 393
- if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "profile"), "children"))) {
- // line 394
- echo " ,
- ";
- // line 395
- $context['_parent'] = (array) $context;
- $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "profile"), "children"));
- $context['loop'] = array(
- 'parent' => $context['_parent'],
- 'index0' => 0,
- 'index' => 1,
- 'first' => true,
- );
- if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
- $length = count($context['_seq']);
- $context['loop']['revindex0'] = $length - 1;
- $context['loop']['revindex'] = $length;
- $context['loop']['length'] = $length;
- $context['loop']['last'] = 1 === $length;
- }
- foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
- // line 396
- echo $this->getAttribute($this, "dump_request_data", array(0 => $this->getAttribute($this->getContext($context, "child"), "token"), 1 => $this->getContext($context, "child"), 2 => $this->getAttribute($this->getAttribute($this->getContext($context, "child"), "getcollector", array(0 => "time"), "method"), "events"), 3 => $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "origin")), "method");
- echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (","));
- echo "
- ";
- ++$context['loop']['index0'];
- ++$context['loop']['index'];
- $context['loop']['first'] = false;
- if (isset($context['loop']['length'])) {
- --$context['loop']['revindex0'];
- --$context['loop']['revindex'];
- $context['loop']['last'] = 0 === $context['loop']['revindex0'];
- }
- }
- $_parent = $context['_parent'];
- unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
- $context = array_merge($_parent, array_intersect_key($context, $_parent));
- }
- // line 399
- echo " ]
- };
- var canvasManager = new CanvasManager(requests_data.requests, requests_data.max);
- query('input[name=\"threshold\"]').value = canvasManager.getThreshold();
- canvasManager.drawAll();
- // Update the colors of legends.
- var timelineLegends = document.querySelectorAll('.sf-profiler-timeline > .legends > span[data-color]');
- for (var i = 0; i < timelineLegends.length; ++i) {
- var timelineLegend = timelineLegends[i];
- timelineLegend.style.borderLeftColor = timelineLegend.getAttribute('data-color');
- }
- // Bind event handlers
- var elementTimelineControl = query('#timeline-control'),
- elementThresholdControl = query('input[name=\"threshold\"]');
- window.onresize = canvasAutoUpdateOnResizeAndSubmit;
- elementTimelineControl.onsubmit = canvasAutoUpdateOnResizeAndSubmit;
- elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange;
- elementThresholdControl.onchange = canvasAutoUpdateOnThresholdChange;
- elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange;
- //]]></script>
- ";
- }
- // line 429
- public function getdump_request_data($token = null, $profile = null, $events = null, $origin = null)
- {
- $context = $this->env->mergeGlobals(array(
- "token" => $token,
- "profile" => $profile,
- "events" => $events,
- "origin" => $origin,
- ));
- $blocks = array();
- ob_start();
- try {
- // line 430
- echo " {
- \"id\": \"";
- // line 431
- echo twig_escape_filter($this->env, $this->getContext($context, "token"), "html", null, true);
- echo "\",
- \"left\": ";
- // line 432
- echo twig_escape_filter($this->env, sprintf("%F", ($this->getAttribute($this->getAttribute($this->getContext($context, "events"), "__section__"), "origin") - $this->getContext($context, "origin"))), "html", null, true);
- echo ",
- \"events\": [
- ";
- // line 434
- echo $this->getAttribute($this, "dump_events", array(0 => $this->getContext($context, "events")), "method");
- echo "
- ]
- }
- ";
- } catch(Exception $e) {
- ob_end_clean();
- throw $e;
- }
- return ob_get_clean();
- }
- // line 439
- public function getdump_events($events = null)
- {
- $context = $this->env->mergeGlobals(array(
- "events" => $events,
- ));
- $blocks = array();
- ob_start();
- try {
- // line 440
- $context['_parent'] = (array) $context;
- $context['_seq'] = twig_ensure_traversable($this->getContext($context, "events"));
- $context['loop'] = array(
- 'parent' => $context['_parent'],
- 'index0' => 0,
- 'index' => 1,
- 'first' => true,
- );
- if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
- $length = count($context['_seq']);
- $context['loop']['revindex0'] = $length - 1;
- $context['loop']['revindex'] = $length;
- $context['loop']['length'] = $length;
- $context['loop']['last'] = 1 === $length;
- }
- foreach ($context['_seq'] as $context["name"] => $context["event"]) {
- // line 441
- if (("__section__" != $this->getContext($context, "name"))) {
- // line 442
- echo " {
- \"name\": \"";
- // line 443
- echo twig_escape_filter($this->env, $this->getContext($context, "name"), "html", null, true);
- echo "\",
- \"category\": \"";
- // line 444
- echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "event"), "category"), "html", null, true);
- echo "\",
- \"origin\": ";
- // line 445
- echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "origin")), "html", null, true);
- echo ",
- \"starttime\": ";
- // line 446
- echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "starttime")), "html", null, true);
- echo ",
- \"endtime\": ";
- // line 447
- echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "endtime")), "html", null, true);
- echo ",
- \"totaltime\": ";
- // line 448
- echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "totaltime")), "html", null, true);
- echo ",
- \"periods\": [";
- // line 450
- $context['_parent'] = (array) $context;
- $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "event"), "periods"));
- $context['loop'] = array(
- 'parent' => $context['_parent'],
- 'index0' => 0,
- 'index' => 1,
- 'first' => true,
- );
- if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
- $length = count($context['_seq']);
- $context['loop']['revindex0'] = $length - 1;
- $context['loop']['revindex'] = $length;
- $context['loop']['length'] = $length;
- $context['loop']['last'] = 1 === $length;
- }
- foreach ($context['_seq'] as $context["_key"] => $context["period"]) {
- // line 451
- echo "{\"begin\": ";
- echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "period"), 0)), "html", null, true);
- echo ", \"end\": ";
- echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "period"), 1)), "html", null, true);
- echo "}";
- echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (", "));
- ++$context['loop']['index0'];
- ++$context['loop']['index'];
- $context['loop']['first'] = false;
- if (isset($context['loop']['length'])) {
- --$context['loop']['revindex0'];
- --$context['loop']['revindex'];
- $context['loop']['last'] = 0 === $context['loop']['revindex0'];
- }
- }
- $_parent = $context['_parent'];
- unset($context['_seq'], $context['_iterated'], $context['_key'], $context['period'], $context['_parent'], $context['loop']);
- $context = array_merge($_parent, array_intersect_key($context, $_parent));
- // line 453
- echo "]
- }";
- // line 454
- echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (","));
- echo "
- ";
- }
- ++$context['loop']['index0'];
- ++$context['loop']['index'];
- $context['loop']['first'] = false;
- if (isset($context['loop']['length'])) {
- --$context['loop']['revindex0'];
- --$context['loop']['revindex'];
- $context['loop']['last'] = 0 === $context['loop']['revindex0'];
- }
- }
- $_parent = $context['_parent'];
- unset($context['_seq'], $context['_iterated'], $context['name'], $context['event'], $context['_parent'], $context['loop']);
- $context = array_merge($_parent, array_intersect_key($context, $_parent));
- } catch(Exception $e) {
- ob_end_clean();
- throw $e;
- }
- return ob_get_clean();
- }
- // line 459
- public function getdisplay_timeline($id = null, $events = null, $colors = null)
- {
- $context = $this->env->mergeGlobals(array(
- "id" => $id,
- "events" => $events,
- "colors" => $colors,
- ));
- $blocks = array();
- ob_start();
- try {
- // line 460
- echo " <div class=\"sf-profiler-timeline\">
- <div class=\"legends\">
- ";
- // line 462
- $context['_parent'] = (array) $context;
- $context['_seq'] = twig_ensure_traversable($this->getContext($context, "colors"));
- foreach ($context['_seq'] as $context["category"] => $context["color"]) {
- // line 463
- echo " <span data-color=\"";
- echo twig_escape_filter($this->env, $this->getContext($context, "color"), "html", null, true);
- echo "\">";
- echo twig_escape_filter($this->env, $this->getContext($context, "category"), "html", null, true);
- echo "</span>
- ";
- }
- $_parent = $context['_parent'];
- unset($context['_seq'], $context['_iterated'], $context['category'], $context['color'], $context['_parent'], $context['loop']);
- $context = array_merge($_parent, array_intersect_key($context, $_parent));
- // line 465
- echo " </div>
- <canvas width=\"680\" height=\"\" id=\"";
- // line 466
- echo twig_escape_filter($this->env, $this->getContext($context, "id"), "html", null, true);
- echo "\" class=\"timeline\"></canvas>
- </div>
- ";
- } catch(Exception $e) {
- ob_end_clean();
- throw $e;
- }
- return ob_get_clean();
- }
- public function getTemplateName()
- {
- return "WebProfilerBundle:Collector:time.html.twig";
- }
- public function isTraitable()
- {
- return false;
- }
- public function getDebugInfo()
- {
- return array ( 784 => 466, 781 => 465, 770 => 463, 766 => 462, 762 => 460, 749 => 459, 723 => 454, 720 => 453, 701 => 451, 684 => 450, 680 => 448, 676 => 447, 672 => 446, 668 => 445, 664 => 444, 660 => 443, 657 => 442, 655 => 441, 638 => 440, 627 => 439, 612 => 434, 607 => 432, 603 => 431, 600 => 430, 586 => 429, 554 => 399, 536 => 396, 519 => 395, 516 => 394, 514 => 393, 509 => 391, 504 => 389, 248 => 136, 177 => 85, 159 => 79, 144 => 72, 135 => 69, 122 => 59, 97 => 43, 386 => 160, 383 => 159, 377 => 158, 375 => 157, 368 => 156, 364 => 155, 360 => 153, 358 => 152, 355 => 151, 352 => 150, 350 => 149, 342 => 147, 340 => 146, 337 => 145, 328 => 140, 325 => 139, 318 => 135, 312 => 131, 309 => 130, 306 => 129, 304 => 128, 278 => 114, 273 => 111, 262 => 105, 256 => 103, 252 => 101, 245 => 97, 238 => 93, 232 => 89, 229 => 88, 224 => 86, 205 => 76, 200 => 92, 191 => 68, 188 => 67, 167 => 82, 105 => 49, 207 => 77, 174 => 84, 168 => 60, 88 => 28, 54 => 23, 186 => 87, 172 => 58, 165 => 64, 162 => 80, 132 => 54, 354 => 163, 345 => 160, 341 => 159, 338 => 158, 333 => 157, 331 => 141, 323 => 138, 321 => 149, 314 => 145, 307 => 141, 300 => 137, 286 => 129, 279 => 125, 272 => 121, 257 => 109, 250 => 100, 236 => 97, 226 => 87, 215 => 83, 212 => 82, 204 => 78, 201 => 77, 190 => 72, 180 => 86, 146 => 73, 133 => 47, 67 => 20, 111 => 40, 51 => 22, 38 => 6, 138 => 42, 95 => 23, 75 => 33, 47 => 13, 21 => 1, 84 => 29, 219 => 83, 126 => 45, 108 => 50, 60 => 16, 299 => 125, 293 => 121, 290 => 120, 287 => 119, 285 => 118, 280 => 115, 274 => 86, 271 => 110, 268 => 84, 266 => 107, 261 => 80, 247 => 79, 243 => 96, 228 => 75, 220 => 73, 218 => 72, 213 => 79, 209 => 81, 202 => 71, 196 => 69, 183 => 68, 181 => 63, 175 => 59, 158 => 59, 107 => 42, 101 => 25, 80 => 19, 63 => 23, 36 => 7, 156 => 56, 148 => 55, 142 => 50, 140 => 71, 127 => 45, 123 => 44, 115 => 55, 110 => 46, 85 => 34, 65 => 14, 59 => 12, 45 => 8, 103 => 41, 91 => 41, 74 => 17, 70 => 22, 66 => 19, 25 => 3, 89 => 40, 82 => 25, 92 => 33, 86 => 39, 77 => 18, 57 => 13, 19 => 2, 42 => 10, 29 => 4, 26 => 3, 223 => 88, 214 => 90, 210 => 78, 203 => 93, 199 => 83, 194 => 69, 192 => 90, 189 => 70, 187 => 77, 184 => 76, 178 => 72, 170 => 64, 157 => 78, 152 => 75, 145 => 58, 130 => 47, 125 => 52, 119 => 45, 116 => 29, 112 => 43, 102 => 35, 98 => 24, 76 => 36, 73 => 23, 69 => 31, 56 => 14, 32 => 5, 24 => 9, 22 => 3, 23 => 29, 17 => 1, 68 => 15, 61 => 16, 44 => 12, 20 => 1, 161 => 121, 153 => 50, 150 => 49, 147 => 51, 143 => 57, 137 => 45, 129 => 46, 121 => 35, 118 => 50, 113 => 44, 104 => 35, 99 => 33, 94 => 37, 81 => 28, 78 => 32, 72 => 32, 64 => 28, 53 => 9, 50 => 14, 48 => 10, 41 => 11, 39 => 8, 35 => 5, 33 => 6, 30 => 5, 27 => 5, 182 => 70, 176 => 62, 169 => 83, 163 => 54, 160 => 53, 155 => 56, 151 => 62, 149 => 47, 141 => 43, 136 => 55, 134 => 50, 131 => 31, 128 => 39, 120 => 51, 117 => 45, 114 => 31, 109 => 38, 106 => 41, 100 => 34, 96 => 32, 93 => 31, 90 => 21, 87 => 29, 83 => 38, 79 => 24, 71 => 16, 62 => 22, 58 => 25, 55 => 16, 52 => 12, 49 => 13, 46 => 20, 43 => 19, 40 => 18, 37 => 17, 34 => 16, 31 => 4, 28 => 4,);
- }
- }