0

As documented by https://code.tutsplus.com/tutorials/how-to-autoload-classes-with-composer-in-php--cms-35649, there are 4 ways classes in a Composer package can be autoloaded. In my vendor folder, there are 20-30 packages (3rd-party, not created by me), and I am hoping to find a convenient way of listing all the classes that will be available for autoloading. As mentioned very aptly by https://stackoverflow.com/a/36682898

If you don't keep track of which classes exist, autoloading won't help you.

All the Reflection-related class methods and functions like get_declared_classes(), ReflectionClass can't work before the classes are autoloaded.

The Nette library as mentioned by https://stackoverflow.com/a/46435624 seems complicated to use.. I am trying to avoid it.

I have already tried globbing and including (recursively) every single file in the vendor directory, but I ended up with 20000+ over files (just files, not classes), and I realised so many files are not meant for autoloading, and can be skipped.

Is there a way to, at least list all the files meant for autoloading by Composer in the vendor directory, and at best list all the classes in those files? I tried search for a Composer command with composer list and on their website getcomposer.org, also to no avail...

forgodsakehold
  • 870
  • 10
  • 26

0 Answers0