Closed nesk closed 6 years ago
I don't know, I kind of liked it ; at least for configurations files.
I agree it's weird to have api/ under config/
After some consideration, we shouldn't create our own autoloading system but use the one provided by Composer (we done this for #10, we should continue on this way), resulting in this composer.json file:
{
"autoload": {
"files": [
"config/admin.php",
"api/newsletter.php",
"metaboxes/page.php"
]
}
}
However @jvelo, Composer doesn't seem to support autoloading for all the files in a directory :disappointed:
This feature is, actually, a bad idea. It doesn't allow to order file loading and causes issues with FTP clients which doesn't automatically remove files when syncing the client and the server. Also, it forces you to put all the logic in the config directory, which is crappy for code organization.
Any thoughts about this @jvelo? We could move to a solution with a main file referencing all the files to load (autoload.php is a great name but it is already used by Composer, any ideas?):
This file is then required by functions.php and all the array entries are required through the
require_once
keyword.