mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Compare commits
51
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e3a039db49 | ||
|
|
7a25a3c529 | ||
|
|
76eacaf8e2 | ||
|
|
026f5dde2d | ||
|
|
39da1b8028 | ||
|
|
f875c6aa70 | ||
|
|
532ed5b340 | ||
|
|
4e08c6d02d | ||
|
|
75d8cc3327 | ||
|
|
5ee5ffb288 | ||
|
|
f8c44c8a50 | ||
|
|
803ba6182c | ||
|
|
5275d0b021 | ||
|
|
3d53249335 | ||
|
|
5ff5c930a5 | ||
|
|
5657e7d04e | ||
|
|
9adf124274 | ||
|
|
20e82b1b8b | ||
|
|
7d68c12f1b | ||
|
|
b3c2b54d09 | ||
|
|
061368fae0 | ||
|
|
f2dbda10c0 | ||
|
|
fe4362c29f | ||
|
|
47f442b98e | ||
|
|
ac397935a1 | ||
|
|
fcfff2ab04 | ||
|
|
440d924518 | ||
|
|
2ae9d0b710 | ||
|
|
979f6ee150 | ||
|
|
17d85a478a | ||
|
|
f356f13ee6 | ||
|
|
b409efc492 | ||
|
|
57d7995e36 | ||
|
|
5e6f53d6aa | ||
|
|
5f4970befd | ||
|
|
060ec455b3 | ||
|
|
86dc85f3a4 | ||
|
|
064ac2ccf8 | ||
|
|
207811a224 | ||
|
|
84e4748625 | ||
|
|
7d38860d16 | ||
|
|
e1e5f5d96b | ||
|
|
219b28e9bf | ||
|
|
abb1007385 | ||
|
|
a89b73d20b | ||
|
|
d5216d5b14 | ||
|
|
939aec866e | ||
|
|
a7e95588c6 | ||
|
|
3a5c233b59 | ||
|
|
8154b4c131 | ||
|
|
d4afe22396 |
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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
@@ -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();
|
||||
|
||||
@@ -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
@@ -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
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'])),
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user