// Set PHP memory limit depending on value of $TYPO3_CONF_VARS["SYS"]["setMemoryLimit"]
if (intval($TYPO3_CONF_VARS["SYS"]["setMemoryLimit"]) > 16) {
    @ini_set('memory_limit', intval($TYPO3_CONF_VARS["SYS"]["setMemoryLimit"]) . 'm');
}
// setting the request type so devs exactly know what type of request it is
define('TYPO3_REQUESTTYPE_FE', 1);
define('TYPO3_REQUESTTYPE_BE', 2);
define('TYPO3_REQUESTTYPE_CLI', 4);
define('TYPO3_REQUESTTYPE_AJAX', 8);
define('TYPO3_REQUESTTYPE_INSTALL', 16);
define('TYPO3_REQUESTTYPE', (TYPO3_MODE == 'FE' ? TYPO3_REQUESTTYPE_FE : 0) | (TYPO3_MODE == 'BE' ? TYPO3_REQUESTTYPE_BE : 0) | (defined('TYPO3_cliMode') && TYPO3_cliMode ? TYPO3_REQUESTTYPE_CLI : 0) | (defined('TYPO3_enterInstallScript') && TYPO3_enterInstallScript ? TYPO3_REQUESTTYPE_INSTALL : 0) | ($TYPO3_AJAX ? TYPO3_REQUESTTYPE_AJAX : 0));
// *********************
// Autoloader
// *********************
require_once PATH_t3lib . 'class.t3lib_autoloader.php';
t3lib_autoloader::registerAutoloader();
// Load extensions:
if (TYPO3_MODE == 'FE' && is_object($TT)) {
    $TT->push('Loading localconf.php extensions', '');
}
$TYPO3_LOADED_EXT = t3lib_extMgm::typo3_loadExtensions();
if ($TYPO3_LOADED_EXT['_CACHEFILE']) {
    require PATH_typo3conf . $TYPO3_LOADED_EXT['_CACHEFILE'] . '_ext_localconf.php';
} else {
    $temp_TYPO3_LOADED_EXT = $TYPO3_LOADED_EXT;
    foreach ($temp_TYPO3_LOADED_EXT as $_EXTKEY => $temp_lEDat) {
        if (is_array($temp_lEDat) && $temp_lEDat['ext_localconf.php']) {
            $_EXTCONF = $TYPO3_CONF_VARS['EXT']['extConf'][$_EXTKEY];
            require $temp_lEDat['ext_localconf.php'];
        }
    }
 /**
  * Try to load the entries for a given class name into the registry.
  *
  * First, figures out the extension the class belongs to.
  * Then, tries to load the ext_autoload.php file inside the extension directory, and adds its contents to the $classNameToFileMapping.
  *
  * @param	string	$className	Class Name
  */
 protected static function attemptToLoadRegistryForGivenClassName($className)
 {
     $classNameParts = explode('_', $className);
     $extensionPrefix = array_shift($classNameParts) . '_' . array_shift($classNameParts);
     $extensionKey = t3lib_extMgm::getExtensionKeyByPrefix($extensionPrefix);
     if (!$extensionKey || array_key_exists($extensionKey, self::$extensionHasAutoloadConfiguration)) {
         // extension key could not be determined or we already tried to load the extension's autoload configuration
         return;
     }
     $possibleAutoloadConfigurationFileName = t3lib_extMgm::extPath($extensionKey) . 'ext_autoload.php';
     if (file_exists($possibleAutoloadConfigurationFileName)) {
         self::$extensionHasAutoloadConfiguration[$extensionKey] = TRUE;
         $extensionClassNameToFileMapping = (require $possibleAutoloadConfigurationFileName);
         self::$classNameToFileMapping = array_merge($extensionClassNameToFileMapping, self::$classNameToFileMapping);
     } else {
         self::$extensionHasAutoloadConfiguration[$extensionKey] = FALSE;
     }
 }