-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Add section on Environment configuration
- Loading branch information
1 parent
14ccacd
commit ae31f86
Showing
8 changed files
with
311 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Documentation/Installation/Environments/_additional-context.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
use TYPO3\CMS\Core\Core\Environment; | ||
|
||
defined('TYPO3') or die(); | ||
|
||
$context = Environment::getContext(); | ||
$baseDirectory = Environment::getConfigPath(); | ||
$subContexts = explode('/', strtolower($context)); | ||
|
||
// Include a file like system/production.php, system/development.php | ||
// or system/staging.php - depending on the TYPO3_CONTEXT application | ||
// context that is currently active. | ||
if (file_exists($baseDirectory . '/system/' . $subContexts[0] . '.php')) { | ||
include $baseDirectory . '/system/' . $subContexts[0] . '.php'; | ||
} | ||
|
||
// ALSO overload an environment-specific configuration, to allow more | ||
// specific environment configuration on top of the "global" application | ||
// context. | ||
if (file_exists($baseDirectory . '/system/environment.php')) { | ||
include $baseDirectory . '/system/environment.php'; | ||
} |
24 changes: 24 additions & 0 deletions
24
Documentation/Installation/Environments/_additional-native.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
defined('TYPO3') or die(); | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport'] | ||
= 'smtp'; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_server'] | ||
= 'smtp.example.com:25'; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_username'] | ||
= '[email protected]'; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_password'] | ||
= 'verySafeAndSecretPassword0815!'; | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'] | ||
= 'typo3'; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'] | ||
= 'db.example.com'; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password'] | ||
= 'joh317'; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user'] | ||
= 'typo3'; | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] = [ | ||
'/var/www/shared/files/' | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
defined('TYPO3') or die(); | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport'] | ||
= $_ENV['TYPO3_MAIL_TRANSPORT']; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_server'] | ||
= $_ENV['TYPO3_MAIL_TRANSPORT_SMTP_SERVER']; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_username'] | ||
= $_ENV['TYPO3_MAIL_TRANSPORT_SMTP_USERNAME']; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_password'] | ||
= $_ENV['TYPO3_MAIL_TRANSPORT_SMTP_PASSWORD']; | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'] | ||
= $_ENV['TYPO3_DB_DBNAME']; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'] | ||
= $_ENV['TYPO3_DB_HOST']; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password'] | ||
= $_ENV['TYPO3_DB_PASSWORD']; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user'] | ||
= $_ENV['TYPO3_DB_USER']; | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] = [ | ||
$_ENV['TYPO3_BE_LOCKROOTPATH'] | ||
]; |
12 changes: 12 additions & 0 deletions
12
Documentation/Installation/Environments/_dotenv-symfony.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
use Symfony\Component\Dotenv\Dotenv; | ||
|
||
try { | ||
$dotenv = new Dotenv(); | ||
// Load file from ".env" file in the current directory (system/) | ||
// You can of course specify another root directory here, like: | ||
// $dotenv->load(TYPO3\CMS\Core\Core\Environment::getProjectPath() . '/.env'); | ||
$dotenv->load(__DIR__ . '/.env'); | ||
} catch (Exception $e) { | ||
// If no ".env" file is found, configuration can still be functional. | ||
} |
14 changes: 14 additions & 0 deletions
14
Documentation/Installation/Environments/_dotenv-vlucas.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
use Dotenv\Dotenv; | ||
use Dotenv\Exception\InvalidPathException; | ||
use TYPO3\CMS\Core\Core\Environment; | ||
|
||
defined('TYPO3') or die(); | ||
|
||
// If no ".env" file is found, configuration can still be functional. | ||
try { | ||
$dotenv = Dotenv::createUnsafeImmutable(Environment::getProjectPath()); | ||
$dotenv->load(); | ||
} catch (InvalidPathException $e) { | ||
// If no ".env" file is found, configuration can still be functional. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
defined('TYPO3') or die(); | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport'] | ||
= 'smtp'; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_server'] | ||
= 'smtp.example.com:25'; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_username'] | ||
= '[email protected]'; | ||
$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_password'] | ||
= 'verySafeAndSecretPassword0815!'; | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['dbname'] | ||
= 'typo3'; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['host'] | ||
= 'db.example.com'; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['password'] | ||
= 'verySafeAndSecretPassword0815!'; | ||
$GLOBALS['TYPO3_CONF_VARS']['DB']['Connections']['Default']['user'] | ||
= 'typo3'; | ||
|
||
$GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] = [ | ||
'/var/www/shared/files/' | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Application context | ||
TYPO3_CONTEXT="Production/Production" | ||
|
||
# Mail settings | ||
TYPO3_MAIL_TRANSPORT="smtp" | ||
TYPO3_MAIL_TRANSPORT_SMTP_SERVER="smtp.example.com:25" | ||
TYPO3_MAIL_TRANSPORT_SMTP_USERNAME="[email protected]" | ||
TYPO3_MAIL_TRANSPORT_SMTP_PASSWORD="verySafeAndSecretPassword0815!" | ||
|
||
# Database settings | ||
TYPO3_DB_DBNAME="typo3" | ||
TYPO3_DB_HOST="db.example.com" | ||
TYPO3_DB_PASSWORD="verySafeAndSecretPassword0815!" | ||
TYPO3_DB_USER="typo3" | ||
|
||
# Rootpath for files | ||
TYPO3_BE_LOCKROOTPATH="/var/www/shared/files/" |