‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder:
TYPO3\CMS\Core\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)
 
TYPO3 CMS Extbase Mvc Cli Request build ($commandLine='', $callingScript='./typo3/sysext/core/bin/typo3')
 

Protected Member Functions

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

Protected Attributes

TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
 
TYPO3 CMS Extbase Reflection ReflectionService $reflectionService
 
TYPO3 CMS Extbase Mvc Cli CommandManager $commandManager
 
TYPO3 CMS Extbase Configuration ConfigurationManagerInterface $configurationManager
 

Detailed Description

Builds a CLI request object from the raw command call

Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0. Use symfony/console commands instead.

Definition at line 22 of file RequestBuilder.php.

Member Function Documentation

◆ build()

TYPO3 CMS Extbase Mvc Cli Request TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::build (   $commandLine = '',
  $callingScript = './typo3/sysext/core/bin/typo3' 
)

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$commandLine‪The command line, either as a string or as an array
string$callingScript‪The calling script (usually ./typo3/sysext/core/bin/typo3)
Returns
‪\TYPO3\CMS\Extbase\Mvc\Cli\Request The CLI request as an object

Definition at line 83 of file RequestBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\parseRawCommandLineArguments(), and TYPO3\CMS\Extbase\Mvc\Cli\Request\setCallingScript().

◆ extractArgumentNameFromCommandLinePart()

string TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::extractArgumentNameFromCommandLinePart (   $commandLinePart)
protected

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

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

Definition at line 192 of file RequestBuilder.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\parseRawCommandLineArguments().

◆ getValueOfCurrentCommandLineOption()

string TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::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$currentArgument‪The current argument
array&$rawCommandLineArguments‪Array of the remaining command line arguments
string$expectedArgumentType‪The expected type of the current argument, because booleans get special attention
Returns
‪string The value of the first argument

Definition at line 206 of file RequestBuilder.php.

Referenced by TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\parseRawCommandLineArguments().

◆ injectCommandManager()

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

Definition at line 59 of file RequestBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\$commandManager.

◆ injectConfigurationManager()

TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::injectConfigurationManager ( \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface  $configurationManager)
Parameters
\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface$configurationManager

Definition at line 67 of file RequestBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\$configurationManager.

◆ injectObjectManager()

TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::injectObjectManager ( \TYPO3\CMS\Extbase\Object\ObjectManagerInterface  $objectManager)
Parameters
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface$objectManager

Definition at line 43 of file RequestBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\$objectManager.

◆ injectReflectionService()

TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::injectReflectionService ( \TYPO3\CMS\Extbase\Reflection\ReflectionService  $reflectionService)
Parameters
\TYPO3\CMS\Extbase\Reflection\ReflectionService$reflectionService

Definition at line 51 of file RequestBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\$reflectionService.

◆ parseRawCommandLineArguments()

array TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::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$rawCommandLineArguments‪The 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

Definition at line 122 of file RequestBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\extractArgumentNameFromCommandLinePart(), and TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\getValueOfCurrentCommandLineOption().

Referenced by TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\build().

Member Data Documentation

◆ $commandManager

TYPO3 CMS Extbase Mvc Cli CommandManager TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::$commandManager
protected

◆ $configurationManager

TYPO3 CMS Extbase Configuration ConfigurationManagerInterface TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::$configurationManager
protected

◆ $objectManager

TYPO3 CMS Extbase Object ObjectManagerInterface TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::$objectManager
protected

◆ $reflectionService

TYPO3 CMS Extbase Reflection ReflectionService TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder::$reflectionService
protected