Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/schibsted-tech-polska/svd.composer-helper
SvD Composer helper
https://github.com/schibsted-tech-polska/svd.composer-helper
Last synced: 3 days ago
JSON representation
SvD Composer helper
- Host: GitHub
- URL: https://github.com/schibsted-tech-polska/svd.composer-helper
- Owner: Schibsted-Tech-Polska
- Created: 2015-07-14T13:52:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-26T15:13:33.000Z (about 8 years ago)
- Last Synced: 2024-03-28T00:23:03.706Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 19
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Composer Helper
## Url Parser
This tool is very useful to split one env variable with uri i.e. to database like `mysql://user:password@host/database_name` and save it to separate env variables. It is useful to split parameters on heroku.### Instalation
Add to composer json:
```json
"schibsted-tech-polska/svd-composer-helper": "~1.0"
```### Usage
Add the folowing configuration to your composer.json file:
```json
"svd-composer-helper": {
"parse-url": {
"DATABASE_URI": {
"env-map": {
"host": "DATABASE_HOST",
"pass": "DATABASE_PASSWORD",
"path": "DATABASE_DBNAME",
"port": "DATABASE_PORT",
"user": "DATABASE_USER"
}
}
}
}
```
The `DATABASE_URI` is env variable which you want to split.If you want to trin database name add `"trim-path": true` under `DATABASE_URI`. It should look like this:
```json
"svd-composer-helper": {
"parse-url": {
"DATABASE_URI": {
"env-map": {
"host": "DATABASE_HOST",
"pass": "DATABASE_PASSWORD",
"path": "DATABASE_DBNAME",
"port": "DATABASE_PORT",
"user": "DATABASE_USER"
},
"trim-path": true
}
}
}
```