otis22/cleardb-url
Composer 安装命令:
composer require otis22/cleardb-url
包简介
Clear-db-url parser.
README 文档
README
Clear-db-url parser. Cleardb is a db as service. Useful for heroku users.
How to use
Install package
composer require otis22/cleardb-url
For heroku users
Heroku server put clearDb url to environments. This function use env with name CLEARDB_DATABASE_URL.
use function Otis22\ClearDb\credential; $credential = credential(); $credential->db(); #db name $credential->driver(); #db type(mysql, pgsql, ...) $credential->host(); #host $credential->pass(); #password $credential->user(); #user
For phinx on heroku
use function Otis22\ClearDb\phinx; return [ ... 'environments' => [ 'default_migration_table' => 'phinxlog', 'default_environment' => 'production', 'production' => phinx()->asArray() ], ...
Parse custom clearDb url
use Otis22\ClearDb\ParsedUrl; use Otis22\ClearDb\Credential; $credential = new Credential( new ParsedUrl('mysql://user:pass@host/dbname?reconnect=true') ); # Available for getting db credentials $credential->db(); ...
Contributing
For run all tests
make all
or connect to terminal
make exec
or use built in php server http://localhost:8080
# start server on 8080 port make serve # custom port 8081 make serve PORT=8081
Dafault php version is 7.4. Use PHP_VERSION= for using custom version.
make all PHP_VERSION=8.0 # run both make all PHP_VERSION=7.4 && make all PHP_VERSION=8.0
all commands
# composer install make install # composer install with --no-dev make install-no-dev # check code style make style # fix code style make style-fix # run static analyze tools make static-analyze # run unit tests make unit # check coverage make coverage
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-12-28