ruli/Restler — comment on commit 5237918a20e4ed4f2e4b844a8170f2c56f618179
File:  line 0
By electrical:

well, the problem is that the function must be flexible to account for different directory structures.
for example mine is:

/app_root/modules/module_name/api/classes/

the module name is then the root path for the classes in there.

for example my.api.com/module_name/class_name

So you would need to scan for directories in a certain structure.
Then you will have the issue that scanning your directory structure all the time is completely idiotic to say the least.
A solution for that would be to create a cache based on the first directory scan. ( create a cache php file with the AddAPI function )

Then if you change something you can remove the cache file and it will re-init it self.

but then again, others may have other directory structures. and it's hard to keep it flexible...