Issue
I need to get all classes that are present inside a folder and its subfolder. For example, with this tree
src/
├── Foo
│ └── Bar
│ └── Hello.php
└── Hello
└── World.php
I would get a list of classes like:
Foo\Bar\Hello
Hello\World
Can composer be used to get this kind of list? Or, ... exists a way to get the list of all classes present inside a folder(src folder)?
Solution
First of all, you should run command:
composer dump-autoload --optimize
Next you could try this code:
$classMap = array_keys(require('vendor/composer/autoload_classmap.php));
Answered By - VirCom
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.