D
D
drboboev2017-03-22 09:17:36
Network administration
drboboev, 2017-03-22 09:17:36

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

6 answer(s)
G
GavriKos, 2017-03-22
@GavriKos

Well, in theory, it's possible. No one is stopping you from writing something like

if ($test_mode == true)
{
//отдаем новый функционал
}
else
{
//отдаем старый функционал
}

But it's not right. The most correct option is to raise another site for a branch with test functionality. At least on the local machine and fumble for everyone, at least on the one where the main site is - just give access to a different url. Otherwise, you will drown in tons of ifs.
An extreme option is to resolve this at the level of page routing, this will potentially reduce the number of conditions, but still very very not nice.

V
Vasily Nazarov, 2017-03-22
@vnaz

"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.

V
Vasya Petrov, 2017-03-22
@VasyaPertrov

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?

It is possible and so, but it is better in that environment, in the same environment where the site will live. Clone on the same hosting on a different domain and closed from strangers.

M
Maxim Timofeev, 2017-03-22
@webinar

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?

I
Ivan Eliseev, 2017-03-22
@ivaneliseeff

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)

D
dativav, 2017-03-22
@dativav

It's better to put a copy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question