uuf6429 / wait4services
Small tool that waits until services are online.
Requires
- php: >=5.6
- roave/security-advisories: dev-master
- symfony/console: ^3.3
Requires (Dev)
- ext-curl: *
- ext-pdo: *
- ext-pdo_mysql: *
- php-amqplib/php-amqplib: *
- phpunit/phpunit: ^5.7
- predis/predis: *
Suggests
- ext-curl: Required for CurlHandler to function.
- ext-pdo_*: Required for PDO to function.
This package is auto-updated.
Last update: 2024-10-12 21:40:18 UTC
README
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):
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:
# 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:
-
Create your handler extending
uuf6429\WFS\Handler\Handler
-
At the end of that file (or in some other file) use the following code:
if (uuf6429\WFS\HandlerManager::class) { uuf6429\WFS\HandlerManager::getInstance() ->register(new YourCustomHandler()); }
-
In your
composer.json
make sure to put the previous file inautoload\files
section:"autoload": { "files": ["path/to/your/handler.php"] }