Download the PHP package wpelevator/phpcs-parallel without Composer

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

run-parallel

Test

Run a list of commands, or one command per matched path, in parallel.

run-parallel is useful for running Composer scripts concurrently — think npm-run-all for PHP — and for monorepos where each package has its own tool config. It discovers paths, renders one command per path, and executes those commands with prefixed output.

Install

The package declares Composer replacements for the earlier package name wpelevator/phpcs-parallel so dependent packages can move to wpelevator/run-parallel without installing duplicate copies.

Usage

At its simplest, pass each command with --command:

Each command becomes its own task, and tasks run in parallel with prefixed output, a per-task summary, and the highest exit code as the result. Repeat --command when you want npm-run-all style behaviour. See Composer scripts for running named scripts concurrently.

For monorepos, provide a path pattern and a command template instead. One task is created per matched path:

Tasks run in parallel by default, one process per CPU core. Use --processes to control the concurrency (--processes=1 runs serially):

Use --cwd when a tool should run from the matched package directory:

Repeat --command with --path-pattern to run multiple commands for each matched path:

By default, labels for multiple commands per matched path include both the matched path and the command, such as foo:composer-validate and foo:composer-test.

When --cwd is set, use {path | realpath} for file paths that must still point back to the matched file:

Use --label when you want custom output prefixes:

Options:

Option Description
--command=CMD Command to run. Repeatable; with --path-pattern, each command is rendered once per matched path.
COMMAND ... Positional shorthand for --command.
--path-pattern=GLOB Match paths to create tasks. Repeatable; comma-separated values are supported.
--processes=N Number of commands to run at once. Default: auto (CPU core count).
--cwd=TEMPLATE Working directory template for each task. Default: invocation directory.
--label=TEMPLATE Output label template for each task. Default: {path | dirname | basename}, {path | dirname | basename}:{command | slug} for multiple commands per path, or {path | slug} for a command list.
--config=PATH PHP config file for custom filters, variables, and defaults.
--dry-run Print the rendered command per task without executing anything.
--fail-fast Stop scheduling and terminate running tasks after the first failure.

Path patterns

Patterns use glob semantics: * and ? match within a single path segment and never cross /, while ** matches any number of segments. Character classes like [0-9] and [!0-9] are supported.

Pattern Matches Does not match
packages/*/phpcs.xml packages/foo/phpcs.xml packages/foo/bar/phpcs.xml
packages/**/phpcs.xml packages/phpcs.xml, packages/foo/bar/phpcs.xml src/phpcs.xml
**/composer.json composer.json at any depth

Use --dry-run to preview which paths matched and what will run:

Template variables

Variable Description
{path} Matched path, rendered relative to the invocation directory when possible. For a command list, the command string itself.
{command} Command template for the current task.
{index} Zero-based task index.

Filters

Variables can be piped through filters with |. Filters apply left to right, so {path | dirname | basename} takes the directory of the matched path, then its last segment.

Example outputs below assume the matched path is packages/foo/phpcs.xml.dist and run-parallel was invoked from /repo:

Filter Description Example output
dirname Parent directory of the path. packages/foo
basename Last segment of the path. phpcs.xml.dist
filename Last segment without its final extension. phpcs.xml
ext Final extension without the dot. dist
realpath Absolute path. Relative values are resolved against the invocation directory; if the path does not exist, the joined path is returned unresolved. /repo/packages/foo/phpcs.xml.dist
relative Path relative to the invocation directory (. for the directory itself). Paths outside it are returned unchanged. packages/foo/phpcs.xml.dist
slug Replaces every run of characters other than letters, digits, ., _, and - with a single -, then trims leading and trailing dashes. Useful for labels and artifact names. packages-foo-phpcs.xml.dist

Referencing an unknown variable or filter in a template is an error and fails the run. Custom filters and variables can be added via a config file.

Commands are executed directly as argv, not through a shell. Pipes, redirects, and shell expansion are not interpreted.

Binary resolution

The first word of each command is resolved through the PATH environment variable, which child processes inherit from run-parallel. When run-parallel runs as a Composer script, Composer prepends the project's vendor/bin directory to PATH for the duration of the run, so bare binary names like phpcs or phpstan resolve to the project-local binaries — even when --cwd points at a package subdirectory, because the prepended vendor/bin path is absolute.

When invoking vendor/bin/run-parallel directly from the shell, PATH is not modified, so bare names resolve to whatever is installed globally. In that case, reference project-local binaries by path:

Working directory

By default, every command runs in the directory where run-parallel was invoked. Use --cwd to run each command from a different directory — typically the matched package directory via --cwd='{path | dirname}'. The template is rendered once per task, and a relative result is resolved against the invocation directory.

--cwd changes the child process working directory, but template variables are still rendered relative to the original invocation directory. Use {path | realpath} when the child process needs an absolute path.

Configuration

Use --config=run-parallel.php to load custom filters, variables, and default option values.

Then run:

CLI options override config defaults, so you can still replace individual values:

The command default also accepts a list. Without path patterns, each command becomes its own task. With path patterns, each command runs once per matched path:

Custom filters receive the current value, the current task, and the invocation working directory:

Examples

PHPCS

Run PHPCS once per package ruleset:

Run PHPCS in parallel and pass PHPCS options directly in the command template:

If your project uses multiple PHPCS config names, repeat --path-pattern:

PHPCBF

PHPStan

PHPUnit

Composer

The command template accepts any Composer invocation, not just composer test:

Run a named Composer script the same way:

Composer scripts

Run existing Composer scripts in parallel by wrapping them in a run-parallel script, npm-run-all style:

Now composer check runs all three concurrently with prefixed output and a summary, and fails if any of them fail.

Composer adds vendor/bin to PATH when running scripts, so both run-parallel and the binaries referenced in commands can use bare names here (see Binary resolution):

Development

Run the same checks used by CI:

Run a specific test suite:

Generate PHPUnit coverage reports (requires Xdebug or PCOV):

Coverage output is written to the terminal, tests/coverage/clover.xml, and tests/coverage/html.

Use the self test to run all checks concurrently:

Why not …?

Notes

License

This project is open-sourced under the MIT License. See LICENSE for details.


All versions of phpcs-parallel with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
squizlabs/php_codesniffer Version ^3.7 || ^4.0
symfony/console Version ^6.4 || ^7.0
symfony/process Version ^6.4 || ^7.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 wpelevator/phpcs-parallel contains the following files

Loading the files please wait ...