David
David

Reputation: 2738

Integrate Symfony2 to a Drupal 5 system

We have a 5 years old system built by Drupal 5. It is not a small system (about 50K lines of code), and most of the functionality has nothing to do with 'content management'.

For this reason, we're thinking about integrating Symfony2 to our current system. The ideal is to keep using the current code for current functionality while developing new features with Symfony2. Slowly we'll move more and more pieces of code from Drupal to Symfony.

My question is how do you suggest implementing this? I though about the following approaches:

  1. Create a module in Drupal. This module will contain the Symfony files and will load the class loader of Symfony. Someone has done this before? are there some critical things I should be aware of?

  2. Create a separate installation of Symfony and hopefully create a different vhost record which point to certain pages in the website. As far as I know I can configure vhost to be a sub-host of my current host (e.g. mysymfony.mydrupal.com). But I can't configure it to point to a specific path in the same domain (mydrupal.com/mysymfony.php). is this true? In this approach the performance would be better for those pages that use Symfony, since it won't need the Drupal bootstrap.

  3. Any other suggestions?

Thanks!

Upvotes: 1

Views: 137

Answers (2)

lee
lee

Reputation: 103

Because I'm new here I can't have more than two links in a post. I was also going to say:

I would start rewriting core functionality (users, permissions, etc) if none of the existing bundles meet your needs. As well as searching github, you could try knpbundles.com to find bundles that solve similar problems.

Upvotes: 1

lee
lee

Reputation: 103

Be aware that you'll likely have to upgrade your PHP version on the machine running Drupal if you'd like to run Symfony2 on the same machine (anything under 5.3.8 and the configurator will object). You may also want to hold out for a bit if you want to stick with Drupal - Drupal 8 is integrating Symfony2 components. Also, there exists (in beta form anyhow), a content management framework for Symfony2.

Regarding vhosts, you are correct - you point a vhost to a directory, not a file. You could however create a rewrite rule to redirect to a specific page, if you wanted (check out the .htaccess file included in the web/ directory in a Symfony distribution - by default it redirects requests to app.php).

Upvotes: 2

Related Questions