<?php
define('TYPO3_MODE','FE');
require('typo3conf/localconf.php');
require('t3lib/class.t3lib_db.php');
require('t3lib/class.t3lib_div.php');
define('TYPO3_db_host', $typo_db_host);
define('TYPO3_db_username', $typo_db_username);
define('TYPO3_db_password', $typo_db_password);
define('TYPO3_db', $typo_db);
define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
define('PATH_site', dirname(PATH_thisScript).'/');
$DB = new t3lib_DB();
$DB->connectDB();
...
问题:
在一个typo3自定义脚本中,我在上面看到了define()
,但实际上在整个脚本中,并没有使用那些常量,例如TYPO3_MOD
,TYPO3_db_host
......为什么将它们define()
放在脚本中?或者是typo3系统的要求,如果是这样,通常我们define()
应该在脚本中放入什么?