Download the PHP package rogerthomas84/daemoniser without Composer

On this page you can find all versions of the php package rogerthomas84/daemoniser. 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 daemoniser

What is it

Daemoniser is a PHP library to take the stress off of creating PHP based daemons. If you're questioning why then this library isn't for you. Generally PHP shouldn't be used for creating daemons.

Use it with Composer

$ composer require rogerthomas84/daemoniser

How to use

For help writing your first daemon, see the example in example/example.php.

A daemon requires an instance of DaemonConfig to be passed in via the execute method.

DaemonConfig constructor:

1) DaemonAbstract $damon / The instance of your daemon (which extends DaemonAbstract)

All config options are also available set and get methods in the config object.

Usage

Daemoniser has several helpful commands.

1) php my-daemon.php status - Get the status of the daemon 2) php my-daemon.php start - Start the daemon 3) php my-daemon.php soft-stop - Stop the daemon via a stop file gracefully. 4) php my-daemon.php stop - Stop the daemon immediately (this is not ideal) 5) php my-daemon.php restart - Restart the daemon (this is not ideal) 6) php my-daemon.php pid - Get the PID for the daemon 7) php my-daemon.php rm-logs - Delete historic logs for this daemon. 8) php my-daemon.php rm-logs all - Delete ALL logs for this daemon. 9) php my-daemon.php help - Show the help content

You shouldn't ever use stop really. Doing so will result in the process being immediately killed. But this is less of a problem if you aren't running something that could result in data loss in the case of an immediate halt being called.

If you 'must' have an immediate stop, you'll have to implement the canImmediatelyStop() method in your daemons and return true. This should be avoided at all costs, as the stop process simply kills the pid immediately.

Extending the commands:

You can easily extend the commands to perform different actions outside of the run() loop. To do this, simply implement the protected function getAdditionalCommands() method.

You'd need to return an array of objects. Each object being an instance of DaemonCommand. There's a helpful ::build() method available on the DaemonCommand which you can use to easily build new functionality.

Should I even use this?

If you're asking yourself this question, then the answer is no. No you shouldn't. This library fills very specific requirements.

Full example file:


All versions of daemoniser with dependencies

PHP Build Version
Package Version
Requires php Version >=5.0
ext-pcntl Version *
ext-posix 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 rogerthomas84/daemoniser contains the following files

Loading the files please wait ....