Download the PHP package phlib/console-process without Composer

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

phlib/console-process

Code Checks Codecov Latest Stable Version Total Downloads Licence

Console signal implementation using PHPs Process control functions.

There are 2 implementations.

  1. Background command. Repeatedly execute a command, until interrupted using the signal handler.
  2. Daemon command. Builds on the Background command to allow forking (detaching) the process.

Install

Via Composer

Background Command

Basic Usage

The Background Command is implemented in the same way as you're used to with the normal Symfony Command, however it must allow for the execute() method to be called multiple times. There is a processing delay between each execution which can be customised.

Stopping execution

Normal usage

Typically, the command will continue execution until interrupted by a signal, e.g. a user pressing Ctrl+C.

Self-termination

Alternatively, if an implementation has a finite task, for example deleting records in batches, it may need to terminate itself once the task is complete. This is done by calling shutdown().

Non-zero exit

If an execution returns a non-zero exit code, iteration will be stopped and the exit code will be passed back to the console, as with a normal Symfony Command.

Lifecycle Methods

The background command has additional methods that get called when the process starts and finishes. Useful for any initialising or final cleanup.

Daemon Command

Basic Usage

Apart from extending a different class, the Daemon Command looks and works in a similar way to the Background Command. The PID file argument is optional. If it is not specified the process generates it's own PID file based on the command name.

Output

Once a daemon process is detached, the original output is also lost. The --child-log | -o option can be used to specify a filename to write output. Alternatively, the createChildOutput() method can be overridden to return a new output instance. For example:

Lifecycle Methods

The daemon command has additional methods, to the standard Symfony command methods and the background command, which gets called during the process lifecycle. The following example demonstrates overriding the methods.

Command Line

Options

Name Short Type Required Default Description
action Argument yes start, stop, status
daemonize d Option no no Detaches the process
pid-file p Option no auto Name of the PID file to use. Not used if daemonize is not set.
child-log o Option no no Name of the file to save child output. Not used if daemonize is not set.

License

This package is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/.


All versions of console-process with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-pcntl Version *
ext-posix Version *
symfony/console Version ^5 || ^6
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 phlib/console-process contains the following files

Loading the files please wait ....