From 372b80ec4cd45ee5c89959cebffdaf6c1d2403e0 Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Wed, 3 Jan 2018 04:05:54 -0500 Subject: [PATCH] Write the domain CSV to a file --- getmemberships.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/getmemberships.php b/getmemberships.php index debe738..71b393f 100755 --- a/getmemberships.php +++ b/getmemberships.php @@ -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.