Skip to content

Instantly share code, notes, and snippets.

@giltotherescue
Created April 17, 2015 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giltotherescue/f6349fd6de55c1ba3f5a to your computer and use it in GitHub Desktop.
Save giltotherescue/f6349fd6de55c1ba3f5a to your computer and use it in GitHub Desktop.
function whitelist($parent, $whitelist = null) {
global $drive, $shared_folder;
if (!$whitelist) {
$whitelist = array($parent);
}
$search = $drive->search("'$parent' in parents");
foreach ($search->files as $file) {
if ($file->type == 'folder') {
$whitelist[] = $file->id;
$whitelist = whitelist($file->id, $whitelist);
}
}
return $whitelist;
}
$whitelist = whitelist($shared_folder);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment