PageRenderTime 54ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/app/cache/dev/twig/fc/a9/d292009b3648380a9c64278c93bd14939f12f82a2708b2f5dc02822048bc.php

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