Hi there!
As sifo is going towards a decoupled ecosystem, we should give the option to start using a custom folder structure (one might want to use a src folder with an application in it).
This won't be a problem as composer can handle a custom auto loading process on its own. The problem comes when having a bunch on coexistent independent classes.
Having a decoupled application probably means having an application following SOLID principles. To help with that (with the D in SOLID actually) some kind of dependency injector should be used.
After a while trying some of the dependency injectors out there,
the symfony one seems to be the one that suits sifo the best.
Dependencies (services from now on) can either be declared using php, yml or xml. The component automatically checks for circular dependencies, wrong definitions and other stuff. This might seem a performance problem as it's done for each request (and it is) but it also provides the option to pre-compile the services definition in a php class so it can be as fast and optimized as possible.
This does not imply a big change in the whole sifo infrastructure. As for now, I can say this affect:
- The bootstrap, to load the services in the autoload method.
- The command line bootstrap for the same reason.
- The controller to receive an instance of the loader object.
This wouldn't affect existing applications. We'd only be giving access to a new attribute in the controllers.
If you think this can be a boost to sifo I'll start writing code (I already have most of it working properly)!
Cheers, Eric.