‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Http Namespace Reference

Namespaces

 Client
 
 Security
 

Classes

class  AbstractApplication
 
class  Application
 
class  CookieHeaderTrait
 
class  CookieScope
 
class  CookieScopeTrait
 
class  Dispatcher
 
interface  DispatcherInterface
 
class  FalDumpFileContentsDecoratorStream
 
class  HtmlResponse
 
class  ImmediateResponseException
 
class  InvalidRequestUrlOnCliException
 
class  JsonResponse
 
class  Message
 
class  MiddlewareDispatcher
 
class  MiddlewareStackResolver
 
class  NormalizedParams
 
class  NullResponse
 
class  PropagateResponseException
 
class  RedirectResponse
 
class  Request
 
class  RequestFactory
 
class  RequestHandler
 
class  Response
 
class  ResponseFactory
 
class  SelfEmittableLazyOpenStream
 
interface  SelfEmittableStreamInterface
 
class  ServerRequest
 
class  ServerRequestFactory
 
class  SetCookieService
 
class  Stream
 
class  StreamFactory
 
class  UploadedFile
 
class  UploadedFileFactory
 
class  Uri
 
class  UriFactory
 

Enumerations

enum  ApplicationType : string { fromRequest }
 
enum  SetCookieBehavior { Remove }
 

Enumeration Type Documentation

◆ ApplicationType

Helper class to answer "Is this a frontend or backend request?".

It requires a PSR-7 ServerRequestInterface request object. Typical usage:

‪ApplicationType::fromRequest($request)->isFrontend()

Note the final request object is given to your controller by the frontend and backend RequestHandler's. This request should be used in code calling this class. However, various library parts of the TYPO3 core do not receive the request object directly, so extensions may not receive it either. To work around this technical debt for now, the RequestHandler's set the final request object as $GLOBALS['TYPO3_REQUEST'], which can be used in those cases to feed this class. Also note that CLI calls often do NOT create a request object, depending on their task.

Classes that may be called from CLI without request object thus use this helper like:

// Do something special if this is a frontend request.
if ((‪$GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface
&& ‪ApplicationType::fromRequest(‪$GLOBALS['TYPO3_REQUEST'])->isBackend()
) {

Important: $GLOBALS['TYPO3_REQUEST'] is NOT available before the RequestHandler has been called. This especially means the question "Is this a frontend or backend request?" can NOT be answered in the TYPO3 bootstrap related extension files ext_localconf.php, ext_tables.php and Configuration/TCA/* files.

Enumerator
fromRequest 

Create an ApplicationType object from a given PSR-7 request.

Exceptions

Definition at line 54 of file ApplicationType.php.

◆ SetCookieBehavior

Define whether a Set-Cookie header should be sent (it's a Directive)

Enumerator
Remove 

Definition at line 23 of file SetCookieBehavior.php.

‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:25
‪TYPO3\CMS\Core\Http\fromRequest
‪@ fromRequest
Definition: ApplicationType.php:66