Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

t3lib_extMgm Class Reference

List of all members.

Public Member Functions

 isLoaded ($key, $exitOnError=0)
 Returns true if the extension with extension key $key is loaded.
 extPath ($key, $script='')
 Returns the absolute path to the extension with extension key $key If the extension is not loaded the function will die with an error message Useful for internal fileoperations Usage: 136.
 extRelPath ($key)
 Returns the relative path to the extension as measured from from the TYPO3_mainDir If the extension is not loaded the function will die with an error message Useful for images and links from backend Usage: 54.
 siteRelPath ($key)
 Returns the relative path to the extension as measured from the PATH_site (frontend) If the extension is not loaded the function will die with an error message Useful for images and links from the frontend Usage: 6.
 getCN ($key)
 Returns the correct class name prefix for the extension key $key Usage: 3.
 addTCAcolumns ($table, $columnArray, $addTofeInterface=0)
 Adding fields to an existing table definition in $TCA Adds an array with $TCA column-configuration to the $TCA-entry for that table.
 addToAllTCAtypes ($table, $str, $specificTypesList='', $position='')
 Makes fields visible in the TCEforms, adding them to the end of (all) "types"-configurations.
 allowTableOnStandardPages ($table)
 Add tablename to default list of allowed tables on pages (in $PAGES_TYPES) Will add the $table to the list of tables allowed by default on pages as setup by $PAGES_TYPES['default']['allowedTables'] FOR USE IN ext_tables.php FILES Usage: 11.
 addModule ($main, $sub='', $position='', $path='')
 Adds a module (main or sub) to the backend interface FOR USE IN ext_tables.php FILES Usage: 18.
 insertModuleFunction ($modname, $className, $classPath, $title, $MM_key='function')
 Adds a "Function menu module" ('third level module') to an existing function menu for some other backend module The arguments values are generally determined by which function menu this is supposed to interact with See Inside TYPO3 for information on how to use this function.
 addPageTSConfig ($content)
 Adds $content to the default Page TSconfig as set in $TYPO3_CONF_VARS[BE]['defaultPageTSconfig'] Prefixed with a [GLOBAL] line FOR USE IN ext_tables.php/ext_locallang.php FILES Usage: 5.
 addUserTSConfig ($content)
 Adds $content to the default User TSconfig as set in $TYPO3_CONF_VARS[BE]['defaultUserTSconfig'] Prefixed with a [GLOBAL] line FOR USE IN ext_tables.php/ext_locallang.php FILES Usage: 3.
 addLLrefForTCAdescr ($tca_descr_key, $file_ref)
 Adds a reference to a locallang file with TCA_DESCR labels FOR USE IN ext_tables.php FILES eg.
 addService ($extKey, $serviceType, $serviceKey, $info)
 Adds a service to the global services array.
 findService ($serviceType, $serviceSubType='', $excludeServiceKeys=array())
 Find the available service with highest priority.
 deactivateService ($serviceType, $serviceKey)
 Deactivate a service.
 addPlugin ($itemArray, $type='list_type')
 Adds an entry to the list of plugins in content elements of type "Insert plugin" Takes the $itemArray (label,value[,icon]) and adds to the items-array of $TCA[tt_content] elements with CType "listtype" (or another field if $type points to another fieldname) If the value (array pos.
 addPiFlexFormValue ($piKeyToMatch, $value)
 Adds an entry to the "ds" array of the tt_content field "pi_flexform".
 addToInsertRecords ($table, $content_table='tt_content', $content_field='records')
 Adds the $table tablename to the list of tables allowed to be includes by content element type "Insert records" By using $content_table and $content_field you can also use the function for other tables.
 addPItoST43 ($key, $classFile='', $prefix='', $type='list_type', $cached=0)
 Add PlugIn to Static Template #43.
 addStaticFile ($extKey, $path, $title)
 Call this method to add an entry in the static template list found in sys_templates "static template files" are the modern equalent (provided from extensions) to the traditional records in "static_templates" FOR USE IN ext_locallang.php FILES Usage: 3.
 addTypoScriptSetup ($content)
 Adds $content to the default TypoScript setup code as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_setup'] Prefixed with a [GLOBAL] line FOR USE IN ext_locallang.php FILES Usage: 6.
 addTypoScriptConstants ($content)
 Adds $content to the default TypoScript constants code as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_constants'] Prefixed with a [GLOBAL] line FOR USE IN ext_locallang.php FILES Usage: 0.
 addTypoScript ($key, $type, $content, $afterStaticUid=0)
 Adds $content to the default TypoScript code for either setup, constants or editorcfg as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_*'] (Basically this function can do the same as addTypoScriptSetup and addTypoScriptConstants - just with a little more hazzle, but also with some more options!) FOR USE IN ext_locallang.php FILES Usage: 7.
 typo3_loadExtensions ()
 Loading extensions configured in $TYPO3_CONF_VARS['EXT']['extList'].
 _makeIncludeHeader ($key, $file)
 Returns the section headers for the compiled cache-files.
 isCacheFilesAvailable ($cacheFilePrefix)
 Returns true if both the localconf and tables cache file exists (with $cacheFilePrefix) Usage: 2.
 isLocalconfWritable ()
 Returns true if the "localconf.php" file in "typo3conf/" is writable Usage: 1.
 cannotCacheFilesWritable ($cacheFilePrefix)
 Returns an error string if typo3conf/ or cache-files with $cacheFilePrefix are NOT writable Returns false if no problem.
 currentCacheFiles ()
 Returns an array with the two cache-files (0=>localconf, 1=>tables) from typo3conf/ if they (both) exist.
 writeCacheFiles ($extensions, $cacheFilePrefix)
 Compiles/Creates the two cache-files in typo3conf/ based on $cacheFilePrefix Returns a array with the key "_CACHEFILE" set to the $cacheFilePrefix value Usage: 1.

Member Function Documentation

t3lib_extMgm::_makeIncludeHeader key,
file
 

Returns the section headers for the compiled cache-files.

Parameters:
string $key is the extension key
string $file is the filename (only informative for comment)
Returns:
string

Definition at line 998 of file class.t3lib_extmgm.php.

References $TYPO3_CONF_VARS.

Referenced by writeCacheFiles().

00998                                              {
00999       return '<?php
01000 ###########################
01001 ## EXTENSION: '.$key.'
01002 ## FILE:      '.$file.'
01003 ###########################
01004 
01005 $_EXTKEY = \''.$key.'\';
01006 $_EXTCONF = $TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][$_EXTKEY];
01007 
01008 ?>';
01009    }

t3lib_extMgm::addLLrefForTCAdescr tca_descr_key,
file_ref
 

Adds a reference to a locallang file with TCA_DESCR labels FOR USE IN ext_tables.php FILES eg.

t3lib_extMgm::addLLrefForTCAdescr('pages','EXT:lang/locallang_csh_pages.xml'); for the pages table or t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_layout','EXT:cms/locallang_csh_weblayout.php'); for the Web > Page module. Usage: 31

Parameters:
string Description key. Typically a database table (like "pages") but for applications can be other strings, but prefixed with "_MOD_")
string File reference to locallang file, eg. "EXT:lang/locallang_csh_pages.php" (or ".xml")
Returns:
void

Definition at line 438 of file class.t3lib_extmgm.php.

00438                                                             {
00439       global $TCA_DESCR;
00440       if ($tca_descr_key)  {
00441          if (!is_array($TCA_DESCR[$tca_descr_key]))   {
00442             $TCA_DESCR[$tca_descr_key]=array();
00443          }
00444          if (!is_array($TCA_DESCR[$tca_descr_key]['refs'])) {
00445             $TCA_DESCR[$tca_descr_key]['refs']=array();
00446          }
00447          $TCA_DESCR[$tca_descr_key]['refs'][]=$file_ref;
00448       }
00449    }

t3lib_extMgm::addModule main,
sub = '',
position = '',
path = ''
 

Adds a module (main or sub) to the backend interface FOR USE IN ext_tables.php FILES Usage: 18.

Parameters:
string $main is the main module key, $sub is the submodule key. So $main would be an index in the $TBE_MODULES array and $sub could be an element in the lists there.
string $sub is the submodule key. If $sub is not set a blank $main module is created.
string $position can be used to set the position of the $sub module within the list of existing submodules for the main module. $position has this syntax: [cmd]:[submodule-key]. cmd can be "after", "before" or "top" (or blank which is default). If "after"/"before" then submodule will be inserted after/before the existing submodule with [submodule-key] if found. If not found, the bottom of list. If "top" the module is inserted in the top of the submodule list.
string $path is the absolute path to the module. If this value is defined the path is added as an entry in $TBE_MODULES['_PATHS'][ main_sub ]=$path; and thereby tells the backend where the newly added modules is found in the system.
Returns:
void

Definition at line 329 of file class.t3lib_extmgm.php.

References $TBE_MODULES, and main().

00329                                                             {
00330       global $TBE_MODULES;
00331 
00332       if (isset($TBE_MODULES[$main]) && $sub)   {  // If there is already a main module by this name:
00333 
00334             // Adding the submodule to the correct position:
00335          list($place,$modRef)=t3lib_div::trimExplode(':',$position,1);
00336          $mods = t3lib_div::trimExplode(',',$TBE_MODULES[$main],1);
00337          if (!in_array($sub,$mods)) {
00338             switch(strtolower($place)) {
00339                case 'after':
00340                case 'before':
00341                   $pointer=0;
00342                   reset($mods);
00343                   while(list($k,$m)=each($mods))   {
00344                      if (!strcmp($m,$modRef))   {
00345                         $pointer=strtolower($place)=='after'?$k+1:$k;
00346                      }
00347                   }
00348                   array_splice(
00349                      $mods,   // The modules array
00350                      $pointer,      // To insert one position from the end of the list
00351                      0,    // Don't remove any items, just insert
00352                      $sub  // Module to insert
00353                   );
00354                break;
00355                default:
00356                   if (strtolower($place)=='top')   {
00357                      array_unshift($mods,$sub);
00358                   } else {
00359                      array_push($mods,$sub);
00360                   }
00361                break;
00362             }
00363          }
00364             // Re-inserting the submodule list:
00365          $TBE_MODULES[$main]=implode(',',$mods);
00366       } else { // Create new main modules with only one submodule, $sub (or none if $sub is blank)
00367          $TBE_MODULES[$main]=$sub;
00368       }
00369 
00370          // Adding path:
00371       if ($path)  {
00372          $TBE_MODULES['_PATHS'][$main.($sub?'_'.$sub:'')]=$path;
00373       }
00374    }

t3lib_extMgm::addPageTSConfig content  ) 
 

Adds $content to the default Page TSconfig as set in $TYPO3_CONF_VARS[BE]['defaultPageTSconfig'] Prefixed with a [GLOBAL] line FOR USE IN ext_tables.php/ext_locallang.php FILES Usage: 5.

Parameters:
string Page TSconfig content
Returns:
void

Definition at line 409 of file class.t3lib_extmgm.php.

References $TYPO3_CONF_VARS.

00409                                        {
00410       global $TYPO3_CONF_VARS;
00411       $TYPO3_CONF_VARS['BE']['defaultPageTSconfig'].="\n[GLOBAL]\n".$content;
00412    }

t3lib_extMgm::addPiFlexFormValue piKeyToMatch,
value
 

Adds an entry to the "ds" array of the tt_content field "pi_flexform".

This is used by plugins to add a flexform XML reference / content for use when they are selected as plugin. Usage: 0

Parameters:
string The same value as the key for the plugin
string Either a reference to a flex-form XML file (eg. "FILE:EXT:newloginbox/flexform_ds.xml") or the XML directly.
Returns:
void
See also:
addPlugin()

Definition at line 680 of file class.t3lib_extmgm.php.

References $TCA.

00680                                                       {
00681       global $TCA;
00682       t3lib_div::loadTCA('tt_content');
00683 
00684       if (is_array($TCA['tt_content']['columns']) && is_array($TCA['tt_content']['columns']['pi_flexform']['config']['ds']))  {
00685          $TCA['tt_content']['columns']['pi_flexform']['config']['ds'][$piKeyToMatch] = $value;
00686       }
00687    }

t3lib_extMgm::addPItoST43 key,
classFile = '',
prefix = '',
type = 'list_type',
cached = 0
 

Add PlugIn to Static Template #43.

When adding a frontend plugin you will have to add both an entry to the TCA definition of tt_content table AND to the TypoScript template which must initiate the rendering. Since the static template with uid 43 is the "content.default" and practically always used for rendering the content elements it's very useful to have this function automatically adding the necessary TypoScript for calling your plugin. It will also work for the extension "css_styled_content" $type determines the type of frontend plugin: "list_type" (default) - the good old "Insert plugin" entry "menu_type" - a "Menu/Sitemap" entry "splash_layout" - a "Textbox" entry "CType" - a new content element type "header_layout" - an additional header type (added to the selection of layout1-5) "includeLib" - just includes the library for manual use somewhere in TypoScript. (Remember that your $type definition should correspond to the column/items array in $TCA[tt_content] where you added the selector item for the element! See addPlugin() function) FOR USE IN ext_locallang.php FILES Usage: 2

Parameters:
string $key is the extension key
string $classFile is the PHP-class filename relative to the extension root directory. If set to blank a default value is chosen according to convensions.
string $prefix is used as a - yes, suffix - of the class name (fx. "_pi1")
string $type, see description above
boolean If $cached is set as USER content object (cObject) is created - otherwise a USER_INT object is created.
Returns:
void

Definition at line 731 of file class.t3lib_extmgm.php.

References getCN(), and siteRelPath().

00731                                                                                     {
00732       global $TYPO3_LOADED_EXT;
00733       $classFile = $classFile ? $classFile : 'pi/class.tx_'.str_replace('_','',$key).$prefix.'.php';
00734       $cN = t3lib_extMgm::getCN($key);
00735 
00736          // General plugin:
00737       if ($cached)   {
00738          $pluginContent = trim('
00739 includeLibs.'.$cN.$prefix.' = '.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$classFile.'
00740 plugin.'.$cN.$prefix.' = USER
00741 plugin.'.$cN.$prefix.' {
00742   userFunc = '.$cN.$prefix.'->main
00743 }');
00744       } else {
00745          $pluginContent = trim('
00746 plugin.'.$cN.$prefix.' = USER_INT
00747 plugin.'.$cN.$prefix.' {
00748   includeLibs = '.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$classFile.'
00749   userFunc = '.$cN.$prefix.'->main
00750 }');
00751       }
00752       t3lib_extMgm::addTypoScript($key,'setup','
00753 # Setting '.$key.' plugin TypoScript
00754 '.$pluginContent);
00755 
00756          // After ST43:
00757       switch($type)  {
00758          case 'list_type':
00759             $addLine = 'tt_content.list.20.'.$key.$prefix.' = < plugin.'.$cN.$prefix;
00760          break;
00761          case 'menu_type':
00762             $addLine = 'tt_content.menu.20.'.$key.$prefix.' = < plugin.'.$cN.$prefix;
00763          break;
00764          case 'splash_layout':
00765             $addLine = 'tt_content.splash.'.$key.$prefix.' = < plugin.'.$cN.$prefix;
00766          break;
00767          case 'CType':
00768             $addLine = trim('
00769 tt_content.'.$key.$prefix.' = COA
00770 tt_content.'.$key.$prefix.' {
00771    10 = < lib.stdheader
00772    20 = < plugin.'.$cN.$prefix.'
00773 }
00774             ');
00775          break;
00776          case 'header_layout':
00777             $addLine = 'lib.stdheader.10.'.$key.$prefix.' = < plugin.'.$cN.$prefix;
00778          break;
00779          case 'includeLib':
00780             $addLine = 'page.1000 = < plugin.'.$cN.$prefix;
00781          break;
00782          default:
00783             $addLine = '';
00784          break;
00785       }
00786       if ($addLine)  {
00787          t3lib_extMgm::addTypoScript($key,'setup','
00788 # Setting '.$key.' plugin TypoScript
00789 '.$addLine.'
00790 ',43);
00791       }
00792    }

t3lib_extMgm::addPlugin itemArray,
type = 'list_type'
 

Adds an entry to the list of plugins in content elements of type "Insert plugin" Takes the $itemArray (label,value[,icon]) and adds to the items-array of $TCA[tt_content] elements with CType "listtype" (or another field if $type points to another fieldname) If the value (array pos.

1) is already found in that items-array, the entry is substituted, otherwise the input array is added to the bottom. Use this function to add a frontend plugin to this list of plugin-types - or more generally use this function to add an entry to any selectorbox/radio-button set in the TCEFORMS FOR USE IN ext_tables.php FILES Usage: 13

Parameters:
array Item Array
string Type (eg. "list_type") - basically a field from "tt_content" table
Returns:
void

Definition at line 655 of file class.t3lib_extmgm.php.

References $TCA.

00655                                                       {
00656       global $TCA;
00657       t3lib_div::loadTCA('tt_content');
00658       if (is_array($TCA['tt_content']['columns']) && is_array($TCA['tt_content']['columns'][$type]['config']['items'])) {
00659          reset($TCA['tt_content']['columns'][$type]['config']['items']);
00660          while(list($k,$v)=each($TCA['tt_content']['columns'][$type]['config']['items'])) {
00661             if (!strcmp($v[1],$itemArray[1]))   {
00662                $TCA['tt_content']['columns'][$type]['config']['items'][$k]=$itemArray;
00663                return;
00664             }
00665          }
00666          $TCA['tt_content']['columns'][$type]['config']['items'][]=$itemArray;
00667       }
00668    }

t3lib_extMgm::addService extKey,
serviceType,
serviceKey,
info
 

Adds a service to the global services array.

Parameters:
string Extension key
string Service type
string Service key
array Service description array
Returns:
void
Author:
René Fritz <r.fritz@colorcube.de>

Definition at line 480 of file class.t3lib_extmgm.php.

References $T3_SERVICES, and deactivateService().

00480                                                                   {
00481       global $T3_SERVICES,$TYPO3_CONF_VARS;
00482 
00483       // even not available services will be included to make it possible to give the admin a feedback of non-available services.
00484       // but maybe it's better to move non-available services to a different array??
00485 
00486       if ($serviceType AND substr($serviceType,0,3)!='tx_' AND substr($serviceKey,0,3)=='tx_' AND is_array($info))   {
00487 
00488          $info['priority'] = max(0,min(100,$info['priority']));
00489 
00490          $T3_SERVICES[$serviceType][$serviceKey]=$info;
00491 
00492          $T3_SERVICES[$serviceType][$serviceKey]['extKey'] = $extKey;
00493          $T3_SERVICES[$serviceType][$serviceKey]['serviceKey'] = $serviceKey;
00494          $T3_SERVICES[$serviceType][$serviceKey]['serviceType'] = $serviceType;
00495 
00496 
00497             // mapping a service key to a service type
00498             // all service keys begin with tx_ - service types don't
00499             // this way a selection of a special service key as service type is easy
00500          $T3_SERVICES[$serviceKey][$serviceKey] = &$T3_SERVICES[$serviceType][$serviceKey];
00501 
00502 
00503             // change the priority (and other values) from TYPO3_CONF_VARS
00504             // $TYPO3_CONF_VARS['T3_SERVICES'][$serviceType][$serviceKey]['priority']
00505             // even the activation is possible (a unix service might be possible on windows for some reasons)
00506          if (is_array($TYPO3_CONF_VARS['T3_SERVICES'][$serviceType][$serviceKey])) {
00507 
00508                // no check is done here - there might be configuration values only the service type knows about, so we pass everything
00509             $T3_SERVICES[$serviceType][$serviceKey] = array_merge ($T3_SERVICES[$serviceType][$serviceKey],$TYPO3_CONF_VARS['T3_SERVICES'][$serviceType][$serviceKey]);
00510          }
00511 
00512 
00513             // OS check
00514             // empty $os means 'not limited to one OS', therefore a check is not needed
00515          if ($T3_SERVICES[$serviceType][$serviceKey]['available'] AND $T3_SERVICES[$serviceType][$serviceKey]['os']!='') {
00516 
00517                // TYPO3_OS is not yet defined
00518             $os_type = stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'UNIX';
00519 
00520             $os = t3lib_div::trimExplode(',',strtoupper($T3_SERVICES[$serviceType][$serviceKey]['os']));
00521 
00522             if (!in_array($os_type,$os)) {
00523                t3lib_extMgm::deactivateService($serviceType, $serviceKey);
00524             }
00525          }
00526 
00527             // convert subtype list to array for quicker access
00528          $T3_SERVICES[$serviceType][$serviceKey]['serviceSubTypes'] = array();
00529          $serviceSubTypes = t3lib_div::trimExplode(',',$info['subtype']);
00530          foreach ($serviceSubTypes as $subtype) {
00531             $T3_SERVICES[$serviceType][$serviceKey]['serviceSubTypes'][$subtype] = $subtype;
00532          }
00533       }
00534    }

t3lib_extMgm::addStaticFile extKey,
path,
title
 

Call this method to add an entry in the static template list found in sys_templates "static template files" are the modern equalent (provided from extensions) to the traditional records in "static_templates" FOR USE IN ext_locallang.php FILES Usage: 3.

Parameters:
string $extKey is of course the extension key
string $path is the path where the template files (fixed names) include_static.txt (integer list of uids from the table "static_templates"), constants.txt, setup.txt and editorcfg.txt is found (relative to extPath, eg. 'static/')
string $title is the title in the selector box.
Returns:
void
See also:
addTypoScript()

Definition at line 806 of file class.t3lib_extmgm.php.

00806                                                 {
00807       global $TCA;
00808       t3lib_div::loadTCA('sys_template');
00809       if ($extKey && $path && is_array($TCA['sys_template']['columns']))   {
00810          $value = str_replace(',','','EXT:'.$extKey.'/'.$path);
00811          $itemArray=array(trim($title.' ('.$extKey.')'),$value);
00812          $TCA['sys_template']['columns']['include_static_file']['config']['items'][]=$itemArray;
00813       }
00814    }

t3lib_extMgm::addTCAcolumns table,
columnArray,
addTofeInterface = 0
 

Adding fields to an existing table definition in $TCA Adds an array with $TCA column-configuration to the $TCA-entry for that table.

This function adds the configuration needed for rendering of the field in TCEFORMS - but it does NOT add the field names to the types lists! So to have the fields displayed you must also call fx. addToAllTCAtypes or manually add the fields to the types list. FOR USE IN ext_tables.php FILES Usage: 4

Parameters:
string $table is the table name of a table already present in $TCA with a columns section
array $columnArray is the array with the additional columns (typical some fields an extension wants to add)
boolean If $addTofeInterface is true the list of fields are also added to the fe_admin_fieldList.
Returns:
void

Definition at line 226 of file class.t3lib_extmgm.php.

References $TCA, and table().

00226                                                                      {
00227       global $TCA;
00228       t3lib_div::loadTCA($table);
00229       if (is_array($columnArray) && is_array($TCA[$table]) && is_array($TCA[$table]['columns']))   {
00230          $TCA[$table]['columns'] = array_merge($TCA[$table]['columns'],$columnArray);  // Candidate for t3lib_div::array_merge() if integer-keys will some day make trouble...
00231          if ($addTofeInterface)  $TCA[$table]['feInterface']['fe_admin_fieldList'].=','.implode(',',array_keys($columnArray));
00232       }
00233    }

t3lib_extMgm::addToAllTCAtypes table,
str,
specificTypesList = '',
position = ''
 

Makes fields visible in the TCEforms, adding them to the end of (all) "types"-configurations.

Adds a string $str (comma list of field names) to all ["types"][xxx]["showitem"] entries for table $table (unless limited by $specificTypesList) This is needed to have new fields shown automatically in the TCEFORMS of a record from $table. Typically this function is called after having added new columns (database fields) with the addTCAcolumns function FOR USE IN ext_tables.php FILES Usage: 1

Parameters:
string Table name
string Field list to add.
string List of specific types to add the field list to. (If empty, all type entries are affected)
string Insert fields before (default) or after one of this fields (commalist with "before:" or "after:" commands). Example: "before:keywords,--palette--;;4,after:description". Palettes must be passed like in the example no matter how the palette definition looks like in TCA.
Returns:
void

Definition at line 250 of file class.t3lib_extmgm.php.

References $TCA, and table().

00250                                                                               {
00251       global $TCA;
00252 
00253       $positionArr=t3lib_div::trimExplode(',',$position,1);
00254       $insert=count($position);
00255 
00256       t3lib_div::loadTCA($table);
00257       if (trim($str) && is_array($TCA[$table]) && is_array($TCA[$table]['types']))  {
00258          foreach($TCA[$table]['types'] as $k => $v)   {
00259             if (!$specificTypesList || t3lib_div::inList($specificTypesList,$k)) {
00260 
00261 
00262 
00263                if ($insert) {
00264                   $append=true;
00265                   $showItem = t3lib_div::trimExplode(',',$TCA[$table]['types'][$k]['showitem'],1);
00266                   foreach($showItem as $key => $fieldInfo) {
00267 
00268                      $parts = explode(';',$fieldInfo);
00269                      $theField = trim($parts[0]);
00270                      $palette = trim($parts[0]).';;'.trim($parts[2]);
00271 
00272                         // insert before: find exact field name or palette with number
00273                      if (in_array($theField, $positionArr) OR in_array($palette, $positionArr) OR
00274                         in_array('before:'.$theField, $positionArr) OR in_array('before:'.$palette, $positionArr))   {
00275                         $showItem[$key]=trim($str).', '.$fieldInfo;
00276                         $append=false;
00277                         break;
00278                      }
00279                         // insert after
00280                      if (in_array('after:'.$theField, $positionArr) OR in_array('after:'.$palette, $positionArr)) {
00281                         $showItem[$key]=$fieldInfo.', '.trim($str);
00282                         $append=false;
00283                         break;
00284                      }
00285                   }
00286 
00287                      // Not found? Then append.
00288                   if($append) {
00289                      $showItem[]=trim($str);
00290                   }
00291 
00292                   $TCA[$table]['types'][$k]['showitem']=implode(', ', $showItem);
00293 
00294                } else {
00295                   $TCA[$table]['types'][$k]['showitem'].=', '.trim($str);
00296                }
00297             }
00298          }
00299       }
00300    }

t3lib_extMgm::addToInsertRecords table,
content_table = 'tt_content',
content_field = 'records'
 

Adds the $table tablename to the list of tables allowed to be includes by content element type "Insert records" By using $content_table and $content_field you can also use the function for other tables.

FOR USE IN ext_tables.php FILES Usage: 9

Parameters:
string Table name to allow for "insert record"
string Table name TO WHICH the $table name is applied. See $content_field as well.
string Field name in the database $content_table in which $table is allowed to be added as a reference ("Insert Record")
Returns:
void

Definition at line 700 of file class.t3lib_extmgm.php.

References $TCA.

00700                                                                                              {
00701       global $TCA;
00702       t3lib_div::loadTCA($content_table);
00703       if (is_array($TCA[$content_table]['columns']) && isset($TCA[$content_table]['columns'][$content_field]['config']['allowed'])) {
00704          $TCA[$content_table]['columns'][$content_field]['config']['allowed'].=','.$table;
00705       }
00706    }

t3lib_extMgm::addTypoScript key,
type,
content,
afterStaticUid = 0
 

Adds $content to the default TypoScript code for either setup, constants or editorcfg as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_*'] (Basically this function can do the same as addTypoScriptSetup and addTypoScriptConstants - just with a little more hazzle, but also with some more options!) FOR USE IN ext_locallang.php FILES Usage: 7.

Parameters:
string $key is the extension key (informative only).
string $type is either "setup", "constants" or "editorcfg" and obviously determines which kind of TypoScript code we are adding.
string $content is the TS content, prefixed with a [GLOBAL] line and a comment-header.
string $afterStaticUid is either an integer pointing to a uid of a static_template or a string pointing to the "key" of a static_file template ([reduced extension_key]/[local path]). The points is that the TypoScript you add is included only IF that static template is included (and in that case, right after). So effectively the TypoScript you set can specifically overrule settings from those static templates.
Returns:
void

Definition at line 856 of file class.t3lib_extmgm.php.

References $content, and $TYPO3_CONF_VARS.

00856                                                                   {
00857       global $TYPO3_CONF_VARS;
00858 
00859       if ($type=='setup' || $type=='editorcfg' || $type=='constants')      {
00860          $content = '
00861 
00862 [GLOBAL]
00863 #############################################
00864 ## TypoScript added by extension "'.$key.'"
00865 #############################################
00866 
00867 '.$content;
00868          if ($afterStaticUid) {
00869             $TYPO3_CONF_VARS['FE']['defaultTypoScript_'.$type.'.'][$afterStaticUid].=$content;
00870             if ($afterStaticUid==43)   {  // If 'content (default)' is targeted, also add to other 'content rendering templates', eg. css_styled_content
00871                $TYPO3_CONF_VARS['FE']['defaultTypoScript_'.$type.'.']['cssstyledcontent/static/'].=$content;
00872             }
00873          } else {
00874             $TYPO3_CONF_VARS['FE']['defaultTypoScript_'.$type].=$content;
00875          }
00876       }
00877    }

t3lib_extMgm::addTypoScriptConstants content  ) 
 

Adds $content to the default TypoScript constants code as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_constants'] Prefixed with a [GLOBAL] line FOR USE IN ext_locallang.php FILES Usage: 0.

Parameters:
string TypoScript Constants string
Returns:
void

Definition at line 839 of file class.t3lib_extmgm.php.

References $TYPO3_CONF_VARS.

00839                                              {
00840       global $TYPO3_CONF_VARS;
00841       $TYPO3_CONF_VARS['FE']['defaultTypoScript_constants'].="\n[GLOBAL]\n".$content;
00842    }

t3lib_extMgm::addTypoScriptSetup content  ) 
 

Adds $content to the default TypoScript setup code as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_setup'] Prefixed with a [GLOBAL] line FOR USE IN ext_locallang.php FILES Usage: 6.

Parameters:
string TypoScript Setup string
Returns:
void

Definition at line 825 of file class.t3lib_extmgm.php.

References $TYPO3_CONF_VARS.

00825                                           {
00826       global $TYPO3_CONF_VARS;
00827       $TYPO3_CONF_VARS['FE']['defaultTypoScript_setup'].="\n[GLOBAL]\n".$content;
00828    }

t3lib_extMgm::addUserTSConfig content  ) 
 

Adds $content to the default User TSconfig as set in $TYPO3_CONF_VARS[BE]['defaultUserTSconfig'] Prefixed with a [GLOBAL] line FOR USE IN ext_tables.php/ext_locallang.php FILES Usage: 3.

Parameters:
string User TSconfig content
Returns:
void

Definition at line 423 of file class.t3lib_extmgm.php.

References $TYPO3_CONF_VARS.

00423                                        {
00424       global $TYPO3_CONF_VARS;
00425       $TYPO3_CONF_VARS['BE']['defaultUserTSconfig'].="\n[GLOBAL]\n".$content;
00426    }

t3lib_extMgm::allowTableOnStandardPages table  ) 
 

Add tablename to default list of allowed tables on pages (in $PAGES_TYPES) Will add the $table to the list of tables allowed by default on pages as setup by $PAGES_TYPES['default']['allowedTables'] FOR USE IN ext_tables.php FILES Usage: 11.

Parameters:
string Table name
Returns:
void

Definition at line 312 of file class.t3lib_extmgm.php.

References $PAGES_TYPES.

00312                                                 {
00313       global $PAGES_TYPES;
00314 
00315       $PAGES_TYPES['default']['allowedTables'].=','.$table;
00316    }

t3lib_extMgm::cannotCacheFilesWritable cacheFilePrefix  ) 
 

Returns an error string if typo3conf/ or cache-files with $cacheFilePrefix are NOT writable Returns false if no problem.

Usage: 1

Parameters:
string Prefix of the cache file to check
Returns:
string

Definition at line 1045 of file class.t3lib_extmgm.php.

References error(), and PATH_typo3conf.

Referenced by typo3_loadExtensions().

01045                                                          {
01046       $error=array();
01047       if (!@is_writeable(PATH_typo3conf)) {
01048          $error[]=PATH_typo3conf;
01049       }
01050       if (@is_file(PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php') &&
01051          !@is_writeable(PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php'))   {
01052             $error[]=PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php';
01053       }
01054       if (@is_file(PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php') &&
01055          !@is_writeable(PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php'))   {
01056             $error[]=PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php';
01057       }
01058       return implode(', ',$error);
01059    }

t3lib_extMgm::currentCacheFiles  ) 
 

Returns an array with the two cache-files (0=>localconf, 1=>tables) from typo3conf/ if they (both) exist.

Otherwise false. Evaluation relies on $TYPO3_LOADED_EXT['_CACHEFILE'] Usage: 2

Returns:
array

Definition at line 1069 of file class.t3lib_extmgm.php.

References isCacheFilesAvailable(), and PATH_typo3conf.

Referenced by t3lib_TCEmain::removeCacheFiles().

01069                                  {
01070       global $TYPO3_LOADED_EXT;
01071 
01072       if ($TYPO3_LOADED_EXT['_CACHEFILE'])   {
01073          if (t3lib_extMgm::isCacheFilesAvailable($TYPO3_LOADED_EXT['_CACHEFILE']))  {
01074             return array(
01075                PATH_typo3conf.$TYPO3_LOADED_EXT['_CACHEFILE'].'_ext_localconf.php',
01076                PATH_typo3conf.$TYPO3_LOADED_EXT['_CACHEFILE'].'_ext_tables.php'
01077             );
01078          }
01079       }
01080    }

t3lib_extMgm::deactivateService serviceType,
serviceKey
 

Deactivate a service.

Parameters:
string Service type
string Service key
Returns:
void
Author:
René Fritz <r.fritz@colorcube.de>

Definition at line 616 of file class.t3lib_extmgm.php.

References $T3_SERVICES.

Referenced by addService(), t3lib_svbase::deactivateService(), and findService().

00616                                                          {
00617       global $T3_SERVICES;
00618 
00619          // ... maybe it's better to move non-available services to a different array??
00620       $T3_SERVICES[$serviceType][$serviceKey]['available'] = FALSE;
00621    }

t3lib_extMgm::extPath key,
script = ''
 

Returns the absolute path to the extension with extension key $key If the extension is not loaded the function will die with an error message Useful for internal fileoperations Usage: 136.

Parameters:
string Extension key
string $script is appended to the output if set.
Returns:
string

Definition at line 146 of file class.t3lib_extmgm.php.

References extPath(), PATH_site, and siteRelPath().

Referenced by tx_install::checkTheImageProcessing(), tx_install::displayTwinImage(), extPath(), and siteRelPath().

00146                                        {
00147       global $TYPO3_LOADED_EXT;
00148       if (!isset($TYPO3_LOADED_EXT[$key]))   {
00149          #debug(array(debug_backtrace()));
00150          die('TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded! (t3lib_extMgm::extPath)');
00151       }
00152       return PATH_site.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$script;
00153    }

t3lib_extMgm::extRelPath key  ) 
 

Returns the relative path to the extension as measured from from the TYPO3_mainDir If the extension is not loaded the function will die with an error message Useful for images and links from backend Usage: 54.

Parameters:
string Extension key
Returns:
string

Definition at line 164 of file class.t3lib_extmgm.php.

References extRelPath().

Referenced by extRelPath(), and SC_db_new::regularNew().

00164                               {
00165       global $TYPO3_LOADED_EXT;
00166       if (!isset($TYPO3_LOADED_EXT[$key]))   {
00167          die('TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded! (t3lib_extMgm::extRelPath)');
00168       }
00169       return $TYPO3_LOADED_EXT[$key]['typo3RelPath'];
00170    }

t3lib_extMgm::findService serviceType,
serviceSubType = '',
excludeServiceKeys = array()
 

Find the available service with highest priority.

Parameters:
string Service type
string Service sub type
mixed Service keys that should be excluded in the search for a service. Array or comma list.
Returns:
mixed Service info array if a service was found, FLASE otherwise
Author:
René Fritz <r.fritz@colorcube.de>

Definition at line 545 of file class.t3lib_extmgm.php.

References $T3_SERVICES, t3lib_exec::checkCommand(), deactivateService(), and PATH_t3lib.

00545                                                                                        {
00546       global $T3_SERVICES;
00547 
00548       $serviceKey = FALSE;
00549       $serviceInfo = FALSE;
00550       $priority = 0;
00551       $quality = 0;
00552 
00553       if (!is_array($excludeServiceKeys) ) {
00554          $excludeServiceKeys = t3lib_div::trimExplode(',', $excludeServiceKeys, 1);
00555       }
00556 
00557       if (is_array($T3_SERVICES[$serviceType])) {
00558          foreach($T3_SERVICES[$serviceType] as $key => $info)  {
00559 
00560             if (in_array($key, $excludeServiceKeys)) {
00561                continue;
00562             }
00563 
00564                // select a subtype randomly
00565                // usefull to start a service by service key without knowing his subtypes - for testing purposes
00566             if ($serviceSubType=='*') {
00567                $serviceSubType = key($info['serviceSubTypes']);
00568             }
00569 
00570                // this matches empty subtype too
00571             if( $info['available'] AND ($info['subtype']==$serviceSubType OR $info['serviceSubTypes'][$serviceSubType]) AND $info['priority']>=$priority ) {
00572 
00573                   // has a lower quality than the already found, therefore we skip this service
00574                if($info['priority']==$priority AND $info['quality']<$quality) {
00575                   continue;
00576                }
00577 
00578                   // service depends on external programs - check if they exists
00579                if(trim($info['exec'])) {
00580                   require_once(PATH_t3lib.'class.t3lib_exec.php');
00581 
00582                   $executables = t3lib_div::trimExplode(',', $info['exec'],1);
00583                   foreach($executables as $executable)   {
00584                      if(!t3lib_exec::checkCommand($executable)) {
00585                         t3lib_extMgm::deactivateService($serviceType, $key);
00586                         $info['available']=FALSE;
00587                         break;
00588                      }
00589                   }
00590                }
00591 
00592                   // still available after exec check?
00593                if($info['available']) {
00594                   $serviceKey = $key;
00595                   $priority = $info['priority'];
00596                   $quality = $info['quality'];
00597                }
00598             }
00599          }
00600       }
00601 
00602       if ($serviceKey) {
00603          $serviceInfo = $T3_SERVICES[$serviceType][$serviceKey];
00604       }
00605       return $serviceInfo;
00606    }

t3lib_extMgm::getCN key  ) 
 

Returns the correct class name prefix for the extension key $key Usage: 3.

Parameters:
string Extension key
Returns:
string

Definition at line 193 of file class.t3lib_extmgm.php.

Referenced by addPItoST43().

00193                         {
00194       return substr($key,0,5)=='user_' ? 'user_'.str_replace('_','',substr($key,5)) : 'tx_'.str_replace('_','',$key);
00195    }

t3lib_extMgm::insertModuleFunction modname,
className,
classPath,
title,
MM_key = 'function'
 

Adds a "Function menu module" ('third level module') to an existing function menu for some other backend module The arguments values are generally determined by which function menu this is supposed to interact with See Inside TYPO3 for information on how to use this function.

FOR USE IN ext_tables.php FILES Usage: 26

Parameters:
string Module name
string Class name
string Class path
string Title of module
string Menu array key - default is "function"
Returns:
void
See also:
t3lib_SCbase::mergeExternalItems()

Definition at line 391 of file class.t3lib_extmgm.php.

00391                                                                                              {
00392       global $TBE_MODULES_EXT;
00393       $TBE_MODULES_EXT[$modname]['MOD_MENU'][$MM_key][$className]=array(
00394          'name' => $className,
00395          'path' => $classPath,
00396          'title' => $title,
00397       );
00398    }

t3lib_extMgm::isCacheFilesAvailable cacheFilePrefix  ) 
 

Returns true if both the localconf and tables cache file exists (with $cacheFilePrefix) Usage: 2.

Parameters:
string Prefix of the cache file to check
Returns:
boolean

Definition at line 1019 of file class.t3lib_extmgm.php.

References PATH_typo3conf.

Referenced by currentCacheFiles(), and typo3_loadExtensions().

01019                                                       {
01020       return
01021          @is_file(PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php') &&
01022          @is_file(PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php');
01023    }

t3lib_extMgm::isLoaded key,
exitOnError = 0
 

Returns true if the extension with extension key $key is loaded.

Usage: 109

Parameters:
string Extension key to test
boolean If $exitOnError is true and the extension is not loaded the function will die with an error message
Returns:
boolean

Definition at line 130 of file class.t3lib_extmgm.php.

Referenced by t3lib_TCEmain::clear_cache(), t3lib_TCEmain::clear_cacheCmd(), tslib_cObj::cObjGetSingle(), SC_alt_main::editPageHandling(), SC_alt_shortcut::editPageIdFunc(), SC_alt_doc::editRegularContentFromId(), SC_mod_tools_em_index::extDelete(), SC_mod_tools_em_index::extensionList_import(), SC_mod_tools_em_index::extensionList_installed(), SC_mod_tools_em_index::extensionListRow(), SC_mod_tools_em_index::extInformationArray(), t3lib_userAuthGroup::fetchGroupData(), firstDomainRecord(), getDomainStartPage(), tx_cms_layout::getPageInfoBox(), getSingleField_typeFlex_sheetMenu(), tx_cms_layout::getTable_sys_note(), tx_cms_layout::getTableMenu(), getVersionSelector(), SC_mod_tools_em_index::importExtFromRep(), SC_wizard_tsconfig::init(), t3lib_pageTree::init(), t3lib_browseTree::init(), tx_wizardsortpages_webfunc_2::main(), tx_wizardcrpages_webfunc_2::main(), tx_cms_webinfo_page::main(), SC_mod_user_setup_index::main(), SC_alt_shortcut::main(), SC_alt_doc_nodoc::main(), SC_alt_doc::makeButtonPanel(), SC_mod_tools_em_index::makeDetailedExtensionAnalysis(), t3lib_fullsearch::makeStoreControl(), t3lib_positionMap::onClickEvent(), tx_cms_layout::pages_drawItem(), SC_db_new::regularNew(), SC_db_layout::renderQuickEdit(), t3lib_fullsearch::saveQueryInAction(), SC_alt_doc::setDocument(), tslib_fe::settingLanguage(), SC_mod_tools_em_index::showExtDetails(), tslib_fe::statistics(), SC_mod_user_setup_index::storeIncomingData(), and t3lib_beUserAuth::trackBeUser().

00130                                           {
00131       global $TYPO3_LOADED_EXT;
00132       if ($exitOnError && !isset($TYPO3_LOADED_EXT[$key]))  die('Fatal Error: Extension "'.$key.'" was not loaded.');
00133       return isset($TYPO3_LOADED_EXT[$key]);
00134    }

t3lib_extMgm::isLocalconfWritable  ) 
 

Returns true if the "localconf.php" file in "typo3conf/" is writable Usage: 1.

Returns:
boolean

Definition at line 1032 of file class.t3lib_extmgm.php.

References PATH_typo3conf.

Referenced by SC_mod_tools_em_index::showExtDetails().

01032                                     {
01033       return is_writeable(PATH_typo3conf) && is_writeable(PATH_typo3conf.'localconf.php');
01034    }

t3lib_extMgm::siteRelPath key  ) 
 

Returns the relative path to the extension as measured from the PATH_site (frontend) If the extension is not loaded the function will die with an error message Useful for images and links from the frontend Usage: 6.

Parameters:
string Extension key
Returns:
string

Definition at line 181 of file class.t3lib_extmgm.php.

References extPath(), and PATH_site.

Referenced by addPItoST43(), extPath(), and tslib_pibase::pi_loadLL().

00181                               {
00182       return substr(t3lib_extMgm::extPath($key),strlen(PATH_site));
00183    }

t3lib_extMgm::typo3_loadExtensions  ) 
 

Loading extensions configured in $TYPO3_CONF_VARS['EXT']['extList'].

CACHING ON: ($TYPO3_CONF_VARS['EXT']['extCache'] = 1 or 2) If caching is enabled (and possible), the output will be $extensions['_CACHEFILE'] set to the cacheFilePrefix. Subsequently the cache files must be included then since those will eventually set up the extensions. If cachefiles are not found they will be generated CACHING OFF: ($TYPO3_CONF_VARS['EXT']['extCache'] = 0) The returned value will be an array where each key is an extension key and the value is an array with filepaths for the extension. This array will later be set in the global var $TYPO3_LOADED_EXT

Usages of this function can be seen in config_default.php Extensions are always detected in the order local - global - system. Usage: 1

Returns:
array Extension Array

Definition at line 919 of file class.t3lib_extmgm.php.

References $TYPO3_CONF_VARS, cannotCacheFilesWritable(), isCacheFilesAvailable(), PATH_site, TYPO3_mainDir, and writeCacheFiles().

00919                                     {
00920       global $TYPO3_CONF_VARS;
00921 
00922          // Full list of extensions includes both required and extList:
00923       $rawExtList = $TYPO3_CONF_VARS['EXT']['requiredExt'].','.$TYPO3_CONF_VARS['EXT']['extList'];
00924 
00925          // Empty array as a start.
00926       $extensions = array();
00927 
00928          //
00929       if ($rawExtList)  {
00930             // The cached File prefix.
00931          $cacheFilePrefix = 'temp_CACHED';
00932             // Setting the name for the cache files:
00933          if (intval($TYPO3_CONF_VARS['EXT']['extCache'])==1)   $cacheFilePrefix.= '_ps'.substr(t3lib_div::shortMD5(PATH_site.'|'.$GLOBALS['TYPO_VERSION']),0,4);
00934          if (intval($TYPO3_CONF_VARS['EXT']['extCache'])==2)   $cacheFilePrefix.= '_'.t3lib_div::shortMD5($rawExtList);
00935 
00936             // If cache files available, set cache file prefix and return:
00937          if ($TYPO3_CONF_VARS['EXT']['extCache'] && t3lib_extMgm::isCacheFilesAvailable($cacheFilePrefix))  {
00938                // Return cache file prefix:
00939             $extensions['_CACHEFILE'] = $cacheFilePrefix;
00940          } else {
00941             // ... but if not, configure...
00942             $temp_extensions = array_unique(t3lib_div::trimExplode(',',$rawExtList,1));
00943             while(list(,$temp_extKey)=each($temp_extensions))  {
00944                if (@is_dir(PATH_site.'typo3conf/ext/'.$temp_extKey)) {
00945                   $extensions[$temp_extKey]=array('type'=>'L','siteRelPath'=>'typo3conf/ext/'.$temp_extKey.'/','typo3RelPath'=>'../typo3conf/ext/'.$temp_extKey.'/');
00946                } elseif (@is_dir(PATH_site.TYPO3_mainDir.'ext/'.$temp_extKey))   {
00947                   $extensions[$temp_extKey]=array('type'=>'G','siteRelPath'=>TYPO3_mainDir.'ext/'.$temp_extKey.'/','typo3RelPath'=>'ext/'.$temp_extKey.'/');
00948                } elseif (@is_dir(PATH_site.TYPO3_mainDir.'sysext/'.$temp_extKey))   {
00949                   $extensions[$temp_extKey]=array('type'=>'S','siteRelPath'=>TYPO3_mainDir.'sysext/'.$temp_extKey.'/','typo3RelPath'=>'sysext/'.$temp_extKey.'/');
00950                }
00951 
00952                $files = t3lib_div::trimExplode(',','
00953                   ext_localconf.php,
00954                   ext_tables.php,
00955                   ext_tables.sql,
00956                   ext_tables_static+adt.sql,
00957                   ext_typoscript_constants.txt,
00958                   ext_typoscript_editorcfg.txt,
00959                   ext_typoscript_setup.txt
00960                ',1);
00961                reset($files);
00962                while(list(,$fName)=each($files))   {
00963                   $temp_filename = PATH_site.$extensions[$temp_extKey]['siteRelPath'].trim($fName);
00964                   if (is_array($extensions[$temp_extKey]) && @is_file($temp_filename)) {
00965                      $extensions[$temp_extKey][$fName]=$temp_filename;
00966                   }
00967                }
00968             }
00969             unset($extensions['_CACHEFILE']);
00970 
00971 
00972             // write cache?
00973             if ($TYPO3_CONF_VARS['EXT']['extCache'])  {
00974                $wrError = t3lib_extMgm::cannotCacheFilesWritable($cacheFilePrefix);
00975                if ($wrError)  {
00976 //debug('Cannot write cache files: '.$wrError.'. Disabling the cache...');
00977                   $TYPO3_CONF_VARS['EXT']['extCache']=0;
00978                } else {
00979                   // Write cache files:
00980                   $extensions = t3lib_extMgm::writeCacheFiles($extensions,$cacheFilePrefix);
00981                }
00982             }
00983          }
00984       }
00985 
00986 #debug($extensions);
00987       return $extensions;
00988    }

t3lib_extMgm::writeCacheFiles extensions,
cacheFilePrefix
 

Compiles/Creates the two cache-files in typo3conf/ based on $cacheFilePrefix Returns a array with the key "_CACHEFILE" set to the $cacheFilePrefix value Usage: 1.

Parameters:
array Extension information array
string Prefix for the cache files
Returns:
array

Definition at line 1092 of file class.t3lib_extmgm.php.

References _makeIncludeHeader(), and PATH_typo3conf.

Referenced by typo3_loadExtensions().

01092                                                             {
01093          // Making cache files:
01094       $extensions['_CACHEFILE'] = $cacheFilePrefix;
01095       $cFiles=array();
01096       $cFiles['ext_localconf'].='<?php
01097 
01098 $TYPO3_LOADED_EXT = unserialize(stripslashes(\''.addslashes(serialize($extensions)).'\'));
01099 
01100 ?>';
01101 
01102       reset($extensions);
01103       while(list($key,$conf)=each($extensions)) {
01104          if (is_array($conf)) {
01105             if ($conf['ext_localconf.php'])  {
01106                $cFiles['ext_localconf'].=t3lib_extMgm::_makeIncludeHeader($key,$conf['ext_localconf.php']);
01107                $cFiles['ext_localconf'].=trim(t3lib_div::getUrl($conf['ext_localconf.php']));
01108             }
01109             if ($conf['ext_tables.php'])  {
01110                $cFiles['ext_tables'].=t3lib_extMgm::_makeIncludeHeader($key,$conf['ext_tables.php']);
01111                $cFiles['ext_tables'].=trim(t3lib_div::getUrl($conf['ext_tables.php']));
01112             }
01113          }
01114       }
01115 
01116       t3lib_div::writeFile(PATH_typo3conf.$cacheFilePrefix.'_ext_localconf.php',$cFiles['ext_localconf']);
01117       t3lib_div::writeFile(PATH_typo3conf.$cacheFilePrefix.'_ext_tables.php',$cFiles['ext_tables']);
01118 
01119       $extensions=array();
01120       $extensions['_CACHEFILE'] = $cacheFilePrefix;
01121 
01122       return $extensions;
01123    }


The documentation for this class was generated from the following file:
Generated on Sun Oct 3 01:06:55 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913