Impove cawangan debug connection commands
This commit is contained in:
@@ -73,15 +73,26 @@ class CawanganDebugConnections extends Command
|
|||||||
$idToNameMap[$item['mysql']] = $item['db_name'];
|
$idToNameMap[$item['mysql']] = $item['db_name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tested_connection = '';
|
||||||
|
try {
|
||||||
$filteredArray2 = array_filter($array2, function ($item) use ($idToNameMap) {
|
$filteredArray2 = array_filter($array2, function ($item) use ($idToNameMap) {
|
||||||
|
$tested_connection = $idToNameMap[$item['mysql']];
|
||||||
return $idToNameMap[$item['mysql']] !== $item['database'];
|
return $idToNameMap[$item['mysql']] !== $item['database'];
|
||||||
});
|
});
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
dump(sprintf('Connection %s not found in table online_arrahn.arrahn_master_db but present in config. Make sure both of connection exist in both app/config and arrahn_master_db', $tested_connection));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
return $filteredArray2;
|
return $filteredArray2;
|
||||||
}
|
}
|
||||||
|
|
||||||
$filteredConnections = filterArraysByDatabaseNames($all_cawangan, $all_cawangan_in_config);
|
$filteredConnections = filterArraysByDatabaseNames($all_cawangan, $all_cawangan_in_config);
|
||||||
|
|
||||||
|
if($filteredConnections === null OR sizeof($filteredConnections) > 1){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$isOK = true;
|
$isOK = true;
|
||||||
|
|
||||||
// checks if there is connection errors
|
// checks if there is connection errors
|
||||||
|
|||||||
Reference in New Issue
Block a user