‪TYPO3CMS  ‪main
TYPO3\CMS\Extbase\Core\Bootstrap Class Reference

Public Member Functions

 __construct (protected readonly ContainerInterface $container, protected readonly ConfigurationManagerInterface $configurationManager, protected readonly PersistenceManagerInterface $persistenceManager, protected readonly CacheService $cacheService, protected readonly Dispatcher $dispatcher, protected readonly RequestBuilder $extbaseRequestBuilder)
 
 setContentObjectRenderer (ContentObjectRenderer $cObj)
 
 initialize (array $configuration, ServerRequestInterface $request)
 
 initializeConfiguration (array $configuration, ServerRequestInterface $request)
 
string run (string $content, array $configuration, ServerRequestInterface $request)
 
 handleFrontendRequest (ServerRequestInterface $request)
 
 handleBackendRequest (ServerRequestInterface $request)
 

Protected Member Functions

 clearCacheOnError (ServerRequestInterface $request)
 
 resetSingletons ()
 
 isExtbaseRequestCacheable (RequestInterface $extbaseRequest)
 

Protected Attributes

ContentObjectRenderer $cObj = null
 

Detailed Description

Creates a request and dispatches it to the controller which was specified by TS Setup and returns the content.

This class is the main entry point for extbase extensions.

Definition at line 41 of file Bootstrap.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Extbase\Core\Bootstrap::__construct ( protected readonly ContainerInterface  $container,
protected readonly ConfigurationManagerInterface  $configurationManager,
protected readonly PersistenceManagerInterface  $persistenceManager,
protected readonly CacheService  $cacheService,
protected readonly Dispatcher  $dispatcher,
protected readonly RequestBuilder  $extbaseRequestBuilder 
)

Definition at line 45 of file Bootstrap.php.

Member Function Documentation

◆ clearCacheOnError()

TYPO3\CMS\Extbase\Core\Bootstrap::clearCacheOnError ( ServerRequestInterface  $request)
protected

Clear cache of current page on error. Needed because we want a re-evaluation of the data.

Definition at line 221 of file Bootstrap.php.

References TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface\CONFIGURATION_TYPE_FRAMEWORK.

Referenced by TYPO3\CMS\Extbase\Core\Bootstrap\handleFrontendRequest().

◆ handleBackendRequest()

TYPO3\CMS\Extbase\Core\Bootstrap::handleBackendRequest ( ServerRequestInterface  $request)

Entrypoint for backend modules, handling PSR-7 requests/responses.

Creates an Extbase Request, dispatches it and then returns the Response

Definition at line 201 of file Bootstrap.php.

References TYPO3\CMS\Extbase\Core\Bootstrap\initialize(), and TYPO3\CMS\Extbase\Core\Bootstrap\resetSingletons().

◆ handleFrontendRequest()

TYPO3\CMS\Extbase\Core\Bootstrap::handleFrontendRequest ( ServerRequestInterface  $request)

◆ initialize()

TYPO3\CMS\Extbase\Core\Bootstrap::initialize ( array  $configuration,
ServerRequestInterface  $request 
)

Explicitly initializes all necessary Extbase objects by invoking the various initialize* methods.

Usually this method is only called from unit tests or other applications which need a more fine-grained control over the initialization and request handling process. Most other applications just call the run() method.

Parameters
array$configuration‪The TS configuration array
Exceptions

Definition at line 73 of file Bootstrap.php.

References TYPO3\CMS\Extbase\Core\Bootstrap\initializeConfiguration(), and TYPO3\CMS\Core\Core\Environment\isCli().

Referenced by TYPO3\CMS\Extbase\Core\Bootstrap\handleBackendRequest(), and TYPO3\CMS\Extbase\Core\Bootstrap\run().

◆ initializeConfiguration()

TYPO3\CMS\Extbase\Core\Bootstrap::initializeConfiguration ( array  $configuration,
ServerRequestInterface  $request 
)

Initializes the Object framework.

See also
initialize()

Definition at line 92 of file Bootstrap.php.

Referenced by TYPO3\CMS\Extbase\Core\Bootstrap\initialize().

◆ isExtbaseRequestCacheable()

◆ resetSingletons()

TYPO3\CMS\Extbase\Core\Bootstrap::resetSingletons ( )
protected

Resets global singletons for the next plugin

Definition at line 235 of file Bootstrap.php.

Referenced by TYPO3\CMS\Extbase\Core\Bootstrap\handleBackendRequest(), and TYPO3\CMS\Extbase\Core\Bootstrap\handleFrontendRequest().

◆ run()

string TYPO3\CMS\Extbase\Core\Bootstrap::run ( string  $content,
array  $configuration,
ServerRequestInterface  $request 
)

Runs the Extbase Framework by resolving an appropriate Request Handler and passing control to it. If the Framework is not initialized yet, it will be initialized.

This is usually used in Frontend plugins. This method will be marked as internal in the future, use EXTBASEPLUGIN in TypoScript to execute an Extbase plugin instead.

Parameters
string$content‪The content. Not used
array$configuration‪The TS configuration array
ServerRequestInterface$request‪the incoming server request
Returns
‪string $content The processed content

Definition at line 126 of file Bootstrap.php.

References TYPO3\CMS\Extbase\Core\Bootstrap\handleFrontendRequest(), and TYPO3\CMS\Extbase\Core\Bootstrap\initialize().

◆ setContentObjectRenderer()

TYPO3\CMS\Extbase\Core\Bootstrap::setContentObjectRenderer ( ContentObjectRenderer  $cObj)

The current (!) cObj. Called for frontend plugins from UserContentObject via ContentObjectRenderer->callUserFunction().

Definition at line 58 of file Bootstrap.php.

References TYPO3\CMS\Extbase\Core\Bootstrap\$cObj.

Member Data Documentation

◆ $cObj

ContentObjectRenderer TYPO3\CMS\Extbase\Core\Bootstrap::$cObj = null
protected