Download the PHP package rasuvaeff/context-process without Composer

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

rasuvaeff/context-process

Latest Stable Version Total Downloads Build Static analysis Psalm level PHP

Runs external processes (ImageMagick, wkhtmltopdf, git, ffmpeg, your own scripts) under a rasuvaeff/context budget. When the deadline passes or the context is cancelled, the process is really stopped — SIGTERM, then SIGKILL after a grace period — instead of running on after the caller gave up.

Using an AI coding assistant? llms.txt contains a compact API reference you can share with the model. Projects using the llm/skills Composer plugin also get this package's agent skill synced into .agents/skills/ automatically on install.

Requirements

Installation

Limitations

Usage

Situation What happens
The process finishes in time Its exit code is returned
The deadline passes The process is stopped (SIGTERM, SIGKILL after gracePeriod); ContextExpiredException
The context is cancelled (also via requestCancel() from a signal handler, e.g. rasuvaeff/context-cli) The process is stopped; ContextCancelledException with the reason as previous
The context is already terminated The process is never started
The process's own setTimeout() / setIdleTimeout() fires symfony/process stops it; its ProcessTimedOutException is rethrown unchanged
The callback throws The process is stopped; the callback's exception propagates
The process was already started LogicException

The budget is not turned into the process's own timeout: symfony/process kills on timeout with no grace period, while the context's deadline goes through the same SIGTERM → grace → SIGKILL path as a cancellation.

Public API

Class Description
ContextProcess run(Process $process, Context $context, ?callable $callback = null, float $gracePeriod = 2.0, float $pollInterval = 0.05): int

Security

Arguments are passed as an argv array to symfony/process, never through a shell. The package adds no input of its own to the command line.

Examples

See examples/ for runnable scripts.

Script Shows Needs server?
budget.php A 10 s command stopped by a 0.5 s budget; a command within the budget returning its exit code and output no

Development

No PHP/Composer on the host — run in Docker via the composer:2 image:

License

BSD-3-Clause


All versions of context-process with dependencies

PHP Build Version
Package Version
Requires php Version 8.3 - 8.6
rasuvaeff/context Version ^0.3 || ^0.5
symfony/process Version ^7.1.7 || ^8.0.5
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 rasuvaeff/context-process contains the following files

Loading the files please wait ...