This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Routing requests for index.php through app.php

Installation and environment issues, mainly on 1.x but there's some 2.x here too.

Routing requests for index.php through app.php

by lrw » Wed May 06, 2015 6:47 pm

I have a legacy PHP site that I'd like to start migrating to Symfony 2.3.

All the existing URLs use the same pattern: /index.php?page=ID.

I'd like to use /app.php for all requests, so I can start migrating legacy pages when I have time to refactor them.

My problem is that Symfony returns a circular reference error.

Here's the controller:

Code: Select all
/**
 * @Route('/index.php', name="_legacy")
 * @ParamConverter("get", name="page")
 */
public function legacyAction($legacyRoute)
{
   return new Response('<html><body>This is the legacy page ID: '.$page.'</body></html>');
}


And here's the error:

Code: Select all
FileLoaderImportCircularReferenceException in FileLoader.php line 97:
Circular reference detected in "/mysite/app/config/routing_dev.yml" ("/mysite/app/config/routing_dev.yml" > "/mysite/app/config/routing.yml" > "/mysite/src/AppBundle/Controller/" > "/mysite/app/config/routing_dev.yml").


I think the issue is in web/.htaccess, but I'm not sure. Has anyone done something similar or have an idea for routing requests for index.php through app.php?
lrw
Junior Member
 
Posts: 1
Joined: Wed May 06, 2015 6:25 pm