From 85f9a6232de77aadaedee2e7b0ef7e3798e687a1 Mon Sep 17 00:00:00 2001 From: Daniel Hensby Date: Sun, 27 Nov 2016 22:33:37 +0000 Subject: [PATCH] Updating references to _ss_environment.php --- cli-script.php | 17 ++++----- .../01_Installation/03_Windows.md | 2 +- .../Windows_IIS7.md | 25 +++++++------ docs/en/00_Getting_Started/02_Composer.md | 2 +- .../03_Environment_Variables.md | 9 +++-- .../07_Debugging/00_Environment_Types.md | 5 ++- .../09_Security/03_Authentication.md | 11 +++--- .../09_Security/04_Secure_Coding.md | 23 ++++++------ docs/en/02_Developer_Guides/10_Email/index.md | 2 +- .../14_Files/03_File_Security.md | 5 ++- .../16_Execution_Pipeline/02_Manifests.md | 2 +- .../16_Execution_Pipeline/index.md | 7 ++-- docs/en/05_Contributing/04_Release_Process.md | 7 ++-- .../05_Making_A_SilverStripe_Core_Release.md | 36 +++++++++---------- main.php | 3 +- src/Control/Email/Email.php | 4 +-- src/Core/Constants.php | 1 - src/Dev/Install/client/dist/js/install.js | 2 +- src/Dev/Install/config-form.html | 2 +- src/Dev/Install/install.php5 | 2 +- src/Security/BasicAuth.php | 4 +-- src/conf/ConfigureFromEnv.php | 4 +-- tests/bootstrap/environment.php | 2 +- 23 files changed, 80 insertions(+), 97 deletions(-) diff --git a/cli-script.php b/cli-script.php index 5a1d9b737e1..e3b2ac16a73 100755 --- a/cli-script.php +++ b/cli-script.php @@ -82,23 +82,20 @@ // Connect to database if(!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) { echo "\nPlease configure your database connection details. You can do this by creating a file -called _ss_environment.php in either of the following locations:\n\n"; - echo " - " . BASE_PATH . DIRECTORY_SEPARATOR . "_ss_environment.php\n - "; - echo dirname(BASE_PATH) . DIRECTORY_SEPARATOR . "_ss_environment.php\n\n"; +called .env in " . BASE_PATH; echo <<'); -define('SS_DATABASE_PASSWORD', ''); -define('SS_DATABASE_NAME', ''); +SS_DATABASE_SERVER="localhost" +SS_DATABASE_USERNAME="" +SS_DATABASE_PASSWORD="" +SS_DATABASE_NAME="" -------------------------------------------------- Once you have done that, run 'composer install' or './framework/sake dev/build' to create diff --git a/docs/en/00_Getting_Started/01_Installation/03_Windows.md b/docs/en/00_Getting_Started/01_Installation/03_Windows.md index 1ea52864167..c52e1132cff 100644 --- a/docs/en/00_Getting_Started/01_Installation/03_Windows.md +++ b/docs/en/00_Getting_Started/01_Installation/03_Windows.md @@ -41,7 +41,7 @@ $ composer create-project silverstripe/installer ./silverstripe * Rename the unpacked directory from `C:\wamp\www\silverstripe-vX.X.X` to `C:\wamp\www\silverstripe` ## Install and configure -* Option 1: Environment file - Set up a file named _ss_environment.php either in the webroot or a directory above webroot and setup as per the [Environment Management process](/getting_started/environment_management). +* Option 1: Environment file - Set up a file named `.env` file either in the webroot and setup as per the [Environment Management process](/getting_started/environment_management). * Option 2: Installer - Visit `http://localhost/silverstripe` - you will see SilverStripe's installation screen. * You should be able to click "Install SilverStripe" and the installer will do its thing. It takes a minute or two. diff --git a/docs/en/00_Getting_Started/01_Installation/04_Other_installation_Options/Windows_IIS7.md b/docs/en/00_Getting_Started/01_Installation/04_Other_installation_Options/Windows_IIS7.md index 1fa32603ec5..40ba1635535 100644 --- a/docs/en/00_Getting_Started/01_Installation/04_Other_installation_Options/Windows_IIS7.md +++ b/docs/en/00_Getting_Started/01_Installation/04_Other_installation_Options/Windows_IIS7.md @@ -160,22 +160,21 @@ You will need to give **Modify** permission to **IUSR** user. To do it right cli Now that we've got the backend server software sorted out, it's time to install the SilverStripe CMS/framework. -Create a new file called **_ss_environment.php** in **C:\inetpub\wwwroot** +Create a new file called `.env` in **C:\inetpub\wwwroot\ss** This file tells SilverStripe projects installed on this machine which database server and credentials, as well as anything environment specific. -Inside the newly created _ss_environment.php file, insert the following code: +Inside the newly created `.env` file, insert the following code: - # Ensure that X-Forwarded-Host is only allowed to determine the request - # hostname for servers ips defined by SS_TRUSTED_PROXY_IPS in your _ss_environment.php + # hostname for servers ips defined by SS_TRUSTED_PROXY_IPS in your .env # Note that in a future release this setting will be always on. SetEnv BlockUntrustedIPs true @@ -586,7 +583,7 @@ following in your .htaccess to ensure this behaviour is activated. In a future release this behaviour will be changed to be on by default, and this environment variable will be no longer necessary, thus it will be necessary to always set -SS_TRUSTED_PROXY_IPS if using a proxy. +`SS_TRUSTED_PROXY_IPS` if using a proxy. ## Related diff --git a/docs/en/02_Developer_Guides/10_Email/index.md b/docs/en/02_Developer_Guides/10_Email/index.md index 059e2a6590d..4baf2989f18 100644 --- a/docs/en/02_Developer_Guides/10_Email/index.md +++ b/docs/en/02_Developer_Guides/10_Email/index.md @@ -220,7 +220,7 @@ assets folder instead. A bounce handler email can be specified one of a few ways: * Via config by setting the `Mailer.default_bounce_email` config to the desired email address. -* Via _ss_environment.php by setting the `BOUNCE_EMAIL` definition. +* Via defining a constant `BOUNCE_EMAIL`. * Via PHP by calling `Email::mailer()->setBounceEmail('bounce@mycompany.com');` ## API Documentation diff --git a/docs/en/02_Developer_Guides/14_Files/03_File_Security.md b/docs/en/02_Developer_Guides/14_Files/03_File_Security.md index 2da883bf2b9..75b2f2d4d0b 100644 --- a/docs/en/02_Developer_Guides/14_Files/03_File_Security.md +++ b/docs/en/02_Developer_Guides/14_Files/03_File_Security.md @@ -232,11 +232,10 @@ In order to better ensure these files are protected, it's recommended to move th root altogether. For instance, given your web root is in the folder `/sites/mysite/www`, you can tell the asset store -to put protected files into `/sites/mysite/protected` with the below `_ss_environment.php` setting: +to put protected files into `/sites/mysite/protected` with the below `.env` setting: - :::php - define('SS_PROTECTED_ASSETS_PATH', '/sites/mysite/protected'); + SS_PROTECTED_ASSETS_PATH="/sites/mysite/protected" ### Configuring: File types diff --git a/docs/en/02_Developer_Guides/16_Execution_Pipeline/02_Manifests.md b/docs/en/02_Developer_Guides/16_Execution_Pipeline/02_Manifests.md index eb9812b3334..c1c430da3ba 100644 --- a/docs/en/02_Developer_Guides/16_Execution_Pipeline/02_Manifests.md +++ b/docs/en/02_Developer_Guides/16_Execution_Pipeline/02_Manifests.md @@ -15,7 +15,7 @@ By default, manifests are stored on the local filesystem through PHP's `serializ Combined with PHP opcode caching this provides fast access. In order to share manifests between servers, or centralise cache management, other storage adapters are available. These can be configured by a `SS_MANIFESTCACHE` constant, -placed in your `_ss_environment.php`. +placed in your `.env`. * `ManifestCache_File`: The default adapter using PHP's `serialize()` * `ManifestCache_File_PHP`: Using `var_export()`, which is faster when a PHP opcode cache is installed diff --git a/docs/en/02_Developer_Guides/16_Execution_Pipeline/index.md b/docs/en/02_Developer_Guides/16_Execution_Pipeline/index.md index 91fc2c77c77..7e91aa99b20 100644 --- a/docs/en/02_Developer_Guides/16_Execution_Pipeline/index.md +++ b/docs/en/02_Developer_Guides/16_Execution_Pipeline/index.md @@ -80,13 +80,12 @@ can leave sensitive files exposed to public access (the `RewriteRule` conditions All requests go through `framework/main.php`, which sets up the execution environment: - * Tries to locate an `_ss_environment.php` - [configuration file](/getting_started/environment_management) in the webroot, - or the two levels above it (to allow sharing configuration between multiple webroots). + * Tries to locate an `.env` + [configuration file](/getting_started/environment_management) in the webroot. * Sets constants based on the filesystem structure (e.g. `BASE_URL`, `BASE_PATH` and `TEMP_FOLDER`) * Normalizes the `url` parameter in preparation for handing it off to `Director` * Connects to a database, based on information stored in the global `$databaseConfig` variable. - The configuration is either defined in your `_config.php`, or through `_ss_environment.php` + The configuration is either defined in your `_config.php`, or through `.env` * Sets up [error handlers](../debugging/error_handling) * Optionally continues a [session](../cookies_and_sessions/sessions) if the request already contains a session identifier * Loads manifests for PHP classes, templates, as well as any [YAML configuration](../configuration). diff --git a/docs/en/05_Contributing/04_Release_Process.md b/docs/en/05_Contributing/04_Release_Process.md index e91c1d902aa..aa466ab1af6 100644 --- a/docs/en/05_Contributing/04_Release_Process.md +++ b/docs/en/05_Contributing/04_Release_Process.md @@ -79,7 +79,7 @@ This change could be committed to a minor release like *3.2.0*, and remains depr (e.g. *3.3.0*, *3.4.0*), until a new major release (e.g. *4.0.0*), at which point it gets removed from the codebase. Deprecation notices are enabled by default on dev environment, but can be -turned off via either _ss_environment.php or in your _config.php. Deprecation +turned off via either `.env` or in your _config.php. Deprecation notices are always disabled on both live and test. @@ -90,11 +90,10 @@ notices are always disabled on both live and test. Deprecation::set_enabled(false); -`_ss_environment.php` +`.env` - :::php - define('SS_DEPRECATION_ENABLED', false); + SS_DEPRECATION_ENABLED="0" ## Security Releases diff --git a/docs/en/05_Contributing/05_Making_A_SilverStripe_Core_Release.md b/docs/en/05_Contributing/05_Making_A_SilverStripe_Core_Release.md index b47e0116ad7..cf7272af747 100644 --- a/docs/en/05_Contributing/05_Making_A_SilverStripe_Core_Release.md +++ b/docs/en/05_Contributing/05_Making_A_SilverStripe_Core_Release.md @@ -36,30 +36,28 @@ As a core contributor it is necessary to have installed the following set of too * [AWS CLI tools](https://aws.amazon.com/cli/): - `pip install awscli` * The `tar` and `zip` commands -* A good _ss_environment.php setup in your localhost webroot. +* A good `.env` setup in your localhost webroot. -Example `_ss_environment.php`: +Example `.env`: - :::php - Database Configuration Step 2 of 5
> - +
diff --git a/src/Dev/Install/install.php5 b/src/Dev/Install/install.php5 index 0afd7341d03..4040299f359 100755 --- a/src/Dev/Install/install.php5 +++ b/src/Dev/Install/install.php5 @@ -1401,7 +1401,7 @@ class Installer extends InstallRequirements { // Write the config file global $usingEnv; if($usingEnv) { - $this->statusMessage("Setting up 'mysite/_config.php' for use with _ss_environment.php..."); + $this->statusMessage("Setting up 'mysite/_config.php' for use with environment variables..."); $this->writeToFile("mysite/_config.php", <<