\QuickApps\ConsoleWebShellDispatcher

Wrapper for CLI shells.

Allows to use CLI shells on HTTP environments. Use with caution as interactive shell may not work properly.

Usage

$success = WebShellDispatcher::run('MyPlugin.MyShell subcommand --arg1 --arg2');

if ($success) {
    echo "OK";
} else {
    echo "ERROR, see below:<br />";
    echo '<pre>' . WebShellDispatcher::output() . '</pre>';
}

Summary

Methods
Properties
Constants
run()
output()
No public properties found
No constants found
_createShell()
$_out
N/A
No private methods found
No private properties found
N/A

Properties

$_out

$_out : string

Holds the output of the last shell process.

Type

string

Methods

run()

run(string $args) : integer

Run the dispatcher.

Parameters

string $args

Commands to run

Returns

integer —

Result of the shell process. 1 on success, 0 otherwise.

output()

output() : string

Returns the output result of the last shell process executed using run().

Returns

string

_createShell()

_createShell(string $className, string $shortName) : \Cake\Console\Shell

Create the given shell name, and set the plugin property.

Parameters

string $className

The class name to instantiate

string $shortName

The plugin-prefixed shell name

Returns

\Cake\Console\Shell —

A shell instance.