schmittjoh / jmsdebuggingbundle Goto Github PK
View Code? Open in Web Editor NEWThis bundle provides advanced debugging tools for your Symfony2 project.
Home Page: http://jmsyst.com/bundles/JMSDebuggingBundle
This bundle provides advanced debugging tools for your Symfony2 project.
Home Page: http://jmsyst.com/bundles/JMSDebuggingBundle
Apologies if this is documented somewhere else, but I cannot seem to find information anywhere on how to get the Help Resources portion of a 500 error page to show up. I'm unsure if this is a bug, or just poorly documented.
Install Symfony with composer as per usual, including JMSDebugging bundle.
Configure Symfony to work with JMSDebugging.
Edit the Welcome controller to throw an exception (or otherwise do something that will cause an exception to be thrown, perhaps unregister a required bundle (that is being used).
Help Resources box offering to find more resources about the thrown exception (or how to fix it)
Help Resources box is nowhere to be found.
Am I overlooking something here? Is there some sort of custom implementation that must be used in custom exceptions?
Cheers,
JP
Hi!
I had to roll my own request matcher service in my firewall and I had to implement an RequestMatcherInterface (https://github.com/symfony/HttpFoundation/blob/master/RequestMatcherInterface.php).
Now because of this file: https://github.com/schmittjoh/JMSDebuggingBundle/blob/430daab75b88d78ee9e06ed2ae7811ea3da947af/Security/TraceableMap.php (line 29) is expecting the request matcher to be one of this type https://github.com/schmittjoh/JMSDebuggingBundle/blob/430daab75b88d78ee9e06ed2ae7811ea3da947af/HttpFoundation/TraceableRequestMatcher.php
I had to implement two methods that are not present on the RequestMatcherInterface.php.
Are you open to a PR that makes this method optional so it plays well with user defined Request Matcher?
Hi all,
It would be nice to add in the docs the assets:install command so that you can enjoy the bundle in Symfony profiler.
Cheers
app/console -s --env=prod
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "jms.debugging.response_listener" has a dependency on a non-existent service "profiler".
Received the following exception (using Symfony 2.05 release):
An exception has been thrown during the rendering of a template ("Notice: Undefined index: acme_search.SearchFactory in C:\Program Files\Zend\Apache2\htdocs\Acme\vendor\bundles\JMS\DebuggingBundle\DataCollector\DiDataCollector.php line 101") in "JMSDebuggingBundle:Collector:container.html.twig" at line 140.
Here are the relevant service definitions:
<service id="acme_search.SearchFactory" class="%acme_search.SearchFactory.class%" scope="request">
<argument type="service" id="acmecore_searchfilter.FilterManager" />
<argument type="service" id="service_container" />
</service>
<service
id="acme_search.searcher"
class="%acmecore_searchfilter.SearcherInterface.class%"
scope="request"
factory-service="acme_search.SearchFactory"
factory-method="make">
</service>
Please make it compatible with latest stable release of symfony 2.0.12
Fatal error: Declaration of JMS\DebuggingBundle\Kernel\NullProfilerStorage::find() must be compatible with that of Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface::find() in D:\www\camnotifier\vendor\bundles\JMS\DebuggingBundle\Kernel\NullProfilerStorage.php on line 25
Thanks,
Petrica
Graph scaling needs to be improved to better use the available space. Right now, the graph often requires too much space for too few nodes.
Possible approaches:
After installing I immediately received this error on my project. After a little debugging I was able to trace this back to a Factory service. The factory service is defined as follows and the service id that returns null when $service = parent::get($id, $invalid);
is called is some_factory_service
. When JMSDebuggingBundle is not installed everything works fine, so I'm not sure if this is just a specific problem to factory services or something else.
Any ideas? Thanks!
app.some_factory:
class: App\SomeBundle\Factory\SomeFactory
arguments:
- "@some_service"
- "@another_service"
some_factory_service:
class: App\SomeBundle\Entity\SomeEntity
factory_service: app.some_factory
factory_method: get
When loading Google Analytics, your script is failing due to the fact that you are importing GA always under http. If you load the profiler under HTTPS, the whole profiler will fail due to the inclusion of GA with http.
Simply load GA using a scheme-less URL
dom.createDom('script', {'src': '//www.google-analytics.com/ga.js', 'type': 'text/javascript'});
I have detected minor typing errors in your css-files:
error_reporting.css:
Fatal error: Call to undefined method JMS\DebuggingBundle\DependencyInjection\JMSDebuggingExtension::getConfiguration() in C:\Program Files\Zend\Apache2\htdocs\MySite\vendor\bundles\JMS\DebuggingBundle\DependencyInjection\JMSDebuggingExtension.php on line 35
Hi!
I got this error when I try run the console in prod. env.:
app/console -s --env=prod
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
The service "jms.debugging.response_listener" has a dependency on a non-existent service "profiler".
I'm using BETA4 of Symfony. The DebuggingBundle configuration is the same as in the docs.
Could you please create a tag? It would be nice to remove the dev-master in our projects composer.json. Thanks in advance!
Add heuristics to show common entry points into the service graph (which services are requested first, and what other services causes that to load, etc.)
Hi,
I get the following error if I follow the docs and JMSSecurityExtraBundle is disabled:
Catchable fatal error: Argument 2 passed to Symfony\Component\HttpKernel\Event\FilterResponseEvent::__construct() must be an instance of Symfony\Component\HttpFoundation\Request, null given, called in /private/var/www/vendor/bundles/JMS/DebuggingBundle/Kernel/ExceptionHandler.php on line 73 and defined in /private/var/www/vendor/symfony/src/Symfony/Component/HttpKernel/Event/FilterResponseEvent.php on line 35
Call Stack
1 0.1106 6358096 JMS\DebuggingBundle\Kernel\ExceptionHandler->handle( ) ../ExceptionHandler.php:0
2 0.2274 7167808 Symfony\Component\HttpKernel\Event\FilterResponseEvent->__construct( ) ../ExceptionHandler.php:73
Symfony version is beta1.
Currently, the max level of the DIC visualizer is hardcoded in the JS code. It would be great to be able to change in through the UI.
Certain changes that the compiler makes like removing definitions, inlining definitions, etc. should be shown.
jms.ui.DirectedGraph
is a dependency of the jms.ui.ServiceGraph
class but it is not available in the bundle.
I also noticed that the plovr config references %kernel.root_dir%/../src-js/
which let me think that this bundle relies on some local setup to be able to compile the JS code.
Show service dependencies which are lazy-loaded from an injected container.
When using the debugging bundle, fatals errors of php are not displayed in development environment anymore. Instead you just get a blank page (with xdebug) or a 500 error without any concrete info (without xdebug).
This is because the bundle registers its own exception handler that symfony does not expect and thus won't trigger a fatal error exception.
But I'm not sure why the jms exception handler does not kick in then and handle the fatal error. I tried to make the JmsDebuggingBundle exception handler extend the HttpKernel exception handler to get recognised, but that's not so easy because the register
methods have different signatures (static vs non-static).
I feel uncomfortable with having my debug data automatically sent to a server I know nothing about (http://jmsyst.com/)
What the xhr is it about?
Fatal error: Declaration of JMS\DebuggingBundle\Kernel\NullProfilerStorage::find() must be compatible with that of Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface::find().
ProfilerStorageInterface::find expects 4 parameters , but NullProfilerStorage::find only have 3 parameters
Apparently the dependency injection tab makes requests to google analytics:
https://github.com/schmittjoh/JMSDebuggingBundle/blob/master/Resources/js/app/dic_visualizer.js#L270
Please provide some information about that in the README, as doing this intransparently might raise some privacy issues.
I've got this error after install JMSDebuggingBundle
The security context contains no authentication token. One possible reason may be that there is no firewall configured for this URL
which cause by a single method in my twig file
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
following is my security.yml
security:
providers:
fos_userbundle:
id: my.user_provider.email
encoders:
FOS\UserBundle\Model\UserInterface: sha512
firewalls:
main:
pattern: ^/
form_login:
provider: fos_userbundle
csrf_provider: form.csrf_provider
#use_referer: true
logout: true
anonymous: true
remember_me:
key: "%secret%"
lifetime: 31536000 # 365 days in seconds
path: /
domain: ~ # Defaults to the current domain from $_SERVER
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, role: ROLE_ADMIN }
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
I've did some hack on SecurityContext::isGranted by add var_dump($this->token) to see how it works.
following is my hack:
final public function isGranted($attributes, $object = null)
{
var_dump($this->token);
exit();
if (null === $this->token) {
throw new AuthenticationCredentialsNotFoundException('The security context contains no authentication token. One possible reason may be that there is no firewall configured for this URL.'); }
I got this when I disable the JMSDebuggingBundle:
class Symfony\Component\Security\Core\Authentication\Token\AnonymousToken#5208 (5) { private $key => string(13) "50a3205e41afc" private $user => string(5) "anon." private $roles => array(0) { } private $authenticated => bool(true) private $attributes => array(0) { } }
I got this when I enable the JMSDebuggingBundle
null
PHP Fatal error: Declaration of JMS\DebuggingBundle\Kernel\NullProfilerStorage::find() must be compatible with Symfony\Component\HttpKernel\Profiler\ProfilerStorageInterface::find($ip, $url, $limit, $method, $start = NULL, $end = NULL) in /var/www/test/symfony-standard-techtalk/vendor/jms/debugging-bundle/JMS/DebuggingBundle/Kernel/NullProfilerStorage.php on line 25
Since a recent update in the serializer component in symfony master, I have this exception when accessing the dev environment:
ErrorException: Catchable Fatal Error: Argument 1 passed to JMS\DebuggingBundle\Listener\ResponseListener::__construct() must be an instance of Symfony\Component\Serializer\Normalizer\NormalizerInterface, instance of JMS\DebuggingBundle\Serializer\ProfilerNormalizer given, called in /home/jordan/3MA/app/cache/dev/appDevDebugProjectContainer.php on line 842 and defined in /home/jordan/3MA/vendor/bundles/JMS/DebuggingBundle/Listener/ResponseListener.php line 40
Service details like its definition, where it is defined, etc. should be shown (possibly as context menu item).
The visualizer should show if a definition inherits from another definition.
When using the profiler offline, the GA tracker is not available which breaks the code of the DIC panel here: https://github.com/schmittjoh/JMSDebuggingBundle/blob/master/Resources/js/app/dic_visualizer.js#L124
IMO, it should be possible to use the profiler without having access to GA as it is not the key feature.
The DI visualizer is broken since symfony/symfony@11cdff9
I'm getting jms_dic_visualizer_install is not defined
javascript error when clicking the Service Container
tab. Not sure if i'm missing something in my config or if that's a bug.
Pretty sweet bundle btw ;)
Property Symfony\Component\HttpFoundation\RequestMatcher::$ip does not exist
It can be resolved to https://github.com/schmittjoh/JMSDebuggingBundle/blob/master/HttpFoundation/TraceableRequestMatcher.php#L68
There is no property $ip
anymore, but $ips
.
Hi,
while using JMSDebuggingBundle with a PHP7 project we keep receiving
Uncaught TypeError: Argument 1 passed to JMS\DebuggingBundle\Kernel\ExceptionHandler::handle() must be an instance of Exception, instance of Error given
That's most likely because PHP7 replaced old error handling system with the new Error Throwable which is not an Exception though (http://php.net/manual/en/class.error.php).
It just seems the bundle is not usable with PHP7 projects.
I will give here some ideas about the visualizer after using it a bit.
With latest patches on this bundle using WebTestCase with phpunit lead tests to crashes.
I added backported fix in my fork.
Since update last friday with dev master version we have an error
"The security context contains no authentication token. One possible reason may be that there is no firewall configured for this URL."
We tried to debug this and no ip filters are configured in security.yml
jms_security_extra:
secure_all_services: false
expressions: true
...
firewalls:
main:
pattern: ^/
anonymous: true
access_denied_url: /forbidden
form_login:
provider: custom
csrf_provider: form.csrf_provider
# default_target_path: /
# use_referer: true
success_handler: authentication_success_handler
failure_handler: authentication_failure_handler
login_path: /
check_path: /login_check
# use_forward: false
# use_referer: true
fos_facebook:
success_handler: facebook_auth_success_handler
app_url: http://apps.facebook.com/%facebook.app_id%/
server_url: "%facebook.server_url%"
login_path: /
check_path: /login_fb_check
always_use_default_target_path: true
use_forward: false
use_referer: true
default_target_path: /
provider: my_fos_facebook_provider
logout: ~
access_control:
- { path: ^/,roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/%admin_url%/login$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/%admin_url%, roles: ROLE_ADMIN }
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
, but apparently, in TraceableRequestMatcher class we have line 69
$ips = array($this->getFieldValue('ip'));
} else {
$ips = $this->getFieldValue('ips');
Maybe you have to check if ip is not null before ?
I encounter this error Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 50696 bytes) in asso\vendor\symfony\src\Symfony\Component\HttpKernel\DataCollector\DataCollector.php on line 29
in 2 cases :
When I throw an Exception from a factory_method. I've defined a service like that:
winzou_cache.cache:
factory_service: winzou_cache.factory
factory_method: build
class: winzou\CacheBundle\Cache\FileCache
arguments:
- %winzou_cache.driver.default%
and if I throw an Exception in the build method of my winzou_cache.factory service, I got this error. Everything works well when I don't throw any exception.
When I define the same service but with abstract: true and without class:
winzou_cache.cache:
factory_service: winzou_cache.factory
factory_method: build
abstract: true
arguments:
- %winzou_cache.driver.default%
I don't throw any exception in that case. Actually, if I put an exit('foo') in my factory file (at the very beginning), it's not even executed.
After investigation, I've found that in both case a FlattenException is thrown. In the first case it's mine, in the second case it's a "You have requested a non-existent service "winzou_cache.cache"." one (maybe I misuse the abstract way of defining a service, that's another problem).
I don't have this error when I don't override AppKernel/getContainerBaseClass() according to the doc of this bundle.
see https://github.com/schmittjoh/composer-deps-analyzer
basically showing the deps graph inside the profiler UI
can reuse the JS graph library used for the DIC visualization
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.