Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7810579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:50:04+00:00 2026-06-02T03:50:04+00:00

Would like to integrate a legacy application with a Symfony 2 application – replacing

  • 0

Would like to integrate a legacy application with a Symfony 2 application – replacing more and more parts of the old application with Symfony components. The approach I would take is using the Symfony 2 container in the legacy application getting the services that are already configured for the Symfony 2 application. The first services I would like to use are the session and the security context.

Questions:

  • Is this feasible?
  • How do I get the configured service container?

More info in the legacy application: The typical PHP mess: Single PHP files, as “controllers” (checking $_GET and $_POST for different execution paths). Each page includes init.php which sets up autoloading, database connection etc. The session management has its own class (which i would like to replace), the data is retrieved through calls to static methods (!) of database objects.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:50:05+00:00Added an answer on June 2, 2026 at 3:50 am

    Using Symfony’s DIC as a standalone component is possible but you’d have to do many things “manually” (as you’re not planning on using full Symfony Framework from the very beginning). You’ll probably won’t get much of using DIC with all that legacy stuff.

    If you want to go this path I’d consider choosing another component first (like HttpFoundation and HttpKernel).

    As @Cerad suggested you might wrap your legacy code in Symfony. Have a look at IngewikkeldWrapperBundle bundle. You can’t use it as is but it might give you some ideas.

    There’s a third way.

    You can decide to implement every new feature in a Symfony app. Than, you can make that both legacy and Symfony apps coexist. On a server level (i.e. Nginx), you might proxy legacy URLs to the legacy app and all the migrated URLs to a Symfony2 app. In my case this scenario was the best option and proved to be working. However, we were committed to abandon legacy app development (so every new feature or change had to be developed in a Symfony2 app).

    Edit: here’s how you could boot the Symfony kernel in a legacy app and dispatch an event (which is needed for the firewall):

    $kernel = new \AppKernel('dev', true);
    $kernel->boot();
    
    $request = Request::createFromGlobals();
    $request->attributes->set('is_legacy', true);
    $request->server->set('SCRIPT_FILENAME', 'app.php');
    
    $container = $kernel->getContainer();
    $container->enterScope('request');
    $container->get('request_stack')->push($request);
    $container->set('request', $request);
    
    $event = new GetResponseEvent($kernel, $request, HttpKernelInterface::MASTER_REQUEST);
    $eventDispatcher = $container->get('event_dispatcher');
    $eventDispatcher->dispatch('kernel.request', $event);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to integrate Facebook into an application - enable login using Facebook
We have an asp.net mvc application that we would like to integrate a FileSystemWatcher
I would like to integrate a Cache Manager in an ASP.NET application. Basically I
I would like to integrate the iPhone call functionality with my sample application. I
I would like to integrate Twitter into my Android application so that I can
I would like to integrate jQuery-DatePicker in my web application. I downloaded the scrips,
I have a critical issue. I would like integrate my application with another much
I would like to integrate CXF with Google Guice. I am already using Guice
I would like to integrate my app with contact manager: More precisely: When I
I would like to integrate Facebook into an iOS application I am building, however

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.