Skip to content

Commit

Permalink
[docs] Added new parameter @notify to file creation function
Browse files Browse the repository at this point in the history
  • Loading branch information
meirzamoodle committed Sep 2, 2024
1 parent 05b391e commit 1698338
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/apis/subsystems/files/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1698338

Please sign in to comment.