Merge pull request #7324 from open-sausages/pulls/4/env-type-docs

DOCS Corrected env type docs (fixes #7290)
This commit is contained in:
Chris Joe 2017-08-30 11:44:55 +12:00 committed by GitHub
commit 76f2358f3b
4 changed files with 6 additions and 36 deletions

View File

@ -12,14 +12,8 @@ detailed error messages for security reasons. You'll typically need to get your
information.
If you can log-in to the CMS as an administrator, append `?isDev=1` to any URL to temporarily set your browsing session into
"dev mode". If you can't log-in in the first place because of the error, add this directive to your `mysite/_config/config.yml`
(don't forget to remove it afterwards!):
```yml
Director:
# temporary debugging statement
environment_type: 'dev'
```
"dev mode". If you can't log-in in the first place because of the error, please
configure an `SS_ENVIRONMENT_TYPE` through [environment-management] (don't forget to remove it afterwards!).
<div class="warning" markdown='1'>
On "live" environments, the `?isDev=1` solution is preferred, as it means that your other visitors don't see ugly

View File

@ -4,22 +4,8 @@ summary: Configure your SilverStripe environment to define how your web applicat
# Environment Types
SilverStripe knows three different environment types (or "modes"). Each of the modes gives you different tools
and behaviors. The environment is managed either through a [YML configuration file](../configuration) or in a
and behaviors. The environment is managed by the `SS_ENVIRONMENT_TYPE` variable through an
[environment configuration file](../../getting_started/environment_management).
The definition of setting an environment type in a `mysite/_config/app.yml` looks like
```yml
SilverStripe\Control\Director:
environment_type: 'dev'
```
The definition of setting an environment type in a `.env` file looks like
```
SS_ENVIRONMENT_TYPE="dev"
```
The three environment types you can set are `dev`, `test` and `live`.
### Dev

View File

@ -1800,6 +1800,8 @@ that it belongs to, e.g. `themes/mytheme/templates/MyVendor/Foobar/Model/MyModel
* `Director::get_environment_type()` and `Director::set_environment_type()` are removed.
Get the `Kernel` instance via injector and query `getEnvironment()` instead.
E.g. `$type = Injector::inst()->get(Kernel::class)->getEnvironment();`.
* The environment can no longer be configured via YAML (`Director.environment_type`).
Use a [.env file](/getting_started/environment_management) to manage environment settings.
* Many global methods have been refactored into `Environment` or `Convert` class.
* `increase_xdebug_nesting_level_to` removed (functionality has been inlined into `AppKernel`)
* `set_increase_time_limit_max` moved to `Environment::setTimeLimitMax()`

View File

@ -22,12 +22,8 @@ use SilverStripe\View\TemplateGlobalProvider;
* The most important part of director is {@link Director::handleRequest()}, which is passed an HTTPRequest and will
* execute the appropriate controller.
*
* Director also has a number of static methods that provide information about the environment, such as
* {@link Director::$environment_type}.
*
* @see Director::handleRequest()
* @see Director::$rules
* @see Director::$environment_type
* @skipUpgrade
*/
class Director implements TemplateGlobalProvider
@ -98,14 +94,6 @@ class Director implements TemplateGlobalProvider
*/
private static $default_base_url = '`SS_BASE_URL`';
/**
* Assigned environment type
*
* @internal
* @var string
*/
protected static $environment_type;
public function __construct()
{
}