Hi, I do development on local machine and than move data do public server. Is is very useful if it can autodetect your environment. Months ago I wrote small script to do that and now tried to integrate into this module. I am not a php programmer so sorry for bugs. But is seems to work fine.
How does it work: detect if you are at IP 127.x.x.x. If so => you are local. If not => you are public.
I added setting so you can set text and color for both.
Maybe someone will find is useful.
| Comment | File | Size | Author |
|---|---|---|---|
| environment_indicator.zip | 2.57 KB | agir |
Comments
Comment #1
agir commentedHere is the code:
Comment #2
agir commentedPlease, can you correct misspell in title? Autodetect enviriment > Autodetect environment
Thx
Comment #3
mrfelton commentedTo be honest I don't like the idea of having that hardcoded into the module. The module is supposed to be simple, flexible and should support any number of environments, not just local and remote. You can already do this by overriding the settings in settings.php - since this file is unique for each of your installations/servers/environments.
I don't see the need for automatic detection - you simply configure the module once for each of your installations, using settings.php, and then forget about it.
Comment #4
agir commentedOK I get your point. Never mind. Maybe someone will find this useful.
For me it is good because I use only local and public environment. And I want to have only one settings.php.
Thanks
Comment #5
mrfelton commentedHow can you only have one settings.php if you have two servers?
ps. thanks for submitting your code anyway. I do appreciate it, but just don't feel that it should be a part of the module for the reasons I outlined above. Please don't hesitate to offer any more suggestions though!
Comment #6
agir commentedBecause I have same db name and password on both. I is then easier to move between local and public. I just copy everything and don't have to remember not to overwrite settings.php
To the submitting: ok ;-)