Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fd85363

Browse files
committed
made it clear that the profiler is for dev only
1 parent 31f8cb9 commit fd85363

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

src/Symfony/Bundle/WebProfilerBundle/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
WebProfilerBundle
22
=================
33

4+
The Web profiler bundle is a **development tool** that gives detailed
5+
information about the execution of any request.
6+
7+
**Never** enable it in production environments as it will lead to major security
8+
vulnerabilities in your project.
9+
410
Resources
511
---------
612

src/Symfony/Bundle/WebProfilerBundle/WebProfilerBundle.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@
1414
use Symfony\Component\HttpKernel\Bundle\Bundle;
1515

1616
/**
17-
* Bundle.
18-
*
1917
* @author Fabien Potencier <[email protected]>
2018
*/
2119
class WebProfilerBundle extends Bundle
2220
{
21+
public function boot()
22+
{
23+
if ('prod' === $this->container->getParameter('kernel.environment')) {
24+
@trigger_error('Using WebProfilerBundle in production is not supported and put your project at risk, disable it.', E_USER_DEPRECATED);
25+
}
26+
}
2327
}

src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
/**
1515
* ProfilerStorageInterface.
1616
*
17+
* This interface exists for historical reasons. The only supported implementation
18+
* is FileProfilerStorage.
19+
*
20+
* As the profiler must only be used in non-production environments, the file storage
21+
* is more than enough and no other implementations will ever be supported.
22+
*
23+
* @internal
24+
*
1725
* @author Fabien Potencier <[email protected]>
1826
*/
1927
interface ProfilerStorageInterface

0 commit comments

Comments
 (0)