PageRenderTime 51ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/app/cache/dev/twig/2f/13/e1f239fb9ff288c11658d2360d17.php

https://bitbucket.org/pyneff/carsharing
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
  1. <?php
  2. /* WebProfilerBundle:Collector:time.html.twig */
  3. class __TwigTemplate_2f13e1f239fb9ff288c11658d2360d17 extends Twig_Template
  4. {
  5. public function __construct(Twig_Environment $env)
  6. {
  7. parent::__construct($env);
  8. $this->parent = $this->env->loadTemplate("WebProfilerBundle:Profiler:layout.html.twig");
  9. $this->blocks = array(
  10. 'toolbar' => array($this, 'block_toolbar'),
  11. 'menu' => array($this, 'block_menu'),
  12. 'panel' => array($this, 'block_panel'),
  13. 'panelContent' => array($this, 'block_panelContent'),
  14. );
  15. }
  16. protected function doGetParent(array $context)
  17. {
  18. return "WebProfilerBundle:Profiler:layout.html.twig";
  19. }
  20. protected function doDisplay(array $context, array $blocks = array())
  21. {
  22. // line 3
  23. if ((!array_key_exists("colors", $context))) {
  24. // line 4
  25. $context["colors"] = array("default" => "#aacd4e", "section" => "#666", "event_listener" => "#3dd", "event_listener_loading" => "#add", "template" => "#dd3", "doctrine" => "#d3d", "propel" => "#f4d", "child_sections" => "#eed");
  26. }
  27. $this->parent->display($context, array_merge($this->blocks, $blocks));
  28. }
  29. // line 16
  30. public function block_toolbar($context, array $blocks = array())
  31. {
  32. // line 17
  33. echo " ";
  34. $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"));
  35. // line 18
  36. echo " ";
  37. ob_start();
  38. // line 19
  39. 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=\"/>
  40. <span>";
  41. // line 20
  42. echo twig_escape_filter($this->env, $this->getContext($context, "total_time"), "html", null, true);
  43. echo "</span>
  44. ";
  45. $context["icon"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  46. // line 22
  47. echo " ";
  48. ob_start();
  49. // line 23
  50. echo " <div class=\"sf-toolbar-info-piece\">
  51. <b>Total time</b>
  52. <span>";
  53. // line 25
  54. echo twig_escape_filter($this->env, $this->getContext($context, "total_time"), "html", null, true);
  55. echo "</span>
  56. </div>
  57. ";
  58. $context["text"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  59. // line 28
  60. echo " ";
  61. $this->env->loadTemplate("WebProfilerBundle:Profiler:toolbar_item.html.twig")->display(array_merge($context, array("link" => $this->getContext($context, "profiler_url"))));
  62. }
  63. // line 31
  64. public function block_menu($context, array $blocks = array())
  65. {
  66. // line 32
  67. echo "<span class=\"label\">
  68. <span class=\"icon\"><img src=\"";
  69. // line 33
  70. echo twig_escape_filter($this->env, $this->env->getExtension('assets')->getAssetUrl("bundles/webprofiler/images/profiler/time.png"), "html", null, true);
  71. echo "\" alt=\"Timeline\" /></span>
  72. <strong>Timeline</strong>
  73. </span>
  74. ";
  75. }
  76. // line 38
  77. public function block_panel($context, array $blocks = array())
  78. {
  79. // line 39
  80. echo " <h2>Timeline</h2>
  81. ";
  82. // line 40
  83. if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "collector"), "events"))) {
  84. // line 41
  85. echo " ";
  86. $this->displayBlock("panelContent", $context, $blocks);
  87. echo "
  88. ";
  89. } else {
  90. // line 43
  91. echo " <p>
  92. <em>No timing events have been recorded. Are you sure that debugging is enabled in the kernel ?</em>
  93. </p>
  94. ";
  95. }
  96. }
  97. // line 49
  98. public function block_panelContent($context, array $blocks = array())
  99. {
  100. // line 50
  101. echo " <form id=\"timeline-control\" action=\"\" method=\"get\">
  102. <input type=\"hidden\" name=\"panel\" value=\"time\" />
  103. <table>
  104. <tr>
  105. <th style=\"width: 20%\">Total time</th>
  106. <td>";
  107. // line 55
  108. echo twig_escape_filter($this->env, sprintf("%.0f", $this->getAttribute($this->getContext($context, "collector"), "totaltime")), "html", null, true);
  109. echo " ms</td>
  110. </tr>
  111. <tr>
  112. <th>Initialization time</th>
  113. <td>";
  114. // line 59
  115. echo twig_escape_filter($this->env, sprintf("%.0f", $this->getAttribute($this->getContext($context, "collector"), "inittime")), "html", null, true);
  116. echo " ms</td>
  117. </tr>
  118. <tr>
  119. <th>Threshold</th>
  120. <td><input type=\"number\" size=\"3\" name=\"threshold\" value=\"1\" min=\"0\" /> ms</td>
  121. </tr>
  122. </table>
  123. </form>
  124. <h3>
  125. ";
  126. // line 69
  127. echo (($this->getAttribute($this->getContext($context, "profile"), "parent")) ? ("Request") : ("Main Request"));
  128. echo "
  129. <small>
  130. - ";
  131. // line 71
  132. echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "totaltime"), "html", null, true);
  133. echo " ms
  134. ";
  135. // line 72
  136. if ($this->getAttribute($this->getContext($context, "profile"), "parent")) {
  137. // line 73
  138. echo " - <a href=\"";
  139. 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);
  140. echo "\">parent</a>
  141. ";
  142. }
  143. // line 75
  144. echo " </small>
  145. </h3>
  146. ";
  147. // line 78
  148. $context["max"] = $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "endtime");
  149. // line 79
  150. echo "
  151. ";
  152. // line 80
  153. 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");
  154. echo "
  155. ";
  156. // line 82
  157. if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "profile"), "children"))) {
  158. // line 83
  159. echo " ";
  160. $context['_parent'] = (array) $context;
  161. $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "profile"), "children"));
  162. foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
  163. // line 84
  164. echo " ";
  165. $context["events"] = $this->getAttribute($this->getAttribute($this->getContext($context, "child"), "getcollector", array(0 => "time"), "method"), "events");
  166. // line 85
  167. echo " <h3>
  168. Sub-request \"<a href=\"";
  169. // line 86
  170. 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);
  171. echo "\">";
  172. 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);
  173. echo "</a>\"
  174. <small> - ";
  175. // line 87
  176. echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getContext($context, "events"), "__section__"), "totaltime"), "html", null, true);
  177. echo " ms</small>
  178. </h3>
  179. ";
  180. // line 90
  181. 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");
  182. echo "
  183. ";
  184. }
  185. $_parent = $context['_parent'];
  186. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
  187. $context = array_merge($_parent, array_intersect_key($context, $_parent));
  188. // line 92
  189. echo " ";
  190. }
  191. // line 93
  192. echo "
  193. <script type=\"text/javascript\">//<![CDATA[
  194. /**
  195. * In-memory key-value cache manager
  196. */
  197. var cache = new function() {
  198. \"use strict\";
  199. var dict = {};
  200. this.get = function(key) {
  201. return dict.hasOwnProperty(key)
  202. ? dict[key]
  203. : null;
  204. }
  205. this.set = function(key, value) {
  206. dict[key] = value;
  207. return value;
  208. }
  209. };
  210. /**
  211. * Query an element with a CSS selector.
  212. *
  213. * @param string selector a CSS-selector-compatible query string.
  214. *
  215. * @return DOMElement|null
  216. */
  217. function query(selector)
  218. {
  219. \"use strict\";
  220. var key = 'SELECTOR: ' + selector;
  221. return cache.get(key) || cache.set(key, document.querySelector(selector));
  222. }
  223. /**
  224. * Canvas Manager
  225. */
  226. function CanvasManager(requests, maxRequestTime) {
  227. \"use strict\";
  228. var _drawingColors = ";
  229. // line 136
  230. echo twig_jsonencode_filter($this->getContext($context, "colors"));
  231. echo ",
  232. _storagePrefix = 'sf2/profiler/timeline',
  233. _threshold = 1,
  234. _requests = requests,
  235. _maxRequestTime = maxRequestTime;
  236. /**
  237. * Check whether this event is a child event.
  238. *
  239. * @return true if it is.
  240. */
  241. function isChildEvent(event)
  242. {
  243. return '__section__.child' === event.name;
  244. }
  245. /**
  246. * Check whether this event is categorized in 'section'.
  247. *
  248. * @return true if it is.
  249. */
  250. function isSectionEvent(event)
  251. {
  252. return 'section' === event.category;
  253. }
  254. /**
  255. * Get the width of the container.
  256. */
  257. function getContainerWidth()
  258. {
  259. return query('#collector_content h2').clientWidth;
  260. }
  261. /**
  262. * Draw one canvas.
  263. *
  264. * @param request the request object
  265. * @param max <subjected for removal>
  266. * @param threshold the threshold (lower bound) of the length of the timeline (in miliseconds).
  267. * @param width the width of the canvas.
  268. */
  269. this.drawOne = function(request, max, threshold, width)
  270. {
  271. \"use strict\";
  272. var text,
  273. ms,
  274. xc,
  275. drawableEvents,
  276. mainEvents,
  277. elementId = 'timeline_' + request.id,
  278. canvasHeight = 0,
  279. gapPerEvent = 38,
  280. colors = _drawingColors,
  281. space = 10.5,
  282. ratio = (width - space * 2) / max,
  283. h = space,
  284. x = request.left * ratio + space, // position
  285. canvas = cache.get(elementId) || cache.set(elementId, document.getElementById(elementId)),
  286. ctx = canvas.getContext(\"2d\");
  287. // Filter events whose total time is below the threshold.
  288. drawableEvents = request.events.filter(function(event) {
  289. return event.totaltime >= threshold;
  290. });
  291. canvasHeight += gapPerEvent * drawableEvents.length;
  292. canvas.width = width;
  293. canvas.height = canvasHeight;
  294. ctx.textBaseline = \"middle\";
  295. ctx.lineWidth = 0;
  296. // For each event, draw a line.
  297. ctx.strokeStyle = \"#dfdfdf\";
  298. drawableEvents.forEach(function(event) {
  299. event.periods.forEach(function(period) {
  300. var timelineHeadPosition = x + period.begin * ratio;
  301. if (isChildEvent(event)) {
  302. ctx.fillStyle = colors.child_sections;
  303. ctx.fillRect(timelineHeadPosition, 0, (period.end - period.begin) * ratio, canvasHeight);
  304. } else if (isSectionEvent(event)) {
  305. var timelineTailPosition = x + period.end * ratio;
  306. ctx.beginPath();
  307. ctx.moveTo(timelineHeadPosition, 0);
  308. ctx.lineTo(timelineHeadPosition, canvasHeight);
  309. ctx.moveTo(timelineTailPosition, 0);
  310. ctx.lineTo(timelineTailPosition, canvasHeight);
  311. ctx.fill();
  312. ctx.closePath();
  313. ctx.stroke();
  314. }
  315. });
  316. });
  317. // Filter for main events.
  318. mainEvents = drawableEvents.filter(function(event) {
  319. return ! isChildEvent(event)
  320. });
  321. // For each main event, draw the visual presentation of timelines.
  322. mainEvents.forEach(function(event) {
  323. h += 8;
  324. // For each sub event, ...
  325. event.periods.forEach(function(period) {
  326. // Set the drawing style.
  327. ctx.fillStyle = colors['default'];
  328. ctx.strokeStyle = colors['default'];
  329. if (colors[event.name]) {
  330. ctx.fillStyle = colors[event.name];
  331. ctx.strokeStyle = colors[event.name];
  332. } else if (colors[event.category]) {
  333. ctx.fillStyle = colors[event.category];
  334. ctx.strokeStyle = colors[event.category];
  335. }
  336. // Draw the timeline
  337. var timelineHeadPosition = x + period.begin * ratio;
  338. if ( ! isSectionEvent(event)) {
  339. ctx.fillRect(timelineHeadPosition, h + 3, 2, 6);
  340. ctx.fillRect(timelineHeadPosition, h, (period.end - period.begin) * ratio || 2, 6);
  341. } else {
  342. var timelineTailPosition = x + period.end * ratio;
  343. ctx.beginPath();
  344. ctx.moveTo(timelineHeadPosition, h);
  345. ctx.lineTo(timelineHeadPosition, h + 11);
  346. ctx.lineTo(timelineHeadPosition + 8, h);
  347. ctx.lineTo(timelineHeadPosition, h);
  348. ctx.fill();
  349. ctx.closePath();
  350. ctx.stroke();
  351. ctx.beginPath();
  352. ctx.moveTo(timelineTailPosition, h);
  353. ctx.lineTo(timelineTailPosition, h + 11);
  354. ctx.lineTo(timelineTailPosition - 8, h);
  355. ctx.lineTo(timelineTailPosition, h);
  356. ctx.fill();
  357. ctx.closePath();
  358. ctx.stroke();
  359. ctx.beginPath();
  360. ctx.moveTo(timelineHeadPosition, h);
  361. ctx.lineTo(timelineTailPosition, h);
  362. ctx.lineTo(timelineTailPosition, h + 2);
  363. ctx.lineTo(timelineHeadPosition, h + 2);
  364. ctx.lineTo(timelineHeadPosition, h);
  365. ctx.fill();
  366. ctx.closePath();
  367. ctx.stroke();
  368. }
  369. });
  370. h += 30;
  371. ctx.beginPath();
  372. ctx.strokeStyle = \"#dfdfdf\";
  373. ctx.moveTo(0, h - 10);
  374. ctx.lineTo(width, h - 10);
  375. ctx.closePath();
  376. ctx.stroke();
  377. });
  378. h = space;
  379. // For each event, draw the label.
  380. mainEvents.forEach(function(event) {
  381. ctx.fillStyle = \"#444\";
  382. ctx.font = \"12px sans-serif\";
  383. text = event.name;
  384. ms = \" ~ \" + (event.totaltime < 1 ? event.totaltime : parseInt(event.totaltime, 10)) + \" ms\";
  385. if (x + event.starttime * ratio + ctx.measureText(text + ms).width > width) {
  386. ctx.textAlign = \"end\";
  387. ctx.font = \"10px sans-serif\";
  388. xc = x + event.endtime * ratio - 1;
  389. ctx.fillText(ms, xc, h);
  390. xc -= ctx.measureText(ms).width;
  391. ctx.font = \"12px sans-serif\";
  392. ctx.fillText(text, xc, h);
  393. } else {
  394. ctx.textAlign = \"start\";
  395. ctx.font = \"12px sans-serif\";
  396. xc = x + event.starttime * ratio + 1;
  397. ctx.fillText(text, xc, h);
  398. xc += ctx.measureText(text).width;
  399. ctx.font = \"10px sans-serif\";
  400. ctx.fillText(ms, xc, h);
  401. }
  402. h += gapPerEvent;
  403. });
  404. };
  405. this.drawAll = function(width, threshold)
  406. {
  407. \"use strict\";
  408. width = width || getContainerWidth();
  409. threshold = threshold || this.getThreshold();
  410. var self = this;
  411. _requests.forEach(function(request) {
  412. self.drawOne(request, maxRequestTime, threshold, width);
  413. });
  414. };
  415. this.getThreshold = function() {
  416. var threshold = localStorage.getItem(_storagePrefix + '/threshold');
  417. if (threshold === null) {
  418. return _threshold;
  419. }
  420. _threshold = parseInt(threshold);
  421. return _threshold;
  422. };
  423. this.setThreshold = function(threshold)
  424. {
  425. _threshold = threshold;
  426. localStorage.setItem(_storagePrefix + '/threshold', threshold);
  427. return this;
  428. };
  429. };
  430. function canvasAutoUpdateOnResizeAndSubmit(e) {
  431. e.preventDefault();
  432. canvasManager.drawAll();
  433. }
  434. function canvasAutoUpdateOnThresholdChange(e) {
  435. canvasManager
  436. .setThreshold(query('input[name=\"threshold\"]').value)
  437. .drawAll();
  438. }
  439. var requests_data = {
  440. \"max\": ";
  441. // line 389
  442. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getAttribute($this->getAttribute($this->getContext($context, "collector"), "events"), "__section__"), "endtime")), "html", null, true);
  443. echo ",
  444. \"requests\": [
  445. ";
  446. // line 391
  447. 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");
  448. echo "
  449. ";
  450. // line 393
  451. if (twig_length_filter($this->env, $this->getAttribute($this->getContext($context, "profile"), "children"))) {
  452. // line 394
  453. echo " ,
  454. ";
  455. // line 395
  456. $context['_parent'] = (array) $context;
  457. $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "profile"), "children"));
  458. $context['loop'] = array(
  459. 'parent' => $context['_parent'],
  460. 'index0' => 0,
  461. 'index' => 1,
  462. 'first' => true,
  463. );
  464. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  465. $length = count($context['_seq']);
  466. $context['loop']['revindex0'] = $length - 1;
  467. $context['loop']['revindex'] = $length;
  468. $context['loop']['length'] = $length;
  469. $context['loop']['last'] = 1 === $length;
  470. }
  471. foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
  472. // line 396
  473. 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");
  474. echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (","));
  475. echo "
  476. ";
  477. ++$context['loop']['index0'];
  478. ++$context['loop']['index'];
  479. $context['loop']['first'] = false;
  480. if (isset($context['loop']['length'])) {
  481. --$context['loop']['revindex0'];
  482. --$context['loop']['revindex'];
  483. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  484. }
  485. }
  486. $_parent = $context['_parent'];
  487. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
  488. $context = array_merge($_parent, array_intersect_key($context, $_parent));
  489. }
  490. // line 399
  491. echo " ]
  492. };
  493. var canvasManager = new CanvasManager(requests_data.requests, requests_data.max);
  494. query('input[name=\"threshold\"]').value = canvasManager.getThreshold();
  495. canvasManager.drawAll();
  496. // Update the colors of legends.
  497. var timelineLegends = document.querySelectorAll('.sf-profiler-timeline > .legends > span[data-color]');
  498. for (var i = 0; i < timelineLegends.length; ++i) {
  499. var timelineLegend = timelineLegends[i];
  500. timelineLegend.style.borderLeftColor = timelineLegend.getAttribute('data-color');
  501. }
  502. // Bind event handlers
  503. var elementTimelineControl = query('#timeline-control'),
  504. elementThresholdControl = query('input[name=\"threshold\"]');
  505. window.onresize = canvasAutoUpdateOnResizeAndSubmit;
  506. elementTimelineControl.onsubmit = canvasAutoUpdateOnResizeAndSubmit;
  507. elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange;
  508. elementThresholdControl.onchange = canvasAutoUpdateOnThresholdChange;
  509. elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange;
  510. //]]></script>
  511. ";
  512. }
  513. // line 429
  514. public function getdump_request_data($token = null, $profile = null, $events = null, $origin = null)
  515. {
  516. $context = $this->env->mergeGlobals(array(
  517. "token" => $token,
  518. "profile" => $profile,
  519. "events" => $events,
  520. "origin" => $origin,
  521. ));
  522. $blocks = array();
  523. ob_start();
  524. try {
  525. // line 430
  526. echo " {
  527. \"id\": \"";
  528. // line 431
  529. echo twig_escape_filter($this->env, $this->getContext($context, "token"), "html", null, true);
  530. echo "\",
  531. \"left\": ";
  532. // line 432
  533. 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);
  534. echo ",
  535. \"events\": [
  536. ";
  537. // line 434
  538. echo $this->getAttribute($this, "dump_events", array(0 => $this->getContext($context, "events")), "method");
  539. echo "
  540. ]
  541. }
  542. ";
  543. } catch(Exception $e) {
  544. ob_end_clean();
  545. throw $e;
  546. }
  547. return ob_get_clean();
  548. }
  549. // line 439
  550. public function getdump_events($events = null)
  551. {
  552. $context = $this->env->mergeGlobals(array(
  553. "events" => $events,
  554. ));
  555. $blocks = array();
  556. ob_start();
  557. try {
  558. // line 440
  559. $context['_parent'] = (array) $context;
  560. $context['_seq'] = twig_ensure_traversable($this->getContext($context, "events"));
  561. $context['loop'] = array(
  562. 'parent' => $context['_parent'],
  563. 'index0' => 0,
  564. 'index' => 1,
  565. 'first' => true,
  566. );
  567. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  568. $length = count($context['_seq']);
  569. $context['loop']['revindex0'] = $length - 1;
  570. $context['loop']['revindex'] = $length;
  571. $context['loop']['length'] = $length;
  572. $context['loop']['last'] = 1 === $length;
  573. }
  574. foreach ($context['_seq'] as $context["name"] => $context["event"]) {
  575. // line 441
  576. if (("__section__" != $this->getContext($context, "name"))) {
  577. // line 442
  578. echo " {
  579. \"name\": \"";
  580. // line 443
  581. echo twig_escape_filter($this->env, $this->getContext($context, "name"), "html", null, true);
  582. echo "\",
  583. \"category\": \"";
  584. // line 444
  585. echo twig_escape_filter($this->env, $this->getAttribute($this->getContext($context, "event"), "category"), "html", null, true);
  586. echo "\",
  587. \"origin\": ";
  588. // line 445
  589. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "origin")), "html", null, true);
  590. echo ",
  591. \"starttime\": ";
  592. // line 446
  593. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "starttime")), "html", null, true);
  594. echo ",
  595. \"endtime\": ";
  596. // line 447
  597. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "endtime")), "html", null, true);
  598. echo ",
  599. \"totaltime\": ";
  600. // line 448
  601. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "event"), "totaltime")), "html", null, true);
  602. echo ",
  603. \"periods\": [";
  604. // line 450
  605. $context['_parent'] = (array) $context;
  606. $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getContext($context, "event"), "periods"));
  607. $context['loop'] = array(
  608. 'parent' => $context['_parent'],
  609. 'index0' => 0,
  610. 'index' => 1,
  611. 'first' => true,
  612. );
  613. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  614. $length = count($context['_seq']);
  615. $context['loop']['revindex0'] = $length - 1;
  616. $context['loop']['revindex'] = $length;
  617. $context['loop']['length'] = $length;
  618. $context['loop']['last'] = 1 === $length;
  619. }
  620. foreach ($context['_seq'] as $context["_key"] => $context["period"]) {
  621. // line 451
  622. echo "{\"begin\": ";
  623. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "period"), 0)), "html", null, true);
  624. echo ", \"end\": ";
  625. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute($this->getContext($context, "period"), 1)), "html", null, true);
  626. echo "}";
  627. echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (", "));
  628. ++$context['loop']['index0'];
  629. ++$context['loop']['index'];
  630. $context['loop']['first'] = false;
  631. if (isset($context['loop']['length'])) {
  632. --$context['loop']['revindex0'];
  633. --$context['loop']['revindex'];
  634. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  635. }
  636. }
  637. $_parent = $context['_parent'];
  638. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['period'], $context['_parent'], $context['loop']);
  639. $context = array_merge($_parent, array_intersect_key($context, $_parent));
  640. // line 453
  641. echo "]
  642. }";
  643. // line 454
  644. echo (($this->getAttribute($this->getContext($context, "loop"), "last")) ? ("") : (","));
  645. echo "
  646. ";
  647. }
  648. ++$context['loop']['index0'];
  649. ++$context['loop']['index'];
  650. $context['loop']['first'] = false;
  651. if (isset($context['loop']['length'])) {
  652. --$context['loop']['revindex0'];
  653. --$context['loop']['revindex'];
  654. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  655. }
  656. }
  657. $_parent = $context['_parent'];
  658. unset($context['_seq'], $context['_iterated'], $context['name'], $context['event'], $context['_parent'], $context['loop']);
  659. $context = array_merge($_parent, array_intersect_key($context, $_parent));
  660. } catch(Exception $e) {
  661. ob_end_clean();
  662. throw $e;
  663. }
  664. return ob_get_clean();
  665. }
  666. // line 459
  667. public function getdisplay_timeline($id = null, $events = null, $colors = null)
  668. {
  669. $context = $this->env->mergeGlobals(array(
  670. "id" => $id,
  671. "events" => $events,
  672. "colors" => $colors,
  673. ));
  674. $blocks = array();
  675. ob_start();
  676. try {
  677. // line 460
  678. echo " <div class=\"sf-profiler-timeline\">
  679. <div class=\"legends\">
  680. ";
  681. // line 462
  682. $context['_parent'] = (array) $context;
  683. $context['_seq'] = twig_ensure_traversable($this->getContext($context, "colors"));
  684. foreach ($context['_seq'] as $context["category"] => $context["color"]) {
  685. // line 463
  686. echo " <span data-color=\"";
  687. echo twig_escape_filter($this->env, $this->getContext($context, "color"), "html", null, true);
  688. echo "\">";
  689. echo twig_escape_filter($this->env, $this->getContext($context, "category"), "html", null, true);
  690. echo "</span>
  691. ";
  692. }
  693. $_parent = $context['_parent'];
  694. unset($context['_seq'], $context['_iterated'], $context['category'], $context['color'], $context['_parent'], $context['loop']);
  695. $context = array_merge($_parent, array_intersect_key($context, $_parent));
  696. // line 465
  697. echo " </div>
  698. <canvas width=\"680\" height=\"\" id=\"";
  699. // line 466
  700. echo twig_escape_filter($this->env, $this->getContext($context, "id"), "html", null, true);
  701. echo "\" class=\"timeline\"></canvas>
  702. </div>
  703. ";
  704. } catch(Exception $e) {
  705. ob_end_clean();
  706. throw $e;
  707. }
  708. return ob_get_clean();
  709. }
  710. public function getTemplateName()
  711. {
  712. return "WebProfilerBundle:Collector:time.html.twig";
  713. }
  714. public function isTraitable()
  715. {
  716. return false;
  717. }
  718. public function getDebugInfo()
  719. {
  720. 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,);
  721. }
  722. }