在 app.php 中
$kernel = new AppKernel('prod', false);
在内核.php
public function __construct($environment, $debug)
{
print('test');
$this->environment = $environment;
$this->debug = (bool) $debug;
$this->rootDir = $this->getRootDir();
$this->name = $this->getName();
if ($this->debug) {
$this->startTime = microtime(true);
}
$defClass = new \ReflectionMethod($this, 'init');
$defClass = $defClass->getDeclaringClass()->name;
if (__CLASS__ !== $defClass) {
trigger_error(sprintf('Calling the %s::init() method is deprecated since version 2.3 and will be removed in 3.0. Move your logic to the constructor method instead.', $defClass), E_USER_DEPRECATED);
$this->init();
}
}
我想在浏览器上输出这段代码以供学习。我猜它是缓冲的,但我在哪里可以关闭它并在浏览器上输出我的打印?还是有更好的方法通过控制台?