Write the domain CSV to a file

This commit is contained in:
Jon Goldberg 2018-01-03 04:05:54 -05:00
parent 409aa13291
commit 372b80ec4c
1 changed files with 11 additions and 3 deletions

View File

@ -9,11 +9,19 @@ $limit = 100;
$offset = 0;
list($projectsById, $projectsByDomain) = getProjectList($limit, $offset, $client);
writeDomains($projectsByDomain);
$userList = getUserList($limit, $offset, $client);
$membershipMapping = getUserMemberships($userList, $client);
//print_r($projectsById);
//print_r($projectsByDomain);
//print_r($membershipMapping);
print_r($projectsById);
print_r($membershipMapping);
function writeDomains($projectsByDomain) {
$domainHandle = fopen('./data/domainmap.csv', 'w');
foreach ($projectsByDomain as $domain => $identifier) {
fwrite ($domainHandle, "$domain,$identifier\n");
}
fclose($domainHandle);
}
function getProjectList($limit, $offset, $client) {
// We'll set a more realistic total user count after the first loop.