Answer the question
In order to leave comments, you need to log in
Site development mode. How to make changes to a working site in the "demo" format?
Good afternoon.
An interesting question arose today, I am interested in the possibility of implementing the idea. The bottom line - I have a site on hosting (the content of the site does not matter, what you need to know is that the site is working and being visited), I do not consider shutting down the site for a certain / indefinite period.
For example, now it is required to make cardinal changes to the structure of the site, namely to correct the controllers, remove unnecessary functions and add new ones to the models, rewrite the views. In general, such a serious "upgrade" of the system. Changes in the database are not planned, only in the site files. The project is closed, access within one particular company and disabling the site will lead to negative feedback from employees and, accordingly, from the authorities.
Today, an idea of the following type arose - is it possible, using some flag in the site settings (either in the code itself or in the database), to enable "developer mode" with the ability to make changes to the site that will be visible only to the system administrator. And then, using the "magic" button, apply all the changes made to all other users of the system.
I think the question will immediately arise, why not clone the entire system to a local server and work with it, and then upload everything to the network. Why did I drop this option? Because access to changes that have not yet been officially confirmed should not only be me. There will be people who will monitor the changes being made, agree on these changes and accept them. Therefore, it is necessary to make such functionality within the framework of one system.
PS I don't use frameworks (yet).
Answer the question
In order to leave comments, you need to log in
Well, in theory, it's possible. No one is stopping you from writing something like
if ($test_mode == true)
{
//отдаем новый функционал
}
else
{
//отдаем старый функционал
}
"Everyone" raises a separate site for such purposes. This is not necessarily a new server/domain, if the code is well written, the site will work the same way, located both in the site.com root folder and in the site.com/testing subfolder.
If it is problematic to achieve work in a subfolder, test.site.com is started.
Git is great for pushing all the changes - both when testing as changes are made, and at the end - all in one fell swoop.
why not clone the whole system to a local server and work with it, and then upload everything to the network. Why did I drop this option?
Make a subdomain. There you conjure, then transfer to the main one. Moreover, since your witchcraft probably does not affect the entire site, you can only take out a part, connect the rest of the files from the main domain. The main question is what site?
Regardless of the engine, I do this with nginx.
The configuration already indicates the folder in which the file says that there are those. service.
And at the moment of direct service, I remove the comment from this line, which redirects all IPs except mine to this folder. Handicraft, I agree, but it works - as they say :))
(convenient, since you don’t need to make any changes to the engine / framework / code itself)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question