Download the PHP package adambrett/shell-wrapper without Composer

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

PHP Shell Wrapper

PHP Shell Wrapper is a high level object-oriented wrapper for accessing the program execution functions in PHP.

Its primary purpose is to abstract away low level program execution functions in your application, allowing you to mock PHP Shell Wrapper in your tests, making applications which call shell functions easily testable.

Installation

Using composer:

Basic Usage

Hello World

Import the required classes into your namespace:

Instantiate a new shell runner:

Create the command:

Add some parameters:

Now run the command:

Which would run the command:

Command Builder

Whilst this library is highly object-oriented behind the scenes, you may not want to use it that way, what's where the Command Builder comes in. The command builder constructs a Command object behind the scenes, and then constructs the correct class for each method called, so you don't have to worry about it.

The Command Builder also has a fluent interface for extra syntactical sugar. Here's the above example re-written using the Command Builder:

And here's a slightly less trivial example:

Which would run:

and another:

Which would run:

Runners

Runners are paths directly in to the PHP program execution functions, and map to them by name exactly. Runners should all implement \AdamBrett\ShellWrapper\Runners\Runner, which means you can type hint on that whenever you need to use a shell and they should then all be interchangeable.

Some runners will also implement \AdamBrett\ShellWrapper\Runners\ReturnValue, but only where that is appropriate to the low level function.

Some runners (marked *) only emulate command running. This feature useful for testing.

Runner Returns Flush getOutput getReturnValue
Exec Last Line x x
Passthru x x
ShellExec Full Output or null
System Last Line or false x x
Dry* Exit code x x
Fake* Exit code x x

You can use FakeRunner in your unit tests to emulate running a command. You can use DryRunnerfor debugging purposes, or when your application uses a --dry-run type argument and you want to echo the command rather than run it.

SubCommands

Usage

Sub commands will not be escaped or modified in anyway, they are intended for use like so:

Which would run the command jekyll build.

Arguments

Usage

$value will be automatically escaped behind the scenes, but $name will not, so make sure you never have user input in $name, or if you do, escape it yourself.

If you want multiple arguments of the same name, then $value can be an array, like so:

Which would result in the following:

Flags

Usage

$flag will not be escaped, but can be a string rather than a single character, so new Flag('lla') is perfectly valid.

Params

Usage

$param will be automatically escaped behind the scenes, but will otherwise be un-altered.

Requirements

Contributing

Pull Requests

  1. Fork the php-shell-wrapper repository
  2. Create a new branch for each feature or improvement
  3. Send a pull request from each feature branch to the master branch

Style Guide

This package is compliant with PSR-4 and PSR-12. If you notice compliance oversights, please send a patch via pull request.

Tests

The library is developed using test driven development. All pull requests should be accompanied by passing unit tests with 100% coverage. phpunit is used for testing and mockery is used for mocks.


All versions of shell-wrapper with dependencies

PHP Build Version
Package Version
No informations.
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 adambrett/shell-wrapper contains the following files

Loading the files please wait ....