Download the PHP package adrian0350/php-daemon without Composer
On this page you can find all versions of the php package adrian0350/php-daemon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adrian0350/php-daemon
More information about adrian0350/php-daemon
Files in adrian0350/php-daemon
Package php-daemon
Short Description Bring workers to your web projects using PHP!
License MIT
Homepage https://github.com/Adrian0350/PHPDaemon
Informations about the package php-daemon
Introduction
With PHPDaemon you'll be able to run simple one-time daemons in any case you find yourself in a situation where you need to run an external script, meaning you need a Helper in your web project or what not.
This class works by storing a pid inside your script's dir as .script_file.pid
(files starting wiht .
are hidden by default).
Script output (logging) will be set in $options
with the keys (boolean) log
and (string) log_path
.
If log
is set to true and no log_path
is provided or is invalid it will log in the script's directory.
If log
is set to true and log_path
is provided and valid it will log into the given log_path.
Log's name will be your script_file
name ending with .log
.
Example:
For the pid /your/daemon/path/to/script_file.php
would be /your/daemon/path/to/.script_file.php.pid
and for the log /your/daemon/path/to/script_file.php
without a log_path, it would be /your/daemon/path/to/script_file.php.log
.
PHP Version
This class is compatible with PHP 5.4 and above due to the use of namespaces and PHP_BINARY constant.
Installing
Add this library to your composer configuration. In composer.json:
OR
If you're using bash.
Usage
For usage just call the methods from your PHPDaemon instance object.
Usage — instantiating
Prepare three arguments you'll need.
- Script's compatible binary file path [OPTIONAL].
- Daemon script file path.