2017-05-02 53 views
0

我在Silex的应用集成silex/web-profilerWebProfiler在Silex的不显示用户

// Security 
$app['security.firewalls'] = array(
    'main' => array(
     'pattern' => '^/', 
     'anonymous' => true, 
     'form' => array('login_path' => '/login', 'check_path' => '/login_check'), 
     'users' => array(
      'admin' => array('ROLE_ADMIN', '$2y$10$3i9/lVd8UOFIJ6PAMFt8gu3/r5g0qeCJvoSlLCsvMTythye19F77a'), 
     ), 
    ) 
); 
$app->register(new Silex\Provider\SecurityServiceProvider(), array()); 

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

我能够登录:

"require-dev": { 
    "silex/web-profiler": "^2.0" 
} 

和配置的例子与形式的认证防火墙例如admin帐户并访问控制器中的用户,但WebProfiler不显示用户选项卡:

enter image description here

是否应该额外配置?

+0

您可以检查您是否安装了安全软件包?它必须安装在ordrer [激活SecurityDataCollector](https://github.com/silexphp/Silex-WebProfiler/blob/master/WebProfilerServiceProvider.php#L180) – mTorres

+0

@mTorres感谢您的提示!是的,安全捆绑软件没有安装。 symfony/security-bundle是对silex/web-profiler的require-dev依赖项,所以它没有通过安装composer进行安装。我不得不作曲者需要--dev symfony/security-bundle,它工作。请添加您的评论作为答案,也许精心制作一点。我会高兴地接受它:) – bostaf

+0

完成后,我们现在可以关闭这个:-) – mTorres

回答