8000 GitHub - ivol84/exec_wrapper: Allows to execute applications from command line.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

ivol84/exec_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

exec-wrapper

Latest Stable Version Build Status Code Coverage Scrutinizer Quality Score Total Downloads

Execution wrapper is extension implements execution of external application in OOP way. Also allows to add listener before and after execution.

Installation

Add exec-wrapper to your Composer project:

composer require ivol/exec-wrapper

Usage

It is really simple:

<php>
// Autoload here
use ivol/ExecutionWrapper;

$wrapper = new ExecutionWrapper();
$result = $wrapper->execute('echo %s', ['123']);
if ($result->getReturnCode() == 0) {
    echo('Success');
} else {
    echo('Failure');
}
echo($result->getOutput());
</php>

If you want to use Event System then you should configure event dispatcher:

...
$dispatcher = $wrapper->getEventDispatcher();
$dispatcher->addSubscriber(...);
$dispatcher->addListener(...);
...

For more information about event dispatcher see The EventDispatcher Component.

For additional examples see ExecutionWrapperIntegrationTest.

Configuration:

You can configure behaviour of args and command escaping by passing config array to ExecWrapper.

For configuration option names please see ExecWrapperConfiguration.

License

exec-wrapper is released under the MIT License.

About

Allows to execute applications from command line.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

0