TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
RequestBuilder Class Reference
Inheritance diagram for RequestBuilder:
SingletonInterface

Public Member Functions

 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 injectCommandManager (\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager $commandManager)
 
 injectConfigurationManager (\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface $configurationManager)
 
 build ($commandLine= '', $callingScript= './typo3/cli_dispatch.phpsh extbase')
 

Protected Member Functions

 parseRawCommandLineArguments (array $rawCommandLineArguments, $controllerObjectName, $controllerCommandName)
 
 extractArgumentNameFromCommandLinePart ($commandLinePart)
 
 getValueOfCurrentCommandLineOption ($currentArgument, array &$rawCommandLineArguments, $expectedArgumentType)
 

Protected Attributes

 $objectManager
 
 $reflectionService
 
 $commandManager
 
 $configurationManager
 

Detailed Description

Builds a CLI request object from the raw command call

http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later

Definition at line 22 of file Cli/RequestBuilder.php.

Member Function Documentation

build (   $commandLine = '',
  $callingScript = './typo3/cli_dispatch.phpsh extbase' 
)

Builds a CLI request object from a command line.

The given command line may be a string (e.g. "myextension:foo do-that-thing –force") or an array consisting of the individual parts. The array must not include the script name (like in $argv) but start with command right away.

Parameters
mixed$commandLineThe command line, either as a string or as an array
string$callingScriptThe calling script (usually ./typo3/cli_dispatch.phpsh)
Returns
The CLI request as an object

Builds a web request object from the raw HTTP information and the configuration

Returns
The web request as an object

Definition at line 87 of file Cli/RequestBuilder.php.

References RequestBuilder\parseRawCommandLineArguments().

extractArgumentNameFromCommandLinePart (   $commandLinePart)
protected

Extracts the option or argument name from the name / value pair of a command line.

Parameters
string$commandLinePartPart of the command line, e.g. "my-important-option=SomeInterestingValue @return string The lowercased argument name, e.g. "myimportantoption

Definition at line 194 of file Cli/RequestBuilder.php.

Referenced by RequestBuilder\parseRawCommandLineArguments().

getValueOfCurrentCommandLineOption (   $currentArgument,
array &  $rawCommandLineArguments,
  $expectedArgumentType 
)
protected

Returns the value of the first argument of the given input array. Shifts the parsed argument off the array.

Parameters
string$currentArgumentThe current argument
array&$rawCommandLineArgumentsArray of the remaining command line arguments
string$expectedArgumentTypeThe expected type of the current argument, because booleans get special attention
Returns
string The value of the first argument

Definition at line 208 of file Cli/RequestBuilder.php.

Referenced by RequestBuilder\parseRawCommandLineArguments().

injectCommandManager ( \TYPO3\CMS\Extbase\Mvc\Cli\CommandManager  $commandManager)
Parameters
\TYPO3\CMS\Extbase\Mvc\Cli\CommandManager$commandManager

Definition at line 63 of file Cli/RequestBuilder.php.

References RequestBuilder\$commandManager.

injectConfigurationManager ( \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface  $configurationManager)
Parameters
\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface$configurationManager

Definition at line 71 of file Cli/RequestBuilder.php.

References RequestBuilder\$configurationManager.

injectObjectManager ( \TYPO3\CMS\Extbase\Object\ObjectManagerInterface  $objectManager)
Parameters
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface$objectManager

Definition at line 47 of file Cli/RequestBuilder.php.

References RequestBuilder\$objectManager.

injectReflectionService ( \TYPO3\CMS\Extbase\Reflection\ReflectionService  $reflectionService)
Parameters
\TYPO3\CMS\Extbase\Reflection\ReflectionService$reflectionService

Definition at line 55 of file Cli/RequestBuilder.php.

References RequestBuilder\$reflectionService.

parseRawCommandLineArguments ( array  $rawCommandLineArguments,
  $controllerObjectName,
  $controllerCommandName 
)
protected

Takes an array of unparsed command line arguments and options and converts it separated by named arguments, options and unnamed arguments.

Parameters
array$rawCommandLineArgumentsThe unparsed command parts (such as "–foo") as an array
string$controllerObjectNameObject name of the designated command controller
string$controllerCommandNameCommand name of the recognized command (ie. method name without "Command" suffix)
Exceptions
\TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentMixingException
Returns
array All and exceeding command line arguments

Definition at line 126 of file Cli/RequestBuilder.php.

References elseif, RequestBuilder\extractArgumentNameFromCommandLinePart(), and RequestBuilder\getValueOfCurrentCommandLineOption().

Referenced by RequestBuilder\build().

Member Data Documentation

$commandManager
protected

Definition at line 37 of file Cli/RequestBuilder.php.

Referenced by RequestBuilder\injectCommandManager().

$configurationManager
protected

Definition at line 42 of file Cli/RequestBuilder.php.

Referenced by RequestBuilder\injectConfigurationManager().

$objectManager
protected

Definition at line 27 of file Cli/RequestBuilder.php.

Referenced by RequestBuilder\injectObjectManager().

$reflectionService
protected

Definition at line 32 of file Cli/RequestBuilder.php.

Referenced by RequestBuilder\injectReflectionService().