Compare commits

...
Author SHA1 Message Date
Matej Bačo e3a039db49 Merge branch 'refactor-usage-sn' of github.com:appwrite/appwrite into refactor-usage-sn 2024-04-02 11:42:18 +02:00
Matej Bačo 7a25a3c529 Upgrade database lib for ZDT 2024-04-02 11:42:10 +02:00
Damodar LohaniandGitHub 76eacaf8e2 Merge pull request #7905 from appwrite/PEA-649-fix-storage-issue
PEA-649 storage do adapter http version
2024-04-02 14:37:43 +05:45
Damodar Lohani 026f5dde2d set http version to 1.1 for do spaces 2024-04-02 08:35:14 +00:00
Damodar Lohani 39da1b8028 composer update 2024-04-02 08:32:30 +00:00
Eldad A. FuxandGitHub f875c6aa70 Merge pull request #7884 from appwrite/refactor-var-dump
Remove var_dump calls
2024-04-01 20:11:49 +02:00
Eldad A. FuxandGitHub 532ed5b340 Merge pull request #7893 from appwrite/fix-oauth-error-code
Fix OAuth error code
2024-04-01 18:36:55 +02:00
Christy JacobandGitHub 4e08c6d02d Merge pull request #7882 from appwrite/feat-configurable-collections
Feat configurable collections
2024-04-01 21:35:47 +05:30
Khushboo Verma 75d8cc3327 Updated error code for OAuth error 2024-04-01 13:27:44 +05:30
Steven NguyenandGitHub 5ee5ffb288 refactor: remove var_dump calls 2024-03-29 21:24:05 +00:00
Christy Jacob f8c44c8a50 chore: linter 2024-03-29 10:18:33 +00:00
Matej Bačo 803ba6182c Update composer.lock 2024-03-29 10:48:31 +01:00
Matej Bačo 5275d0b021 Merge branch 'refactor-usage-sn' into feat-configurable-collections 2024-03-29 10:48:11 +01:00
Jake BarnbyandGitHub 3d53249335 Merge pull request #7877 from appwrite/refactor-usage-sn-45-8
Transaction and reconnection fixes
2024-03-29 00:54:28 +13:00
fogelito 5ff5c930a5 composer.lock 2024-03-28 13:32:54 +02:00
fogelito 5657e7d04e Bust database 45-8 2024-03-28 13:08:55 +02:00
Christy JacobandGitHub 9adf124274 Merge pull request #7854 from appwrite/feat-improve-vcs-comment-1
Update VCS Comment
2024-03-25 19:24:38 +05:30
Christy JacobandGitHub 20e82b1b8b Merge pull request #7777 from appwrite/fix-cloud-tests
Fix tests required for Cloud
2024-03-25 12:38:33 +05:30
Damodar LohaniandGitHub 7d68c12f1b Update init.php 2024-03-25 11:35:28 +05:45
Damodar LohaniandGitHub b3c2b54d09 Merge branch 'refactor-usage-sn' into fix-cloud-tests 2024-03-25 07:03:45 +05:45
Damodar LohaniandGitHub 061368fae0 Update init.php 2024-03-24 12:09:30 +05:45
Christy JacobandGitHub f2dbda10c0 Merge pull request #7852 from appwrite/fix-function-domain-permissions
Fix function domain permissions
2024-03-21 12:29:21 +05:30
Khushboo Verma fe4362c29f Update VCS Comment 2024-03-20 22:17:48 +05:30
Steven NguyenandGitHub 47f442b98e fix(functions): fix permissions for function domains
Execution via domain should be blocked if permissions does not contain
any and permissions does not contain guests.
2024-03-20 15:49:05 +00:00
Steven NguyenandGitHub ac397935a1 fix: remove escaping
It's done automatically when setting the params already.
2024-03-20 15:47:33 +00:00
Steven NguyenandGitHub fcfff2ab04 chore: remove dead code in error template 2024-03-20 15:46:42 +00:00
Matej Bačo 440d924518 Allow getCache override 2024-03-20 14:14:23 +01:00
Matej Bačo 2ae9d0b710 Make realtime resources configurable 2024-03-20 13:47:20 +01:00
Damodar Lohani 979f6ee150 Merge remote-tracking branch 'origin/refactor-usage-sn' into fix-cloud-tests 2024-03-18 09:41:43 +00:00
Damodar Lohani 17d85a478a fix event test dsn 2024-03-14 01:18:17 +00:00
Damodar LohaniandGitHub f356f13ee6 Merge branch 'refactor-usage-sn' into fix-cloud-tests 2024-03-13 11:20:12 +05:45
Damodar Lohani b409efc492 fix path 2024-03-10 08:01:10 +00:00
Damodar Lohani 57d7995e36 fix file path 2024-03-04 12:58:28 +00:00
Damodar Lohani 5e6f53d6aa reclaim pool 2024-03-04 12:50:49 +00:00
Damodar Lohani 5f4970befd fix path 2024-03-04 12:49:56 +00:00
Damodar Lohani 060ec455b3 fix 2024-03-04 12:44:40 +00:00
Damodar Lohani 86dc85f3a4 fix file path 2024-03-04 12:17:35 +00:00
Damodar Lohani 064ac2ccf8 fix dsn in event test 2024-03-04 11:15:45 +00:00
shimon 207811a224 usage updates 2024-02-13 19:26:23 +02:00
shimon 84e4748625 usage updates 2024-02-13 17:58:27 +02:00
shimon 7d38860d16 usage updates 2024-02-13 17:04:16 +02:00
shimon e1e5f5d96b usage updates 2024-02-13 16:27:01 +02:00
shimon 219b28e9bf usage updates 2024-02-13 16:08:40 +02:00
Matej Bačo abb1007385 Rework project creation 2024-02-07 12:04:46 +01:00
Matej Bačo a89b73d20b Fix bug 2024-02-07 10:48:02 +01:00
Matej Bačo d5216d5b14 Linter fix 2024-02-07 10:17:34 +01:00
Matej Bačo 939aec866e Add getProxyProjectDatabase hook 2024-02-07 10:16:17 +01:00
Matej Bačo a7e95588c6 Fix bug on ZDT 2024-02-06 16:08:42 +01:00
Matej Bačo 3a5c233b59 Fix bug 2024-02-06 11:47:43 +00:00
Matej Bačo 8154b4c131 Linter fix 2024-02-06 12:11:27 +01:00
Matej Bačo d4afe22396 Add ZDT migration support to project creation 2024-02-06 12:07:47 +01:00
14 changed files with 172 additions and 191 deletions
+1 -1
View File
@@ -639,7 +639,7 @@ return [
Exception::PROJECT_PROVIDER_UNSUPPORTED => [
'name' => Exception::PROJECT_PROVIDER_UNSUPPORTED,
'description' => 'The chosen OAuth provider is unsupported. Please check the <a href="/docs/client/account?sdk=web-default#accountCreateOAuth2Session">Create OAuth2 Session docs</a> for the complete list of supported OAuth providers.',
'code' => 501,
'code' => 400,
],
Exception::PROJECT_INVALID_SUCCESS_URL => [
'name' => Exception::PROJECT_INVALID_SUCCESS_URL,
+5 -1
View File
@@ -4,6 +4,7 @@ use Appwrite\Auth\Auth;
use Appwrite\Event\Delete;
use Appwrite\Event\Validator\Event;
use Appwrite\Extend\Exception;
use Appwrite\Hooks\Hooks;
use Appwrite\Network\Validator\Email;
use Appwrite\Network\Validator\Origin;
use Appwrite\Template\Template;
@@ -75,7 +76,8 @@ App::post('/v1/projects')
->inject('dbForConsole')
->inject('cache')
->inject('pools')
->action(function (string $projectId, string $name, string $teamId, string $region, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Response $response, Database $dbForConsole, Cache $cache, Group $pools) {
->inject('hooks')
->action(function (string $projectId, string $name, string $teamId, string $region, string $description, string $logo, string $url, string $legalName, string $legalCountry, string $legalState, string $legalCity, string $legalAddress, string $legalTaxId, Response $response, Database $dbForConsole, Cache $cache, Group $pools, Hooks $hooks) {
$team = $dbForConsole->getDocument('teams', $teamId);
@@ -217,6 +219,8 @@ App::post('/v1/projects')
$dbForProject->createCollection($key, $attributes, $indexes);
}
$hooks->trigger('afterProjectCreation', [ $project, $pools, $cache ]);
$response
->setStatusCode(Response::STATUS_CODE_CREATED)
->dynamic($project, Response::MODEL_PROJECT);
+1 -8
View File
@@ -167,7 +167,7 @@ function router(App $utopia, Database $dbForConsole, callable $getProjectDB, Swo
$permissions = $function->getAttribute('execute');
if (!(\in_array('any', $permissions)) && (\in_array('guests', $permissions))) {
if (!(\in_array('any', $permissions)) && !(\in_array('guests', $permissions))) {
throw new AppwriteException(AppwriteException::USER_UNAUTHORIZED, 'To execute function using domain, execute permissions must include "any" or "guests"');
}
@@ -820,31 +820,24 @@ App::error()
}
break;
case 'Utopia\Database\Exception\Conflict':
\var_dump('Wrapping conflict exception');
$error = new AppwriteException(AppwriteException::DOCUMENT_UPDATE_CONFLICT, previous: $error);
break;
case 'Utopia\Database\Exception\Timeout':
\var_dump('Wrapping timeout exception');
$error = new AppwriteException(AppwriteException::DATABASE_TIMEOUT, previous: $error);
break;
case 'Utopia\Database\Exception\Query':
\var_dump('Wrapping query exception');
$error = new AppwriteException(AppwriteException::GENERAL_QUERY_INVALID, $error->getMessage(), previous: $error);
break;
case 'Utopia\Database\Exception\Structure':
\var_dump('Wrapping structure exception');
$error = new AppwriteException(AppwriteException::DOCUMENT_INVALID_STRUCTURE, $error->getMessage(), previous: $error);
break;
case 'Utopia\Database\Exception\Duplicate':
\var_dump('Wrapping duplicate exception');
$error = new AppwriteException(AppwriteException::DOCUMENT_ALREADY_EXISTS);
break;
case 'Utopia\Database\Exception\Restricted':
\var_dump('Wrapping restricted exception');
$error = new AppwriteException(AppwriteException::DOCUMENT_DELETE_RESTRICTED);
break;
case 'Utopia\Database\Exception\Authorization':
\var_dump('Wrapping authorization exception');
$error = new AppwriteException(AppwriteException::USER_UNAUTHORIZED);
break;
}
+6 -2
View File
@@ -1266,7 +1266,9 @@ function getDevice($root): Device
case Storage::DEVICE_S3:
return new S3($root, $accessKey, $accessSecret, $bucket, $region, $acl);
case STORAGE::DEVICE_DO_SPACES:
return new DOSpaces($root, $accessKey, $accessSecret, $bucket, $region, $acl);
$device = new DOSpaces($root, $accessKey, $accessSecret, $bucket, $region, $acl);
$device->setHttpVersion(S3::HTTP_VERSION_1_1);
return $device;
case Storage::DEVICE_BACKBLAZE:
return new Backblaze($root, $accessKey, $accessSecret, $bucket, $region, $acl);
case Storage::DEVICE_LINODE:
@@ -1295,7 +1297,9 @@ function getDevice($root): Device
$doSpacesRegion = App::getEnv('_APP_STORAGE_DO_SPACES_REGION', '');
$doSpacesBucket = App::getEnv('_APP_STORAGE_DO_SPACES_BUCKET', '');
$doSpacesAcl = 'private';
return new DOSpaces($root, $doSpacesAccessKey, $doSpacesSecretKey, $doSpacesBucket, $doSpacesRegion, $doSpacesAcl);
$device = new DOSpaces($root, $doSpacesAccessKey, $doSpacesSecretKey, $doSpacesBucket, $doSpacesRegion, $doSpacesAcl);
$device->setHttpVersion(S3::HTTP_VERSION_1_1);
return $device;
case Storage::DEVICE_BACKBLAZE:
$backblazeAccessKey = App::getEnv('_APP_STORAGE_BACKBLAZE_ACCESS_KEY', '');
$backblazeSecretKey = App::getEnv('_APP_STORAGE_BACKBLAZE_SECRET', '');
+71 -62
View File
@@ -36,74 +36,83 @@ require_once __DIR__ . '/init.php';
Runtime::enableCoroutine(SWOOLE_HOOK_ALL);
function getConsoleDB(): Database
{
global $register;
// Allows overriding
if (!function_exists("getConsoleDB")) {
function getConsoleDB(): Database
{
global $register;
/** @var \Utopia\Pools\Group $pools */
$pools = $register->get('pools');
/** @var \Utopia\Pools\Group $pools */
$pools = $register->get('pools');
$dbAdapter = $pools
->get('console')
->pop()
->getResource()
;
$database = new Database($dbAdapter, getCache());
$database
->setNamespace('_console')
->setMetadata('host', \gethostname())
->setMetadata('project', '_console');
return $database;
}
function getProjectDB(Document $project): Database
{
global $register;
/** @var \Utopia\Pools\Group $pools */
$pools = $register->get('pools');
if ($project->isEmpty() || $project->getId() === 'console') {
return getConsoleDB();
}
$dbAdapter = $pools
->get($project->getAttribute('database'))
->pop()
->getResource()
;
$database = new Database($dbAdapter, getCache());
$database
->setNamespace('_' . $project->getInternalId())
->setMetadata('host', \gethostname())
->setMetadata('project', $project->getId());
return $database;
}
function getCache(): Cache
{
global $register;
$pools = $register->get('pools'); /** @var \Utopia\Pools\Group $pools */
$list = Config::getParam('pools-cache', []);
$adapters = [];
foreach ($list as $value) {
$adapters[] = $pools
->get($value)
$dbAdapter = $pools
->get('console')
->pop()
->getResource()
;
}
return new Cache(new Sharding($adapters));
$database = new Database($dbAdapter, getCache());
$database
->setNamespace('_console')
->setMetadata('host', \gethostname())
->setMetadata('project', '_console');
return $database;
}
}
// Allows overriding
if (!function_exists("getProjectDB")) {
function getProjectDB(Document $project): Database
{
global $register;
/** @var \Utopia\Pools\Group $pools */
$pools = $register->get('pools');
if ($project->isEmpty() || $project->getId() === 'console') {
return getConsoleDB();
}
$dbAdapter = $pools
->get($project->getAttribute('database'))
->pop()
->getResource()
;
$database = new Database($dbAdapter, getCache());
$database
->setNamespace('_' . $project->getInternalId())
->setMetadata('host', \gethostname())
->setMetadata('project', $project->getId());
return $database;
}
}
// Allows overriding
if (!function_exists("getCache")) {
function getCache(): Cache
{
global $register;
$pools = $register->get('pools'); /** @var \Utopia\Pools\Group $pools */
$list = Config::getParam('pools-cache', []);
$adapters = [];
foreach ($list as $value) {
$adapters[] = $pools
->get($value)
->pop()
->getResource()
;
}
return new Cache(new Sharding($adapters));
}
}
$realtime = new Realtime();
+4 -43
View File
@@ -59,7 +59,7 @@ $title = $this->getParam('title', '')
<link rel="stylesheet" href="/fonts/main.css" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="content-security-policy" content="">
<title><?php echo $this->print($title, self::FILTER_ESCAPE); ?></title>
<title><?php echo $this->print($title); ?></title>
<style>
@media(min-width:768px) {
@@ -74,11 +74,11 @@ $title = $this->getParam('title', '')
<div class="container u-margin-block-start-24">
<article class="card u-padding-16">
<div class="u-flex u-flex-vertical u-gap-16">
<h1 class="heading-level-4 u-trim-1">Error <?php echo $this->print($code, self::FILTER_ESCAPE); ?></h1>
<p class="text"><?php echo $this->print($message, self::FILTER_ESCAPE); ?></p>
<h1 class="heading-level-4 u-trim-1">Error <?php echo $this->print($code); ?></h1>
<p class="text"><?php echo $this->print($message); ?></p>
<div class="u-flex u-flex-vertical u-gap-8">
<p class="text">Type</p>
<p><code class="inline-code"><?php echo $this->print($type, self::FILTER_ESCAPE); ?></code></p>
<p><code class="inline-code"><?php echo $this->print($type); ?></code></p>
</div>
<?php if ($development) : ?>
<h2 class="heading-level-5 u-trim-1">Error Trace</h2>
@@ -111,45 +111,6 @@ $title = $this->getParam('title', '')
</div>
</article>
</div>
<!--section>
<h1>Error <?php echo $this->print($code, self::FILTER_ESCAPE); ?></h1>
<p><?php echo $this->print($message, self::FILTER_ESCAPE); ?></p>
<small>Error ID: <?php echo $this->print($errorID, self::FILTER_ESCAPE); ?></small>
<?php if (!empty($projectURL)) : ?>
<hr />
<p><a href="<?php echo $this->print($projectURL, self::FILTER_ESCAPE); ?>" rel="noopener">Back to <?php echo $this->print($projectName, self::FILTER_ESCAPE); ?></a></p>
<?php endif; ?>
<?php if ($development) : ?>
<div>
<h2>Error Trace</h2>
<?php foreach ($trace as $log) : ?>
<table>
<?php foreach ($log as $key => $value) : ?>
<tr>
<td style="width: 120px"><?php echo $this->print($key, self::FILTER_ESCAPE); ?></td>
<td>
<?php if (is_array($value)) : ?>
<?php echo $this->print(var_export($value, true), self::FILTER_ESCAPE); ?>
<?php else : ?>
<?php echo $this->print($value, self::FILTER_ESCAPE); ?>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section-->
<script type="text/javascript">
const app = (JSON.parse(localStorage.getItem('appwrite')) ?? {});
const theme = app.theme ?? 'auto';
+1 -1
View File
@@ -50,7 +50,7 @@
"utopia-php/cache": "0.9.*",
"utopia-php/cli": "0.15.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "0.45.7",
"utopia-php/database": "0.45.*",
"utopia-php/domains": "0.5.*",
"utopia-php/dsn": "0.1.*",
"utopia-php/framework": "0.33.*",
Generated
+48 -48
View File
@@ -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": "95d4c9ccd4b2f958ca247d83b04d1391",
"content-hash": "bbf819232382a6aeabe9d763844c3188",
"packages": [
{
"name": "adhocore/jwt",
@@ -156,15 +156,15 @@
},
{
"name": "appwrite/php-runtimes",
"version": "0.13.3",
"version": "0.13.5",
"source": {
"type": "git",
"url": "https://github.com/appwrite/runtimes.git",
"reference": "5d93fc578a9a543bcdc9b2c0562d80a51d56c73d"
"reference": "ba24c3a163f1a1da6cd355db92def508d05e59f7"
},
"require": {
"php": ">=8.0",
"utopia-php/system": "0.7.*"
"utopia-php/system": "0.8.*"
},
"require-dev": {
"phpunit/phpunit": "^9.3",
@@ -195,7 +195,7 @@
"php",
"runtimes"
],
"time": "2024-03-01T14:47:47+00:00"
"time": "2024-04-01T10:35:02+00:00"
},
{
"name": "chillerlan/php-qrcode",
@@ -1041,16 +1041,16 @@
},
{
"name": "utopia-php/cache",
"version": "0.9.0",
"version": "0.9.1",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/cache.git",
"reference": "4fc7b4789b5f0ce74835c1ecfec4f3afe6f0e34e"
"reference": "552b4c554bb14d0c529631ce304cdf4a2b9d06a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/cache/zipball/4fc7b4789b5f0ce74835c1ecfec4f3afe6f0e34e",
"reference": "4fc7b4789b5f0ce74835c1ecfec4f3afe6f0e34e",
"url": "https://api.github.com/repos/utopia-php/cache/zipball/552b4c554bb14d0c529631ce304cdf4a2b9d06a6",
"reference": "552b4c554bb14d0c529631ce304cdf4a2b9d06a6",
"shasum": ""
},
"require": {
@@ -1085,9 +1085,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/cache/issues",
"source": "https://github.com/utopia-php/cache/tree/0.9.0"
"source": "https://github.com/utopia-php/cache/tree/0.9.1"
},
"time": "2024-01-07T18:11:23+00:00"
"time": "2024-03-19T17:07:20+00:00"
},
{
"name": "utopia-php/cli",
@@ -1191,16 +1191,16 @@
},
{
"name": "utopia-php/database",
"version": "0.45.7",
"version": "0.45.9",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "3ffcc226cbc5b8747cdc5d6b06ce887cdffee8e1"
"reference": "e43e4b42f2a43e56dcfdc99ca527dfc885ca0667"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/3ffcc226cbc5b8747cdc5d6b06ce887cdffee8e1",
"reference": "3ffcc226cbc5b8747cdc5d6b06ce887cdffee8e1",
"url": "https://api.github.com/repos/utopia-php/database/zipball/e43e4b42f2a43e56dcfdc99ca527dfc885ca0667",
"reference": "e43e4b42f2a43e56dcfdc99ca527dfc885ca0667",
"shasum": ""
},
"require": {
@@ -1208,7 +1208,7 @@
"ext-pdo": "*",
"php": ">=8.0",
"utopia-php/cache": "0.9.*",
"utopia-php/framework": "0.*.*",
"utopia-php/framework": "0.33.*",
"utopia-php/mongo": "0.3.*"
},
"require-dev": {
@@ -1241,9 +1241,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/0.45.7"
"source": "https://github.com/utopia-php/database/tree/0.45.9"
},
"time": "2024-03-13T18:03:15+00:00"
"time": "2024-04-02T09:22:05+00:00"
},
{
"name": "utopia-php/domains",
@@ -1393,16 +1393,16 @@
},
{
"name": "utopia-php/framework",
"version": "0.33.3",
"version": "0.33.6",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/http.git",
"reference": "893d602cd96676810c25fc9b9a2e9360eebb898f"
"reference": "8fe57da0cecd57e3b17cd395b4a666a24f4c07a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/http/zipball/893d602cd96676810c25fc9b9a2e9360eebb898f",
"reference": "893d602cd96676810c25fc9b9a2e9360eebb898f",
"url": "https://api.github.com/repos/utopia-php/http/zipball/8fe57da0cecd57e3b17cd395b4a666a24f4c07a6",
"reference": "8fe57da0cecd57e3b17cd395b4a666a24f4c07a6",
"shasum": ""
},
"require": {
@@ -1432,9 +1432,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/http/issues",
"source": "https://github.com/utopia-php/http/tree/0.33.3"
"source": "https://github.com/utopia-php/http/tree/0.33.6"
},
"time": "2024-03-11T13:43:23+00:00"
"time": "2024-03-21T18:10:57+00:00"
},
{
"name": "utopia-php/image",
@@ -2062,16 +2062,16 @@
},
{
"name": "utopia-php/storage",
"version": "0.18.3",
"version": "0.18.4",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/storage.git",
"reference": "faa0279519ac14f3501e8b138e0865ad9d12bff6"
"reference": "94ab8758fabcefee5c5fa723616e45719833f922"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/storage/zipball/faa0279519ac14f3501e8b138e0865ad9d12bff6",
"reference": "faa0279519ac14f3501e8b138e0865ad9d12bff6",
"url": "https://api.github.com/repos/utopia-php/storage/zipball/94ab8758fabcefee5c5fa723616e45719833f922",
"reference": "94ab8758fabcefee5c5fa723616e45719833f922",
"shasum": ""
},
"require": {
@@ -2111,9 +2111,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/storage/issues",
"source": "https://github.com/utopia-php/storage/tree/0.18.3"
"source": "https://github.com/utopia-php/storage/tree/0.18.4"
},
"time": "2023-12-31T11:45:12+00:00"
"time": "2024-04-02T08:24:09+00:00"
},
{
"name": "utopia-php/swoole",
@@ -2168,16 +2168,16 @@
},
{
"name": "utopia-php/system",
"version": "0.7.2",
"version": "0.8.0",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/system.git",
"reference": "4593d4d334b0c15879c4744a826e0362924c5d66"
"reference": "a2cbfb3c69b9ecb8b6f06c5774f3cf279ea7665e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/system/zipball/4593d4d334b0c15879c4744a826e0362924c5d66",
"reference": "4593d4d334b0c15879c4744a826e0362924c5d66",
"url": "https://api.github.com/repos/utopia-php/system/zipball/a2cbfb3c69b9ecb8b6f06c5774f3cf279ea7665e",
"reference": "a2cbfb3c69b9ecb8b6f06c5774f3cf279ea7665e",
"shasum": ""
},
"require": {
@@ -2218,9 +2218,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/system/issues",
"source": "https://github.com/utopia-php/system/tree/0.7.2"
"source": "https://github.com/utopia-php/system/tree/0.8.0"
},
"time": "2023-10-20T01:39:17+00:00"
"time": "2024-04-01T10:22:28+00:00"
},
{
"name": "utopia-php/vcs",
@@ -3220,16 +3220,16 @@
},
{
"name": "phpstan/phpdoc-parser",
"version": "1.26.0",
"version": "1.27.0",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "231e3186624c03d7e7c890ec662b81e6b0405227"
"reference": "86e4d5a4b036f8f0be1464522f4c6b584c452757"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/231e3186624c03d7e7c890ec662b81e6b0405227",
"reference": "231e3186624c03d7e7c890ec662b81e6b0405227",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/86e4d5a4b036f8f0be1464522f4c6b584c452757",
"reference": "86e4d5a4b036f8f0be1464522f4c6b584c452757",
"shasum": ""
},
"require": {
@@ -3261,9 +3261,9 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.26.0"
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.27.0"
},
"time": "2024-02-23T16:05:55+00:00"
"time": "2024-03-21T13:14:53+00:00"
},
{
"name": "phpunit/php-code-coverage",
@@ -4702,16 +4702,16 @@
},
{
"name": "squizlabs/php_codesniffer",
"version": "3.9.0",
"version": "3.9.1",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
"reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b"
"reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b",
"reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b",
"url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/267a4405fff1d9c847134db3a3c92f1ab7f77909",
"reference": "267a4405fff1d9c847134db3a3c92f1ab7f77909",
"shasum": ""
},
"require": {
@@ -4778,7 +4778,7 @@
"type": "open_collective"
}
],
"time": "2024-02-16T15:06:51+00:00"
"time": "2024-03-31T21:03:09+00:00"
},
{
"name": "swoole/ide-helper",
@@ -5169,5 +5169,5 @@
"platform-overrides": {
"php": "8.0"
},
"plugin-api-version": "2.6.0"
"plugin-api-version": "2.3.0"
}
+5 -2
View File
@@ -16,11 +16,14 @@ class Hooks
/**
* @param mixed[] $params
* @return mixed
*/
public function trigger(string $name, array $params = [])
public function trigger(string $name, array $params = []): mixed
{
if (isset(self::$hooks[$name])) {
call_user_func_array(self::$hooks[$name], $params);
return call_user_func_array(self::$hooks[$name], $params);
}
return null;
}
}
+19 -12
View File
@@ -2,8 +2,8 @@
namespace Appwrite\Vcs;
use Utopia\Database\Document;
use Utopia\App;
use Utopia\Database\Document;
class Comment
{
@@ -65,18 +65,23 @@ class Comment
];
}
//TODO: Update link to documentation
$text .= "**Your function has been automatically deployed.** Learn more about Appwrite [Function Deployments](https://appwrite.io/docs/functions).\n\n";
foreach ($projects as $projectId => $project) {
$text .= "**{$project['name']}** `{$projectId}`\n\n";
$text .= "| Function | ID | Status | Action |\n";
$text .= "| :- | :- | :- | :- |\n";
$protocol = App::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
$hostname = App::getEnv('_APP_DOMAIN');
foreach ($project['functions'] as $functionId => $function) {
if ($function['status'] === 'waiting' || $function['status'] === 'processing' || $function['status'] === 'building') {
$text .= "**Your function deployment is in progress. Please check back in a few minutes for the updated status.**\n\n";
} elseif ($function['status'] === 'ready') {
$text .= "**Your function has been successfully deployed.**\n\n";
} else {
$text .= "**Your function deployment has failed. Please check the logs for more details and retry.**\n\n";
}
$text .= "Project name: **{$project['name']}** \nProject ID: `{$projectId}`\n\n";
$text .= "| Function | ID | Status | Action |\n";
$text .= "| :- | :- | :- | :- |\n";
$protocol = App::getEnv('_APP_OPTIONS_FORCE_HTTPS') == 'disabled' ? 'http' : 'https';
$hostname = App::getEnv('_APP_DOMAIN');
$generateImage = function (string $status) use ($protocol, $hostname) {
$extention = $status === 'building' ? 'gif' : 'png';
$imagesUrl = $protocol . '://' . $hostname . '/images/vcs/';
@@ -104,7 +109,9 @@ class Comment
$text .= "\n\n";
}
//TODO: Update did you know section
$functionUrl = $protocol . '://' . $hostname . '/console/project-' . $projectId . '/functions/function-' . $functionId;
$text .= "Only deployments on the production branch are activated automatically. If you'd like to activate this deployment, navigate to [your deployments]($functionUrl). Learn more about Appwrite [Function deployments](https://appwrite.io/docs/functions).\n\n";
$tip = $this->tips[array_rand($this->tips)];
$text .= "> **💡 Did you know?** \n " . $tip . "\n\n";
@@ -4266,7 +4266,7 @@ trait DatabasesBase
], $this->getHeaders()), [
'documentId' => ID::unique(),
'data' => [
'longtext' => file_get_contents('tests/resources/longtext.txt'),
'longtext' => file_get_contents(__DIR__ . '/../../../resources/longtext.txt'),
],
'permissions' => [
Permission::read(Role::user($this->getUser()['$id'])),
+3 -3
View File
@@ -227,9 +227,9 @@ trait LocaleBase
/**
* Test for SUCCESS
*/
$languages = require('app/config/locale/codes.php');
$defaultCountries = require('app/config/locale/countries.php');
$defaultContinents = require('app/config/locale/continents.php');
$languages = require(__DIR__ . '/../../../../app/config/locale/codes.php');
$defaultCountries = require(__DIR__ . '/../../../../app/config/locale/countries.php');
$defaultContinents = require(__DIR__ . '/../../../../app/config/locale/continents.php');
foreach ($languages as $lang) {
$response = $this->client->call(Client::METHOD_GET, '/locale/countries', [
@@ -798,7 +798,7 @@ class ProjectsConsoleClientTest extends Scope
public function testUpdateProjectOAuth($data): array
{
$id = $data['projectId'] ?? '';
$providers = require('app/config/providers.php');
$providers = require(__DIR__ . '/../../../../app/config/providers.php');
/**
* Test for SUCCESS
@@ -909,7 +909,7 @@ class ProjectsConsoleClientTest extends Scope
public function testUpdateProjectAuthStatus($data): array
{
$id = $data['projectId'] ?? '';
$auth = require('app/config/auth.php');
$auth = require(__DIR__ . '/../../../../app/config/auth.php');
$originalEmail = uniqid() . 'user@localhost.test';
$originalPassword = 'password';
@@ -1732,7 +1732,7 @@ class ProjectsConsoleClientTest extends Scope
$this->assertNotEmpty($project['body']['$id']);
$id = $project['body']['$id'];
$services = require('app/config/services.php');
$services = require(__DIR__ . '/../../../../app/config/services.php');
/**
* Test for Disabled
@@ -1806,7 +1806,7 @@ class ProjectsConsoleClientTest extends Scope
{
$id = $data['projectId'];
$services = require('app/config/services.php');
$services = require(__DIR__ . '/../../../../app/config/services.php');
/**
* Test for Disabled
@@ -1880,7 +1880,7 @@ class ProjectsConsoleClientTest extends Scope
{
$id = $data['projectId'];
$services = require('app/config/services.php');
$services = require(__DIR__ . '/../../../../app/config/services.php');
/**
* Test for Disabled
+2 -2
View File
@@ -28,9 +28,9 @@ class EventTest extends TestCase
'pass' => App::getEnv('_APP_REDIS_PASS', ''),
]);
$dsn = App::getEnv('_APP_CONNECTIONS_QUEUE', $fallbackForRedis);
$dsn = App::getEnv('_APP_CONNECTIONS_QUEUE', 'redis=' . $fallbackForRedis);
$dsn = explode('=', $dsn);
$dsn = $dsn[0] ?? '';
$dsn = $dsn[1] ?? '';
$dsn = new DSN($dsn);
$connection = new Queue\Connection\Redis($dsn->getHost(), $dsn->getPort());
$this->queue = 'v1-tests' . uniqid();