Updated file refresh_dblist.
Dieser Commit ist enthalten in:
Ursprung
a15ca02189
Commit
d9b5665f63
2 geänderte Dateien mit 658 neuen und 612 gelöschten Zeilen
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
|
@ -10,32 +10,28 @@ $verbose = true;
|
|||
* Build exclude array with configuration files that should be skipped
|
||||
*/
|
||||
$excludedConfigurationFiles = array(
|
||||
'mysqldumper',
|
||||
//add more excluded files via: 'configFileName',
|
||||
//'mysqldumper',
|
||||
//add more excluded files by adding their name
|
||||
);
|
||||
|
||||
$myNl = '<br />';
|
||||
$verbose = true;
|
||||
if (isset ($_SERVER['SESSIONNAME'])) {
|
||||
if (PHP_SAPI === 'cli' || empty($_SERVER['REMOTE_ADDR'])) {
|
||||
// called via cli - check verbose param
|
||||
$myNl = "\n";
|
||||
define('NEWLINE', "\n");
|
||||
$options = getopt('v::', array('verbose::'));
|
||||
if (isset($options['v'])) {
|
||||
$verbose = $options['v'];
|
||||
}
|
||||
if (isset($options['verbose'])) {
|
||||
$verbose = $options['verbose'];
|
||||
}
|
||||
$verbose = isset($options['verbose']) || isset($options['v']) ? true : false;
|
||||
} else {
|
||||
define('NEWLINE', '<br />');
|
||||
}
|
||||
|
||||
date_default_timezone_set('Europe/Berlin');
|
||||
define('APPLICATION_PATH', realpath(dirname(__FILE__)));
|
||||
define('APPLICATION_PATH', __DIR__);
|
||||
chdir(APPLICATION_PATH);
|
||||
include (APPLICATION_PATH . '/inc/functions.php');
|
||||
include (APPLICATION_PATH . '/inc/mysql.php');
|
||||
include ('language/en/lang.php');
|
||||
include(APPLICATION_PATH . '/inc/functions.php');
|
||||
include(APPLICATION_PATH . '/inc/mysql.php');
|
||||
include('language/en/lang.php');
|
||||
// load default configuration
|
||||
include ('work/config/mysqldumper.php');
|
||||
include('work/config/mysqldumper.php');
|
||||
GetLanguageArray();
|
||||
|
||||
$configFiles = get_config_filenames();
|
||||
|
@ -43,18 +39,26 @@ foreach ($configFiles as $configFile) {
|
|||
if (in_array($configFile, $excludedConfigurationFiles)) {
|
||||
continue;
|
||||
}
|
||||
if ($verbose) {
|
||||
echo 'Refreshing database list for configuration file: ' . $configFile . $myNl;
|
||||
}
|
||||
output('Refreshing database list for configuration file: ' . $configFile, $verbose);
|
||||
$config['config_file'] = $configFile;
|
||||
include ($config['paths']['config'] . $configFile . '.php');
|
||||
include($config['paths']['config'] . $configFile . '.php');
|
||||
$out = '';
|
||||
if (isset($config['dbconnection']) && is_resource($config['dbconnection'])) {
|
||||
mysql_close($config['dbconnection']);
|
||||
$config['dbconnection'] = false;
|
||||
}
|
||||
SetDefault();
|
||||
output($out, $verbose);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $message
|
||||
* @param boolean $verbose
|
||||
*/
|
||||
function output($message, $verbose)
|
||||
{
|
||||
if ($verbose) {
|
||||
echo str_replace("\n", $myNl, $out) . $myNl;
|
||||
$message = str_replace("\n", NEWLINE, $message);
|
||||
echo $message . NEWLINE;
|
||||
}
|
||||
}
|
Laden …
In neuem Issue referenzieren