From ebf720e43cbfaa83ba6e781c6102f54f66b989de Mon Sep 17 00:00:00 2001 From: Robbieakoto Date: Wed, 21 Jun 2023 01:15:39 +0000 Subject: [PATCH] Fix environment setup issues --- .idea/.gitignore | 8 +++++ .idea/modules.xml | 8 +++++ .idea/php.xml | 6 ++++ .idea/storage-php.iml | 12 ++++++++ .idea/vcs.xml | 6 ++++ composer.json | 1 - src/Util/EnvSetup.php | 40 ------------------------- tests/integration/StorageBucketTest.php | 2 +- tests/integration/StorageFileTest.php | 2 +- 9 files changed, 42 insertions(+), 43 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/modules.xml create mode 100644 .idea/php.xml create mode 100644 .idea/storage-php.iml create mode 100644 .idea/vcs.xml delete mode 100644 src/Util/EnvSetup.php diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..741452d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000..0e09af4 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/storage-php.iml b/.idea/storage-php.iml new file mode 100644 index 0000000..a066156 --- /dev/null +++ b/.idea/storage-php.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/composer.json b/composer.json index f928865..a669bf8 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,6 @@ "keywords": ["supabase","storage", "storage-php"], "homepage": "https://github.com/supabase-community/storage-php", "autoload": { - "psr-0": { "": "src/" }, "psr-4": { "Supabase\\Storage\\": "src/" } diff --git a/src/Util/EnvSetup.php b/src/Util/EnvSetup.php deleted file mode 100644 index b9725b7..0000000 --- a/src/Util/EnvSetup.php +++ /dev/null @@ -1,40 +0,0 @@ -safeLoad(); - if (key_exists('API_KEY', $loaded)) { - $apiKey = $loaded['API_KEY']; - } - - if (key_exists('REFERENCE_ID', $loaded)) { - $refId = $loaded['REFERENCE_ID']; - } - } - - if (empty($apiKey)) { - throw new \Exception('Could not load API_KEY'); - } - - if (empty($refId)) { - throw new \Exception('Could not load REFERENCE_ID'); - } - - return [ - 'API_KEY' => $apiKey, - 'REFERENCE_ID' => $refId, - ]; - } -} diff --git a/tests/integration/StorageBucketTest.php b/tests/integration/StorageBucketTest.php index fbe56e9..85088c2 100644 --- a/tests/integration/StorageBucketTest.php +++ b/tests/integration/StorageBucketTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); use PHPUnit\Framework\TestCase; -use Supabase\Storage\Util\EnvSetup; +use Supabase\Common\EnvSetup; final class StorageBucketTest extends TestCase { diff --git a/tests/integration/StorageFileTest.php b/tests/integration/StorageFileTest.php index 2329cb0..ac825e0 100644 --- a/tests/integration/StorageFileTest.php +++ b/tests/integration/StorageFileTest.php @@ -3,7 +3,7 @@ declare(strict_types=1); use PHPUnit\Framework\TestCase; -use Supabase\Storage\Util\EnvSetup; +use Supabase\Common\EnvSetup; final class StorageFileTest extends TestCase {