Project

General

Profile

Bug #17427 » 5873.diff

Administrator Admin, 2010-03-13 09:46

View differences:

patch/t3lib/class.t3lib_extmgm.php 2010-03-13 09:43:47.000000000 +0100
}
/**
* Displays the last function calls before the error has occurred.
*/
public static function echoBacktrace () {
$backtrace = debug_backtrace();
echo '<strong>Backtrace:</strong><br />';
for ($i = 11; $i >= 0; --$i) {
if (is_array($backtrace[$i])) {
$file = file($backtrace[$i]['file']);
$out = htmlspecialchars($backtrace[$i]['file'].' : '.$backtrace[$i]['line']).'<br />';
echo $out;
}
}
}
/**
* 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
......
* @return string
*/
public static function extPath($key, $script = '') {
global $TYPO3_LOADED_EXT;
global $TYPO3_LOADED_EXT, $_EXTKEY;
if (!isset($TYPO3_LOADED_EXT[$key])) {
#debug(array(debug_backtrace()));
die('TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded! (t3lib_extMgm::extPath)');
self::echoBacktrace();
die('TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded for extension "' . $_EXTKEY .'"! (t3lib_extMgm::extPath)');
}
return PATH_site.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$script;
}
......
* @return string
*/
public static function extRelPath($key) {
global $TYPO3_LOADED_EXT;
global $TYPO3_LOADED_EXT, $_EXTKEY;
if (!isset($TYPO3_LOADED_EXT[$key])) {
die('TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded! (t3lib_extMgm::extRelPath)');
self::echoBacktrace();
die('TYPO3 Fatal Error: Extension key "'.$key.'" was NOT loaded for extension "' . $_EXTKEY .'"! (t3lib_extMgm::extRelPath)');
}
return $TYPO3_LOADED_EXT[$key]['typo3RelPath'];
}
(2-2/2)