Adjusted structure for PDS skeleton.
This commit is contained in:
1 parent
4238509861
commit
d92a778d10
17 files changed
+164
-312
No files matched your search
@@ -4,6 +4,7 @@
|
|||||||
[](https://scrutinizer-ci.com/g/Rarst/laps/?branch=master)
|
[](https://scrutinizer-ci.com/g/Rarst/laps/?branch=master)
|
||||||
[](https://packagist.org/packages/rarst/laps)
|
[](https://packagist.org/packages/rarst/laps)
|
||||||
[](https://packagist.org/packages/rarst/laps)
|
[](https://packagist.org/packages/rarst/laps)
|
||||||
|
[](https://github.com/php-pds/skeleton)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
+9
-9
@@ -15,10 +15,10 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
public function watch() {
|
public function watch() {
|
||||||
|
|
||||||
$this->taskWatch()
|
$this->taskWatch()
|
||||||
->monitor( [ 'css/variables.less', 'css/laps.less' ], function () {
|
->monitor( [ 'public/css/variables.less', 'public/css/laps.less' ], function () {
|
||||||
$this->makeCss();
|
$this->makeCss();
|
||||||
} )
|
} )
|
||||||
->monitor( 'js/source.js', function () {
|
->monitor( 'public/js/source.js', function () {
|
||||||
$this->makeJs();
|
$this->makeJs();
|
||||||
} )
|
} )
|
||||||
->run();
|
->run();
|
||||||
@@ -39,9 +39,9 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
*/
|
*/
|
||||||
public function makeCss() {
|
public function makeCss() {
|
||||||
|
|
||||||
$this->taskExec( 'lessc css/laps.less css/laps.css --source-map=css/laps.css.map' )->run();
|
$this->taskExec( 'lessc public/css/laps.less public/css/laps.css --source-map=public/css/laps.css.map' )->run();
|
||||||
|
|
||||||
$this->taskMinify( 'css/laps.css' )
|
$this->taskMinify( 'public/css/laps.css' )
|
||||||
->run();
|
->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,12 +52,12 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
|
|
||||||
$this->taskConcat( [
|
$this->taskConcat( [
|
||||||
'vendor/twbs/bootstrap/js/tooltip.js',
|
'vendor/twbs/bootstrap/js/tooltip.js',
|
||||||
'js/source.js',
|
'public/js/source.js',
|
||||||
] )
|
] )
|
||||||
->to( 'js/laps.js' )
|
->to( 'public/js/laps.js' )
|
||||||
->run();
|
->run();
|
||||||
|
|
||||||
$this->taskMinify( 'js/laps.js' )
|
$this->taskMinify( 'public/js/laps.js' )
|
||||||
->run();
|
->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,11 +65,11 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
* Compiles plugin's mustache template
|
* Compiles plugin's mustache template
|
||||||
*/
|
*/
|
||||||
public function makeMustache() {
|
public function makeMustache() {
|
||||||
$dir = __DIR__ . '/views/cache';
|
$dir = __DIR__ . '/src/mustache/cache';
|
||||||
$this->_cleanDir( $dir );
|
$this->_cleanDir( $dir );
|
||||||
$mustache = new \Mustache_Engine(
|
$mustache = new \Mustache_Engine(
|
||||||
array(
|
array(
|
||||||
'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__ . '/views' ),
|
'loader' => new \Mustache_Loader_FilesystemLoader( __DIR__ . '/src/mustache' ),
|
||||||
'cache' => $dir,
|
'cache' => $dir,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
+2
-1
@@ -32,6 +32,7 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"twbs/bootstrap": "~3.2",
|
"twbs/bootstrap": "~3.2",
|
||||||
"brain/monkey" : "^2.2"
|
"brain/monkey" : "^2.2",
|
||||||
|
"pds/skeleton": "^1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+32
-1
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "6e02995f57446a59552f7e5a84a75278",
|
"content-hash": "ae3ee3a571959800e23b0be51d700c2c",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "composer/installers",
|
"name": "composer/installers",
|
||||||
@@ -540,6 +540,37 @@
|
|||||||
],
|
],
|
||||||
"time": "2017-10-06T16:20:43+00:00"
|
"time": "2017-10-06T16:20:43+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "pds/skeleton",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-pds/skeleton.git",
|
||||||
|
"reference": "95e476e5d629eadacbd721c5a9553e537514a231"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-pds/skeleton/zipball/95e476e5d629eadacbd721c5a9553e537514a231",
|
||||||
|
"reference": "95e476e5d629eadacbd721c5a9553e537514a231",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"bin/pds-skeleton"
|
||||||
|
],
|
||||||
|
"type": "standard",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Pds\\Skeleton\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"CC-BY-SA-4.0"
|
||||||
|
],
|
||||||
|
"description": "Standard for PHP package skeletons.",
|
||||||
|
"homepage": "https://github.com/php-pds/skeleton",
|
||||||
|
"time": "2017-01-25T23:30:41+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "twbs/bootstrap",
|
"name": "twbs/bootstrap",
|
||||||
"version": "v3.3.7",
|
"version": "v3.3.7",
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
@@ -1,7 +1,7 @@
|
|||||||
@import (reference) "../vendor/twbs/bootstrap/less/variables.less";
|
@import (reference) "../../vendor/twbs/bootstrap/less/variables.less";
|
||||||
@import (reference) "../vendor/twbs/bootstrap/less/mixins.less";
|
@import (reference) "../../vendor/twbs/bootstrap/less/mixins.less";
|
||||||
@import (reference) "../vendor/twbs/bootstrap/less/progress-bars.less";
|
@import (reference) "../../vendor/twbs/bootstrap/less/progress-bars.less";
|
||||||
@import (reference) "../vendor/twbs/bootstrap/less/scaffolding.less";
|
@import (reference) "../../vendor/twbs/bootstrap/less/scaffolding.less";
|
||||||
@import "variables.less";
|
@import "variables.less";
|
||||||
|
|
||||||
#wpadminbar {
|
#wpadminbar {
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@import "../vendor/twbs/bootstrap/less/tooltip.less";
|
@import "../../vendor/twbs/bootstrap/less/tooltip.less";
|
||||||
|
|
||||||
.tooltip.in {
|
.tooltip.in {
|
||||||
.opacity(1);
|
.opacity(1);
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -22,8 +22,8 @@ class Asset_Manager {
|
|||||||
public function enqueue_scripts() {
|
public function enqueue_scripts() {
|
||||||
|
|
||||||
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
$suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min';
|
||||||
wp_register_script( 'laps', plugins_url( "js/laps{$suffix}.js", dirname( __DIR__ ) ), [ 'jquery' ], '3.3.1', true );
|
wp_register_script( 'laps', plugins_url( "public/js/laps{$suffix}.js", dirname( __DIR__ ) ), [ 'jquery' ], '3.3.1', true );
|
||||||
wp_register_style( 'laps', plugins_url( "css/laps{$suffix}.css", dirname( __DIR__ ) ) );
|
wp_register_style( 'laps', plugins_url( "public/css/laps{$suffix}.css", dirname( __DIR__ ) ) );
|
||||||
|
|
||||||
if ( is_admin_bar_showing() ) {
|
if ( is_admin_bar_showing() ) {
|
||||||
wp_enqueue_script( 'laps' );
|
wp_enqueue_script( 'laps' );
|
||||||
|
|||||||
+2
-2
@@ -28,8 +28,8 @@ class Plugin extends Container {
|
|||||||
|
|
||||||
$laps['mustache'] = function () {
|
$laps['mustache'] = function () {
|
||||||
return new \Mustache_Engine( [
|
return new \Mustache_Engine( [
|
||||||
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/views' ),
|
'loader' => new \Mustache_Loader_FilesystemLoader( dirname( __DIR__ ) . '/src/mustache' ),
|
||||||
'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/views/cache' ),
|
'cache' => new Mustache_Cache_FrozenCache( dirname( __DIR__ ) . '/src/mustache/cache' ),
|
||||||
] );
|
] );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
class __Mustache_a04731de0bb9e043ecde3814b3a901bb extends Mustache_Template
|
||||||
|
{
|
||||||
|
private $lambdaHelper;
|
||||||
|
|
||||||
|
public function renderInternal(Mustache_Context $context, $indent = '')
|
||||||
|
{
|
||||||
|
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
|
||||||
|
$buffer = '';
|
||||||
|
|
||||||
|
// 'timelines' section
|
||||||
|
$value = $context->find('timelines');
|
||||||
|
$buffer .= $this->sectionAdac57c50f147efcda3ea1c17e7a6c61($context, $indent, $value);
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function section9f1840fed1e29fb14453f0ea2bfe30ad(Mustache_Context $context, $indent, $value)
|
||||||
|
{
|
||||||
|
$buffer = '';
|
||||||
|
|
||||||
|
if (!is_string($value) && is_callable($value)) {
|
||||||
|
$source = '
|
||||||
|
<div class="event event-{{category}}" data-toggle="tooltip" title="{{description}}" style="width:{{width}}%; left:{{offset}}%;">
|
||||||
|
<span class="sr-only">{{description}}</span>
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
$result = call_user_func($value, $source, $this->lambdaHelper);
|
||||||
|
if (strpos($result, '{{') === false) {
|
||||||
|
$buffer .= $result;
|
||||||
|
} else {
|
||||||
|
$buffer .= $this->mustache
|
||||||
|
->loadLambda((string) $result)
|
||||||
|
->renderInternal($context);
|
||||||
|
}
|
||||||
|
} elseif (!empty($value)) {
|
||||||
|
$values = $this->isIterable($value) ? $value : array($value);
|
||||||
|
foreach ($values as $value) {
|
||||||
|
$context->push($value);
|
||||||
|
|
||||||
|
$buffer .= $indent . ' <div class="event event-';
|
||||||
|
$value = $this->resolveValue($context->find('category'), $context);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '" data-toggle="tooltip" title="';
|
||||||
|
$value = $this->resolveValue($context->find('description'), $context);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '" style="width:';
|
||||||
|
$value = $this->resolveValue($context->find('width'), $context);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '%; left:';
|
||||||
|
$value = $this->resolveValue($context->find('offset'), $context);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '%;">
|
||||||
|
';
|
||||||
|
$buffer .= $indent . ' <span class="sr-only">';
|
||||||
|
$value = $this->resolveValue($context->find('description'), $context);
|
||||||
|
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
||||||
|
$buffer .= '</span>
|
||||||
|
';
|
||||||
|
$buffer .= $indent . ' </div>
|
||||||
|
';
|
||||||
|
$context->pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function sectionAdac57c50f147efcda3ea1c17e7a6c61(Mustache_Context $context, $indent, $value)
|
||||||
|
{
|
||||||
|
$buffer = '';
|
||||||
|
|
||||||
|
if (!is_string($value) && is_callable($value)) {
|
||||||
|
$source = '
|
||||||
|
<div class="laps-timeline">
|
||||||
|
{{#.}}
|
||||||
|
<div class="event event-{{category}}" data-toggle="tooltip" title="{{description}}" style="width:{{width}}%; left:{{offset}}%;">
|
||||||
|
<span class="sr-only">{{description}}</span>
|
||||||
|
</div>
|
||||||
|
{{/.}}
|
||||||
|
</div>
|
||||||
|
';
|
||||||
|
$result = call_user_func($value, $source, $this->lambdaHelper);
|
||||||
|
if (strpos($result, '{{') === false) {
|
||||||
|
$buffer .= $result;
|
||||||
|
} else {
|
||||||
|
$buffer .= $this->mustache
|
||||||
|
->loadLambda((string) $result)
|
||||||
|
->renderInternal($context);
|
||||||
|
}
|
||||||
|
} elseif (!empty($value)) {
|
||||||
|
$values = $this->isIterable($value) ? $value : array($value);
|
||||||
|
foreach ($values as $value) {
|
||||||
|
$context->push($value);
|
||||||
|
|
||||||
|
$buffer .= $indent . ' <div class="laps-timeline">
|
||||||
|
';
|
||||||
|
// '.' section
|
||||||
|
$value = $context->last('.');
|
||||||
|
$buffer .= $this->section9f1840fed1e29fb14453f0ea2bfe30ad($context, $indent, $value);
|
||||||
|
$buffer .= $indent . ' </div>
|
||||||
|
';
|
||||||
|
$context->pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
File renamed without changes.
@@ -1,292 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class __Mustache_797f2a84b9a5a7b601644494da75d61e extends Mustache_Template
|
|
||||||
{
|
|
||||||
private $lambdaHelper;
|
|
||||||
|
|
||||||
public function renderInternal(Mustache_Context $context, $indent = '')
|
|
||||||
{
|
|
||||||
$this->lambdaHelper = new Mustache_LambdaHelper($this->mustache, $context);
|
|
||||||
$buffer = '';
|
|
||||||
$blocksContext = array();
|
|
||||||
|
|
||||||
$buffer .= $indent . '<div class="laps-timeline">
|
|
||||||
';
|
|
||||||
// 'events' section
|
|
||||||
$value = $context->find('events');
|
|
||||||
$buffer .= $this->section940385acb9865793d8943db356869c18($context, $indent, $value);
|
|
||||||
$buffer .= $indent . '</div>
|
|
||||||
';
|
|
||||||
$buffer .= $indent . '
|
|
||||||
';
|
|
||||||
// 'savequeries' section
|
|
||||||
$value = $context->find('savequeries');
|
|
||||||
$buffer .= $this->sectionB93c1beb6bc5c41326a972381b0dd94a($context, $indent, $value);
|
|
||||||
$buffer .= $indent . '
|
|
||||||
';
|
|
||||||
// 'savehttp' section
|
|
||||||
$value = $context->find('savehttp');
|
|
||||||
$buffer .= $this->section238f05e38d8d133266503e545e18de7e($context, $indent, $value);
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function section940385acb9865793d8943db356869c18(Mustache_Context $context, $indent, $value)
|
|
||||||
{
|
|
||||||
$buffer = '';
|
|
||||||
$blocksContext = array();
|
|
||||||
|
|
||||||
if (!is_string($value) && is_callable($value)) {
|
|
||||||
$source = '
|
|
||||||
<div class="event event-{{category}}" data-toggle="tooltip" title="{{name}} - {{duration}} ms - {{memory}} MB" style="width:{{width}}%; left:{{offset}}%;">
|
|
||||||
<span class="sr-only">{{name}} - {{duration}} ms - {{memory}} MB</span>
|
|
||||||
</div>
|
|
||||||
';
|
|
||||||
$result = call_user_func($value, $source, $this->lambdaHelper);
|
|
||||||
if (strpos($result, '{{') === false) {
|
|
||||||
$buffer .= $result;
|
|
||||||
} else {
|
|
||||||
$buffer .= $this->mustache
|
|
||||||
->loadLambda((string) $result)
|
|
||||||
->renderInternal($context);
|
|
||||||
}
|
|
||||||
} elseif (!empty($value)) {
|
|
||||||
$values = $this->isIterable($value) ? $value : array($value);
|
|
||||||
foreach ($values as $value) {
|
|
||||||
$context->push($value);
|
|
||||||
|
|
||||||
$buffer .= $indent . ' <div class="event event-';
|
|
||||||
$value = $this->resolveValue($context->find('category'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '" data-toggle="tooltip" title="';
|
|
||||||
$value = $this->resolveValue($context->find('name'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' - ';
|
|
||||||
$value = $this->resolveValue($context->find('duration'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' ms - ';
|
|
||||||
$value = $this->resolveValue($context->find('memory'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' MB" style="width:';
|
|
||||||
$value = $this->resolveValue($context->find('width'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '%; left:';
|
|
||||||
$value = $this->resolveValue($context->find('offset'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '%;">
|
|
||||||
';
|
|
||||||
$buffer .= $indent . ' <span class="sr-only">';
|
|
||||||
$value = $this->resolveValue($context->find('name'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' - ';
|
|
||||||
$value = $this->resolveValue($context->find('duration'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' ms - ';
|
|
||||||
$value = $this->resolveValue($context->find('memory'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' MB</span>
|
|
||||||
';
|
|
||||||
$buffer .= $indent . ' </div>
|
|
||||||
';
|
|
||||||
$context->pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function section372053fedd826e7e297c29f607930cbc(Mustache_Context $context, $indent, $value)
|
|
||||||
{
|
|
||||||
$buffer = '';
|
|
||||||
$blocksContext = array();
|
|
||||||
|
|
||||||
if (!is_string($value) && is_callable($value)) {
|
|
||||||
$source = '
|
|
||||||
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;">
|
|
||||||
<span class="sr-only">{{sql}}</span>
|
|
||||||
</div>
|
|
||||||
';
|
|
||||||
$result = call_user_func($value, $source, $this->lambdaHelper);
|
|
||||||
if (strpos($result, '{{') === false) {
|
|
||||||
$buffer .= $result;
|
|
||||||
} else {
|
|
||||||
$buffer .= $this->mustache
|
|
||||||
->loadLambda((string) $result)
|
|
||||||
->renderInternal($context);
|
|
||||||
}
|
|
||||||
} elseif (!empty($value)) {
|
|
||||||
$values = $this->isIterable($value) ? $value : array($value);
|
|
||||||
foreach ($values as $value) {
|
|
||||||
$context->push($value);
|
|
||||||
|
|
||||||
$buffer .= $indent . ' <div class="event event-';
|
|
||||||
$value = $this->resolveValue($context->find('category'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '" title="';
|
|
||||||
$value = $this->resolveValue($context->find('sql'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '" style="width:';
|
|
||||||
$value = $this->resolveValue($context->find('width'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '%; left:';
|
|
||||||
$value = $this->resolveValue($context->find('offset'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '%;">
|
|
||||||
';
|
|
||||||
$buffer .= $indent . ' <span class="sr-only">';
|
|
||||||
$value = $this->resolveValue($context->find('sql'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '</span>
|
|
||||||
';
|
|
||||||
$buffer .= $indent . ' </div>
|
|
||||||
';
|
|
||||||
$context->pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function sectionB93c1beb6bc5c41326a972381b0dd94a(Mustache_Context $context, $indent, $value)
|
|
||||||
{
|
|
||||||
$buffer = '';
|
|
||||||
$blocksContext = array();
|
|
||||||
|
|
||||||
if (!is_string($value) && is_callable($value)) {
|
|
||||||
$source = '
|
|
||||||
<div class="laps-timeline">
|
|
||||||
{{#queries}}
|
|
||||||
<div class="event event-{{category}}" title="{{sql}}" style="width:{{width}}%; left:{{offset}}%;">
|
|
||||||
<span class="sr-only">{{sql}}</span>
|
|
||||||
</div>
|
|
||||||
{{/queries}}
|
|
||||||
</div>
|
|
||||||
';
|
|
||||||
$result = call_user_func($value, $source, $this->lambdaHelper);
|
|
||||||
if (strpos($result, '{{') === false) {
|
|
||||||
$buffer .= $result;
|
|
||||||
} else {
|
|
||||||
$buffer .= $this->mustache
|
|
||||||
->loadLambda((string) $result)
|
|
||||||
->renderInternal($context);
|
|
||||||
}
|
|
||||||
} elseif (!empty($value)) {
|
|
||||||
$values = $this->isIterable($value) ? $value : array($value);
|
|
||||||
foreach ($values as $value) {
|
|
||||||
$context->push($value);
|
|
||||||
|
|
||||||
$buffer .= $indent . '<div class="laps-timeline">
|
|
||||||
';
|
|
||||||
// 'queries' section
|
|
||||||
$value = $context->find('queries');
|
|
||||||
$buffer .= $this->section372053fedd826e7e297c29f607930cbc($context, $indent, $value);
|
|
||||||
$buffer .= $indent . '</div>
|
|
||||||
';
|
|
||||||
$context->pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function section26362c0132f6d74333e6154005595603(Mustache_Context $context, $indent, $value)
|
|
||||||
{
|
|
||||||
$buffer = '';
|
|
||||||
$blocksContext = array();
|
|
||||||
|
|
||||||
if (!is_string($value) && is_callable($value)) {
|
|
||||||
$source = '
|
|
||||||
<div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;">
|
|
||||||
<span class="sr-only">{{name}} - {{duration}} ms</span>
|
|
||||||
</div>
|
|
||||||
';
|
|
||||||
$result = call_user_func($value, $source, $this->lambdaHelper);
|
|
||||||
if (strpos($result, '{{') === false) {
|
|
||||||
$buffer .= $result;
|
|
||||||
} else {
|
|
||||||
$buffer .= $this->mustache
|
|
||||||
->loadLambda((string) $result)
|
|
||||||
->renderInternal($context);
|
|
||||||
}
|
|
||||||
} elseif (!empty($value)) {
|
|
||||||
$values = $this->isIterable($value) ? $value : array($value);
|
|
||||||
foreach ($values as $value) {
|
|
||||||
$context->push($value);
|
|
||||||
|
|
||||||
$buffer .= $indent . ' <div class="event event-';
|
|
||||||
$value = $this->resolveValue($context->find('category'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '" title="';
|
|
||||||
$value = $this->resolveValue($context->find('name'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' - ';
|
|
||||||
$value = $this->resolveValue($context->find('duration'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' ms" style="width:';
|
|
||||||
$value = $this->resolveValue($context->find('width'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '%; left:';
|
|
||||||
$value = $this->resolveValue($context->find('offset'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= '%;">
|
|
||||||
';
|
|
||||||
$buffer .= $indent . ' <span class="sr-only">';
|
|
||||||
$value = $this->resolveValue($context->find('name'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' - ';
|
|
||||||
$value = $this->resolveValue($context->find('duration'), $context);
|
|
||||||
$buffer .= htmlspecialchars($value, 2, 'UTF-8');
|
|
||||||
$buffer .= ' ms</span>
|
|
||||||
';
|
|
||||||
$buffer .= $indent . ' </div>
|
|
||||||
';
|
|
||||||
$context->pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function section238f05e38d8d133266503e545e18de7e(Mustache_Context $context, $indent, $value)
|
|
||||||
{
|
|
||||||
$buffer = '';
|
|
||||||
$blocksContext = array();
|
|
||||||
|
|
||||||
if (!is_string($value) && is_callable($value)) {
|
|
||||||
$source = '
|
|
||||||
<div class="laps-timeline">
|
|
||||||
{{#http}}
|
|
||||||
<div class="event event-{{category}}" title="{{name}} - {{duration}} ms" style="width:{{width}}%; left:{{offset}}%;">
|
|
||||||
<span class="sr-only">{{name}} - {{duration}} ms</span>
|
|
||||||
</div>
|
|
||||||
{{/http}}
|
|
||||||
</div>
|
|
||||||
';
|
|
||||||
$result = call_user_func($value, $source, $this->lambdaHelper);
|
|
||||||
if (strpos($result, '{{') === false) {
|
|
||||||
$buffer .= $result;
|
|
||||||
} else {
|
|
||||||
$buffer .= $this->mustache
|
|
||||||
->loadLambda((string) $result)
|
|
||||||
->renderInternal($context);
|
|
||||||
}
|
|
||||||
} elseif (!empty($value)) {
|
|
||||||
$values = $this->isIterable($value) ? $value : array($value);
|
|
||||||
foreach ($values as $value) {
|
|
||||||
$context->push($value);
|
|
||||||
|
|
||||||
$buffer .= $indent . '<div class="laps-timeline">
|
|
||||||
';
|
|
||||||
// 'http' section
|
|
||||||
$value = $context->find('http');
|
|
||||||
$buffer .= $this->section26362c0132f6d74333e6154005595603($context, $indent, $value);
|
|
||||||
$buffer .= $indent . '</div>
|
|
||||||
';
|
|
||||||
$context->pop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user