探查器不工作我做了symfony應用程序3.3新內核使用官方的文檔http://symfony.com/doc/current/configuration/multiple_kernels.htmlSymfony的使用多個內核
,但我犯了一個新的文件夾的API與所有的configs,並將此if語句app_dev和Web文件夾
應用這是我的app_dev.php文件
<?php
use Symfony\Component\Debug\Debug;
use Symfony\Component\HttpFoundation\Request;
require_once(__DIR__.'/../c3.php');
// If you don't want to setup permissions the proper way, just uncomment the following PHP line
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
// for more information
//umask(0000);
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true) || PHP_SAPI === 'cli-server')
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
require __DIR__.'/../vendor/autoload.php';
Debug::enable();
if (strpos($_SERVER['REQUEST_URI'], 'api') !== false) {
$kernel = new ApiKernel('dev', true);
} else {
$kernel = new AppKernel('dev', true);
}
if (PHP_VERSION_ID < 70000) {
$kernel->loadClassCache();
}
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
這也工作正常,但是當我的API內核的symfony調試欄上說,它無法連接到分析器,還當我從API服務器響應和在標題中是
X-調試令牌,鏈接→http://localhost:8000/_profiler/5cb1d5
但是當我打開此探查器只顯示來自API的應用程序的內核沒有什麼可以幫助我的要求嗎?我是否缺少一些配置?
我從app.php在app_dev.php複製的代碼我有這樣的,對不起,我錯將改變它 –
剛編輯我的答案 –
我要探查的路線,但也許我需要使用不同的分析器的API,因爲profiler與應用程序內核調用,是否有可能合併來自兩者的數據? –