I am trying to debug some code on my Drupal 9
application.
For example, at the file web/index.php
, I try to add die('Was here')
<?php
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
$autoloader = require_once 'autoload.php';
//My code is here
die('Was here');
$kernel = new DrupalKernel('prod', $autoloader);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
At first, I got the result on my browser. Next I delete this die
function, and when i refresh my browser, I get the same as before as if I didn't change the code
After some minutes, the expected result is shown in my browser. So weird
So I am wondering why is Drupal isn't taking that code change into account.
Btw, I run the command drush cr
but it didn't change anything