Skip to content

Commit

Permalink
[TASK] Update concerning $TYPO3_CONF_VARS
Browse files Browse the repository at this point in the history
Make sure to use $GLOBALS['TYPO3_CONF_VARS'] instead of
$TYPO3_CONF_VARS.
  • Loading branch information
Christopher committed Jun 17, 2017
1 parent 5086ee9 commit d08166f
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 34 deletions.
Expand Up @@ -19,7 +19,7 @@ The scope of such options is the backend only.
Registration
""""""""""""

Options are configured in the global variable :code:`$TYPO3_CONF_VARS['BE']['customPermOptions']` in
Options are configured in the global variable :code:`$GLOBALS['TYPO3_CONF_VARS']['BE']['customPermOptions']` in
:file:`ext_tables.php`. The syntax is demonstrated in the following example, which adds three options
under a given header:

Expand Down
Expand Up @@ -8,7 +8,7 @@ Support for custom tables in the Page module

In the Web > Page module you can have listings of other records than
Content Elements. Any table can be displayed by adding to the array
:code:`$TYPO3_CONF_VARS['EXTCONF']['cms']`.
:code:`$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']`.

The TYPO3 CMS Core itself defines such a listing for the "fe_users" table::

Expand Down
Expand Up @@ -34,7 +34,7 @@ Global variables


- :Variable:
$TYPO3\_CONF\_VARS
$GLOBALS['TYPO3\_CONF\_VARS']
:Defined:
:file:`typo3/sysext/core/Configuration/DefaultConfiguration.php`
:Description:
Expand Down
8 changes: 4 additions & 4 deletions Documentation/ApiOverview/Hooks/Concept/Index.rst
Expand Up @@ -49,7 +49,7 @@ clear-cache post-processing. The objective of this could be to
perform additional actions whenever the cache is cleared for a
specific page. ::

$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = 'myext_cacheProc->proc';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = 'myext_cacheProc->proc';

This registers the class/method name to a
hook inside of :code:`\TYPO3\CMS\Core\DataHandling\DataHandler`. The hook will call the user function
Expand All @@ -67,9 +67,9 @@ activated like this:
:linenos:
// Call post processing function for clear-cache:
if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'])) {
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'])) {
$_params = array('cacheCmd' => $cacheCmd);
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] as $_funcRef) {
foreach($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] as $_funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($_funcRef, $_params, $this);
}
}
Expand All @@ -85,7 +85,7 @@ to you and what data might possibly be passed by reference and thereby
possible to manipulate from your hook function.

Finally, notice how the array
:code:`$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib\_tcemain.php']['clearCachePostProc']`
:code:`$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib\_tcemain.php']['clearCachePostProc']`
is traversed and for each entry the value is expected to be a function reference which will
be called. This allows many hooks to be called at the same place. The
hooks can even rearrange the calling order if they dare.
Expand Down
20 changes: 10 additions & 10 deletions Documentation/ApiOverview/Hooks/Configuration/Index.rst
Expand Up @@ -21,8 +21,8 @@ carry hook configuration but might be used for other purposes as well.

.. _hooks-extensions:

$TYPO3\_CONF\_VARS['EXTCONF']
"""""""""""""""""""""""""""""
$GLOBALS['TYPO3\_CONF\_VARS']['EXTCONF']
""""""""""""""""""""""""""""""""""""""""

**Configuration space for extensions.**

Expand All @@ -31,7 +31,7 @@ extensions including possible hooks in them! What options are
available to you will depend on a search in the documentation for that
particular extension. ::

$TYPO3_CONF_VARS['EXTCONF'][ extension_key ][ sub_key ] = value
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][ extension_key ][ sub_key ] = value

- **extension\_key :** The unique extension key

Expand All @@ -45,11 +45,11 @@ particular extension. ::

.. note::

:code:`$TYPO3_CONF_VARS['EXTCONF']` is the recommended place to
:code:`$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']` is the recommended place to
put hook configuration that are available inside your extensions!

This example shows hooks used in the "linkvalidator" system extension.
The code looks inside the :code:`$TYPO3_CONF_VARS['EXTCONF']` array
The code looks inside the :code:`$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']` array
for items listed under the "checkLinks" key of the "linkvalidator"
extension itself. All found classes are stored in an array, to be instantiated
and used at a later point. ::
Expand All @@ -69,8 +69,8 @@ and used at a later point. ::

.. _hooks-core:

$TYPO3\_CONF\_VARS['SC\_OPTIONS']
"""""""""""""""""""""""""""""""""
$GLOBALS['TYPO3\_CONF\_VARS']['SC\_OPTIONS']
""""""""""""""""""""""""""""""""""""""""""""

**Configuration space for core scripts.**

Expand All @@ -79,7 +79,7 @@ script. This will typically be used from the core scripts of TYPO3
which do not have a natural identifier like extensions have their
extension keys. ::

$TYPO3_CONF_VARS['SC_OPTIONS'][ main_key ][ sub_key ][ index ] = function_reference
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS'][ main_key ][ sub_key ][ index ] = function_reference

- **main\_key :** The relative path of a script (for output scripts it
should be the "script ID" as found in a comment in the HTML header )
Expand Down Expand Up @@ -150,8 +150,8 @@ the parent object. ::

.. _hooks-modules:

$TYPO3\_CONF\_VARS['TBE\_MODULES\_EXT']
"""""""""""""""""""""""""""""""""""""""
$GLOBALS['TYPO3\_CONF\_VARS']['TBE\_MODULES\_EXT']
""""""""""""""""""""""""""""""""""""""""""""""""""

** Configuration space for backend modules.**

Expand Down
4 changes: 2 additions & 2 deletions Documentation/ApiOverview/Http/Index.rst
Expand Up @@ -20,11 +20,11 @@ stream wrappers and chooses the best solution for the system.
A TYPO3-specific PHP class called `TYPO3\CMS\Core\Http\RequestFactory` has been added as
a simplified wrapper to access Guzzle clients.

All options available under `$TYPO3_CONF_VARS[HTTP]` are automatically applied to the Guzzle
All options available under `$GLOBALS['TYPO3_CONF_VARS'][HTTP]` are automatically applied to the Guzzle
clients when using the `RequestFactory` class. The options are a subset to the available options
on Guzzle (http://docs.guzzlephp.org/en/latest/request-options.html) but can further be extended.

Existing `$TYPO3_CONF_VARS[HTTP]` options have been removed and/or migrated to the
Existing `$GLOBALS['TYPO3_CONF_VARS'][HTTP]` options have been removed and/or migrated to the
new Guzzle-compliant options.

A full documentation for Guzzle can be found at http://docs.guzzlephp.org/en/latest/.
Expand Down
Expand Up @@ -437,7 +437,7 @@ You can configure cache post-processing with a user defined PHP
function. Configuration of the hook can be done from
:code:`ext_localconf.php`. An example might look like::

$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = 'myext_cacheProc->proc';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = 'myext_cacheProc->proc';
require_once(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('myext') . 'class.myext_cacheProc.php');


Expand Down
10 changes: 5 additions & 5 deletions Documentation/ApiOverview/Typo3CoreEngine/Files/Index.rst
Expand Up @@ -223,7 +223,7 @@ of how to initialize the usage.
// Initializing:
$this->fileProcessor = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\File\\ExtendedFileUtility');
$this->fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']);
$this->fileProcessor->init($FILEMOUNTS, $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
$this->fileProcessor->init_actionPerms($BE_USER->user['fileoper_perms']);
$this->fileProcessor->start($this->file);
Expand All @@ -235,13 +235,13 @@ allow/deny file extensions in web-space and ftp-space (see below).
Then the file operation permissions are loaded from the user object in
line 4. Finally, the file command array is loaded in line 6 (and
internally additional configuration takes place from
:code:`$TYPO3_CONF_VARS`!). In line 7 the command map is executed.
:code:`$GLOBALS['TYPO3_CONF_VARS']`!). In line 7 the command map is executed.


.. _tce-file-extensions-control:

Web-space, FTP-space and $TYPO3\_CONF\_VARS['BE']['fileExtensions']
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Web-space, FTP-space and $GLOBALS['TYPO3\_CONF\_VARS']['BE']['fileExtensions']
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

The control of file extensions goes in two categories. Webspace and
ftpspace. Webspace is folders accessible from a web browser (below
Expand All @@ -257,7 +257,7 @@ extension is matched. If no file extension, true is returned if
matches. This (default) configuration below accepts everything in
ftpspace and everything in webspace except php files::

$TYPO3_CONF_VARS['BE']['fileExtensions'] = array (
$GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions'] = array (
'webspace' => array('allow' => '', 'deny' => 'php'),
'ftpspace' => array('allow' => '*', 'deny' => '')
);
Expand Down
Expand Up @@ -19,7 +19,7 @@ every request. They should therefore be optimized for speed.
such classes and functions would *always* be loaded.
It is better to have them included only as needed.

So stick to changing values in :code:`TYPO3_CONF_VARS` only!
So stick to changing values in :code:`$GLOBALS['TYPO3_CONF_VARS']` only!

- :code:`ext_tables.php` is *not* always included in global scope (in the frontend)

Expand All @@ -30,7 +30,7 @@ every request. They should therefore be optimized for speed.

- Before the inclusion of any of the two files, the variables :code:`$_EXTKEY`
is set to the extension key and :code:`$_EXTCONF` is set
to the configuration from :code:`$TYPO3_CONF_VARS["EXT"]["extConf"][extension key]`.
to the configuration from :code:`$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][extension key]`.
We recommend to not use :code:`$_EXTKEY`, current planning is to deprecate this
variable in the future.

Expand Down
Expand Up @@ -62,7 +62,7 @@ extensions with the name prefix "ext\_".
- :Filename: ext\_localconf.php
:Description:
Addition to :code:`LocalConfiguration.php` which is included if found. Should
contain additional configuration of :code:`$TYPO3_CONF_VARS` and may include
contain additional configuration of :code:`$GLOBALS['TYPO3_CONF_VARS']` and may include
additional PHP class files.

|
Expand Down Expand Up @@ -185,14 +185,14 @@ extensions with the name prefix "ext\_".
If this file is present the EM provides you with an interface for
editing the configuration values defined in the file. The result is
written as a serialized array to :code:`LocalConfiguration.php`
in the variable :code:`$TYPO3_CONF_VARS['EXT']['extConf'][`
in the variable :code:`$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][`
:code:`*extension_key*` :code:`]`

|
If you want to do user processing before the content from the
configuration form is saved (or shown for that sake) there is a hook
in the EM which is configurable with :code:`$TYPO3_CONF_VARS
in the EM which is configurable with :code:`$GLOBALS['TYPO3_CONF_VARS']
['SC_OPTIONS']['typo3/mod/tools/em/index.php']['tsStyleConfigForm'][] = "`
:code:`*function reference*` :code:`"`

Expand Down
2 changes: 1 addition & 1 deletion Documentation/ExtensionArchitecture/Installation/Index.rst
Expand Up @@ -43,7 +43,7 @@ extensions with TYPO3:
configure some settings. Again the EM is able to handle the
configuration of the extensions based on a certain API for this. Any
settings - if present - configured for an extension are available as
an array in the variable `$TYPO3_CONF_VARS["EXT"]["extConf"][extension key]`.
an array in the variable `$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][extension key]`.

Loaded extensions are registered in a global variable,
`$TYPO3_LOADED_EXT`, available in both frontend and backend of TYPO3.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/Rte/InTheBackend/PlugRte/Index.rst
Expand Up @@ -47,10 +47,10 @@ Connecting an RTE in an extension to TYPO3 is easy.
needed.

- In the :file:`ext_localconf.php` file put an entry in
:code:`$TYPO3_CONF_VARS['BE']['RTE_reg']` which registers the new RTE with
:code:`$GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg']` which registers the new RTE with
the system. For example::

$TYPO3_CONF_VARS['BE']['RTE_reg']['myrte'] = array(
$GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg']['myrte'] = array(
'objRef' => 'Foo\\MyRte\\Editors\\RteBase');

where the value of :code:`objRef` is the fully qualified name
Expand Down
2 changes: 1 addition & 1 deletion Documentation/Rte/Transformations/CustomApi/Index.rst
Expand Up @@ -34,7 +34,7 @@ contain dashes (see :ref:`transformations-custom-usage`).
Registering the transformation key in the system
""""""""""""""""""""""""""""""""""""""""""""""""

In :code:`ext_localconf.php`, simply set a :code:`$TYPO3_CONF_VARS` variable
In :code:`ext_localconf.php`, simply set a :code:`$GLOBALS['TYPO3_CONF_VARS']` variable
to point to the class which contains the transformation methods::

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation']['tx_examples_transformation']
Expand Down

0 comments on commit d08166f

Please sign in to comment.