Coder Social home page Coder Social logo

schmittjoh / jmsdebuggingbundle Goto Github PK

View Code? Open in Web Editor NEW
161.0 161.0 29.0 401 KB

This bundle provides advanced debugging tools for your Symfony2 project.

Home Page: http://jmsyst.com/bundles/JMSDebuggingBundle

PHP 47.97% JavaScript 34.01% CSS 8.85% HTML 9.17%

jmsdebuggingbundle's People

Contributors

bocharsky-bw avatar cordoval avatar cristinecula avatar dcsg avatar gimler avatar jalliot avatar jpalawaga avatar krymen avatar lenar avatar lsmith77 avatar marijn avatar marliotto avatar ornicar avatar richardmiller-zz avatar schmittjoh avatar seldaek avatar stof avatar tomadam avatar vicb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jmsdebuggingbundle's Issues

Help Resource Finder not making an Appearance.

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.

Reproduction:

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).

Expected:

Help Resources box offering to find more resources about the thrown exception (or how to fix it)

Actual:

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

Problem with rolling your own request matcher

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?

Add assets:install to the docs

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

ependency on a non-existent service "profiler"

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".  

Undefined Index Exception when DIC uses factory to get service

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>

Declaration of NullProfilerStorage::find()

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

Improve graph scaling/node placement

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:

  • count line segment crossings
  • analyze line segment length distribution (line segments should have almost equal length)

Warning: SplObjectStorage::contains() expects parameter 1 to be object, null given in ....JMS/DebuggingBundle/DependencyInjection/TraceableContainer.php line 71

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

Script doesn't load under HTTPS (mixed-mode content)

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'});

typing errors in css-file

I have detected minor typing errors in your css-files:
error_reporting.css:

jms-debugging-error-reporting uses margin-bottm ilo margin-bottom

jms-ui-report-dialog-attr uses font-color ilo color

Dependency on a non-existent service "profiler"

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.

create a tag

Could you please create a tag? It would be nice to remove the dev-master in our projects composer.json. Thanks in advance!

Show entry points

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.)

Error if JMSSecurityExtraBundle is disabled

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

Time Memory Function Location

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.

Missing JS source files

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.

Fatal errors are not displayed

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).

Error after updating symfony

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

security token is missing after using JMSDebuggingBundle

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

Issue with latest symfony master

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

Show service details

Service details like its definition, where it is defined, etc. should be shown (possibly as context menu item).

Show Inheritance

The visualizer should show if a definition inherits from another definition.

javascript error in dic tab

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 ;)

Error on Symfony 2.3

After installing and activating the bundle I'm having the following error:

The service "profiler" has a dependency on a non-existent service "security.context".

captura de pantalla 2015-02-17 a las 10 31 37

ExceptionHandler not supporting PHP7 Error

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.

Improvement of the DI visualizer

I will give here some ideas about the visualizer after using it a bit.

  • It seems that setter injection is not handled by the visualizer currently. Adding it would be useful as it also defines dependencies.
  • Inheritance of definitions does not appear either which can hide some dependencies coming from the parent definition
  • and finally for the UI: it seems weird to use the full height of the page when there is only 2 services in the graph. The point is that the left column of the profiler is big so it always add a vertical scroll bar. A big graph could of course require scrolling but a small one also does curently.

Uncaught TypeError

Hello,
Recently, I got this error.
error_jmsdebugging
After deactivating JMSDebuggingBundle, I discover it was missing a file (cf. a repository) in my project. The error was not clear about that.

error with Sf2.1 since friday

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 ?

Allowed memory size exhausted

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.