Inside TYPO3

3.1.3. Global variables, Constants and Classes

After init.php has been included there is a set of variables, constants and classes available to the parent script. In the document "TYPO3 Core API" you can see two tables listing these constants and variables.

The column "Avail. in FE" is an indicator that tells you if the constant, variable or class mentioned is also available to scripts running under the frontend of the "cms" extension. Strictly this is not a part of the core (which is what we deal with in this document), but since the "cms" extension is practically always a part of a TYPO3 setup it's included here as a service to you.

Classes

This is the classes already included after having included "init.php":

Class

Included in

Description

Avail. in FE

t3lib_div

init.php

 

YES

t3lib_extMgm

init.php

 

YES

t3lib_db

init.php

 

YES

t3lib_userauth

init.php

 

YES

t3lib_userauthgroup

init.php

 

-

t3lib_beuserauth

init.php

 

-

t3lib_iconworks

init.php

 

-

t3lib_befunc

init.php

 

-

t3lib_cs

init.php

 

YES

gzip_encode

init.php

Output compression class by Sandy McArthur, Jr. Included if option is set in TYPO3_CONF_VARS.

(YES)

 

Possibly other classes could have been included in "ext_tables.php" files or "ext_localconf.php" files. This is OK for the "localconf.php" file, but not necessarily for extensions. Please see the Extension API description for guidelines on this.

System/PHP Variables

A short notice on system variables:

Don't use any system-global vars, except these:

  HTTP_GET_VARS, HTTP_POST_VARS, HTTP_COOKIE_VARS

 

Any other variables may not be accessible if php.ini-optimized is used!

Environment / Server variables are also very critical! Since different servers and platforms offer different values in the environment and server variables, TYPO3 features an abstraction function you should always use if you need to get the REQUEST_URI, HTTP_HOST or something like that. At least never use the PHP function "getenv()" or take the values directly from HTTP_SERVER_VARS - rather call t3lib_div::getIndpEnv("name_of_sys_variable") to get the value (if it is supported by that function). You can rely on that function will deliver a consistent value independently of the server OS and webserver software.

You should refer to the TYPO3 Coding Guidelines or TYPO3 Core API for more information about this or go directly to the source of class.t3lib_div.php.

To top


Valid XHTML 1.0!