mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
DOCS Add namespacing to environment types page
This commit is contained in:
parent
3f1cda8510
commit
03e890fe5d
@ -10,7 +10,7 @@ and behaviors. The environment is managed either through a [YML configuration fi
|
|||||||
The definition of setting an environment type in a `mysite/_config/app.yml` looks like
|
The definition of setting an environment type in a `mysite/_config/app.yml` looks like
|
||||||
|
|
||||||
:::yml
|
:::yml
|
||||||
Director:
|
SilverStripe\Control\Director:
|
||||||
environment_type: 'dev'
|
environment_type: 'dev'
|
||||||
|
|
||||||
The definition of setting an environment type in a `_ss_environment.php` file looks like
|
The definition of setting an environment type in a `_ss_environment.php` file looks like
|
||||||
@ -44,7 +44,7 @@ want to password protect the site. You can enable that by adding this to your `m
|
|||||||
Only:
|
Only:
|
||||||
environment: 'test'
|
environment: 'test'
|
||||||
---
|
---
|
||||||
BasicAuth:
|
SilverStripe\Security\BasicAuth:
|
||||||
entire_site_protected: true
|
entire_site_protected: true
|
||||||
|
|
||||||
### Live Mode
|
### Live Mode
|
||||||
@ -78,11 +78,11 @@ Checking for what environment you're running in can also be done in PHP. Your ap
|
|||||||
certain functionality depending on the environment type.
|
certain functionality depending on the environment type.
|
||||||
|
|
||||||
:::php
|
:::php
|
||||||
if(Director::isLive()) {
|
if (Director::isLive()) {
|
||||||
// is in live
|
// is in live
|
||||||
} else if(Director::isTest()) {
|
} elseif (Director::isTest()) {
|
||||||
// is in test mode
|
// is in test mode
|
||||||
} else if(Director::isDev()) {
|
} elseif (Director::isDev()) {
|
||||||
// is in dev mode
|
// is in dev mode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user