Skip to content

Commit 5e5f531

Browse files
committed
working proof of concept
1 parent 5dda8b9 commit 5e5f531

File tree

6 files changed

+27
-26
lines changed

6 files changed

+27
-26
lines changed

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ networks:
33

44
services:
55
app:
6-
user: root:${UID-1000}:${GID-1000}
6+
user: ${UID-1000}:${GID-1000}
77
build:
88
context: .
99
ports:
@@ -18,6 +18,8 @@ services:
1818
- NEO4J_PASSWORD=testtest
1919
- XDEBUG_CONFIG="client_host=host.docker.internal log=/tmp/xdebug.log"
2020
working_dir: /opt/project
21+
extra_hosts:
22+
- "host.docker.internal:host-gateway"
2123
networks:
2224
- neo4j-symfony
2325

src/Collector/Neo4jDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ public function getQueryCount(): int
7878

7979
public static function getTemplate(): ?string
8080
{
81-
return 'data_collector/web_profiler.html.twig';
81+
return '@Neo4j/web_profiler.html.twig';
8282
}
8383
}

src/DependencyInjection/Neo4jExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function load(array $configs, ContainerBuilder $container): ContainerBuil
7373
(new Definition(Neo4jDataCollector::class))
7474
->setAutowired(true)
7575
->addTag('data_collector', [
76-
'id' => Neo4jDataCollector::class,
76+
'id' => 'neo4j',
7777
'priority' => 500,
7878
])
7979
);

templates/web_profiler.html.twig renamed to src/Resources/views/web_profiler.html.twig

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% block toolbar %}
55
{% if collector.queryCount > 0 %}
66
{% set icon %}
7-
{{ include('@Neo4j/neo4j.svg') }}
7+
{# {{ include('@Neo4j/public/images/neo4j.svg') }}#}
88
<span class="sf-toolbar-value">{{ collector.queryCount }}</span>
99
<span class="sf-toolbar-label">stmt.</span>
1010
{% endset %}
@@ -22,25 +22,25 @@
2222
{% endif %}
2323
<div class="sf-toolbar-info-piece">
2424
<b>Total time</b>
25-
<span class="sf-toolbar-status">{{ '%0.2f'|format(collector.time) }}ms</span>
25+
{# <span class="sf-toolbar-status">{{ '%0.2f'|format(collector.time) }}ms</span>#}
2626
</div>
2727

2828
{% endset %}
2929
{% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url, 'status': collector.failedStatements|length ? 'red' : '' } %}
3030
{% endif %}
3131
{% endblock %}
3232

33-
{% block head %}
34-
<link rel="stylesheet" href="{{ asset('bundles/neo4j/css/neo4j.css') }}" />
35-
<script type="text/javascript" src="{{ asset("bundles/neo4j/js/neo4j.js") }}"></script>
36-
{{ parent() }}
37-
{% endblock %}
33+
{#{% block head %}#}
34+
{# <link rel="stylesheet" href="{{ asset('bundles/neo4j/css/neo4j.css') }}" />#}
35+
{# <script type="text/javascript" src="{{ asset("bundles/neo4j/js/neo4j.js") }}"></script>#}
36+
{# {{ parent() }}#}
37+
{#{% endblock %}#}
3838

3939
{% block menu %}
4040
{# This left-hand menu appears when using the full-screen profiler. #}
4141
<span class="label {{ collector.queryCount == 0 ? 'disabled' }} {{ collector.failedStatements|length ? 'label-status-error' }}">
4242
<span class="icon">
43-
{{ include('@Neo4j/Icon/neo4j.svg') }}
43+
{# {{ include('@Neo4j/Icon/neo4j.svg') }}#}
4444
</span>
4545
<strong>Neo4j</strong>
4646
{% if collector.failedStatements|length %}
@@ -68,7 +68,7 @@
6868
{% set start_time = statement.start_time|default(null) %}
6969
{% set end_time = statement.end_time|default(null) %}
7070

71-
<td class="nowrap{% if not statement.success %} bg-red{% endif %}">{{ idx + 1 }}</td>
71+
<td class="nowrap">{{ idx + 1 }}</td>
7272
<td class="nowrap">{% if start_time is not null and end_time is not null %}{{ '%0.2f'|format(end_time - start_time) }}ms{% endif %}</td>
7373
<td>
7474
<div>
@@ -85,24 +85,24 @@
8585
<div>
8686
<strong class="font-normal text-small">Tag</strong>: {{ statement.tag|default('N/A')|yaml_encode }}
8787
</div>
88-
{% if statement.success %}
89-
<div>
90-
<strong class="font-normal text-small">Number of results</strong>: {{ statement.nb_results }}
91-
</div>
92-
<div>
93-
<strong class="font-normal text-small">Scheme</strong>: {{ statement.scheme }}
94-
</div>
88+
{# {% if statement.success %}#}
9589
<div>
96-
<strong class="font-normal text-small">Statistics</strong>: {{ statement.statistics|yaml_encode }}
90+
<strong class="font-normal text-small">Number of results</strong>: {{ statement.nb_results|default('N/A') }}
9791
</div>
98-
{% else %}
9992
<div>
100-
<strong class="font-normal text-small">Type</strong>: {{ statement.exceptionCode }}
93+
<strong class="font-normal text-small">Scheme</strong>: {{ statement.scheme|default('N/A') }}
10194
</div>
10295
<div>
103-
<strong class="font-normal text-small">message</strong>: {{ statement.exceptionMessage }}
96+
<strong class="font-normal text-small">Statistics</strong>: {{ statement|yaml_encode }}
10497
</div>
105-
{% endif %}
98+
{# {% else %}#}
99+
{# <div>#}
100+
{# <strong class="font-normal text-small">Type</strong>: {{ statement.exceptionCode }}#}
101+
{# </div>#}
102+
{# <div>#}
103+
{# <strong class="font-normal text-small">message</strong>: {{ statement.exceptionMessage }}#}
104+
{# </div>.suc#}
105+
{# {% endif %}#}
106106
</div>
107107
</td>
108108
</tr>

tests/App/config/default.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ twig:
2020
debug: "%kernel.debug%"
2121
paths:
2222
- '%kernel.project_dir%/tests/App/Controller/Twig'
23-
- '%kernel.project_dir%/templates'
2423

2524
web_profiler:
2625
toolbar: true

tests/App/config/routes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ web_profiler_wdt:
77
prefix: /_wdt
88
web_profiler_profiler:
99
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
10-
prefix: /_profiler
10+
prefix: /_profiler4

0 commit comments

Comments
 (0)