TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ExtDirectApi Class Reference

Public Member Functions

 __construct ()
 
 getAPI (ServerRequestInterface $request, ResponseInterface $response)
 
 getApiPhp (array $filterNamespaces)
 
 getRoutingUrl ($namespace)
 

Protected Member Functions

 generateAPI (array $filterNamespaces)
 
 getExtDirectApi (array $filterNamespaces)
 
 getNamespaceError (array $filterNamespaces)
 
 findNamespace ($namespace, array $filterNamespaces)
 

Protected Attributes

 $settings = array()
 

Detailed Description

Ext Direct API Generator

Definition at line 25 of file ExtDirectApi.php.

Constructor & Destructor Documentation

__construct ( )

Constructs this object.

Definition at line 35 of file ExtDirectApi.php.

References $GLOBALS.

Member Function Documentation

findNamespace (   $namespace,
array  $filterNamespaces 
)
protected

Looks if the given namespace is present in $filterNamespaces

Parameters
string$namespace
array$filterNamespaces
Returns
bool

Definition at line 198 of file ExtDirectApi.php.

References GeneralUtility\isFirstPartOfStr().

Referenced by ExtDirectApi\generateAPI().

generateAPI ( array  $filterNamespaces)
protected

Generates the API that is configured inside the ExtDirect configuration array "$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']".

Parameters
array$filerNamespaceNamespace that should be loaded like array('TYPO3.Backend')
Returns
array Javascript API configuration

Definition at line 93 of file ExtDirectApi.php.

References ExtDirectApi\findNamespace(), ExtDirectApi\getRoutingUrl(), and GeneralUtility\getUserObj().

Referenced by ExtDirectApi\getExtDirectApi().

getAPI ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Parses the ExtDirect configuration array "$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']" and feeds the given typo3 ajax instance with the resulting information. The get parameter "namespace" will be used to filter the configuration.

This method makes usage of the reflection mechanism to fetch the methods inside the defined classes together with their amount of parameters. This information are building the API and are required by ExtDirect. The result is cached to improve the overall performance.

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 56 of file ExtDirectApi.php.

References $response, and MessageInterface\getBody().

getApiPhp ( array  $filterNamespaces)

Get the API for a given nameapace

Parameters
array$filterNamespaces
Returns
string
Exceptions
\InvalidArgumentException

Definition at line 69 of file ExtDirectApi.php.

References ExtDirectApi\getExtDirectApi(), and ExtDirectApi\getNamespaceError().

getExtDirectApi ( array  $filterNamespaces)
protected

Generates the API or reads it from cache

Parameters
array$filterNamespaces
Returns
string $javascriptNamespaces

Definition at line 156 of file ExtDirectApi.php.

References GeneralUtility\_GET(), ExtDirectApi\generateAPI(), and GeneralUtility\getIndpEnv().

Referenced by ExtDirectApi\getApiPhp().

getNamespaceError ( array  $filterNamespaces)
protected

Generates the error message

Parameters
array$filterNamespaces
Returns
string $errorMessage

Definition at line 179 of file ExtDirectApi.php.

References $GLOBALS.

Referenced by ExtDirectApi\getApiPhp().

getRoutingUrl (   $namespace)

Returns the convenient path for the routing Urls based on the TYPO3 mode.

Parameters
string$namespace
Returns
string

Definition at line 140 of file ExtDirectApi.php.

References $url, and GeneralUtility\locationHeaderUrl().

Referenced by ExtDirectApi\generateAPI().

Member Data Documentation

$settings = array()
protected

Definition at line 30 of file ExtDirectApi.php.