Good day.

There is an old big site. Half the functionality of the site is implemented as before - the .php files with noodles from html , php and sql , are in the root of the site, the path is site.com/somefile.php .

The other half of the functionality is implemented in a new way - in the root of the site there is a subdirectory with the mvc-framework and there are controllers, models and displays, the path site.com/framework/somecontroller/somemethod .

The main page of the site works as before .
The task is to transfer the functionality of the main page to the framework so that the path does not change.

Options for solving the problem:

  1. Expand the second copy of the framework in the root of the site, implement the functionality of the main page as site.com/controller/method , slowly transfer the model controllers and views from site.com/framework/ to site.com/ . At the same time, it will be necessary to somehow maintain the presence of /framework/ in the links.

  2. Implement the functionality of the main page of the site in site.com/framework/ , and from site.com/index.php go to site.com/framework/controller/method , site.com/framework/controller/method and show content.

  3. Implement the functionality of the main page of the site in site.com/framework/ , then the contents of the directory /framework/ make the site root. At the same time, it will be necessary to somehow maintain the presence of /framework/ in the links.

Which solution is more adequate? How to keep the presence of /framework/ in the links in the case of option 1 and 3?

    1 answer 1

    @pavelchervov , there is such a pattern - a facade. Outwardly, nothing at all changes, inside is actively rewritten. Just the first thing the do-nothing is implemented is the controller, which simply gives the request to the old backend, and then gradually the application is built up around it.

    Regarding to deploy the framework directly on the site and rewrite the code in the same place.

    I do not know who advised this to you, but you will not leave like this.