typo3 define PATH_site and read localconf.php


/ Published in: R
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if (!defined('PATH_thisScript')) 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']))));
  2.  
  3. $pos = strpos(PATH_thisScript, 'typo3conf');
  4.  
  5. if (!defined('PATH_site')) define('PATH_site', substr(PATH_thisScript, 0, $pos));
  6. if (!defined('PATH_t3lib')) define('PATH_t3lib', PATH_site.'t3lib/');
  7.  
  8. define('TYPO3_mainDir', 'typo3/'); // This is the directory of the backend administration for the sites of this TYPO3 installation.
  9. define('PATH_typo3', PATH_site.TYPO3_mainDir);
  10. define('PATH_typo3conf', PATH_site.'typo3conf/');
  11.  
  12. if (!@is_dir(PATH_typo3conf)) die('Cannot find configuration. This file is probably executed from the wrong location.');
  13.  
  14. require_once(PATH_t3lib.'class.t3lib_div.php');
  15. require_once(PATH_t3lib.'class.t3lib_extmgm.php');
  16.  
  17. require(PATH_typo3conf.'localconf.php');
  18.  
  19. define('TYPO3_db', $typo_db);
  20. define('TYPO3_db_username', $typo_db_username);
  21. define('TYPO3_db_password', $typo_db_password);
  22. define('TYPO3_db_host', $typo_db_host);
  23.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.