-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_db_info
executable file
·27 lines (23 loc) · 921 Bytes
/
get_db_info
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/php
<?php
$TYPO3_CONF_VARS = array();
$typo_db_username = 'xxx'; // Modified or inserted by TYPO3 Install Tool.
$typo_db_password = 'xxx'; // Modified or inserted by TYPO3 Install Tool.
$typo_db_host = 'xxx'; // Modified or inserted by TYPO3 Install Tool.
$typo_db = 'xxx';
if(!isset($argv[1])){
throw new Exception('You need to specify a site');
}
$site = $argv[1];
$sitesRoot = '/home/kristian'.DIRECTORY_SEPARATOR.'sites';
$siteDir = $sitesRoot.DIRECTORY_SEPARATOR.$site;
if(!is_link($siteDir)){
throw new Exception('The specified site "'.$site.'" does not exist in: '.$sitesRoot);
}
set_error_handler('myErrorHandler');
$localconfPath = $siteDir.DIRECTORY_SEPARATOR.'typo3conf'.DIRECTORY_SEPARATOR.'localconf.php';
include $localconfPath;
restore_error_handler();
echo "($typo_db_host $typo_db_username $typo_db_password $typo_db)";
function myErrorHandler($errno, $errstr, $errfile, $errline){
}