Download the PHP package byjg/php-daemonize without Composer

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

PHP Daemonize

Build Status Opensource ByJG GitHub source GitHub license GitHub release

Transform any class in a *nix daemon process or cron job without changes or refactoring.

Motivation

Some times we need to create a cron tab or a process for running in background. The most of times we need to create a new class, probably in a different framework and have to set or even choose another language for create the job/daemon.

"Daemonize" enables you to can create a linux daemon or a job for use in a cron tab without change you pre-existing class.

"Daemonize" is a script that create a "init.d" script and encapsulate or class enabling you to run it in the bash, for example.

How to

Suppose you have a pre-existing class for read some info from database and run some action with these data. For example:

If you want transform this class and method in a linux daemon (or "daemonize" it) you have to first create a bootstrap php file.

The most simple bootstrap is vendor/autoload.php but you can create a more complex bootstrap file if you need.

Below is an example of a bootstrap file:

Now, if you want to test it you can run the command:

You can test with:

If everything is ok, now you can "daemonize" this class (as root):

note: valid templates are:

Now for start or stop the service you need only

For uninstall just type:

and list all "daemonized" php classes

Install

Daemonize does not need to be associated to your PHP project. You can either as a global package or as a local package.

If you want to share this installation with another users consider use the command chmod a+x /root. The root directory will remain unreadable for them, but you'll can execute the script "daemonize".

Running a pre-installed demo

Open two terminals.

First do :

On the second do:

If everything is OK, will see on the first terminal a lot of lines added. Do not forget to run sudo service tryme stop

Dependencies


Open source ByJG


All versions of php-daemonize with dependencies

PHP Build Version
Package Version
Requires symfony/console Version ^5.4 | ^6.2
php Version >=5.4.0
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 byjg/php-daemonize contains the following files

Loading the files please wait ....