https://github.com/uuf6429/wait4services
A simple tool for waiting until all required services are up and running.
https://github.com/uuf6429/wait4services
Last synced: about 2 months ago
JSON representation
A simple tool for waiting until all required services are up and running.
- Host: GitHub
- URL: https://github.com/uuf6429/wait4services
- Owner: uuf6429
- License: mit
- Created: 2018-02-03T16:43:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-12T08:42:08.000Z (over 6 years ago)
- Last Synced: 2025-04-03T11:57:31.260Z (about 2 months ago)
- Language: PHP
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wait4services
[](https://travis-ci.org/uuf6429/wait4services)
[](https://codecov.io/gh/uuf6429/wait4services/branch/master/)
[](https://php.net/)
[](https://github.com/uuf6429/wait4services/blob/master/LICENSE)
[](https://packagist.org/packages/uuf6429/wait4services)A simple tool for waiting until all required services are up and running.

## Installation
Add via composer, either locally or globally (depending on your needs):
```bash
composer require uuf6429/wait4services
```
_(to install globally just add "global" before "require")_## Usage
Let's say you want to run some tests on a system bootstrapped from Docker, this tool could be used like so:
```bash
# start docker services
docker-compose up -d# wait for the services
vendor/bin/wait4services \
"pdo-mysql://dbuser:dbpass@docker/somedb" \
"http://docker/wp-admin"# run your tests
vendor/bin/phpunit
```## Extending
It's a bit difficult to extend due to autoloading, however it can be achieved with the following steps:
1. Create your handler extending `uuf6429\WFS\Handler\Handler`
2. At the end of that file (or in some other file) use the following code:
```php
if (uuf6429\WFS\HandlerManager::class) {
uuf6429\WFS\HandlerManager::getInstance()
->register(new YourCustomHandler());
}
```
3. In your `composer.json` make sure to put the previous file in `autoload\files` section:
```json
"autoload": {
"files": ["path/to/your/handler.php"]
}
```