File tree Expand file tree Collapse file tree 4 files changed +53
-0
lines changed
private/Files/ObjectStore
public/Files/ObjectStore/Events Expand file tree Collapse file tree 4 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 490490 'OCP \\Files \\Notify \\IChange ' => $ baseDir . '/lib/public/Files/Notify/IChange.php ' ,
491491 'OCP \\Files \\Notify \\INotifyHandler ' => $ baseDir . '/lib/public/Files/Notify/INotifyHandler.php ' ,
492492 'OCP \\Files \\Notify \\IRenameChange ' => $ baseDir . '/lib/public/Files/Notify/IRenameChange.php ' ,
493+ 'OCP \\Files \\ObjectStore \\Events \\BucketCreatedEvent ' => $ baseDir . '/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php ' ,
493494 'OCP \\Files \\ObjectStore \\IObjectStore ' => $ baseDir . '/lib/public/Files/ObjectStore/IObjectStore.php ' ,
494495 'OCP \\Files \\ObjectStore \\IObjectStoreMetaData ' => $ baseDir . '/lib/public/Files/ObjectStore/IObjectStoreMetaData.php ' ,
495496 'OCP \\Files \\ObjectStore \\IObjectStoreMultiPartUpload ' => $ baseDir . '/lib/public/Files/ObjectStore/IObjectStoreMultiPartUpload.php ' ,
Original file line number Diff line number Diff line change @@ -531,6 +531,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
531531 'OCP \\Files \\Notify \\IChange ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Notify/IChange.php ' ,
532532 'OCP \\Files \\Notify \\INotifyHandler ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Notify/INotifyHandler.php ' ,
533533 'OCP \\Files \\Notify \\IRenameChange ' => __DIR__ . '/../../.. ' . '/lib/public/Files/Notify/IRenameChange.php ' ,
534+ 'OCP \\Files \\ObjectStore \\Events \\BucketCreatedEvent ' => __DIR__ . '/../../.. ' . '/lib/public/Files/ObjectStore/Events/BucketCreatedEvent.php ' ,
534535 'OCP \\Files \\ObjectStore \\IObjectStore ' => __DIR__ . '/../../.. ' . '/lib/public/Files/ObjectStore/IObjectStore.php ' ,
535536 'OCP \\Files \\ObjectStore \\IObjectStoreMetaData ' => __DIR__ . '/../../.. ' . '/lib/public/Files/ObjectStore/IObjectStoreMetaData.php ' ,
536537 'OCP \\Files \\ObjectStore \\IObjectStoreMultiPartUpload ' => __DIR__ . '/../../.. ' . '/lib/public/Files/ObjectStore/IObjectStoreMultiPartUpload.php ' ,
Original file line number Diff line number Diff line change 1414use Aws \S3 \S3Client ;
1515use GuzzleHttp \Promise \Create ;
1616use GuzzleHttp \Promise \RejectedPromise ;
17+ use OCP \EventDispatcher \IEventDispatcher ;
18+ use OCP \Files \ObjectStore \Events \BucketCreatedEvent ;
1719use OCP \Files \StorageNotAvailableException ;
1820use OCP \ICertificateManager ;
1921use OCP \Server ;
@@ -150,6 +152,13 @@ public function getConnection() {
150152 throw new StorageNotAvailableException ('The bucket will not be created because the name is not dns compatible, please correct it: ' . $ this ->bucket );
151153 }
152154 $ this ->connection ->createBucket (['Bucket ' => $ this ->bucket ]);
155+ Server::get (IEventDispatcher::class)
156+ ->dispatchTyped (new BucketCreatedEvent (
157+ $ this ->bucket ,
158+ $ options ['endpoint ' ],
159+ $ options ['region ' ],
160+ $ options ['version ' ]
161+ ));
153162 $ this ->testTimeout ();
154163 } catch (S3Exception $ e ) {
155164 $ logger ->debug ('Invalid remote storage. ' , [
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /**
6+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+ * SPDX-License-Identifier: AGPL-3.0-only
8+ */
9+ namespace OCP \Files \ObjectStore \Events ;
10+
11+ use OCP \EventDispatcher \Event ;
12+
13+ /**
14+ * @since 33.0.0
15+ */
16+ class BucketCreatedEvent extends Event {
17+
18+ public function __construct (
19+ private string $ bucket ,
20+ private string $ endpoint ,
21+ private string $ region ,
22+ private string $ version = 'latest ' ,
23+ ) {
24+ parent ::__construct ();
25+ }
26+
27+ public function getBucket (): string {
28+ return $ this ->bucket ;
29+ }
30+
31+ public function getEndpoint (): string {
32+ return $ this ->endpoint ;
33+ }
34+
35+ public function getRegion (): string {
36+ return $ this ->region ;
37+ }
38+
39+ public function getVersion (): string {
40+ return $ this ->version ;
41+ }
42+ }
You can’t perform that action at this time.
0 commit comments