#!/usr/bin/php <?php require_once 'phplib/Sag.php'; require_once 'functions.php'; require_once 'config.php'; // check while while ($stop == false) { while ($host == false) { foreach (explode(" ", $hosts) as $testhost) { $host = check_couchdb($testhost); if ($host) { break; } } if ($host) { continue; } do_log("No connect to cluster-db sleep now for next tray in (s):" . $testsleep); sleep($testsleep); } $sag = new Sag($host); $dbconfig = db_config(); print_r($dbconfig->default->fs_nodes); sleep(5); $host = false; }
function get_dbhost($hosts) { global $testsleep; while ($host == false) { foreach (explode(" ", $hosts) as $testhost) { $host = check_couchdb($testhost); if ($host) { break; } } if ($host) { continue; } show_debug("No connect to cluster-db sleep now for next tray in (s):" . $testsleep); sleep($testsleep); } return $host; }