Git Product home page Git Product logo

silex-webprofiler's People

Contributors

bangpound avatar danez avatar dominikzogg avatar fabpot avatar glaubinix avatar gromnan avatar gwendolenlynch avatar heahdude avatar henrikbjorn avatar hkdobrev avatar igorw avatar igusev avatar jeremyfreeagent avatar mashkin avatar mtorres avatar mvanbaak avatar qkdreyer avatar sarim avatar sergiors avatar skalpa avatar softius avatar spacepossum avatar stof avatar teameh 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silex-webprofiler's Issues

PHPUnit: LogicException: The section "5147994aa3a78" has been started at an other level and can not be opened.

When I enable the profiler in unit tests I get the following exception.
In regular web requests profiling (and toolbar) do work fine.

Thanks, mano

vendor/symfony/stopwatch/Symfony/Component/Stopwatch/Stopwatch.php:48
vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php:391
vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php:129
vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpKernel.php:90
vendor/silex/silex/src/Silex/Application.php:516
vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Client.php:64
vendor/symfony/browser-kit/Symfony/Component/BrowserKit/Client.php:264

Silex Web Profiler broken TranslationService

An example is worth a thousand words. Simple App (Silex Fat + SilexWebProfiler)

composer.json

{
    "require": {
        "silex/silex": "~1.0",
        "silex/web-profiler": "~1.0",
        "symfony/browser-kit": "~2.1",
        "symfony/console": "~2.1",
        "symfony/config": "~2.1",
        "symfony/css-selector": "~2.1",
        "symfony/dom-crawler": "~2.1",
        "symfony/filesystem": "~2.1",
        "symfony/finder": "~2.1",
        "symfony/form": "~2.1",
        "symfony/locale": "~2.1",
        "symfony/process": "~2.1",
        "symfony/security": "~2.1",
        "symfony/serializer": "~2.1",
        "symfony/translation": "~2.1",
        "symfony/validator": "~2.1",
        "symfony/monolog-bridge": "~2.1",
        "symfony/twig-bridge": "~2.1",
        "doctrine/dbal": ">=2.2.0,<2.4.0-dev",
        "swiftmailer/swiftmailer": "5.*"
    }
}

web\index.php

<?php

require_once __DIR__.'/../vendor/autoload.php';

$app = new Silex\Application();
$app->register(new Silex\Provider\ServiceControllerServiceProvider());
$app->register(new Silex\Provider\TwigServiceProvider());
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());
/*$app->register(new Silex\Provider\WebProfilerServiceProvider(), array(
    'profiler.cache_dir' => __DIR__.'/../cache/profiler',
    'profiler.mount_prefix' => '/_profiler', // this is the default
));*/

$app->register(new Silex\Provider\TranslationServiceProvider(), array(
    'locale_fallback' => 'en',
));
$app['translator.domains'] = array(
    'messages' => array(
        'en' => array(
            'hello'     => 'Hello %name%',
            'goodbye'   => 'Goodbye %name%',
        ),
        'de' => array(
            'hello'     => 'Hallo %name%',
            'goodbye'   => 'Tschüss %name%',
        ),
        'fr' => array(
            'hello'     => 'Bonjour %name%',
            'goodbye'   => 'Au revoir %name%',
        ),
    ),
    'validators' => array(
        'fr' => array(
            'This value should be a valid number.' => 'Cette valeur doit être un nombre.',
        ),
    ),
);

$app->get('/{_locale}/{message}/{name}', function ($message, $name) use ($app) {
    return $app['translator']->trans($message, array('%name%' => $name));
});

$app->run();

Run:

http://localhost/silex/web/index.php/en/hello/SoutlinK
http://localhost/silex/web/index.php/de/hello/SoutlinK
http://localhost/silex/web/index.php/fr/hello/SoutlinK

Result, it works as spected.

Now uncoment this lines:

$app->register(new Silex\Provider\WebProfilerServiceProvider(), array(
    'profiler.cache_dir' => __DIR__.'/../cache/profiler',
    'profiler.mount_prefix' => '/_profiler', // this is the default
));

Run again:

http://localhost/silex/web/index.php/en/hello/SoutlinK
http://localhost/silex/web/index.php/de/hello/SoutlinK
http://localhost/silex/web/index.php/fr/hello/SoutlinK

It don't works at all, always use 'en' as locale

composer.json for web-profiler doesn't use |3.0.*

composer.json of web-profiler is

"require": {
    "silex/silex": "~1.1",
    "symfony/stopwatch": "~2.2",
    "symfony/web-profiler-bundle": "~2.4"
},

but perhaps should be

"require": {
    "silex/silex": "~1.1",
    "symfony/stopwatch": "~2.2|3.0.*",
    "symfony/web-profiler-bundle": "~2.4|3.0.*"
},

Logs are not displaying in the profiler

I can not see any of the monolog logs in the profiler.

The bridge class does exist and is loaded. Additional monolog is logging the data. I just cant view the logs in the profiler pages. It sayd that there are no logs available.

I am running xampp on windows 8.1 x64.

the required dependencies

        "silex/silex": "v1.2.0",
        "symfony/yaml": "v2.4.3",
        "silex/web-profiler": "~1.0",
        "monolog/monolog": ">=1.0.0",
        "symfony/monolog-bridge": "v2.4.2",
        "symfony/security": ">=2.3,<2.6-dev",
        "symfony/config": ">=2.3,<2.6-dev",
        "symfony/locale": ">=2.3,<2.6-dev",
        "symfony/form": ">=2.3,<2.6-dev",
        "symfony/browser-kit": ">=2.3,<2.6-dev",
        "symfony/css-selector": ">=2.3,<2.6-dev",
        "symfony/debug": ">=2.3,<2.6-dev",
        "symfony/dom-crawler": ">=2.3,<2.6-dev",
        "symfony/finder": ">=2.3,<2.6-dev",
        "symfony/options-resolver": ">=2.3,<2.6-dev",
        "symfony/process": ">=2.3,<2.6-dev",
        "symfony/serializer": ">=2.3,<2.6-dev",
        "symfony/translation": ">=2.3,<2.6-dev",
        "symfony/twig-bridge": ">=2.3,<2.6-dev",
        "symfony/validator": ">=2.3,<2.6-dev",
        "twig/twig": ">=1.8.0,<2.0-dev",
        "doctrine/dbal": "~2.2",
        "swiftmailer/swiftmailer": "5.*",
        "phpunit/phpunit": "~3.7"

and my app class

<?php
namespace Yamiko;

use Silex\Application as App;
use Silex\Provider\TwigServiceProvider;
use Silex\Provider\UrlGeneratorServiceProvider;
use Silex\Provider\SessionServiceProvider;
use Silex\Provider\ValidatorServiceProvider;
use Silex\Provider\FormServiceProvider;
use Silex\Provider\HttpCacheServiceProvider;
use Silex\Provider\HttpFragmentServiceProvider;
use Silex\Provider\SecurityServiceProvider;
use Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder;
use Silex\Provider\RememberMeServiceProvider;
use Silex\Provider\SwiftmailerServiceProvider;
use Silex\Provider\MonologServiceProvider;
use Silex\Provider\TranslationServiceProvider;
use Symfony\Component\Translation\Loader\YamlFileLoader;
use Silex\Provider\DoctrineServiceProvider;
use Silex\Provider\ServiceControllerServiceProvider;
use Silex\Provider\WebProfilerServiceProvider;

class Application extends App{
    use App\TwigTrait;
    use App\SecurityTrait;
    use App\FormTrait;
    use App\UrlGeneratorTrait;
    use App\SwiftmailerTrait;
    use App\MonologTrait;
    use App\TranslationTrait;

    public function __construct(array $values = array()) {
        parent::__construct($values);

        // monolog
        $this->register(new MonologServiceProvider(), array(
            'monolog.name' => 'yamiko',
            'monolog.level' => 100,
            'monolog.logfile' => __DIR__ . '/cache/yamiko.log',
        ));

        // http cache
        $this->register(new HttpCacheServiceProvider(), array(
            'http_cache.cache_dir' => __DIR__ . '/cache/http/',
        ));

        // http fragments used for ESI and hincludes
        $this->register(new HttpFragmentServiceProvider());

        // UrlGeneratorServiceProvider
        $this->register(new UrlGeneratorServiceProvider());

        // service controller
        $this->register(new ServiceControllerServiceProvider());

        // TranslationServiceProvider
        $this->register(new TranslationServiceProvider(), array(
            'locale_fallbacks' => array('en'),
        ));
        $this['translator'] = $this->share($this->extend('translator', function($translator, $this) {
            $translator->addLoader('yaml', new YamlFileLoader());
            $translator->addResource('yaml', 'Yamiko/locales/en.yml', 'en');
            $translator->addResource('yaml', 'Yamiko/locales/es.yml', 'es');
            $translator->addResource('yaml', 'Yamiko/locales/fr.yml', 'fr');
            return $translator;
        }));

        // FormServiceProvider
        $this->register(new FormServiceProvider());

        // validator
        $this->register(new ValidatorServiceProvider());

        // SecurityServiceProvider
        $this->register(new SecurityServiceProvider());
        $this->register(new RememberMeServiceProvider());
        // @TODO configure remember me provider
        $this['security.firewalls'] = array(
            'admin' => array(
                'pattern' => '^/admin',
                'http' => true,
                'users' => array(
                    // raw password is foo
                    'admin' => array('ROLE_ADMIN', '5FZ2Z8QIkA7UTZ4BYkoC+GsReLf569mSKDsfods6LYQ8t+a8EW9oaircfMpmaLbPBh4FOBiiFyLfuZmTSUwzZg=='),
                ),
            ),
        );
        $this['security.encoder.digest'] = $this->share(function ($this) {
            // use the sha1 algorithm
            // don't base64 encode the password
            // use only 1 iteration
//            return new MessageDigestPasswordEncoder('sha1', false, 1);
            return new BCryptPasswordEncoder(10);
        });

        // twig
        $this->register(new TwigServiceProvider(), array(
            'twig.path' => 'Yamiko/views',
            'twig.options' => array(
                'debug' => $this['debug'],
                'cache' => 'Yamiko/cache/views/',
                'optimizations' => -1,
                'strict_variables' => true,
                'autoescape' => true,
                'charset' => 'utf-8',
//                'auto_reload' => $this['debug']
            )
        ));
        $this['twig'] = $this->share($this->extend('twig', function($twig, $app) {
//            $twig->addGlobal('pi', 3.14);
//            $twig->addFilter('levenshtein', new \Twig_Filter_Function('levenshtein'));
            return $twig;
        }));

        // sessions
//        $this['cookie_lifetime'] = 0;// can be used to set an exlicit cookie lifetime.
        $this->register(new SessionServiceProvider());

        // swift mailer
        $this->register(new SwiftmailerServiceProvider());
        $this['swiftmailer.options'] = array(
            'host' => 'localhost',
            'port' => '25',
            'username' => '',
            'password' => '',
            'encryption' => null,
            'auth_mode' => null
        );

        // profiler
        $this->register($p = new WebProfilerServiceProvider(), array(
            'profiler.cache_dir' => __DIR__ . '/cache/profiler',
            'profiler.mount_prefix' => '/_profiler', // this is the default
        ));
        $this->mount('/_profiler', $p);
    }
}

When using '$app['twig']->addGlobal' - receive the error 'Template "@WebProfiler/Profiler/toolbar_js.html.twig" is not defined ().'

If I have the web profiler enabled and use the addGlobal feature of twig then an error occurs when loading the profiler toolbar templates.

silex

I have created a gist which demonstrates the issue - https://gist.github.com/madebydavid/6976097

If I comment out line 14 of index.php then the error does not occur. If I leave line 14 uncommented and comment out lines 19-22 inclusive (disabling the profiler) then the error does not occur.

LoggerDataCollector looses logger object

Hello,

I am using the WebProfilerServiceProvider for Silex and noticed that the Logs panel doesn't show anything. I have activated MonologServiceProvider for Silex with a log file.
Additional I added the monolog bridge.

I have broken down the issue to the Profiler, which is returning a Profile containing not the initial LoggerDataCollector. It contains a new instance with logger null.

Popup Error 500 on every page

Hi guys,

I'm very excited about this Silex Web Profiler and I really want to integrate it to my project, but I faced this one problem of error 500 on every page.

Below is my composer set:

"require": {
    "silex/silex": "1.0.*",
    "symfony/class-loader": "2.2.*",
    "symfony/config": "2.2.*",
    "symfony/form": "2.2.*",
    "symfony/translation": "2.2.*",
    "symfony/twig-bridge": "2.2.*",
    "symfony/validator": "2.2.*",
    "twig/twig": "1.*",
    "swiftmailer/swiftmailer": ">=4.1.2,<4.2-dev"
},
"require-dev":{
    "silex/web-profiler": "~1.0",
    "symfony/browser-kit": "2.2.*"
}

I install it based on the readme, and it shows this popup error:

An error occurred while loading the web debug toolbar (500: Internal Server Error).

Do you want to open the profiler?

[Ok] [Cancel] 

When I clicked ok, it says:

Twig_Error_Runtime: Method "statustext" for object "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector" does not exist in "@WebProfiler/Collector/request.html.twig" at line 19

I tried to remove the lines and after removing a few lines (same error on different lines), it changed to this:

 Twig_Error_Runtime: Variable "icon" does not exist in "@WebProfiler/Profiler/toolbar_item.html.twig" at line 2

Do let me know if you need more data as I can try to reproduce it for now.

Appreciate,
Max

Chemin du README

Bonjour,
Si on se réfère au projet Silex et sa documentation, les chemins sont incomplet :

s/new Provider/new Silex/Provider/g

$app->register($p = new Silex\Provider\WebProfilerServiceProvider(), array(
'profiler.cache_dir' => DIR.'/../cache/profiler',

));

$app->register(new Silex\Provider\ServiceControllerServiceProvider());
$app->register(new Silex\Provider\TwigServiceProvider());
$app->register(new Silex\Provider\UrlGeneratorServiceProvider());

Uncaught exception 'InvalidArgumentException' with message 'Identifier "security.authentication_providers" is not defined.

after registring WebProfilerServiceProvider im getting this error

    <b>Fatal error</b>:  Uncaught exception 'InvalidArgumentException' with message 'Identifier &quot;security.authentication_providers&quot; is not defined.' in D:\private\www\cms\vendor\pimple\pimple\lib\Pimple.php:78
    Stack trace:
    #0 D:\private\www\cms\vendor\silex\silex\src\Silex\Provider\SecurityServiceProvider.php(78): Pimple-&gt;offsetGet('security.authen...')
    #1 D:\private\www\cms\vendor\pimple\pimple\lib\Pimple.php(122): Silex\Provider\SecurityServiceProvider-&gt;Silex\Provider\{closure}(Object(Sorien\Application))
    #2 D:\private\www\cms\vendor\pimple\pimple\lib\Pimple.php(83): Pimple-&gt;{closure}(Object(Sorien\Application))
    #3 D:\private\www\cms\vendor\silex\silex\src\Silex\Provider\SecurityServiceProvider.php(74): Pimple-&gt;offsetGet('security.authen...')
    #4 D:\private\www\cms\vendor\pimple\pimple\lib\Pimple.php(122): Silex\Provider\SecurityServiceProvider-&gt;Silex\Provider\{closure}(Object(Sorien\Application))
    #5 D:\private\www\cms\vendor\pimple\pimple\lib\Pimple.php(83): Pimple-&gt;{closure}(Object(Sorien\Application))
    #6 D:\private\www\cms\vendor in <b>D:\private\www\cms\vendor\pimple\pimple\lib\Pimple.php</b> on line <b>78</b><br />

config:
https://gist.github.com/Sorien/4737951

full error from xdebug:
https://gist.github.com/Sorien/4737954

there is problem when i register SecurityServiceProvider and WebProfilerServiceProvider together

sf2.2 deps

First of all, I've been waiting for this for some time now - good stuff :)

I do have some issues with dependencies adding the package with composer. Unless I explicitly require 'symfony/web-profiler-bundle' in my composer.json it won't be found.

The bundle, in turn, has dependencies on htt-kernel 2.2, so this would force me to use sf2.2, right?

Having followed the discussion about whether (or not) to bump the silex requirements from 2.1 to 2.2 I wonder what to do - am I missing something here?

Errors

Hi,
Not understanding where the error is coming when tring to embed web-profiler.
Here is the error message : php InvalidArgumentException in Pimple.php line 78: Identifier "security.authentication_providers" is not defined.php

And here is my code :

$app->register(new Silex\Provider\ServiceControllerServiceProvider());
if (isset($app['debug']) && $app['debug']) {
    $app->register(new Silex\Provider\HttpFragmentServiceProvider());
    $app->register(new Silex\Provider\WebProfilerServiceProvider(), array(
        'profiler.cache_dir' => __DIR__.'/../var/cache/profiler'
    ));`````php

Fatal error : 'Object not found" in ProfilerListener onKernelTerminate()

Hello,

Since I've installed WebProfiler, as described on the readme, I have the following message on each page :

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'Object not found' in /Library/WebServer/Documents/i2kn/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php on line 128

It occurs into the onKernelTerminate() function.

Here are the versions I use (I have tried with others and the error is the same), if it may help :

    "require": {
        "silex/silex"           : "1.2.*@dev",
    "silex/web-profiler"        : "1.0.*@dev",

    "twig/twig"             : ">=1.8.0,<2.0-dev",
    "twig/extensions"       : "1.0.*@dev",
    "symfony/twig-bridge"       : "2.3.*@dev",
    "symfony/form"              : "2.3.*@dev",
    "symfony/validator"         : "2.3.*@dev",
    "symfony/security"          : "2.3.*@dev",
    "symfony/translation"       : "2.3.*@dev",
    "symfony/config"        : "2.3.*@dev",
    "symfony/yaml"                 : "2.3.*@dev",

    "doctrine/dbal"         : "2.2.*@dev",
... }

I can nevertheless access to the /_profiler page, but the webprofiler toolbar is not shown (which implies there is no logged profile)

Thanks for any help. I really don't understand where it may come from.

Olivier.

Neither the property "redirect" in @WebProfiler/Profiler/layout.html.twig

Hi,

I just update to Silex 2.0 and i have a bug with the WebProfiler.
I can access to my web page but the profiler wont load and throw this error:

Twig_Error_Runtime in Template.php line 590:
Neither the property "redirect" nor one of the methods "redirect()", "getredirect()"/"isredirect()" or "__call()" exist and have public access in class "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector" in "@WebProfiler/Profiler/layout.html.twig" at line 23

Here is my composer.json

{
    "name": "",
    "description": "A pre-configured skeleton for the Silex microframework with Grunt tasks added",
    "license": "Copyright",
    "type": "project",
    "require": {
        "php": ">=5.6",
        "silex/silex": "~2.0",
        "silex/web-profiler": "^2.0",
        "symfony/class-loader": "^2.8",
        "symfony/config": "^3.0",
        "symfony/console": "~2.8",
        "symfony/debug": "~2.8",
        "symfony/finder": "~2.8",
        "symfony/form": "~2.8",
        "symfony/monolog-bridge": "~2.8",
        "symfony/process": "~2.8",
        "symfony/security": "~2.8",
        "symfony/translation": "~2.8",
        "symfony/twig-bridge": "~2.8",
        "symfony/validator": "~2.8",
        "symfony/http-kernel": "^2.8",
        "twig/extensions": "^1.3",
        "doctrine/dbal": "~2.2",
        "pimple/pimple": "~3.0",
        "dflydev/doctrine-orm-service-provider": "~2.0",
        "symfony/serializer": "^3.0",
        "swiftmailer/swiftmailer": "^5.4",
        "gedmo/doctrine-extensions": "v2.4.13",
        "symfony/yaml": "^2.8",
        "symfony/routing": "^2.8",
        "jms/serializer": "^1.1",
        "cnam/security-jwt-service-provider": "dev-master",
    "m1/vars": "dev-silex-v2"
    },
    "autoload": {
        "psr-0": {
            "": "src/"
        }
    }
}

Do you have any idea ?

Undefined method Closure::getWrappedListener()

Hello,

I'm working on a Silex Project, and I'm having an issue after cleaning my composer file and upgrading to Silex 1.2.

My app won't launch, and I'm getting the following error:

Fatal error: Call to undefined method Closure::getWrappedListener() in .../symfony/event-dispatcher/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php on line 229

I've been looking for a solution, and apart from setting $skipped to true as returned value for postProcess and comment out the foreach loop, I can't get the toolbar to work.

The app and the toolbar start and work like a charm when $skipped is set to true.

Here is the composer I'm using :

  "require": {
        "silex/silex": "~1.2",
        "symfony/yaml": "2.4.*@dev",
        "deralex/yaml-config-service-provider": "1.0.x-dev",
        "symfony/twig-bridge": "~2.3",
        "symfony/filesystem": "~2.3", 
        "symfony/config": "~2.3", 
        "doctrine/dbal": ">=2.2.0,<2.4.0-dev", 
        "silex/web-profiler": "~1.0",
        "symfony/validator": "~2.3"
    },

I've tried to require what I had before, one by one, without success.

The function "render" does not exist

The function "render" does not exist in "@WebProfiler/Collector/config.html.twig" at line 1

Package Version
doctrine/annotations v1.2.4
doctrine/cache v1.4.1
doctrine/collections v1.3.0
doctrine/common v2.5.0
doctrine/dbal v2.5.1
doctrine/inflector v1.0.1
doctrine/lexer v1.0.1
monolog/monolog 1.13.1
pimple/pimple v1.1.1
psr/log 1.0.0
silex/silex v1.3.0
silex/web-profiler v1.0.7
swiftmailer/swiftmailer v5.4.0
symfony/config v2.7.0
symfony/console v2.7.0
symfony/debug v2.7.0
symfony/event-dispatcher v2.7.0
symfony/filesystem v2.7.0
symfony/form v2.7.0
symfony/http-foundation v2.7.0
symfony/http-kernel v2.7.0
symfony/intl v2.7.0
symfony/locale v2.7.0
symfony/options-resolver v2.7.0
symfony/process v2.7.0
symfony/property-access v2.7.0
symfony/routing v2.7.0
symfony/security v2.7.0
symfony/stopwatch v2.7.0
symfony/translation v2.7.0
symfony/twig-bridge v2.7.0
symfony/validator v2.7.0
symfony/web-profiler-bundle v2.7.0
twig/twig v1.18.1

does anyone know how to solve?

The function "render" does not exist

@fabpot I get the follwing error, message, but there is no render call

Twig_Error_Syntax in ExpressionParser.php line 568: The function "render" does not exist. Did you mean "knp_menu_render", "knp_pagination_render" in "@WebProfiler/Collector/config.html.twig" at line 1

in ExpressionParser.php line 568
at Twig_ExpressionParser->getFunctionNodeClass('render', '5') in ExpressionParser.php line 351
at Twig_ExpressionParser->getFunctionNode('render', '5') in ExpressionParser.php line 144
at Twig_ExpressionParser->parsePrimaryExpression() in ExpressionParser.php line 84
at Twig_ExpressionParser->getPrimary() in ExpressionParser.php line 41
at Twig_ExpressionParser->parseExpression() in Parser.php line 141
at Twig_Parser->subparse(array(object(Twig_TokenParser_Block), 'decideBlockEnd'), true) in Block.php line 45
at Twig_TokenParser_Block->parse(object(Twig_Token)) in Parser.php line 187
at Twig_Parser->subparse(null, false) in Parser.php line 95
at Twig_Parser->parse(object(Twig_TokenStream)) in Environment.php line 543
at Twig_Environment->parse(object(Twig_TokenStream)) in Environment.php line 595
at Twig_Environment->compileSource('{% extends '@WebProfiler/Profiler/base.html.twig' %} {% block body %} {{ render(path('_wdt', { 'token': token, 'position': 'normal' })) }} <div id="content"> {% include '@WebProfiler/Profiler/header.html.twig' only %} <div id="main"> <div class="clear-fix"> <div id="collector-wrapper"> {% if profile %} <div id="resume"> <a id="resume-view-all" href="{{ path('_profiler_search', {limit: 10}) }}">View last 10</a> <strong>Profile for:</strong> {{ profile.method|upper }} {% if profile.method|upper in ['GET', 'HEAD'] %} <a href="{{ profile.url }}" id="resume-url">{{ profile.url }}</a> {% else %} <span id="resume-url">{{ profile.url }}</span> {% endif %} <span class="date"> <em>by {{ profile.ip }}</em> at <em>{{ profile.time|date('r') }}</em> </span> </div> {% endif %} <div id="collector-content"> {% include '@WebProfiler/Profiler/base_js.html.twig' %} {% block panel '' %} </div> </div> <div id="navigation"> {% if templates is defined %} <ul id="menu-profiler"> {% for name, template in templates %} {% set menu %}{{ template.renderBlock('menu', { 'collector': profile.getcollector(name)}) }}{% endset %} {% if menu != '' %} <li class="{{ name }}{% if name == panel %} selected{% endif %}"> <a href="{{ path('_profiler', { 'token': token, 'panel': name }) }}">{{ menu|raw }}</a> </li> {% endif %} {% endfor %} <li class="minimize"> <a href="javascript:void(0);" title="Minimize toolbar" onclick="return toggleMenuPanels();"> <span class="label"> <span class="icon"><svg id="minimizePanelIcon" width="30" height="33" xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" viewBox="0 0 30 33" enable-background="new 0 0 30 33" xml:space="preserve"><path fill="#3F3F3F" d="M15 5C8.4 5 3 10.4 3 17c0 6.6 5.4 12 12 12s12-5.4 12-12C27 10.4 21.6 5 15 5z M19.1 21.5l-1.8 1.8L10.9 17 l6.3-6.3l1.8 1.8L14.6 17L19.1 21.5z"/></svg></span> <strong>Minimize</strong> </span> </a> </li> </ul> {% endif %} {{ render(path('_profiler_search_bar')) }} {% include '@WebProfiler/Profiler/admin.html.twig' with { 'token': token } only %} </div> </div> </div> </div> <script>//<![CDATA[ function toggleMenuPanels(state, doSave) { var menu = document.getElementById('navigation'), savedState = Sfjs.getPreference('menu/displayState'), displayState, elem, className; if (null === savedState) { savedState = 'block'; } displayState = state || ('block' === savedState ? 'none' : 'block'); if ('undefined' === typeof doSave) { doSave = true; } document.getElementById('searchBar').style.display = displayState; document.getElementById('adminBar').style.display = displayState; if ('block' === displayState) { Sfjs.removeClass(menu, 'collapsed-menu'); Sfjs.removeClass(menu.parentNode.parentNode, 'collapsed-menu-parents'); } else { Sfjs.addClass(menu, 'collapsed-menu'); Sfjs.addClass(menu.parentNode.parentNode, 'collapsed-menu-parents'); } if (doSave) { Sfjs.setPreference('menu/displayState', displayState); } try { canvasAutoUpdateOnThresholdChange(null); } catch (err) { } return false; } window.setTimeout(function() { if (null === document.getElementById('menu-profiler')) { return; } var menuItems = document.getElementById('menu-profiler').getElementsByTagName('LI'), elem, value, child, displayState = Sfjs.getPreference('menu/displayState'); if (displayState == 'none') { toggleMenuPanels('none', false); } for (elem in menuItems) { if (typeof(menuItems[elem].children) !== 'undefined' && menuItems[elem].children.length > 0) { child = menuItems[elem].children[0]; if ('' === child.getAttribute('title') || null === child.getAttribute('title')) { value = child.text.replace(/^\s+/g, '').split('\n')[0].replace(/\s+$/g, ''); child.setAttribute('title', value); } } } }, 25); //]]></script> {% endblock %} ', '@WebProfiler/Profiler/layout.html.twig') in Environment.php line 335
at Twig_Environment->loadTemplate('@WebProfiler/Profiler/layout.html.twig', null) in Template.php line 254
at Twig_Template->loadTemplate('@WebProfiler/Profiler/layout.html.twig', '@WebProfiler/Collector/config.html.twig', '1') in cdef1a2e64cc069918f80a58ac470eb5540478725a412bbe013ed0f5c176.php line 11
at __TwigTemplate_fbfbcdef1a2e64cc069918f80a58ac470eb5540478725a412bbe013ed0f5c176->__construct(object(Twig_Environment)) in Environment.php line 346
at Twig_Environment->loadTemplate('@WebProfiler/Collector/config.html.twig') in TemplateManager.php line 76
at TemplateManager->getTemplates(object(Profile)) in ProfilerController.php line 109
at ProfilerController->panelAction(object(Request), '96bccf')
at call_user_func_array(array(object(ProfilerController), 'panelAction'), array(object(Request), '96bccf')) in HttpKernel.php line 147
at HttpKernel->handleRaw(object(Request), '1') in HttpKernel.php line 68
at HttpKernel->handle(object(Request), '1', true) in Application.php line 581
at Application->handle(object(Request)) in Application.php line 558
at Application->run() in index_dev.php line 48

Some errors n stuff

Notice: Indirect modification of overloaded element of Silex\Application has no effect in vendor\silex\web-profiler\Silex\Provider\WebProfilerServiceProvider.php on line 75

Fatal error: Call to undefined method Silex\Application::share() in vendor\silex\web-profiler\Silex\Provider\WebProfilerServiceProvider.php on line 112

share() is not available for the new pimple (and silex 2) .. but this extension should be for silex 2

https://github.com/silexphp/Silex/wiki/Third-Party-ServiceProviders-for-Silex-2.x#other

https://github.com/silexphp/Silex-WebProfiler/blob/master/composer.json#L13

Missing symfony/monolog-bridge dependency in composer.json?

Hi, I think this package should have symfony/monolog-bridge in "require" section in composer.json because without it symfony/web-profiler-bundle won't keep track of any log messages.

This is because (I'm assuming you're using Monolog) MonologServiceProvider returns instance of Monolog\Logger since class Symfony\Bridge\Monolog\Logger doesn't exist - see line 36.
Later WebProfilerServiceProvider creates instance of new LoggerDataCollector($app['logger']); but in LoggerDataCollector it ignores passed $app['logger'] because it's not an instance of DebugLoggerInterface (it's just Monolog\Logger).
That's why it doesn't log any messages. To fix this you can simply add symfony/monolog-bridge to your composer.json because then MonologServiceProvider returns instance of Symfony\Bridge\Monolog\Logger which already implements DebugLoggerInterface.

https://github.com/silexphp/Silex-Skeleton already requires symfony/monolog-bridge but I think it should be included also here because if you don't look into LoggerDataCollector's code you're surprised why you don't see any logs in profiler's page.

Create 1.x branch

Create a 1.x branch, and merge the Silex 2.0 changes into master.

Method "countscreams" for object "Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector" does not exist

I am trying to use the Profiler v1.0.3 with Silex v1.2.1.

This is the error I get when trying to access a record:

Twig_Error_Runtime: Method "countscreams" for object "Symfony\Component\HttpKernel\DataCollector\LoggerDataCollector" does not exist in "@WebProfiler/Collector/logger.html.twig" at line 5

This is how the profiler is registered:

if ($app['debug']) {
    $app->register(new Silex\Provider\ServiceControllerServiceProvider());
    $app->register(new Silex\Provider\WebProfilerServiceProvider(), array(
        'profiler.cache_dir' => __DIR__.'/../var/cache/profiler',
        'profiler.mount_prefix' => '/_profiler',
    ));
}

The TwigServiceProvider and the UrlGeneratorServiceProvider have also been registered already.

Am I doing something wrong? Or is this a general error?

No events are recorded (events tab always empty)

This bug has been present for a long time ago I think. The problem is the profiler is not recording a single event at all. Always yelling:

No events have been recorded. Are you sure that debugging is enabled in the kernel?

I went freak yesterday (I wanted to fix this) and I spent 10 hours trying to understand the kernel event system and to track, understand & fix this bug.


The problem:

This bug is caused when $app['data_collectors'] is created, in the events line 76:

'events'    => $app->share(function ($app) { return new EventDataCollector(); }),

EventDataCollector NEEDS the dispatcher as a argument to collect the events, but here is not passed! So, I tried to fix this passing the argument:

'events'    => $app->share(function ($app) { return new EventDataCollector($app['dispatcher']); }),

... and then all went wrong. Server crashed everytime, no error messages at all. Dafuq, why??? D:

Well, this is because in order to instantiate the new extended $app['dispatcher'] service to pass it as an argument to EventDataCollector, it needs to instantiate too a TraceableEventDispatcher, who needs the $app['stopwatch'] service, BUT that service hasn't been created yet ! (is more below in the code, line 149). Not only that, the service needs too to instantiate the $app['profiler'] service, who needs to use the $app['profiler.storage'] variable (which hasnt been set !.... and it needs the $app['profiler.cache_dir'] which is passed by argument in the configuration files, not in this source), but not only that, even the $app['profiler'] service has not been defined yet (is in the line 120, AND it needs to use $app['data_collectors'] variable xDDD).

Tl;Dr: There are a hell of dependencies to successfully instantiate the EventDataCollector the right way because it needs the dispatcher service as argument and is NOT ready to that yet.


Proposed solutions:

  • Put the line I suggest below as a temporally fix in the boot function, because dispatcher is instantiated there.
  • Move all the data_collectors sets to profiler service to the boot function below (and fix the EventDataCollector call passing it the dispatcher).
  • Update EventDataCollector to make it not neccesary to pass it as an argument the dispatcher service (using a function to set/update it maybe?).
  • Forget about the events profiling xDDD

Temporally fix for users:

Meanwhile, I suggest you to add this in your development configuration file (or where you register the web profiler service) to temporally fix this bug:

// This is as always ...
$app->register(new WebProfilerServiceProvider(), array(
    'profiler.cache_dir'    => __DIR__.'/../var/cache/profiler',
    'profiler.mount_prefix' => '/_profiler'
));

// THE FIX !
$app['profiler']->add(new \Symfony\Component\HttpKernel\DataCollector\EventDataCollector($app['dispatcher']));

Thanks fabien for Silex, it's awesome ;)

Method "request" for object "Silex\Application" does not exist

My composer.json:

...
"require": {
        "php": ">=5.5.9",
        "silex/silex": "~2.0@dev",
        "silex/web-profiler": "~2.0@dev",
        "symfony/browser-kit": "~2.6",
        "symfony/class-loader": "~2.6",
        "symfony/config": "~2.6",
        "symfony/yaml": "~2.6",
        "symfony/console": "~2.6",
        "symfony/css-selector": "~2.6",
        "symfony/debug": "~2.6",
        "symfony/finder": "~2.6",
        "symfony/form": "~2.6",
        "symfony/monolog-bridge": "~2.6",
        "symfony/process": "~2.6",
        "symfony/security": "~2.6",
        "symfony/twig-bridge": "~2.6"
},
...

On requesting any route in dev, silex responses with:

Twig_Error_Runtime in Template.php line 485:
Method "request" for object "Silex\Application" does not exist in "@WebProfiler/Profiler/base_js.html.twig" at line 208

I think symfony/symfony#14217 broke something, because I updated all dependencies today, before everything worked flawless. Did I missed something?

Just as a note: Manually hack twig-cache from:

$this->getAttribute((isset($context["app"]) ? $context["app"] : $this->getContext($context, "app")), "request", array())

to

$this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : $this->getContext($context, "app")), "request_stack", array()), "getCurrentRequest", array())

would prevent this issue and of course force web-profiler-bundle to v2.6.7 in composer.json, too:

"symfony/web-profiler-bundle": "v2.6.7"

Support intercept_redirects

Hello,

I am trying out the web profiler support for silex and noticed that I am missing the intercept_redirects feature.
Giving as second argument true for WebDebugToolbarListener results for me in a

Twig_Error_Loader: Template "TwigBundle::layout.html.twig" is not defined ().

layout.html.twig is in this case my base template from which all other templates derives.

Useing nonexisting method

Twig_Error_Runtime: Method "statustext" for object "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector" does not exist in "@WebProfiler/Collector/request.html.twig"

Missing token?

When i enable this provider i get

Some mandatory parameters are missing ("token") to generate a URL for route "_profiler_router".

Without it everything works fine

Indirect modification of overloaded element of Application has no effect

After upgrading Symfony components to 2.7.0 I got this notice

Indirect modification of overloaded element of [Application] has no effect in […]/vendor/silex/web-profiler/Silex/Provider/WebProfilerServiceProvider.php on line 71

Line 71 is

$app['data_collector.templates']['twig'] = '@WebProfiler/Collector/twig.html.twig';

As $app implements ArrayAccess, $app['data_collector.templates'] returns a copy so adding a value doesn't affect $app.
This can be worked around building the array in a temporary variable, or maybe using share?

Plus, it seems to me it should append array('twig', '@WebProfiler/Collector/twig.html.twig') instead of merging array('twig' => '@WebProfiler/Collector/twig.html.twig').

Move web_profile.toolbar.listener to boot method

Hi, if you use SecurityServiceProvider, you have to boot app before register WebProfilerServiceProvider, it would be ok move $dispatcher->addSubscriber($app['web_profiler.toolbar.listener']); to the boot method?

Fail when strict_variables are on

Twig_Error_Runtime: Method "statustext" for object "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector" does not exist in "@WebProfiler/Collector/request.html.twig" at line 17

I have

        "silex/silex": "1.0.*",
        "silex/web-profiler": "1.0.*",

updated to latest versions

and

$app->register(new TwigServiceProvider(), array(
    'twig.path'         => array(__DIR__.'/../twig'),
    'twig.options'      => array(
        'strict_variables' => true,
        'cache' => TWIG_COMPILATION_CACHE
    ),
));

With strict_variables=false there is no error

Profiler ajax call returning 35k lines of html

The profiler's ajax call takes about 30 secs to complete, when it completes it returns a 500 error and about 35k lines of html. The html consist of one page of the project over and over again, 150 times. No matter where I navigate in this project I get the same response from the profiler with the same html.

I've cleared the twig cache and profiler cache and get the same result. I'm happy to post any code that would help.

Since Symfony 2.4.0, the "timer" and "timeline" no longer work in the Profiler.

Since the upgrade to Symfony 2.4.0, the toolbar no longer lists the execution time, and the profiler timelines do not work either. As far as I can tell, this is because of the changes in Symfony\Component\HttpKernel\DataCollector\TimeDataCollector, but it might be something else.

Minimal testcase:

composer.json:

{
    "require": {
        "silex/silex": "~1.1",
        "silex/web-profiler": "1.0.*"
    }
}

index.php:

<?php

use Silex\Provider;

require_once __DIR__.'/../vendor/autoload.php';

$app = new Silex\Application();

$app['debug'] = true;

$app->register(new Provider\ServiceControllerServiceProvider());
$app->register(new Provider\TwigServiceProvider());
$app->register(new Provider\UrlGeneratorServiceProvider());

$app->register(new Provider\WebProfilerServiceProvider(), array(
    'profiler.cache_dir' => __DIR__.'/../cache/profiler',
    'profiler.mount_prefix' => '/_profiler', // this is the default
));

$app->get('/', function () {
    return "<html><body>Hi!</body></html>";
});

$app->run();

Result:

screen shot 2013-12-05 at 19 10 39


screen shot 2013-12-05 at 19 09 57

Silex Web Profiler broken TranslationService

Hey,

if I turn on the WebProfiler all translations are working fine depending on the route.
if I turn it off, even print_r($app['translator']->getLocale()); prints nothing.

Any Idea what this is causing?

<?php

use Silex\Provider\FormServiceProvider;
use Silex\Provider\HttpCacheServiceProvider;
use Silex\Provider\MonologServiceProvider;
use Silex\Provider\SecurityServiceProvider;
use Silex\Provider\ServiceControllerServiceProvider;
use Silex\Provider\SessionServiceProvider;
use Silex\Provider\TranslationServiceProvider;
use Silex\Provider\TwigServiceProvider;
use Silex\Provider\UrlGeneratorServiceProvider;
use Silex\Provider\ValidatorServiceProvider;
use Silex\Provider\WebProfilerServiceProvider;
use SilexAssetic\AsseticServiceProvider;
use Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder;
use Symfony\Component\Translation\Loader\YamlFileLoader;


$app->register(new HttpCacheServiceProvider());

$app->register(new SessionServiceProvider());
$app->register(new ValidatorServiceProvider());
$app->register(new FormServiceProvider());
$app->register(new UrlGeneratorServiceProvider());
$app->register(new Silex\Provider\DoctrineServiceProvider());

$app->register(new SecurityServiceProvider(), array(
    'security.firewalls' => array(
        'admin' => array(
            'pattern' => '^/',
            'form'    => array(
                'login_path'         => '/login',
                'username_parameter' => 'form[username]',
                'password_parameter' => 'form[password]',
            ),
            'logout'    => true,
            'anonymous' => true,
            'users'     => array(),
        ),
    ),
));

$app['security.encoder.digest'] = $app->share(function ($app) {
    return new PlaintextPasswordEncoder();
});

$app['portal'] = $app->share(function ($app) {
    return $app['db']->fetchAssoc('SELECT * FROM domains WHERE domain = ?', array($_SERVER['SERVER_NAME']));
});

$app->register(new TranslationServiceProvider());
$app['translator'] = $app->share($app->extend('translator', function ($translator, $app) {
    $translator->addLoader('yaml', new YamlFileLoader());

    $translator->addResource('yaml', __DIR__.'/../resources/locales/de.yml', 'de');
    $translator->addResource('yaml', __DIR__.'/../resources/locales/en.yml', 'en');

    $translator->addResource('yaml', __DIR__.'/../web/cdn/'.$app['portal']['domain'].'/locales/de.yml', 'de');
    $translator->addResource('yaml', __DIR__.'/../web/cdn/'.$app['portal']['domain'].'/locales/en.yml', 'en');


    return $translator;
}));

$app->register(new MonologServiceProvider(), array(
    'monolog.logfile' => __DIR__.'/../resources/log/app.log',
    'monolog.name'    => 'app',
    'monolog.level'   => 300 // = Logger::WARNING
));

$app->register(new TwigServiceProvider(), array(
    'twig.options'        => array(
        'cache'            => isset($app['twig.options.cache']) ? $app['twig.options.cache'] : false,
        'strict_variables' => true
    ),
    'twig.form.templates' => array('form_div_layout.html.twig', 'common/form_div_layout.html.twig'),
    'twig.path'           => array(__DIR__ . '/../resources/views')
));

$app->register(new ServiceControllerServiceProvider());


if ($app['debug'] && isset($app['cache.path'])) {
    $app->register(new ServiceControllerServiceProvider());
    $app->register(new WebProfilerServiceProvider(), array(
        'profiler.cache_dir' => $app['cache.path'].'/profiler',
    ));
}


$app['statistic_organizer'] = $app->share(function ($app) {
    return new MasterCode\StatisticOrganizer($app['db']);
});
$app['advertising_organizer'] = $app->share(function ($app) {
    return new MasterCode\AdvertisingOrganizer($app['db']);
});
$app['repository.video'] = $app->share(function ($app) {
    return new MasterCode\Repository\VideoRepository($app['db']);
});

return $app;

Twig_Error_Runtime: Unable to generate a URL for the named route "_wdt" as such route does not exist.

Just installed the WebProfiler and keep on getting back the error below on whatever route I try

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "_wdt" as such route does not exist.") in "@WebProfiler/Profiler/toolbar_js.html.twig" at line 14.

When checking the connect() function of the provider I can see ->bind(_wdt) is there; but apparently it is never executed when trying to halt things inside that function (the exception is thrown even before the ->connect() function kicks in.

After having poked around a bit more I found the exception to be triggered by $dispatcher->addSubscriber($app['profiler.listener']); which is located inside boot() (which is executed before connect() I guess?)

Here's my composer.json in case you might ask for it:

{
    "require": {
        "silex/silex": "1.0.*@dev",
        "twig/twig": "~1.2",
        "symfony/twig-bridge": "~2.1",
        "symfony/form": "~2.1",
        "symfony/validator": "~2.1",
        "symfony/config": "~2.1",
        "symfony/translation": "~2.1",
        "silex/web-profiler": "~1.0"
    },
    "autoload": {
        "psr-0": {
            "Ikdoeict": "src/"
        }
    }
}

Regards,
Bramus.

Problems with Symfony\Component\HttpKernel

I recently got this error message when I update my composer dependencies.

PHP Catchable fatal error:  Argument 1 passed to Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher::setProfiler() must be an instance of Symfony\Component\HttpKernel\Debug\Profiler, instance of Symfony\Component\HttpKernel\Profiler\Profiler given, called in /Users/steve/Sites/sparkles-core.local/vendor/silex/web-profiler/Silex/Provider/WebProfilerServiceProvider.php on line 49 and defined in /Users/steve/Sites/sparkles-core.local/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php on line 67
PHP Stack trace:
PHP   1. {main}() /Users/steve/Sites/sparkles-core.local/console:0
PHP   2. require() /Users/steve/Sites/sparkles-core.local/console:16
PHP   3. Silex\Application->boot() /Users/steve/Sites/sparkles-core.local/app/console.php:23
PHP   4. Silex\Provider\HttpCacheServiceProvider->boot() /Users/steve/Sites/sparkles-core.local/vendor/silex/silex/src/Silex/Application.php:186
PHP   5. Pimple->offsetGet() /Users/steve/Sites/sparkles-core.local/vendor/silex/silex/src/Silex/Application.php:51
PHP   6. Pimple::{closure:/Users/steve/Sites/sparkles-core.local/vendor/pimple/pimple/lib/Pimple.php:122-130}() /Users/steve/Sites/sparkles-core.local/vendor/pimple/pimple/lib/Pimple.php:83
PHP   7. Pimple->{closure:/Users/steve/Sites/sparkles-core.local/vendor/pimple/pimple/lib/Pimple.php:200-202}() /Users/steve/Sites/sparkles-core.local/vendor/pimple/pimple/lib/Pimple.php:126
PHP   8. Silex\Provider\WebProfilerServiceProvider->Silex\Provider\{closure}() /Users/steve/Sites/sparkles-core.local/vendor/pimple/pimple/lib/Pimple.php:201
PHP   9. Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher->setProfiler() /Users/steve/Sites/sparkles-core.local/vendor/silex/web-profiler/Silex/Provider/WebProfilerServiceProvider.php:49

Here is my composer.json

{
    "require": {
        "php"                      : ">=5.4",
        "silex/silex"              : "~1.2",
        "symfony/form"             : "~2.3",
        "symfony/translation"      : "~2.3",
        "symfony/twig-bridge"      : "~2.3",
        "symfony/validator"        : "~2.3",
        "symfony/yaml"             : "~2.3",
        "symfony/config"           : "~2.3",
        "symfony/console"          : "~2.3",
        "symfony/security"         : "~2.3",
        "symfony/event-dispatcher" : "~2.3",
        "symfony/finder"           : "~2.3",
        "twig/twig"                : "~1.10",
        "swiftmailer/swiftmailer"  : "5.0.2",
        "monolog/monolog"          : "~1.6",
        "kriswallsmith/assetic"    : "~1.1",
        "doctrine/common"          : "~2.4",
        "doctrine/dbal"            : "~2.4",
        "twitter/bootstrap"        : "v2.3.2",
        "mheap/silex-assetic"      : "~1.0.0",
        "leafo/lessphp"            : "~0.4"
    },
    "require-dev": {
        "symfony/dom-crawler"   : "~2.3",
        "symfony/css-selector"  : "~2.3",
        "symfony/browser-kit"   : "~2.3",
        "silex/web-profiler"    : "~1.0"
    },
}

Enable other panel

I can't find any solution to enable Security and Doctrine Panel ,just like Symfony.
Is there any chance for litle how to enable?

Time inaccuracies

It seems like the total time in the toolbar is wrong. On a request, my browser shows a 263ms total request time and the toolbar shows 951ms. When using the HttpCacheServiceProvider the total time displays as n/a.

Anyone else notice this?

Twig Template throwing 404 during rendering

Hello,

I am attempting to run the profiler in my application, but after configuration I have the following error in my app.log:

Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Error when rendering "http://www.dev.gaspares.local/_profiler/empty/search/results?limit=10&url=%2F_profiler%2Fempty%2Fsearch%2Fresults" (Status code is 404).") in "@WebProfiler/Profiler/layout.html.twig" at line 4. (uncaught exception) at /usr/local/turtle/lib/vendor/twig/twig/lib/Twig/Template.php line 148 {"exception":"[object](Twig_Error_Runtime: An exception has been thrown during the rendering of a template %28"Error when rendering "http://www.dev.gaspares.local/_profiler/empty/search/results?limit=10&url=%2F_profiler%2Fempty%2Fsearch%2Fresults" %28Status code is 404%29."%29 in "@WebProfiler/Profiler/layout.html.twig" at line 4. at /usr/local/turtle/lib/vendor/twig/twig/lib/Twig/Template.php:148, RuntimeException: Error when rendering "http://www.dev.gaspares.local/_profiler/empty/search/results?limit=10&url=%2F_profiler%2Fempty%2Fsearch%2Fresults" %28Status code is 404%29. at /usr/local/turtle/lib/vendor/silex/silex/src/Silex/Provider/TwigCoreExtension.php:46)"}

I assume that as the system is getting this far all the relevant components have been registered but for some reason this is not working.

My initialisation code for the profiler is:

$profiler_cache_path = sprintf("%s/profiler", $this -> config['cache']['path']);
$this -> log(sprintf('Profiler Cache Path: %s', $profiler_cache_path), array(), \Monolog\Logger::DEBUG, true);

$app -> register(new \Silex\Provider\ServiceControllerServiceProvider());
$app -> register(new \Silex\Provider\WebProfilerServiceProvider(), array(
    'profiler.cache_dir' => $profiler_cache_path
));

All the files that it wants to access seem to be in place. The following is the packages part of my composer.json file:

    "require": {
        "silex/silex": "~1.2",
        "silex/web-profiler": "1.0.*@dev",

        "easybib/silex-elastica": "0.1.1",

        "monolog/monolog": "1.9.1",

        "twig/twig": "1.15.1",

        "symfony/yaml": "~2.4",
        "symfony/console": "~2.4",
        "symfony/twig-bridge": "~2.4",
        "symfony/config": "~2.4",
        "symfony/monolog-bridge": "~2.4",

        "macedigital/silex-jms-serializer": "1.0.0",

        "mheap/silex-gravatar": "dev-master",
        "mheap/gravatar-php": "dev-master",
        "mheap/silex-assetic": "1.0.4",

        "knplabs/knp-menu": "2.0.*@dev"

    },

I am happy to provide more information if and when needed, just not sure what is required to help debug this problem.

I am running this through Nginx if that makes any difference.

Thanks, Russell

Move code under sensiolabs or sensio namespace

It's quite confusing that this package is under the sensiolabs org, with a "silex" vendor name in composer and a "Silex" namespace. Is the package "official"? Or is it considered third party?

IMO it should be third party, but either way it should be somehow consistent.

Silex 2.0 and 'Identifier "dispatcher" does not contain an object definition.'

Note: I'm using silex 2.0.x-dev#c207787 and WebProfiler 2.0.x-dev.

Registering the WebProfilerServiceProvider with the following code:

    $app->register(new WebProfilerServiceProvider, [
        'profiler.cache_dir'    => __DIR__ .  $cacheDir,
        'profiler.mount_prefix' => $mountPrefix
    ]);

Throws the following exception:

Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Identifier "dispatcher" does not contain an object definition.' in /vagrant/vendor/pimple/pimple/src/Pimple/Container.php on line 232
( ! ) InvalidArgumentException: Identifier "dispatcher" does not contain an object definition. in /vagrant/vendor/pimple/pimple/src/Pimple/Container.php on line 232

It seems that Container::extend() is throwing the exception because the value "dispatcher" (the EventDispatcher object) doesn't contain the __invoke() method:

screen shot 2015-09-05 at 18 36 28

screen shot 2015-09-05 at 18 37 10

FatalErrorException on undefined method

FatalErrorException: Error: Call to undefined method Symfony\Component\HttpKernel\Event\FilterResponseEvent::isMasterRequest() in /vendor/symfony/web-profiler-bundle/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php line 55

Ever since the v1.0.1 update which I got via composer am getting the following Exception every time I try to use the Web Profiler.

security panel needs symfony/yaml

the security panel does not work without the symfony/yaml package

I don't think it can be added to composer.json dependencies (unless symfony/security-bundle is also added)

maybe dump or var_dump can used when the Yaml class does not exists ?

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.