我使用symfony2。在AppKernel.php中,我这样写:
class AppKernel extends Kernel {
public function __construct ($environment, $debug) {
parent::__construct($environment, $debug);
echo "ok";
}
}
在页面中,它在prod环境中显示一次"ok",但在dev环境中显示两次。似乎AppKernel被实例化了两次?我不知道为什么。有什么想法吗?
在开发环境中,symfony2提供了异步加载的"web调试工具栏"。这意味着启动第二个内核来加载bar。