0

in app.php

$kernel = new AppKernel('prod', false);

in Kernel.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();
        }
    }

I want to output this code at the browser for learning purposes . I guess it's buffered, but where can I switch it off and output my print at the browser? Or is there a better way through the console?

1
  • What exactly do you want to achieve? What do you mean by "output this code at the browser"? Commented Aug 6, 2021 at 13:40

1 Answer 1

1

Not positive I understand the question but if you look in web/app.php then you will see:

$loader = require_once __DIR__.'/../app/bootstrap.php.cache';

The bootstrap.php.cache file is where the cached (buffered?) copy of the Kernel object lives. You can either edit the cache file and add your print statements or just not include the cache file:

$loader = require_once __DIR__.'/../app/autoload.php';
Sign up to request clarification or add additional context in comments.

3 Comments

Thank you very much, now I see :)
So did this answer your question? Just curious.
Yes, and I vote but this message comes: Thanks for the feedback! Once you earn a total of 15 reputation, your votes will change the publicly displayed post score.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.