TYPO3 CMS  TYPO3_7-6
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)
 
 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 RequestBuilder.php.

Member Function Documentation

◆ build()

TYPO3\CMS\Extbase\Mvc\Web\RequestBuilder::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 RequestBuilder.php.

References TYPO3\CMS\Extbase\Mvc\Cli\RequestBuilder\parseRawCommandLineArguments().

◆ extractArgumentNameFromCommandLinePart()

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$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 RequestBuilder.php.

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

◆ getValueOfCurrentCommandLineOption()

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$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 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 63 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 71 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 47 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 55 of file RequestBuilder.php.

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

◆ parseRawCommandLineArguments()

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$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

Definition at line 126 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\RequestBuilder::$commandManager
protected

◆ $configurationManager

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

◆ $objectManager

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

◆ $reflectionService

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