4623 Posts in 1398 Topics by 1393 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1761 Views |
-
Is there a specific test for live mode?

19 January 2010 at 5:24am
I have had an email from a colleague warning about a scam involving scallywags using SilverStripe sites that are in dev mode. From reading the documentation I think that my site is in live mode (the Director::set_environment_type("dev") directive is not set and it is not running on localhost). But is there a way that I can be sure? I do see some slightly alarming options when I look at the /dev/folder on my site, without authenticating as admin.
Reassurance craved!
Ian.
-- -
Re: Is there a specific test for live mode?

19 January 2010 at 9:23am
You can tell if your site is in live mode by logging out entirely then trying to do any of the developer tasks. Eg go to yoursite.com/dev/build. If it is in live mode you should be prompted for a password before you are allowed to rebuild the database. If you aren't asked for a password to do that you are either a) still logged in
or b) not in live mode.
Or if you want to be a bit more certain you could add something like this in your _config file to just test it out (remove it afterwards)
die(Director::get_environment_type());
Which should give you a blank screen with either 'live', 'test', 'dev' or nothing.
-
Re: Is there a specific test for live mode?

29 April 2010 at 1:30pm
Hi - I have a site which is launching TODAY and I have just tried putting it in "Live" mode using: Director::set_environment_type("live"); in my _config.php.
But, I can still access /dev/build without being logged in! I tried putting your code in Willr and the pages came out saying "live". Any idea why it's still letting anyone at dev/build without needing a password?
-
Re: Is there a specific test for live mode?

17 October 2010 at 6:29am
I have a site, where I need to switch css resources depending on my dev mode.
How can I test my mode from within a template? -
Re: Is there a specific test for live mode?

17 October 2010 at 10:05am
DsX - that function is not available in the templates but you can put something like this in page.php which will allow you to use <% if InDevMode %> (or you could look for live rather than dev)
function InDevMode() {
return (Director::isDev());
} -
Re: Is there a specific test for live mode?

17 October 2010 at 11:33am
Thanks Willr,
thats just about the exact same as I added ;)
Might be a worthwhile one to add as a standard.
| 1761 Views | ||
|
Page:
1
|
Go to Top |




