From 736a8f89e41c7b275ec3f69a45eee16a345746e6 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Wed, 21 Jun 2023 21:19:49 +0100 Subject: [PATCH] Fix Firebase --- playground.php | 12 ++++++------ src/Transfer/Sources/Firebase.php | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/playground.php b/playground.php index 4b676c1..1576e61 100644 --- a/playground.php +++ b/playground.php @@ -31,12 +31,12 @@ // $_ENV['SOURCE_APPWRITE_TEST_KEY'] // ); -// $firebase = json_decode($_ENV['FIREBASE_TEST_ACCOUNT'], true); +$firebase = json_decode($_ENV['FIREBASE_TEST_ACCOUNT'], true); -// $sourceFirebase = new Firebase( -// $firebase, -// $firebase['project_id'] ?? '', -// ); +$sourceFirebase = new Firebase( + $firebase, + $firebase['project_id'] ?? '', +); // $sourceNHost = new NHost( // $_ENV['NHOST_TEST_SUBDOMAIN'] ?? '', @@ -71,7 +71,7 @@ * Initialise Transfer Class */ $transfer = new Transfer( - $sourceSupabase, + $sourceFirebase, $destinationLocal ); diff --git a/src/Transfer/Sources/Firebase.php b/src/Transfer/Sources/Firebase.php index c29bda7..c5a3f50 100644 --- a/src/Transfer/Sources/Firebase.php +++ b/src/Transfer/Sources/Firebase.php @@ -223,7 +223,7 @@ protected function exportGroupDatabases(int $batchSize, array $resources) private function exportDB(int $batchSize, bool $pushDocuments, Database $database) { - $baseURL = "https://firestore.googleapis.com/v1/{$this->projectID}/databases/(default)"; + $baseURL = "https://firestore.googleapis.com/v1/projects/{$this->projectID}/databases/(default)/documents"; $nextPageToken = null; $allCollections = [];