Download the PHP package ofbeaton/db-ping without Composer
On this page you can find all versions of the php package ofbeaton/db-ping. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package db-ping
db-ping
db-ping verifies a database server is responding by executing a query in a timed loop.
Optionally includes slave replication checks.
PHP 5.6+ console command that uses PDO to provide the database drivers:
- [x] MySQL
- [x] ODBC (i.e. Microsoft SQL Server ...)
Updates
The project is considered in a usable state and feature complete.
This project is used in corporate applications. As such, the authors are unlikely to update it on a regular basis, but instead when the corporate applications that use it run into problems. You should expect updates in the 5-10yr range.
Issues and PRs will be monitored, and we will continue to work with the community to provide updates as they are contributed.
Installing via phar
Before proceeding, you need a working PHP 5.6+ installation.
The recommended way to install db-ping is by downloading the phar.
See Releases for downloads.
Next, run the phar from the command line:
Testing
Smoke test
If there is no mysql server running locally, pinging will give a connection refused
error as below
Against a real MySql server
Launch a temporary mysql server:
docker run --name some-mysql --rm -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -p 3306:3306 mysql
Wait a few seconds while it initializes, then open another terminal and ping it:
To stop the dockerfile: docker stop some-mysql
Against a real database server via ODBC
- Set up your php server for ODBC
- Add the server you'd like to test against to the
/etc/odbc.ini
file (on linux) - Ping it
The ping SQL query can be repeated more than once per ping with the repeat
option. This is useful to make the ping test more stressful:
The output format can be controlled with the format
option:
Also, et
instead of te
would shuffle the order
Unit tests
Run vbin/phing check
License
This software is distributed under the MIT License. Please see License file for more information.