Login / Status
developer.Resource
Home . Documentation . Document Library . Core Documentation
Sponsors
hosted by punkt.deTYPO3 and Open Source MagazineAOE Media

3.3. Configuration

localconf.php and $TYPO3_CONF_VARS

Configuration of TYPO3 is basically about setting values in the global $TYPO3_CONF_VARS array. This is supposed to take place in the file localconf.php located in the typo3conf/ directory (PATH_typo3conf). Furthermore, extensions can add content included in the same context as the localconf.php by defining "ext_localconf.php" files. See the Extension API for details.

Typically a localconf.php file could look like this:

<?php    // Setting the Install Tool password to the default 'joh316'$TYPO3_CONF_VARS['BE']['installToolPassword'] = 'bacb98acf97e0b6112b1d1b650b84971';    // Setting the list of extensions to BLANK (by default there is a long list set)$TYPO3_CONF_VARS['EXT']['extList'] = 'install';$TYPO3_CONF_VARS['EXT']['requiredExt'] = 'lang';    // Setting up the database username, password and host$typo_db_username = 'root';$typo_db_password = 'nuwr875';$typo_db_host = 'localhost';## INSTALL SCRIPT EDIT POINT TOKEN - all lines after this points may be changed by the install script!$typo_db = 't3_coreinstall';    //  Modified or inserted by Typo3 Install Tool.$TYPO3_CONF_VARS['SYS']['sitename'] = 'Core Install';    //  Modified or inserted by Typo3 Install Tool.// Updated by Typo3 Install Tool 14-02-2003 15:20:04$TYPO3_CONF_VARS['EXT']['extList'] = 'install,phpmyadmin,setup,info_pagetsconfig';       // Modified or inserted by Typo3 Extension Manager. // Updated by Typo3 Extension Manager 19-02-2003 12:47:26?>

In this example the lines until the "## INSTALL SCRIPT EDIT POINT TOKEN..." were manually added during the setup of the  installation. But all lines after that point was added either by the Install Tool or by the Extension Manager. You can also see how the Extension Manager has overridden the formerly set value for "extList" - the list of installed extensions. This line in localconf.php is automatically found by the Extension Manager and next time an extensions is installed/removed this line will be modified.

As you can see the localconf.php file must be writeable for the Install Tool and Extension Manager to work correctly.

config_default.php

The localconf.php file and equivalents from extensions are included from the config_default.php file. This file will set the default values in the $TYPO3_CONF_VARS array. This is also the ultimate source for information about each configuration option available! So please take a look into the source code of that file if you want to browse the full array of options you can apply!

This is a snippet from that file:

<?php/*** TYPO3 default configuration** TYPO3_CONF_VARS is a global array with configuration for the TYPO3 libraries* THESE VARIABLES MAY BE OVERRIDDEN FROM WITHIN localconf.php** 'IM' is short for 'ImageMagick', which is an external image manipulation package available from www.imagemagick.org. Version is ABSOLUTELY preferred to be 4.2.9, but may be 5+. See the install notes for TYPO3!!* 'GD' is short for 'GDLib/FreeType', which are libraries that should be compiled into PHP4. GDLib <=1.3 supports GIF, while the latest version 1.8.x and 2.x supports only PNG. GDLib is available from www.boutell.com/gd/. Freetype has a link from there.** @author    Kasper Skårhøj <kasper@typo3.com>* Revised for TYPO3 3.6 2/2003 by Kasper Skårhøj*/if (!defined ('PATH_typo3conf'))     die ('The configuration path was not properly defined!');$TYPO3_CONF_VARS = Array(    'GFX' => array(        // Configuration of the image processing features in TYPO3. 'IM' and 'GD' are short for ImageMagick and  GD library respectively.        'image_processing' => 1,                // Boolean. Enables image processing features. Disabling this means NO image processing with either GD or IM!        'thumbnails' => 1,                        // Boolean. Enables the use of thumbnails in the backend interface. Thumbnails are generated by IM/partly GD in the file typo3/thumbs.php        'thumbnails_png' => 0,                    // Bits. Bit0: If set, thumbnails from non-jpegs will be 'png', otherwise 'gif' (0=gif/1=png). Bit1: Even JPG's will be converted to png or gif (2=gif/3=png)        'gif_compress' => 1,                    // Boolean. Enables the use of the t3lib_div::gif_compress() workaround function for compressing giffiles made with GD or IM, which probably use only RLE or no compression at all.        ...[and it goes on!]...

Install Tool

In relation to configuration the Install Tool does some configuration automatically from the Basic Configuration menu item. But specifically the menu item "All Configuration" will list all options found in $TYPO3_CONF_VARS and also read out the comments from the config_default.php file! So this is basically the visual editor of the $TYPO3_CONF_VARS variable!

Browsing $TYPO3_CONF_VARS values

In the module Tools>Configuration (extension key: lowlevel), you can also browse the $TYPO3_CONF_VARS array and its values:

Notice: This module is merely a browser letting you comfortably investigate the values configured - you can not change the values (although it might seem an obvious thing to add). There are currently no plans about adding that capability.

User and Page TSconfig

"User TSconfig" and "Page TSconfig" are very flexible concepts for adding fine-grained configuration of the backend of TYPO3. It is text-based configuration system where you assign values to keyword-strings entered in a database table field. The syntax used is TypoScript. There is a document, "TSconfig", describing in detail how it works and which options it includes.

User TSconfig

User TSconfig can be set for each backend user and group. Configuration set for backend groups is inherited by the user who is a member of those groups. The available options typically cover user settings like those found in the User>Setup module (in fact options from that module can be forcibly overridden from User TSconfig!), configuration of the "Admin Panel" (frontend), various backend tweaks (lock user to IP, show shortcut frame, may user clear all cache?, width of the navigation frame etc.) and backend module configuration (overriding any configuration set for backend modules in Page TSconfig).

You can find more details about User TSconfig in the "TSconfig" document.

Page TSconfig

Page TSconfig can be set for each page in the page tree. Tree branches inherit configuration for pages closer to the tree root. The available options typically cover backend module configuration which means that modules related to page ids (those in the "Web" main module) can be configured for different behaviours in different branches of the tree. It also includes configuration of TCEforms and TCEmain including Rich Text Editor behaviours. Again, the point is that the configuration is active for certain branches of the page tree which is very practical in projects running many sites in the same page tree.

You can find more details about Page TSconfig in the "TSconfig" document.



TYPO3 Core API

TSRef

TYPO3 Coding Guidelines