PageRenderTime 56ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/app/cache/dev/twig/12/4d/f3eb4017ac6aa8d6576ebf95f6723f8a57b8fe135b51d1cc9dd5c03e8614.php

https://github.com/silvanei/treinaweb-symfony2-basico
PHP | 837 lines | 622 code | 97 blank | 118 comment | 39 complexity | c2b187a86ce884c6c8cfe53e62e1f7f8 MD5 | raw file
Possible License(s): BSD-3-Clause
  1. <?php
  2. /* @WebProfiler/Collector/time.html.twig */
  3. class __TwigTemplate_124df3eb4017ac6aa8d6576ebf95f6723f8a57b8fe135b51d1cc9dd5c03e8614 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_5ed76467abb08d70d5a18823039da801a7f7e325db2b639ff74ebb385d4e4be4"] = $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_5ed76467abb08d70d5a18823039da801a7f7e325db2b639ff74ebb385d4e4be4"]->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_5ed76467abb08d70d5a18823039da801a7f7e325db2b639ff74ebb385d4e4be4"]->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>";
  188. // line 94
  189. echo "//<![CDATA[
  190. /**
  191. * In-memory key-value cache manager
  192. */
  193. var cache = new function() {
  194. \"use strict\";
  195. var dict = {};
  196. this.get = function(key) {
  197. return dict.hasOwnProperty(key)
  198. ? dict[key]
  199. : null;
  200. }
  201. this.set = function(key, value) {
  202. dict[key] = value;
  203. return value;
  204. }
  205. };
  206. /**
  207. * Query an element with a CSS selector.
  208. *
  209. * @param string selector a CSS-selector-compatible query string.
  210. *
  211. * @return DOMElement|null
  212. */
  213. function query(selector)
  214. {
  215. \"use strict\";
  216. var key = 'SELECTOR: ' + selector;
  217. return cache.get(key) || cache.set(key, document.querySelector(selector));
  218. }
  219. /**
  220. * Canvas Manager
  221. */
  222. function CanvasManager(requests, maxRequestTime) {
  223. \"use strict\";
  224. var _drawingColors = ";
  225. // line 136
  226. echo twig_jsonencode_filter((isset($context["colors"]) ? $context["colors"] : $this->getContext($context, "colors")));
  227. echo ",
  228. _storagePrefix = 'timeline/',
  229. _threshold = 1,
  230. _requests = requests,
  231. _maxRequestTime = maxRequestTime;
  232. /**
  233. * Check whether this event is a child event.
  234. *
  235. * @return true if it is.
  236. */
  237. function isChildEvent(event)
  238. {
  239. return '__section__.child' === event.name;
  240. }
  241. /**
  242. * Check whether this event is categorized in 'section'.
  243. *
  244. * @return true if it is.
  245. */
  246. function isSectionEvent(event)
  247. {
  248. return 'section' === event.category;
  249. }
  250. /**
  251. * Get the width of the container.
  252. */
  253. function getContainerWidth()
  254. {
  255. return query('#collector-content h2').clientWidth;
  256. }
  257. /**
  258. * Draw one canvas.
  259. *
  260. * @param request the request object
  261. * @param max <subjected for removal>
  262. * @param threshold the threshold (lower bound) of the length of the timeline (in milliseconds).
  263. * @param width the width of the canvas.
  264. */
  265. this.drawOne = function(request, max, threshold, width)
  266. {
  267. \"use strict\";
  268. var text,
  269. ms,
  270. xc,
  271. drawableEvents,
  272. mainEvents,
  273. elementId = 'timeline_' + request.id,
  274. canvasHeight = 0,
  275. gapPerEvent = 38,
  276. colors = _drawingColors,
  277. space = 10.5,
  278. ratio = (width - space * 2) / max,
  279. h = space,
  280. x = request.left * ratio + space, // position
  281. canvas = cache.get(elementId) || cache.set(elementId, document.getElementById(elementId)),
  282. ctx = canvas.getContext(\"2d\"),
  283. backingStoreRatio,
  284. scaleRatio,
  285. devicePixelRatio;
  286. // Filter events whose total time is below the threshold.
  287. drawableEvents = request.events.filter(function(event) {
  288. return event.duration >= threshold;
  289. });
  290. canvasHeight += gapPerEvent * drawableEvents.length;
  291. // For retina displays so text and boxes will be crisp
  292. devicePixelRatio = window.devicePixelRatio == \"undefined\" ? 1 : window.devicePixelRatio;
  293. backingStoreRatio = ctx.webkitBackingStorePixelRatio == \"undefined\" ? 1 : ctx.webkitBackingStorePixelRatio;
  294. scaleRatio = devicePixelRatio / 1;
  295. canvasHeight += gapPerEvent * drawableEvents.length;
  296. canvas.width = width * scaleRatio;
  297. canvas.height = canvasHeight * scaleRatio;
  298. canvas.style.width = width + 'px';
  299. canvas.style.height = canvasHeight + 'px';
  300. ctx.scale(scaleRatio, scaleRatio);
  301. ctx.textBaseline = \"middle\";
  302. ctx.lineWidth = 0;
  303. // For each event, draw a line.
  304. ctx.strokeStyle = \"#dfdfdf\";
  305. drawableEvents.forEach(function(event) {
  306. event.periods.forEach(function(period) {
  307. var timelineHeadPosition = x + period.start * ratio;
  308. if (isChildEvent(event)) {
  309. ctx.fillStyle = colors.child_sections;
  310. ctx.fillRect(timelineHeadPosition, 0, (period.end - period.start) * ratio, canvasHeight);
  311. } else if (isSectionEvent(event)) {
  312. var timelineTailPosition = x + period.end * ratio;
  313. ctx.beginPath();
  314. ctx.moveTo(timelineHeadPosition, 0);
  315. ctx.lineTo(timelineHeadPosition, canvasHeight);
  316. ctx.moveTo(timelineTailPosition, 0);
  317. ctx.lineTo(timelineTailPosition, canvasHeight);
  318. ctx.fill();
  319. ctx.closePath();
  320. ctx.stroke();
  321. }
  322. });
  323. });
  324. // Filter for main events.
  325. mainEvents = drawableEvents.filter(function(event) {
  326. return !isChildEvent(event)
  327. });
  328. // For each main event, draw the visual presentation of timelines.
  329. mainEvents.forEach(function(event) {
  330. h += 8;
  331. // For each sub event, ...
  332. event.periods.forEach(function(period) {
  333. // Set the drawing style.
  334. ctx.fillStyle = colors['default'];
  335. ctx.strokeStyle = colors['default'];
  336. if (colors[event.name]) {
  337. ctx.fillStyle = colors[event.name];
  338. ctx.strokeStyle = colors[event.name];
  339. } else if (colors[event.category]) {
  340. ctx.fillStyle = colors[event.category];
  341. ctx.strokeStyle = colors[event.category];
  342. }
  343. // Draw the timeline
  344. var timelineHeadPosition = x + period.start * ratio;
  345. if (!isSectionEvent(event)) {
  346. ctx.fillRect(timelineHeadPosition, h + 3, 2, 6);
  347. ctx.fillRect(timelineHeadPosition, h, (period.end - period.start) * ratio || 2, 6);
  348. } else {
  349. var timelineTailPosition = x + period.end * ratio;
  350. ctx.beginPath();
  351. ctx.moveTo(timelineHeadPosition, h);
  352. ctx.lineTo(timelineHeadPosition, h + 11);
  353. ctx.lineTo(timelineHeadPosition + 8, h);
  354. ctx.lineTo(timelineHeadPosition, h);
  355. ctx.fill();
  356. ctx.closePath();
  357. ctx.stroke();
  358. ctx.beginPath();
  359. ctx.moveTo(timelineTailPosition, h);
  360. ctx.lineTo(timelineTailPosition, h + 11);
  361. ctx.lineTo(timelineTailPosition - 8, h);
  362. ctx.lineTo(timelineTailPosition, h);
  363. ctx.fill();
  364. ctx.closePath();
  365. ctx.stroke();
  366. ctx.beginPath();
  367. ctx.moveTo(timelineHeadPosition, h);
  368. ctx.lineTo(timelineTailPosition, h);
  369. ctx.lineTo(timelineTailPosition, h + 2);
  370. ctx.lineTo(timelineHeadPosition, h + 2);
  371. ctx.lineTo(timelineHeadPosition, h);
  372. ctx.fill();
  373. ctx.closePath();
  374. ctx.stroke();
  375. }
  376. });
  377. h += 30;
  378. ctx.beginPath();
  379. ctx.strokeStyle = \"#dfdfdf\";
  380. ctx.moveTo(0, h - 10);
  381. ctx.lineTo(width, h - 10);
  382. ctx.closePath();
  383. ctx.stroke();
  384. });
  385. h = space;
  386. // For each event, draw the label.
  387. mainEvents.forEach(function(event) {
  388. ctx.fillStyle = \"#444\";
  389. ctx.font = \"12px sans-serif\";
  390. text = event.name;
  391. ms = \" ~ \" + (event.duration < 1 ? event.duration : parseInt(event.duration, 10)) + \" ms / ~ \" + event.memory + \" MB\";
  392. if (x + event.starttime * ratio + ctx.measureText(text + ms).width > width) {
  393. ctx.textAlign = \"end\";
  394. ctx.font = \"10px sans-serif\";
  395. xc = x + event.endtime * ratio - 1;
  396. ctx.fillText(ms, xc, h);
  397. xc -= ctx.measureText(ms).width;
  398. ctx.font = \"12px sans-serif\";
  399. ctx.fillText(text, xc, h);
  400. } else {
  401. ctx.textAlign = \"start\";
  402. ctx.font = \"12px sans-serif\";
  403. xc = x + event.starttime * ratio + 1;
  404. ctx.fillText(text, xc, h);
  405. xc += ctx.measureText(text).width;
  406. ctx.font = \"10px sans-serif\";
  407. ctx.fillText(ms, xc, h);
  408. }
  409. h += gapPerEvent;
  410. });
  411. };
  412. this.drawAll = function(width, threshold)
  413. {
  414. \"use strict\";
  415. width = width || getContainerWidth();
  416. threshold = threshold || this.getThreshold();
  417. var self = this;
  418. _requests.forEach(function(request) {
  419. self.drawOne(request, maxRequestTime, threshold, width);
  420. });
  421. };
  422. this.getThreshold = function() {
  423. var threshold = Sfjs.getPreference(_storagePrefix + 'threshold');
  424. if (threshold === null) {
  425. return _threshold;
  426. }
  427. _threshold = parseInt(threshold);
  428. return _threshold;
  429. };
  430. this.setThreshold = function(threshold)
  431. {
  432. _threshold = threshold;
  433. Sfjs.setPreference(_storagePrefix + 'threshold', threshold);
  434. return this;
  435. };
  436. };
  437. function canvasAutoUpdateOnResizeAndSubmit(e) {
  438. e.preventDefault();
  439. canvasManager.drawAll();
  440. }
  441. function canvasAutoUpdateOnThresholdChange(e) {
  442. canvasManager
  443. .setThreshold(query('input[name=\"threshold\"]').value)
  444. .drawAll();
  445. }
  446. var requests_data = {
  447. \"max\": ";
  448. // line 404
  449. 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")), "js", null, true);
  450. echo ",
  451. \"requests\": [
  452. ";
  453. // line 406
  454. echo $context["__internal_5ed76467abb08d70d5a18823039da801a7f7e325db2b639ff74ebb385d4e4be4"]->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"));
  455. echo "
  456. ";
  457. // line 408
  458. if (twig_length_filter($this->env, $this->getAttribute((isset($context["profile"]) ? $context["profile"] : $this->getContext($context, "profile")), "children"))) {
  459. // line 409
  460. echo " ,
  461. ";
  462. // line 410
  463. $context['_parent'] = (array) $context;
  464. $context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context["profile"]) ? $context["profile"] : $this->getContext($context, "profile")), "children"));
  465. $context['loop'] = array(
  466. 'parent' => $context['_parent'],
  467. 'index0' => 0,
  468. 'index' => 1,
  469. 'first' => true,
  470. );
  471. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  472. $length = count($context['_seq']);
  473. $context['loop']['revindex0'] = $length - 1;
  474. $context['loop']['revindex'] = $length;
  475. $context['loop']['length'] = $length;
  476. $context['loop']['last'] = 1 === $length;
  477. }
  478. foreach ($context['_seq'] as $context["_key"] => $context["child"]) {
  479. // line 411
  480. echo $context["__internal_5ed76467abb08d70d5a18823039da801a7f7e325db2b639ff74ebb385d4e4be4"]->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"));
  481. echo (($this->getAttribute((isset($context["loop"]) ? $context["loop"] : $this->getContext($context, "loop")), "last")) ? ("") : (","));
  482. echo "
  483. ";
  484. ++$context['loop']['index0'];
  485. ++$context['loop']['index'];
  486. $context['loop']['first'] = false;
  487. if (isset($context['loop']['length'])) {
  488. --$context['loop']['revindex0'];
  489. --$context['loop']['revindex'];
  490. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  491. }
  492. }
  493. $_parent = $context['_parent'];
  494. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']);
  495. $context = array_intersect_key($context, $_parent) + $_parent;
  496. }
  497. // line 414
  498. echo " ]
  499. };
  500. var canvasManager = new CanvasManager(requests_data.requests, requests_data.max);
  501. query('input[name=\"threshold\"]').value = canvasManager.getThreshold();
  502. canvasManager.drawAll();
  503. // Update the colors of legends.
  504. var timelineLegends = document.querySelectorAll('.sf-profiler-timeline > .legends > span[data-color]');
  505. for (var i = 0; i < timelineLegends.length; ++i) {
  506. var timelineLegend = timelineLegends[i];
  507. timelineLegend.style.borderLeftColor = timelineLegend.getAttribute('data-color');
  508. }
  509. // Bind event handlers
  510. var elementTimelineControl = query('#timeline-control'),
  511. elementThresholdControl = query('input[name=\"threshold\"]');
  512. window.onresize = canvasAutoUpdateOnResizeAndSubmit;
  513. elementTimelineControl.onsubmit = canvasAutoUpdateOnResizeAndSubmit;
  514. elementThresholdControl.onclick = canvasAutoUpdateOnThresholdChange;
  515. elementThresholdControl.onchange = canvasAutoUpdateOnThresholdChange;
  516. elementThresholdControl.onkeyup = canvasAutoUpdateOnThresholdChange;
  517. window.setTimeout(function() {
  518. canvasAutoUpdateOnThresholdChange(null);
  519. }, 50);
  520. //]]>";
  521. // line 446
  522. echo "</script>
  523. ";
  524. }
  525. // line 449
  526. public function getdump_request_data($_token = null, $_profile = null, $_events = null, $_origin = null)
  527. {
  528. $context = $this->env->mergeGlobals(array(
  529. "token" => $_token,
  530. "profile" => $_profile,
  531. "events" => $_events,
  532. "origin" => $_origin,
  533. ));
  534. $blocks = array();
  535. ob_start();
  536. try {
  537. // line 451
  538. $context["__internal_a44b9936bb56c92e899af7b68862951880a774d7d31c9d8b6ba9780647b992ab"] = $this;
  539. // line 452
  540. echo " {
  541. \"id\": \"";
  542. // line 453
  543. echo twig_escape_filter($this->env, (isset($context["token"]) ? $context["token"] : $this->getContext($context, "token")), "js", null, true);
  544. echo "\",
  545. \"left\": ";
  546. // line 454
  547. 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")))), "js", null, true);
  548. echo ",
  549. \"events\": [
  550. ";
  551. // line 456
  552. echo $context["__internal_a44b9936bb56c92e899af7b68862951880a774d7d31c9d8b6ba9780647b992ab"]->getdump_events((isset($context["events"]) ? $context["events"] : $this->getContext($context, "events")));
  553. echo "
  554. ]
  555. }
  556. ";
  557. } catch (Exception $e) {
  558. ob_end_clean();
  559. throw $e;
  560. }
  561. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  562. }
  563. // line 462
  564. public function getdump_events($_events = null)
  565. {
  566. $context = $this->env->mergeGlobals(array(
  567. "events" => $_events,
  568. ));
  569. $blocks = array();
  570. ob_start();
  571. try {
  572. // line 464
  573. $context['_parent'] = (array) $context;
  574. $context['_seq'] = twig_ensure_traversable((isset($context["events"]) ? $context["events"] : $this->getContext($context, "events")));
  575. $context['loop'] = array(
  576. 'parent' => $context['_parent'],
  577. 'index0' => 0,
  578. 'index' => 1,
  579. 'first' => true,
  580. );
  581. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  582. $length = count($context['_seq']);
  583. $context['loop']['revindex0'] = $length - 1;
  584. $context['loop']['revindex'] = $length;
  585. $context['loop']['length'] = $length;
  586. $context['loop']['last'] = 1 === $length;
  587. }
  588. foreach ($context['_seq'] as $context["name"] => $context["event"]) {
  589. // line 465
  590. if (("__section__" != (isset($context["name"]) ? $context["name"] : $this->getContext($context, "name")))) {
  591. // line 466
  592. echo " {
  593. \"name\": \"";
  594. // line 467
  595. echo twig_escape_filter($this->env, (isset($context["name"]) ? $context["name"] : $this->getContext($context, "name")), "js", null, true);
  596. echo "\",
  597. \"category\": \"";
  598. // line 468
  599. echo twig_escape_filter($this->env, $this->getAttribute((isset($context["event"]) ? $context["event"] : $this->getContext($context, "event")), "category"), "js", null, true);
  600. echo "\",
  601. \"origin\": ";
  602. // line 469
  603. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute((isset($context["event"]) ? $context["event"] : $this->getContext($context, "event")), "origin")), "js", null, true);
  604. echo ",
  605. \"starttime\": ";
  606. // line 470
  607. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute((isset($context["event"]) ? $context["event"] : $this->getContext($context, "event")), "starttime")), "js", null, true);
  608. echo ",
  609. \"endtime\": ";
  610. // line 471
  611. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute((isset($context["event"]) ? $context["event"] : $this->getContext($context, "event")), "endtime")), "js", null, true);
  612. echo ",
  613. \"duration\": ";
  614. // line 472
  615. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute((isset($context["event"]) ? $context["event"] : $this->getContext($context, "event")), "duration")), "js", null, true);
  616. echo ",
  617. \"memory\": ";
  618. // line 473
  619. echo twig_escape_filter($this->env, sprintf("%.1F", (($this->getAttribute((isset($context["event"]) ? $context["event"] : $this->getContext($context, "event")), "memory") / 1024) / 1024)), "js", null, true);
  620. echo ",
  621. \"periods\": [";
  622. // line 475
  623. $context['_parent'] = (array) $context;
  624. $context['_seq'] = twig_ensure_traversable($this->getAttribute((isset($context["event"]) ? $context["event"] : $this->getContext($context, "event")), "periods"));
  625. $context['loop'] = array(
  626. 'parent' => $context['_parent'],
  627. 'index0' => 0,
  628. 'index' => 1,
  629. 'first' => true,
  630. );
  631. if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
  632. $length = count($context['_seq']);
  633. $context['loop']['revindex0'] = $length - 1;
  634. $context['loop']['revindex'] = $length;
  635. $context['loop']['length'] = $length;
  636. $context['loop']['last'] = 1 === $length;
  637. }
  638. foreach ($context['_seq'] as $context["_key"] => $context["period"]) {
  639. // line 476
  640. echo "{\"start\": ";
  641. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute((isset($context["period"]) ? $context["period"] : $this->getContext($context, "period")), "starttime")), "js", null, true);
  642. echo ", \"end\": ";
  643. echo twig_escape_filter($this->env, sprintf("%F", $this->getAttribute((isset($context["period"]) ? $context["period"] : $this->getContext($context, "period")), "endtime")), "js", null, true);
  644. echo "}";
  645. echo (($this->getAttribute((isset($context["loop"]) ? $context["loop"] : $this->getContext($context, "loop")), "last")) ? ("") : (", "));
  646. ++$context['loop']['index0'];
  647. ++$context['loop']['index'];
  648. $context['loop']['first'] = false;
  649. if (isset($context['loop']['length'])) {
  650. --$context['loop']['revindex0'];
  651. --$context['loop']['revindex'];
  652. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  653. }
  654. }
  655. $_parent = $context['_parent'];
  656. unset($context['_seq'], $context['_iterated'], $context['_key'], $context['period'], $context['_parent'], $context['loop']);
  657. $context = array_intersect_key($context, $_parent) + $_parent;
  658. // line 478
  659. echo "]
  660. }";
  661. // line 479
  662. echo (($this->getAttribute((isset($context["loop"]) ? $context["loop"] : $this->getContext($context, "loop")), "last")) ? ("") : (","));
  663. echo "
  664. ";
  665. }
  666. ++$context['loop']['index0'];
  667. ++$context['loop']['index'];
  668. $context['loop']['first'] = false;
  669. if (isset($context['loop']['length'])) {
  670. --$context['loop']['revindex0'];
  671. --$context['loop']['revindex'];
  672. $context['loop']['last'] = 0 === $context['loop']['revindex0'];
  673. }
  674. }
  675. $_parent = $context['_parent'];
  676. unset($context['_seq'], $context['_iterated'], $context['name'], $context['event'], $context['_parent'], $context['loop']);
  677. $context = array_intersect_key($context, $_parent) + $_parent;
  678. } catch (Exception $e) {
  679. ob_end_clean();
  680. throw $e;
  681. }
  682. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  683. }
  684. // line 485
  685. public function getdisplay_timeline($_id = null, $_events = null, $_colors = null)
  686. {
  687. $context = $this->env->mergeGlobals(array(
  688. "id" => $_id,
  689. "events" => $_events,
  690. "colors" => $_colors,
  691. ));
  692. $blocks = array();
  693. ob_start();
  694. try {
  695. // line 486
  696. echo " <div class=\"sf-profiler-timeline\">
  697. <div class=\"legends\">
  698. ";
  699. // line 488
  700. $context['_parent'] = (array) $context;
  701. $context['_seq'] = twig_ensure_traversable((isset($context["colors"]) ? $context["colors"] : $this->getContext($context, "colors")));
  702. foreach ($context['_seq'] as $context["category"] => $context["color"]) {
  703. // line 489
  704. echo " <span data-color=\"";
  705. echo twig_escape_filter($this->env, (isset($context["color"]) ? $context["color"] : $this->getContext($context, "color")), "html", null, true);
  706. echo "\">";
  707. echo twig_escape_filter($this->env, (isset($context["category"]) ? $context["category"] : $this->getContext($context, "category")), "html", null, true);
  708. echo "</span>
  709. ";
  710. }
  711. $_parent = $context['_parent'];
  712. unset($context['_seq'], $context['_iterated'], $context['category'], $context['color'], $context['_parent'], $context['loop']);
  713. $context = array_intersect_key($context, $_parent) + $_parent;
  714. // line 491
  715. echo " </div>
  716. <canvas width=\"680\" height=\"\" id=\"";
  717. // line 492
  718. echo twig_escape_filter($this->env, (isset($context["id"]) ? $context["id"] : $this->getContext($context, "id")), "html", null, true);
  719. echo "\" class=\"timeline\"></canvas>
  720. </div>
  721. ";
  722. } catch (Exception $e) {
  723. ob_end_clean();
  724. throw $e;
  725. }
  726. return ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
  727. }
  728. public function getTemplateName()
  729. {
  730. return "@WebProfiler/Collector/time.html.twig";
  731. }
  732. public function isTraitable()
  733. {
  734. return false;
  735. }
  736. public function getDebugInfo()
  737. {
  738. return array ( 810 => 492, 807 => 491, 796 => 489, 792 => 488, 788 => 486, 775 => 485, 749 => 479, 746 => 478, 727 => 476, 710 => 475, 706 => 473, 702 => 472, 698 => 471, 694 => 470, 690 => 469, 686 => 468, 682 => 467, 679 => 466, 677 => 465, 660 => 464, 649 => 462, 634 => 456, 629 => 454, 625 => 453, 622 => 452, 620 => 451, 606 => 449, 601 => 446, 567 => 414, 549 => 411, 532 => 410, 529 => 409, 527 => 408, 522 => 406, 517 => 404, 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 => 94, 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 => 136, 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,);
  739. }
  740. }