Download the PHP package yogarine/wait-for-it.php without Composer

On this page you can find all versions of the php package yogarine/wait-for-it.php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wait-for-it.php

wait-for-it.php

wait-for-it.php is a PHP implementation of the wait-for-it.sh script by Gilles Hall.

It can be both run as a standalone executable or included in PHP and used by calling the wait_for_it() function. As standalone script it can be used as a drop-in replacement for wait-for-it.sh.

Usage

From the command line

From PHP:

Installation

As Composer package

You can install it globally to use it as a stand-alone command:

You can also install wait-for-it.php as a dependency of your project:

This will allow you to use the wait_for_it() function.

Docker

wait-for-it.php is also available as a Docker image:

You can also easily copy the script in your own Dockerfiles:

Just keep in mind you'll need to have the pcntl extension installed.

Usage in PHP code

When installed as composer package wait-for-it.php is automatically included as helper file, and declares the wait_for_it() function.

It will wait and return true if the host came up, and false otherwise.

Examples

For example, let's test to see if we can access port 80 on www.google.com, and if it is available, echo the message google is up.

You can set your own timeout with the -t or --timeout= option. Setting the timeout value to 0 will disable the timeout:

The subcommand will be executed regardless if the service is up or not. If you wish to execute the subcommand only if the service is up, add the --strict argument. In this example, we will test port 81 on www.google.com which will fail:

If you don't want to execute a subcommand, leave off the -- argument. This way, you can test the exit condition of wait-for-it.php in your own scripts, and determine how to proceed:


All versions of wait-for-it.php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
ext-pcntl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yogarine/wait-for-it.php contains the following files

Loading the files please wait ....