Skip to content

Commit df84b94

Browse files
Merge branch '1.8.x' into feat-health-module
2 parents 42bf515 + a7d39b5 commit df84b94

3 files changed

Lines changed: 26 additions & 34 deletions

File tree

composer.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@
100100
"provide": {
101101
"ext-phpiredis": "*"
102102
},
103-
"repositories": [
104-
{
105-
"type": "vcs",
106-
"url": "https://github.com/utopia-php/migration.git"
107-
}
108-
],
109103
"config": {
110104
"platform": {
111105
"php": "8.3"

composer.lock

Lines changed: 10 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Appwrite/Platform/Modules/Storage/Http/Buckets/Files/Create.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,9 @@ public function action(
385385
}
386386
$file = Authorization::skip(fn () => $dbForProject->updateDocument('bucket_' . $bucket->getSequence(), $fileId, $file));
387387
}
388+
389+
// Trigger after create success hook
390+
$this->afterCreateSuccess($file);
388391
} else {
389392
if ($file->isEmpty()) {
390393
$doc = new Document([
@@ -448,4 +451,17 @@ public function action(
448451
->setStatusCode(Response::STATUS_CODE_CREATED)
449452
->dynamic($file, Response::MODEL_FILE);
450453
}
454+
455+
/**
456+
* Hook to run after file is created successfully
457+
*
458+
* @param Document $file
459+
* @return void
460+
*/
461+
protected function afterCreateSuccess(Document $file)
462+
{
463+
if (!($file instanceof Document)) {
464+
throw new Exception('file must be an instance of document');
465+
}
466+
}
451467
}

0 commit comments

Comments
 (0)