PHP Class Neos\Flow\Cli\CommandController

Inheritance: implements Neos\Flow\Mvc\Controller\ControllerInterface
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$arguments Neos\Flow\Mvc\Controller\Arguments
$commandManager CommandManager
$commandMethodName string Name of the command method
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$output ConsoleOutput
$request Request
$response Response

Méthodes publiques

Méthode Description
__construct ( ) Constructs the command controller
getFlowInvocationString ( ) : string Returns the CLI Flow command depending on the environment
injectCommandManager ( CommandManager $commandManager ) : void
injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void Injects the reflection service
processRequest ( Neos\Flow\Mvc\RequestInterface $request, Neos\Flow\Mvc\ResponseInterface $response ) : void Processes a command line request.

Méthodes protégées

Méthode Description
callCommandMethod ( ) : void Calls the specified command method and passes the arguments.
forward ( string $commandName, string $controllerObjectName = null, array $arguments = [] ) : void Forwards the request to another command and / or CommandController.
initializeCommandMethodArguments ( ) : void Initializes the arguments array of this controller by creating an empty argument object for each of the method arguments found in the designated command method.
mapRequestArgumentsToControllerArguments ( ) : void Maps arguments delivered by the request object to the local controller arguments.
output ( string $text, array $arguments = [] ) : void Outputs specified text to the console window You can specify arguments that will be passed to the text via sprintf
outputFormatted ( string $text = '', array $arguments = [], integer $leftPadding ) : void Formats the given text to fit into MAXIMUM_LINE_LENGTH and outputs it to the console window
outputLine ( string $text = '', array $arguments = [] ) : void Outputs specified text to the console window and appends a line break
quit ( integer $exitCode ) : void Exits the CLI through the dispatcher and makes sure that Flow is properly shut down.
resolveCommandMethodName ( ) : string Resolves and checks the current command method name
sendAndExit ( integer $exitCode ) : void Sends the response and exits the CLI without any further code execution Should be used for commands that flush code caches.

Method Details

__construct() public méthode

Constructs the command controller
public __construct ( )

callCommandMethod() protected méthode

If the command returns a string, it is appended to the content in the response object. If the command doesn't return anything and a valid view exists, the view is rendered automatically.
protected callCommandMethod ( ) : void
Résultat void

forward() protected méthode

Request is directly transferred to the other command / controller without the need for a new request.
protected forward ( string $commandName, string $controllerObjectName = null, array $arguments = [] ) : void
$commandName string
$controllerObjectName string
$arguments array
Résultat void

getFlowInvocationString() public méthode

Returns the CLI Flow command depending on the environment
public getFlowInvocationString ( ) : string
Résultat string

initializeCommandMethodArguments() protected méthode

Initializes the arguments array of this controller by creating an empty argument object for each of the method arguments found in the designated command method.
protected initializeCommandMethodArguments ( ) : void
Résultat void

injectCommandManager() public méthode

public injectCommandManager ( CommandManager $commandManager ) : void
$commandManager CommandManager
Résultat void

injectObjectManager() public méthode

Injects the reflection service
public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
Résultat void

mapRequestArgumentsToControllerArguments() protected méthode

Maps arguments delivered by the request object to the local controller arguments.

output() protected méthode

Outputs specified text to the console window You can specify arguments that will be passed to the text via sprintf
See also: http://www.php.net/sprintf
protected output ( string $text, array $arguments = [] ) : void
$text string Text to output
$arguments array Optional arguments to use for sprintf
Résultat void

outputFormatted() protected méthode

Formats the given text to fit into MAXIMUM_LINE_LENGTH and outputs it to the console window
See also: outputLine()
protected outputFormatted ( string $text = '', array $arguments = [], integer $leftPadding ) : void
$text string Text to output
$arguments array Optional arguments to use for sprintf
$leftPadding integer The number of spaces to use for indentation
Résultat void

outputLine() protected méthode

Outputs specified text to the console window and appends a line break
See also: output()
See also: outputLines()
protected outputLine ( string $text = '', array $arguments = [] ) : void
$text string Text to output
$arguments array Optional arguments to use for sprintf
Résultat void

processRequest() public méthode

Processes a command line request.
public processRequest ( Neos\Flow\Mvc\RequestInterface $request, Neos\Flow\Mvc\ResponseInterface $response ) : void
$request Neos\Flow\Mvc\RequestInterface The request object
$response Neos\Flow\Mvc\ResponseInterface The response, modified by this handler
Résultat void

quit() protected méthode

If your command relies on functionality which is triggered through the Bootstrap shutdown (such as the persistence framework), you must use quit() instead of exit().
protected quit ( integer $exitCode ) : void
$exitCode integer Exit code to return on exit (see http://www.php.net/exit)
Résultat void

resolveCommandMethodName() protected méthode

Note: The resulting command method name might not have the correct case, which isn't a problem because PHP is case insensitive regarding method names.
protected resolveCommandMethodName ( ) : string
Résultat string Method name of the current command

sendAndExit() protected méthode

Sends the response and exits the CLI without any further code execution Should be used for commands that flush code caches.
protected sendAndExit ( integer $exitCode ) : void
$exitCode integer Exit code to return on exit
Résultat void

Property Details

$arguments protected_oe property

protected Arguments,Neos\Flow\Mvc\Controller $arguments
Résultat Neos\Flow\Mvc\Controller\Arguments

$commandManager protected_oe property

protected CommandManager,Neos\Flow\Cli $commandManager
Résultat CommandManager

$commandMethodName protected_oe property

Name of the command method
protected string $commandMethodName
Résultat string

$objectManager protected_oe property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Résultat Neos\Flow\ObjectManagement\ObjectManagerInterface

$output protected_oe property

protected ConsoleOutput,Neos\Flow\Cli $output
Résultat ConsoleOutput

$request protected_oe property

protected Request,Neos\Flow\Cli $request
Résultat Request

$response protected_oe property

protected Response,Neos\Flow\Cli $response
Résultat Response