For debugging and testing purposes, I have created an "external" php file in the top directory of my Symfony project, and I call it with php from the command line. So far I did not succeed in using Symfony's default autoloading in that external file. I tried each of the following in turn the beginning of the file :
require 'app/autoload.php';
require 'vendor/autoload.php'
require 'composer/autoload_real.php'
But none of them work : every time I try something like
$check=class_exists(AppBundle/Entity/User);
my debugger tells that $check is set to false so that my User class is not recognized by php. What is the correct way to do this ?