diff --git a/composer.json b/composer.json index 0a073c4..4b7713e 100644 --- a/composer.json +++ b/composer.json @@ -30,8 +30,9 @@ "require": { "php": ">=8.0", "adhocore/jwt": "^1.1", - "utopia-php/framework": "0.*.*", - "utopia-php/cache": "^0.10.0" + "utopia-php/framework": "1.0.*", + "utopia-php/system": "0.8.*", + "utopia-php/cache": "0.10.*" }, "require-dev": { "phpunit/phpunit": "^9.4", diff --git a/composer.lock b/composer.lock index 00a57ff..3d7c288 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ca1f5655de669048785cdde30d95a93e", + "content-hash": "7ee10c0ef3f71a96b451afd3364211be", "packages": [ { "name": "adhocore/jwt", @@ -113,25 +113,75 @@ }, "time": "2024-06-25T20:36:35+00:00" }, + { + "name": "utopia-php/di", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/di.git", + "reference": "22490c95f7ac3898ed1c33f1b1b5dd577305ee31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/di/zipball/22490c95f7ac3898ed1c33f1b1b5dd577305ee31", + "reference": "22490c95f7ac3898ed1c33f1b1b5dd577305ee31", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "laravel/pint": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.25", + "swoole/ide-helper": "4.8.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\": "src/", + "Tests\\E2E\\": "tests/e2e" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A simple and lite library for managing dependency injections", + "keywords": [ + "framework", + "http", + "php", + "upf" + ], + "support": { + "issues": "https://github.com/utopia-php/di/issues", + "source": "https://github.com/utopia-php/di/tree/0.1.0" + }, + "time": "2024-08-08T14:35:19+00:00" + }, { "name": "utopia-php/framework", - "version": "0.34.3", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "e3bbca07c1df4e908ea9d3ce4f59367a7696b66b" + "reference": "cc880ec41f7f163d4f9956fec26cc6be51b412cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/e3bbca07c1df4e908ea9d3ce4f59367a7696b66b", - "reference": "e3bbca07c1df4e908ea9d3ce4f59367a7696b66b", + "url": "https://api.github.com/repos/utopia-php/http/zipball/cc880ec41f7f163d4f9956fec26cc6be51b412cf", + "reference": "cc880ec41f7f163d4f9956fec26cc6be51b412cf", "shasum": "" }, "require": { "ext-swoole": "*", - "php": ">=8.0" + "php": ">=8.0", + "utopia-php/servers": "0.1.*" }, "require-dev": { + "ext-xdebug": "*", "laravel/pint": "^1.2", "phpbench/phpbench": "^1.2", "phpstan/phpstan": "^1.10", @@ -141,8 +191,7 @@ "type": "library", "autoload": { "psr-4": { - "Utopia\\": "src/", - "Tests\\E2E\\": "tests/e2e" + "Utopia\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -158,9 +207,118 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/0.34.3" + "source": "https://github.com/utopia-php/http/tree/1.0.0" + }, + "time": "2024-09-05T15:38:08+00:00" + }, + { + "name": "utopia-php/servers", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/servers.git", + "reference": "7d9e4f364fb1ab1889fb89ca96eb9946467cb09c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/servers/zipball/7d9e4f364fb1ab1889fb89ca96eb9946467cb09c", + "reference": "7d9e4f364fb1ab1889fb89ca96eb9946467cb09c", + "shasum": "" + }, + "require": { + "php": ">=8.0", + "utopia-php/di": "0.1.*" + }, + "require-dev": { + "laravel/pint": "^0.2.3", + "phpstan/phpstan": "^1.8", + "phpunit/phpunit": "^9.5.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Servers\\": "src/Servers" + } }, - "time": "2024-07-02T15:08:46+00:00" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Team Appwrite", + "email": "team@appwrite.io" + } + ], + "description": "A base library for building Utopia style servers.", + "keywords": [ + "framework", + "php", + "servers", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/servers/issues", + "source": "https://github.com/utopia-php/servers/tree/0.1.0" + }, + "time": "2024-08-08T14:31:39+00:00" + }, + { + "name": "utopia-php/system", + "version": "0.8.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/system.git", + "reference": "a2cbfb3c69b9ecb8b6f06c5774f3cf279ea7665e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/system/zipball/a2cbfb3c69b9ecb8b6f06c5774f3cf279ea7665e", + "reference": "a2cbfb3c69b9ecb8b6f06c5774f3cf279ea7665e", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "require-dev": { + "laravel/pint": "1.13.*", + "phpstan/phpstan": "1.10.*", + "phpunit/phpunit": "9.6.*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\System\\": "src/System" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eldad Fux", + "email": "eldad@appwrite.io" + }, + { + "name": "Torsten Dittmann", + "email": "torsten@appwrite.io" + } + ], + "description": "A simple library for obtaining information about the host's system.", + "keywords": [ + "framework", + "php", + "system", + "upf", + "utopia" + ], + "support": { + "issues": "https://github.com/utopia-php/system/issues", + "source": "https://github.com/utopia-php/system/tree/0.8.0" + }, + "time": "2024-04-01T10:22:28+00:00" } ], "packages-dev": [ @@ -597,35 +755,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.31", + "version": "9.2.32", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", - "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.6" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -634,7 +792,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "9.2-dev" + "dev-main": "9.2.x-dev" } }, "autoload": { @@ -663,7 +821,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -671,7 +829,7 @@ "type": "github" } ], - "time": "2024-03-02T06:37:42+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", diff --git a/docker-compose.yml b/docker-compose.yml index bf60042..1698ec4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,3 @@ -version: '3.9' - services: tests: build: @@ -11,4 +9,4 @@ services: environment: - PRIVATE_KEY - APP_IDENTIFIER - - INSTALLATION_ID \ No newline at end of file + - INSTALLATION_ID diff --git a/tests/Detector/DetectorTest.php b/tests/Detector/DetectorTest.php index 2ac4826..7f3ae4e 100644 --- a/tests/Detector/DetectorTest.php +++ b/tests/Detector/DetectorTest.php @@ -3,7 +3,6 @@ namespace Utopia\Tests; use PHPUnit\Framework\TestCase; -use Utopia\Http\Http; use Utopia\Cache\Adapter\None; use Utopia\Cache\Cache; use Utopia\Detector\Adapter\Bun; @@ -18,6 +17,7 @@ use Utopia\Detector\Adapter\Ruby; use Utopia\Detector\Adapter\Swift; use Utopia\Detector\Detector; +use Utopia\System\System; use Utopia\VCS\Adapter\Git\GitHub; class DetectorTest extends TestCase @@ -53,9 +53,9 @@ public function detect($files, $languages): ?string public function setUp(): void { $this->github = new GitHub(new Cache(new None())); - $privateKey = Http::getEnv('PRIVATE_KEY') ?? ''; - $githubAppId = Http::getEnv('APP_IDENTIFIER') ?? ''; - $installationId = Http::getEnv('INSTALLATION_ID') ?? ''; + $privateKey = System::getEnv('PRIVATE_KEY') ?? ''; + $githubAppId = System::getEnv('APP_IDENTIFIER') ?? ''; + $installationId = System::getEnv('INSTALLATION_ID') ?? ''; $this->github->initializeVariables($installationId, $privateKey, $githubAppId); } diff --git a/tests/VCS/Adapter/GitHubTest.php b/tests/VCS/Adapter/GitHubTest.php index 9e8b4c9..b738145 100644 --- a/tests/VCS/Adapter/GitHubTest.php +++ b/tests/VCS/Adapter/GitHubTest.php @@ -2,9 +2,9 @@ namespace Utopia\Tests\VCS\Adapter; -use Utopia\Http\Http; use Utopia\Cache\Adapter\None; use Utopia\Cache\Cache; +use Utopia\System\System; use Utopia\Tests\Base; use Utopia\VCS\Adapter\Git; use Utopia\VCS\Adapter\Git\GitHub; @@ -19,9 +19,9 @@ protected function createVCSAdapter(): Git public function setUp(): void { $this->vcsAdapter = new GitHub(new Cache(new None())); - $privateKey = Http::getEnv('PRIVATE_KEY') ?? ''; - $githubAppId = Http::getEnv('APP_IDENTIFIER') ?? ''; - $installationId = Http::getEnv('INSTALLATION_ID') ?? ''; + $privateKey = System::getEnv('PRIVATE_KEY') ?? ''; + $githubAppId = System::getEnv('APP_IDENTIFIER') ?? ''; + $installationId = System::getEnv('INSTALLATION_ID') ?? ''; $this->vcsAdapter->initializeVariables($installationId, $privateKey, $githubAppId); } diff --git a/tests/VCS/Base.php b/tests/VCS/Base.php index b87413b..e31ef61 100644 --- a/tests/VCS/Base.php +++ b/tests/VCS/Base.php @@ -4,7 +4,7 @@ use Exception; use PHPUnit\Framework\TestCase; -use Utopia\Http\Http; +use Utopia\System\System; use Utopia\VCS\Adapter\Git; use Utopia\VCS\Adapter\Git\GitHub; @@ -44,7 +44,7 @@ public function testGetPullRequestFromBranch(): void public function testGetOwnerName(): void { - $installationId = Http::getEnv('INSTALLATION_ID') ?? ''; + $installationId = System::getEnv('INSTALLATION_ID') ?? ''; $owner = $this->vcsAdapter->getOwnerName($installationId); $this->assertEquals('test-kh', $owner); }