media-bundle
media-bundle copied to clipboard
[RFC] Refactor media to be framework agnostic
This is a proposal to find a way to share media code between the CMF project and the Vespolina project. Basically, I have extracted the framework specific code out into its own library https://github.com/iampersistent/Media . (this is all untested at this point) This library would be used in the Vespolina project for handling media related to commerce. Media in the Vespolia project can be more than images, it can also be documents and spreadsheets.
Because there are additional needs with the Vespolina project, the media library would need more features. It would become more like a framework agnostic SonataMediaBundle, as far as the scope of the features. I did notice that the CMF Media seems to be intended to be simple, which may clash with the needs of Vespolina.
I can see a few different options.
- we can leave things as they are and not share media code between the two projects
- we can have a full featured media library shared between the projects
- we can have a simple media library for CMF that is used as a base library for Vespolina media library
There may be other options I'm missing and I'm open to hearing them.
@lsmith77 @dbu @rmsint @inspiran @wjzijderveld
I think this is a really good proposal, a Media component would make a lot of sense, and CMF/Vespolinaisms can then be pushed to the "Bundle layer". Also I really want us to share taxonomy logic - I might make a proposal for that.. :)
I think its a great idea .. the question is the timing. I was about to go to RC1 with the MediaBundle this Wednesday :)
So either we:
- rush this in
- delay RC1
- delay this refactoring until 1.1 along with the BC break (not sure if we should sensible try to then do some BC hacks)
i think its a good proposal, and i am all for sharing code. i think we have to "get this right". there is already SonataMediaBundle, and also LiipImagineBundle that both touch on what we do.
i am quite against delaying RC1 of the CmfMediaBundle. we promised to be stable 2 months ago. so lets discuss out how this all should look, in which organization it should live and what it should and should not do. then we can start building the library and provide a migration path to that for cmf 1.1
@dbu I'm open to that.
I don't care personally where the library should live. I don't think there is necessarily any advantage to having it as part of V over CMF.
From the perspective of the CMF project, what shouldn't the library do? I think defining the limits might help to understand the needs.
Great idea! (Just read this, got some internet now on my phone) I think it would be nice to have a base for media that is shared across several projects. This also means additional features can be build and shared between projects.
Regarding limits and needs, @iampersistent have you seen this wiki page: https://github.com/symfony-cmf/symfony-cmf/wiki/Media, it was used to build the current bundle.