cargomedia/CM — pull request #1223 by njam (2014-05-16 16:49:56+00:00)
Title: Introduce CM_Service_Filesystems with getters for data,userfiles,tmp filesystem

Based on https://github.com/cargomedia/CM/pull/1222

@cm-jan @tomaszdurka @fauvel please review

The goal here is to have a *combined* service which provides the required filesystems "data", "userfiles" and "tmp".
There's now a *broker*-service `CM_Service_Filesystems` which basically just proxies to additional services.
This has the advantage that we have hardcoded getters for the built-in and necessary filesystems.

To keep this broker-service simple I opted to register the individual services to be actual `CM_File_Filesystem` instances.
To allow that I introduced a `CM_File_Filesystem_Factory` which takes a array-config and produces a filesystem instance via `createFilsystem()`.
I extended the service manager to optionally call a *factory method* on the created instance (inspired by [Symfony service factory config](http://symfony.com/doc/current/components/dependency_injection/factories.html)).

While it feels a bit strange to have an intermediary service which again returns service instances,
I feel that this gives us additional guarantees and structure when using these services throughout the framework.
A similar approach could also be used for [DB services](https://github.com/cargomedia/CM/pull/1195)?
What do you think?