Download the PHP package nusje2000/process-runner without Composer

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

Process runner

This package provides simple services to run commands within a php process. Each set of commands is called a TaskList and each TaskList contains a set of Tasks. A TaskList can be processed by an Executor which takes the commands from each task and runs it.

Creating a TaskList

The creation of a tasklist can be done manually like this:

Or using the provided factory for simple task lists:

Executing a TaskList

The execution of command is done by an Executor, this package provides two executors: ParallelExecutor and SequentialExecutor.

You can try them by running php vendor/nusje2000/process-runner/bin/example.php. This runs a set of commands using both the sequential and parallel executor.

Using the parallel executor

The ParallelExecutor runs all the tasks at the same time.

Using the sequential executor

The SequentialExecutor runs all the tasks after each other.

Listening for process updates

Sometimes the output from commands must be used within the parent process. This can be done by using a listener. Each listener has an onTick function which is called when the child process state is checked.

Creating a listener using the callback listener

If you want to add a simple listen function to an executor than the CallbackListener can be used. This takes a callback as argument and then uses that callback as tick function.

Creating a listener using the ExecutionListener interface

Sometimes a listener is too complicated for a simple callback function, in this case you can create your own class that implements the ExecutionListener interface to handle the tick.

Forwarding the status of the tasks to the console

In most cases the parent process is a command as well. If you want to see the status of the child processes in the output of the parent process, you can add the ConsoleListener to the executor. This will show a list of all the tasks with their status and in case of an error, it will show the output and error output of the child process.

The output of the listener will look something like this:

Using the console listener in situations where the output is logged

Is some situations (like ci/cd integrations), the output of console commands is logged to files. If this is the case, using the default ConsoleLogger would result in output for each process change check (by default 5 times a second). For these usecases, you can use the StaticConsoleListener. This listener will only print the changes to the console, instead of updating the console output using sections.

The output of the listener will look something like this:


All versions of process-runner with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
symfony/process Version ^4.4|^5.0|^6.0
symfony/console Version ^4.4|^5.0|^6.0
ramsey/uuid Version ^4.1
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 nusje2000/process-runner contains the following files

Loading the files please wait ....