[TYPO3] 404 page handler extension: error in external php script
Daniel
daniel.rampanelli at gmail.com
Mon Jun 26 12:09:44 CEST 2006
Hi to all,
I'm trying to get the 404 page handler extension working, but without
success. I've configured all like in the docs, but I still have an
annoying problem in the script '404page_not_found.php'.
This php-script does only call the pageNotFoundHandler of the current
domain. I get the following error:
Fatal error: Call to a member function on a non-object in
/typo3_src-3.8.0/typo3/sysext/cms/tslib/class.tslib_fe.php on line 413
Browsing in the source, I figured out that this problem is caused by
the variable $GLOBAL['TYPO3_DB'] not being defined.
Here is the (shorted version) source of that script:
<snippet>
error_reporting (E_ALL ^ E_NOTICE);
$TYPO3_MISC['microtime_start'] = microtime();
define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
define('TYPO3_MODE','FE');
define('PATH_thisScript',str_replace('//','/', str_replace('\\','/',
php_sapi_name()=='cgi'||php_sapi_name()=='isapi' ?
$HTTP_SERVER_VARS['PATH_TRANSLATED']:$HTTP_SERVER_VARS['SCRIPT_FILENAME'])));
define('PATH_site', dirname(PATH_thisScript).'/');
define('PATH_t3lib', PATH_site.'t3lib/');
define('PATH_tslib', PATH_site.'tslib/');
define('PATH_typo3conf', PATH_site.'typo3conf/');
define('TYPO3_mainDir', 'typo3/');
if (!@is_dir(PATH_typo3conf)) die('Cannot find configuration. This
file is probably executed from the wrong location.');
require_once(PATH_t3lib.'class.t3lib_timetrack.php');
$TT = new t3lib_timeTrack;
$TT->start();
$TT->push('','Script start');
require(PATH_t3lib.'class.t3lib_div.php');
require(PATH_t3lib.'class.t3lib_extmgm.php');
require(PATH_t3lib.'config_default.php');
if (!defined ('TYPO3_db')) die ('The configuration file was not included.');
if (!t3lib_extMgm::isLoaded('cms')) die('<strong>Error:</strong> The
main frontend extension "cms" was not loaded. Enable it in the
extension manager in the backend.');
$CLIENT=t3lib_div::clientInfo();
require_once(PATH_tslib.'class.tslib_fe.php');
require_once(PATH_t3lib.'class.t3lib_page.php');
require_once(PATH_t3lib.'class.t3lib_userauth.php');
require_once(PATH_tslib.'class.tslib_feuserauth.php');
require_once(PATH_t3lib.'class.t3lib_tstemplate.php');
require_once(PATH_t3lib.'class.t3lib_cs.php');
$temp_TSFEclassName=t3lib_div::makeInstanceClassName('tslib_fe');
$TSFE = new $temp_TSFEclassName(
$TYPO3_CONF_VARS,
t3lib_div::GPvar('id'),
t3lib_div::GPvar('type'),
t3lib_div::GPvar('no_cache'),
t3lib_div::GPvar('cHash'),
t3lib_div::GPvar('jumpurl'),
t3lib_div::GPvar('MP'),
t3lib_div::GPvar('RDCT')
);
$TSFE->connectToDB();
$TSFE->pageNotFoundHandler ();
</snippet>
More information about the TYPO3-english
mailing list