Property | Type | Description | |
---|---|---|---|
$banner | null | string | callable | ||
$bannerDisabledForUserCommands | boolean | ||
$console | Zend\Console\Adapter\AdapterInterface | ||
$debug | boolean | Flag to specify if the application is in debug mode | |
$dispatcher | ZF\Console\DispatcherInterface | ||
$exceptionHandler | callable | ||
$footer | null | string | callable | ||
$name | string | ||
$routeCollection | ZF\Console\RouteCollection | ||
$version | string |
Method | Description | |
---|---|---|
__construct ( string $name, string $version, array | Traversabl\Traversable $routes, Zend\Console\Adapter\AdapterInterface $console = null, ZF\Console\DispatcherInterface $dispatcher = null ) | Initialize the application | |
getDispatcher ( ) : ZF\Console\DispatcherInterface | ||
getExceptionHandler ( ) : callable | Gets the registered exception handler | |
isBannerDisabledForUserCommands ( ) : boolean | Whether or not to disable the banner in user commands. False by default. | |
removeRoute ( String $name ) : self | Remove a route by name | |
run ( array $args = null ) : integer | Run the application | |
setBanner ( null | string | callable $bannerOrCallable ) : self | Set the banner to display. | |
setBannerDisabledForUserCommands ( boolean $flag = true ) : self | Disables the banner for user commands. Still shows it before usage messages. | |
setDebug ( boolean $flag ) | Sets the debug flag of the application | |
setExceptionHandler ( callable $handler ) : self | Sets exception handler to use the expection Message | |
setFooter ( null | string | callable $footerOrCallable ) : self | Set the footer to display. | |
showMessage ( string | callable $messageOrCallable ) | Display a message (banner or footer) | |
showUsageMessage ( null | string $name = null ) | Displays a usage message for the router | |
showVersion ( Zend\Console\Adapter\AdapterInterface $console ) : integer | Display the application version |
Method | Description | |
---|---|---|
calcMaxString ( array $data = [] ) : integer | Calculate the maximum string length for an array | |
initializeExceptionHandler ( ) | Initialize the exception handler (if not in debug mode) | |
mapRouteHandler ( array $route ) | Map a route handler | |
processRun ( array $args ) : integer | Process run If the argument list is empty, displays a usage message. | |
setProcessTitle ( ) | Set CLI process title (PHP versions >= 5.5) | |
setRoutes ( array | Traversabl\Traversable $routes ) : self | Set routes to use | |
setupAutocompleteCommand ( ZF\Console\RouteCollection $routeCollection, ZF\Console\DispatcherInterface $dispatcher ) | Sets up the default autocomplete command | |
setupHelpCommand ( ZF\Console\RouteCollection $routeCollection, ZF\Console\DispatcherInterface $dispatcher ) | Sets up the default help command | |
setupVersionCommand ( ZF\Console\RouteCollection $routeCollection, ZF\Console\DispatcherInterface $dispatcher ) | Sets up the default version command | |
showUnmatchedRouteMessage ( array $args ) | Show message indicating inability to match a route. | |
showUnrecognizedRouteMessage ( string $name ) | Display an error message indicating a route name was not recognized | |
showUsageMessageForRoute ( |
Display the usage message for an individual route | |
validateMessage ( mixed $stringOrCallable ) |
public __construct ( string $name, string $version, array | Traversabl\Traversable $routes, Zend\Console\Adapter\AdapterInterface $console = null, ZF\Console\DispatcherInterface $dispatcher = null ) | ||
$name | string | Application name |
$version | string | Application version |
$routes | array | Traversabl\Traversable | Routes/route specifications to use for the application |
$console | Zend\Console\Adapter\AdapterInterface | Console adapter to use within the application |
$dispatcher | ZF\Console\DispatcherInterface | Configured dispatcher mapping routes to callables |
protected calcMaxString ( array $data = [] ) : integer | ||
$data | array | |
return | integer |
public getDispatcher ( ) : ZF\Console\DispatcherInterface | ||
return | ZF\Console\DispatcherInterface |
public getExceptionHandler ( ) : callable | ||
return | callable |
protected initializeExceptionHandler ( ) |
public isBannerDisabledForUserCommands ( ) : boolean | ||
return | boolean |
protected mapRouteHandler ( array $route ) | ||
$route | array |
protected processRun ( array $args ) : integer | ||
$args | array | |
return | integer |
public removeRoute ( String $name ) : self | ||
$name | String | |
return | self |
public setBannerDisabledForUserCommands ( boolean $flag = true ) : self | ||
$flag | boolean | |
return | self |
public setExceptionHandler ( callable $handler ) : self | ||
$handler | callable | |
return | self |
protected setProcessTitle ( ) |
protected setupAutocompleteCommand ( ZF\Console\RouteCollection $routeCollection, ZF\Console\DispatcherInterface $dispatcher ) | ||
$routeCollection | ZF\Console\RouteCollection | |
$dispatcher | ZF\Console\DispatcherInterface |
protected setupHelpCommand ( ZF\Console\RouteCollection $routeCollection, ZF\Console\DispatcherInterface $dispatcher ) | ||
$routeCollection | ZF\Console\RouteCollection | |
$dispatcher | ZF\Console\DispatcherInterface |
protected setupVersionCommand ( ZF\Console\RouteCollection $routeCollection, ZF\Console\DispatcherInterface $dispatcher ) | ||
$routeCollection | ZF\Console\RouteCollection | |
$dispatcher | ZF\Console\DispatcherInterface |
public showMessage ( string | callable $messageOrCallable ) | ||
$messageOrCallable | string | callable |
protected showUnmatchedRouteMessage ( array $args ) | ||
$args | array |
protected showUnrecognizedRouteMessage ( string $name ) | ||
$name | string |
public showUsageMessage ( null | string $name = null ) | ||
$name | null | string |
protected showUsageMessageForRoute ( |
||
$route |
public showVersion ( Zend\Console\Adapter\AdapterInterface $console ) : integer | ||
$console | Zend\Console\Adapter\AdapterInterface | |
return | integer |
protected validateMessage ( mixed $stringOrCallable ) | ||
$stringOrCallable | mixed |
protected bool $bannerDisabledForUserCommands | ||
return | boolean |
protected AdapterInterface,Zend\Console\Adapter $console | ||
return | Zend\Console\Adapter\AdapterInterface |
protected bool $debug | ||
return | boolean |
protected DispatcherInterface,ZF\Console $dispatcher | ||
return | ZF\Console\DispatcherInterface |
protected RouteCollection,ZF\Console $routeCollection | ||
return | ZF\Console\RouteCollection |