2017 © Pedro Peláez
 

library php-exec-command

Simple php command executor with param binding.

image

pastuhov/php-exec-command

Simple php command executor with param binding.

  • Thursday, December 21, 2017
  • by pastuhov
  • Repository
  • 1 Watchers
  • 19 Stars
  • 17,931 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 8 Versions
  • 7 % Grown

The README.md

php-exec-command

Build Status Scrutinizer Code Quality Code Coverage Total Downloads StyleCI, (*1)

Simple php command executor with param binding., (*2)

Install

Via Composer, (*3)

``` bash $ composer require pastuhov/php-exec-command, (*4)


## Features * light weight * param binding * throws an exception if return status >0 * redirect stderr to stdout if needed ## Usage ```php $output = Command::exec( 'echo {phrase}', [ 'phrase' => 'hello' ] ); // $output = 'hello'

or, (*5)

    $output = Command::exec(
        'echo {phrase}',
        [
            'phrase' => [
                'hello',
                'world'
            ]
        ]
    );
    // $output = 'hello world'

or, (*6)

    try {
        Command::exec('locate {parody}',
            [
                'parody' => [
                    'pink_unicorn'
                ]
            ]
        );    

        echo "unicorn was found!";
    } catch (\pastuhov\Command\CommandException $e) {
        echo "can't find unicorn :(";
    }

By default, all arguments are escaped using escapeshellarg. If you need to pass unescaped arguments, use {!name!}, like so:, (*7)

Command::exec('echo {!path!}', ['path' => '$PATH']);

Testing

``` bash $ composer test, (*8)

or
```bash
$ phpunit

Security

If you discover any security related issues, please email kirill@pastukhov.su instead of using the issue tracker., (*9)

Credits

License

GNU General Public License, version 2. Please see License File for more information., (*10)

The Versions

21/12 2017

dev-add-sonar-cube

dev-add-sonar-cube https://github.com/pastuhov/php-exec-command

Simple php command executor with param binding.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

command exec system

27/04 2017

dev-master

9999999-dev https://github.com/pastuhov/php-exec-command

Simple php command executor with param binding.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

command exec system

27/08 2016

1.1.0

1.1.0.0 https://github.com/pastuhov/php-exec-command

Simple php command executor with param binding.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

command exec system

25/03 2016

dev-pastuhov-patch-2

dev-pastuhov-patch-2 https://github.com/pastuhov/php-exec-command

Simple php command executor with param binding.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

command exec system

17/03 2016

dev-pastuhov-patch-1

dev-pastuhov-patch-1 https://github.com/pastuhov/php-exec-command

Simple php command executor with param binding.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

command exec system

17/03 2016

dev-analysis-zYjdao

dev-analysis-zYjdao https://github.com/pastuhov/php-exec-command

Simple php command executor with param binding.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

command exec system

18/12 2015

1.0.1

1.0.1.0 https://github.com/pastuhov/php-exec-command

Simple php command executor with param binding.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

command exec system

20/06 2015

v1.0

1.0.0.0 https://github.com/pastuhov/php-exec-command

Simple php command executor with param binding.

  Sources   Download

GPL-2.0

The Requires

  • php >=5.3.0

 

The Development Requires

command exec system