1

We're planning a new intranet for our organization. Some part is like a CMS, and there are some custom-made applications.

The Symfony2 CMF distribution looks fine for building the CMS part of the intranet, but other parts like Doctrine, "normal" SQL databases, etc, looks better for the custom-made applications for the intranet.

Because I need common authorization and authentication system for this intranet (against an Active Directory), I supose that I'll get better results building all in only on app. So, can I mix a CMF application with a normal application, and both use the same database (an Oracle DB)?

mHouses
  • 875
  • 1
  • 16
  • 36

3 Answers3

4

Yes you can easily mix the CMF with other Bundles. For example the routing allows using both routes from the CMF as well as "static" routes defined in yml files. Also you can easily also add the ORM next to PHPCR ODM. If you use Doctrine DBAL for storage in PHPCR, you can even reuse the same connection configuration with the ORM etc.

  • 1
    This guide explains how to set up the CMF bundles inside a Symfony Standard Edition: http://symfony.com/doc/master/cmf/cookbook/editions/cmf_core.html – dbu Feb 07 '15 at 10:24
  • Regarding Oracle: jackalope-doctrine-dbal has not been tested on oracle yet. It might need some work to get the xml queries working. Or simply run the Java jackrabbit server for CMS pages. Or you could look into ORM mapping for the SimpleCmsBundle. Feel free to open github issues on the relevant projects to discuss further, or use the mailinglist https://groups.google.com/forum/#!forum/symfony-cmf-devs – dbu Feb 07 '15 at 10:26
2

In brief yes it is, and I do this in my own Symfony2 project. I combine both SF-SE and SF-CMF bundles.

In fact, with Symfony2 it's very simple (this is just a matter of choosing the most suitable Bundles; SF is a very decoupled framework, which is why I don't plan to migrate to any other solution for the moment), but I'd like to share some of my experience with doing that. Actually the one most important question to think through to make a decision about how to combine both "worlds" is this:

Composer.

After some inquries I found out that since Symfony CMF is (in a way) based on Symfony SE, and not vice versa, it's better to start with the latter, as it contains the most core features (though I did it also in the opposite way, rather not recommended). So just take a SF-SE's composer.json, take a look at bundles from there you need, and then take a look at differences within SF-CMF's composer.json. You should end up with the most suitable set of bundles.

The basic features from these bundles to look-up for are:

  • MODEL - Doctrine ORM, PHPCR-ODM, or both - if still not sure, don't hesitate to ask a comment, I'll share here my experience furthere.
  • ROUTING - the primary question here is how flexible routing do you actually need? If not sure, I'd go with standard SF Router, and then possibly replace it e.g. when still on a dev stage.
  • OUT-OF-THE-BOX CMS FUNCTIONALITY - bundles such as CreateBundle, MenuBundle or MediaBundle may help you building surprisingly fast, but not quite flexible soltions. In general, I ended up without using most of them, and if using, then I mainly take some Interfaces I do implement in my own Bundles (to ensure future compatibility with possible other bundles to be potentially used).

Besides of these above, I created a number of Bridge Design Pattern and Provider Design Pattern solutions to make some bundles working together, to adjust their functionalities, or simply to decouple things.

forsberg
  • 1,681
  • 1
  • 21
  • 27
1

In programming almost everything is possible. But think about restrictions delivered with CMF (routing for eg.). Maybe you should consider Standard Symfony with Sonata? I think CMS pages it's only small part of your system and implementation it in standard symfony will take smallest part (and cost) of whole project.

  • What restrictions do you mean? I am not aware of any restrictions in routing that the CMF would impose. It has a chain router that allows to use both CMS routing and the configured routing. Using Sonata for the administration of the CMS pages is a good idea however. – dbu Feb 07 '15 at 10:22
  • Don't mistake CMS with CMF. CMF is the whole meta-system - a dev tool (CMF), than a user system (CMS). BTW Routing as used in Symfony CMF is more flexible and powerful than the standard one. – forsberg May 07 '16 at 16:07