From 16983388a00268a489023ea69f536f9f7d7ad47e Mon Sep 17 00:00:00 2001 From: meirzamoodle Date: Mon, 2 Sep 2024 12:56:05 +0700 Subject: [PATCH] [docs] Added new parameter @notify to file creation function --- docs/apis/subsystems/files/index.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/apis/subsystems/files/index.md b/docs/apis/subsystems/files/index.md index 83e11d61da..dd658fed0b 100644 --- a/docs/apis/subsystems/files/index.md +++ b/docs/apis/subsystems/files/index.md @@ -293,6 +293,19 @@ $fs = get_file_storage(); $fs->create_file_from_storedfile($fileinfo, $existingfile); ``` +#### Notification requirements for new files + +By default, the `$notify` parameter has a value of `true` and will call the after_file_created hook after files are created. If you prefer not to do this, you can set it to `false`. + +```php title="Create a file from a file on disk, but do not trigger the after_file_created hook" +$fs = get_file_storage(); + +// Create a file from a file on disk, but do not trigger the after_file_created hook. +$fs->create_file_from_pathname($fileinfo, $requestdir . '/helloworld.txt', false); +``` + +The same principle also applies to the other functions. + ### List all files in a particular file area You may need to fetch a list of all files in a specific file area. You can do this using the `file_storage::get_area_files()` API, which will return array of `stored_file` objects, for example: