Skip to content

Commit

Permalink
[TASK] Describe TYPO3 constant (#3597)
Browse files Browse the repository at this point in the history
Releases: main, 12.4, 11.5

Co-authored-by: Chris Müller <2566282+brotkrueml@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and brotkrueml committed Oct 22, 2023
1 parent 75b2fbe commit dd3fab4
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Documentation/ApiOverview/GlobalValues/Constants/Index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,38 @@ Available in frontend:
Yes


.. index::
Constants; TYPO3
.. _globals-constants-typo3:

TYPO3
-----

TYPO3 still has some extension PHP script files executed in global context
without class or callable encapsulation, namely :file:`ext_localconf.php`,
:file:`ext_tables.php` and files within :file:`Configuration/TCA/Overrides/`.
When those files are located within the public document root of an instance and
called via HTTP directly, they may error out and render error messages. This can
be a security risk. To prevent this, those files **must** have a security gate
as first line:

.. code-block:: php
<?php
defined('TYPO3') or die();
// ... your code
It is defined to :php:`true` in early TYPO3 bootstrap.

.. seealso::

* :ref:`ext_localconf.php <ext-localconf-php>`
* :ref:`ext_tables.php <ext-tables-php>`
* :ref:`Configuration/TCA/Overrides/ <extension-configuration-tca-overrides>`


.. index:: Constants; Filetypes

File types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ The skeleton of the :file:`ext_localconf.php` looks like this:
// Add your code here
})();
Read :ref:`why the check for the TYPO3 constant is necessary <globals-constants-typo3>`.

.. index:: Extension development; PageTSconfig

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ new records of your table to be added on Standard pages call:
'tx_myextension_domain_model_mymodel'
);
Read :ref:`why the check for the TYPO3 constant is necessary <globals-constants-typo3>`.

.. index:: Extension development; Scheduler task registration
.. _extension-configuration-files-scheduler:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ Here's the complete code, taken from file
'tx_examples_options, tx_examples_special'
);
Read :ref:`why the check for the TYPO3 constant is necessary <globals-constants-typo3>`.

.. note::

The second example :php:`tx_examples_special` only works when the
Expand Down

0 comments on commit dd3fab4

Please sign in to comment.