Skip to content
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Commit 1626390

Browse files
committed
Added API changelog to colelctor + Added field description on hover
1 parent 7aefaf2 commit 1626390

File tree

2 files changed

+33
-34
lines changed

2 files changed

+33
-34
lines changed

DataCollector/CacheCollector.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,4 @@
11
<?php
2-
/**
3-
*
4-
* This file is part of phpFastCache.
5-
*
6-
* @license MIT License (MIT)
7-
*
8-
* For full copyright and license information, please see the docs/CREDITS.txt file.
9-
*
10-
* @author Georges.L (Geolim4) <contact@geolim4.com>
11-
* @author PastisD https://github.com/PastisD
12-
* @author Khoa Bui (khoaofgod) <khoaofgod@gmail.com> http://www.phpfastcache.com
13-
*
14-
*/
152

163
namespace phpFastCache\Bundle\DataCollector;
174

@@ -67,6 +54,7 @@ public function collect(Request $request, Response $response, \Exception $except
6754

6855
$this->data = [
6956
'apiVersion' => phpFastCacheApi::getVersion(),
57+
'apiChangelog' => phpFastCacheApi::getChangelog(),
7058
'driverUsed' => $driverUsed,
7159
'instances' => $instances,
7260
'stats' => $stats,
@@ -137,6 +125,13 @@ public function getApiVersion()
137125
return $this->data[ 'apiVersion' ];
138126
}
139127

128+
/**
129+
* @return mixed
130+
*/
131+
public function getApiChangelog()
132+
{
133+
return $this->data[ 'apiChangelog' ];
134+
}
140135

141136
/**
142137
* @return string

Resources/views/data_collector/template.html.twig

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
{#
2-
*
3-
* This file is part of phpFastCache.
4-
*
5-
* @license MIT License (MIT)
6-
*
7-
* For full copyright and license information, please see the docs/CREDITS.txt file.
8-
*
9-
* @author Georges.L (Geolim4) <contact@geolim4.com>
10-
* @author PastisD https://github.com/PastisD
11-
* @author Khoa Bui (khoaofgod) <khoaofgod@gmail.com> http://www.phpfastcache.com
12-
*
13-
#}
14-
151
{% extends 'WebProfilerBundle:Profiler:layout.html.twig' %}
162

173
{% block toolbar %}
@@ -53,7 +39,7 @@
5339
{% elseif collector.driverUsed|length == 1 %}
5440
<span><abbr title="{{ collector.driverUsed|first }}">{{ collector.driverUsed|keys|first }}</abbr></span>
5541
{% else %}
56-
<span>Multiple ({{ collector.driverUsed|length }})</span>
42+
<span title="{{ collector.driverUsed|keys|join(', ') }}"><abbr>Multiple ({{ collector.driverUsed|length }})</abbr></span>
5743
{% endif %}
5844
</div>
5945
</div>
@@ -114,31 +100,45 @@
114100
<table class="{{ class|default('') }}">
115101
<tbody>
116102
<tr>
117-
<th>Driver Name</th>
103+
<th title="The driver name with the namespace used">
104+
<abbr>Driver Name</abbr>
105+
</th>
118106
<td><strong>{{ collector.instances[name].driverName }}</strong> (
119107
<small><code>{{ collector.driverUsed[collector.instances[name].driverName] }}</code>
120108
</small>
121109
)
122110
</td>
123111
</tr>
124112
<tr>
125-
<th>Driver Info</th>
113+
<th title="A short information provided by the itemPool depending the driver configuration">
114+
<abbr>Driver Info</abbr>
115+
</th>
126116
<td>{{ stat.info|nl2br }}</td>
127117
</tr>
128118
<tr>
129-
<th>Driver Size</th>
119+
<th title="The disk/memory size took by the driver, it can be approximate depending the kind of driver.">
120+
<abbr>Driver Size</abbr>
121+
</th>
130122
<td>{{ stat.size|sizeFormat(1) }}</td>
131123
</tr>
132124
<tr>
133-
<th>Driver Data</th>
125+
<th title="The driver items keys fetched during the whole script execution">
126+
<abbr>
127+
Driver Data
128+
</abbr>
129+
</th>
134130
<td>{{ stat.data }}</td>
135131
</tr>
136132
<tr>
137-
<th>Driver RawData</th>
133+
<th title="A bunch of raw configuration/debug data provided by the driver itself">
134+
<abbr>Driver RawData</abbr>
135+
</th>
138136
<td>{{ dump(stat.rawData) }}</td>
139137
</tr>
140138
<tr>
141-
<th>Driver Config</th>
139+
<th title="The configuration that was used to setup the driver instance">
140+
<abbr>Driver Config</abbr>
141+
</th>
142142
<td>{{ dump(collector.instances[name].driverConfig) }}</td>
143143
</tr>
144144
</tbody>
@@ -164,4 +164,8 @@
164164
{% endfor %}
165165
</tbody>
166166
</table>
167+
<h2>PhpFastCache API Changelog</h2>
168+
<div>
169+
<pre>{{ collector.apiChangelog }}</pre>
170+
</div>
167171
{% endblock %}

0 commit comments

Comments
 (0)