if ($user['username'] == $userId || $userId == null) { $userId = $user['id']; } } if (!is_array($projects)) { echo 'Unable to fetch the list of projects, is the server url / token correct?' . PHP_EOL; die(1); } //variables $trelloLists = array(); $trelloLabels = array(); //we will store all label names, but not add them immediately, only when used $trelloAttachments = array(); //create the project echo 'Creating project.' . PHP_EOL; $projectId = $client->createProject($trelloObj->name); $counter = 0; while (empty($projectId)) { $projectId = $client->createProject($trelloObj->name . $counter++); // die("We could not create the project, perhaps it already exists?".PHP_EOL); } //remove the columns created by default $columns = $client->getColumns($projectId); foreach ($columns as $column) { $client->removeColumn($column['id']); } //set the public/private status of the project if ($trelloObj->prefs->permissionLevel == "private") { echo "project is private" . PHP_EOL; // $client->updateProject(array('id' => $projectId, 'is_public' => false)); }