helhum / env-ts
Writes environment variables as TypoScript constant file
Installs: 20 870
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 2
Open Issues: 1
Type:composer-plugin
Requires
- php: >=5.5.0
- composer-plugin-api: ^1.0
Requires (Dev)
- composer/composer: ^1.0.0
- mikey179/vfsstream: ~1.6.0
- phpunit/phpunit: ~4.8.0
Suggests
- helhum/dotenv-connector: ^1.1
README
env ts
This is a composer plugin, that writes environment variables to a TypoScript constants file.
This package is the missing link to be able to provide different TypoScript settings for TYPO3 installations in different environments.
configuration options
You configure env ts in the extra section of a composer.json
in any package like that:
"extra": {
"helhum/env-ts": {
"files": {
"path/to/environment.t3s": [
"PAGE__ROOT",
"PAGE__IMPRINT",
"PAGE__CUSTOMER_LOGIN"
]
},
"prefix": "environment",
"array-delimiter": "__",
"lower-camel-case": true
}
}
files
[array]
Multiple files (path relative to package dir) can be specified as key and which environment variable prefixes should be included.
In the above example it would have been enough to specify the prefix PAGE__
prefix
[string]
By default environment variables are passed as is to the constants file.
But it is possible to specify a prefix for the constants.
In the above example environment.page.root
is written for env var PAGE__ROOT
The default value is environment
array-delimiter
[string]
By default environment variables are passed as is to the constants file.
But it is possible to specify an array delimiter of the environment vars to be transformed into an
array part of the constants. In the above example environment.page.root
is written for env var PAGE__ROOT
The default value is __
lower-camel-case
[bool]
Whether the constant name should rather be lower camel cased than totally upper cased.
In the above example environment.page.customerLogin
is written for env var PAGE__CUSTOMER_LOGIN
The default value is true
.
Feedback
Any feedback is appreciated. Please write bug reports, feature request, create pull requests, or just drop me a "thank you" via Twitter or spread the word.
Thank you!