Spaces:
Sleeping
Sleeping
File size: 900 Bytes
07c3cdd | 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 28 29 30 31 32 33 | <?php
function cliListIds($command, $args)
{
CLI::logging("list-ids INIT\n");
$workspaces = get_workspaces_from_args($command);
foreach ($workspaces as $index => $workspace) {
$hostPort1 = explode(":", $workspace->dbInfo['DB_HOST']);
$hostPort = $hostPort1[0] . (isset($hostPort[1]) ? ";port=" . $hostPort[1] : "");
$connectionString = sprintf(
"%s:host=%s;dbname=%s",
$workspace->dbInfo['DB_ADAPTER'],
$hostPort,
$workspace->dbInfo['DB_NAME']
);
$dbh = new PDO(
$connectionString,
$workspace->dbInfo['DB_USER'],
$workspace->dbInfo['DB_PASS']
);
foreach (WorkspaceTools::$populateIdsQueries as $query) {
echo ".";
$dbh->query($query);
}
echo "\n";
}
//Done
CLI::logging("list-ids DONE\n");
}
|