Function __global->reorganise_uploads
Definitions
sources/uploads2.php
- Reorganise upload paths.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: array
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $content_type | string | No | No | required parameter | N/A | N/A | Content type |
| $upload_directory | string | No | No | required parameter | N/A | N/A | Upload directory |
| $upload_field | string | No | No | required parameter | N/A | N/A | Upload field |
| $where | ?array | No | No | [] | N/A | N/A | Limit reorganisation to rows matching this WHERE map (null: none) |
| $append_content_type_to_upload_dir | boolean | No | No | False | N/A | N/A | "$upload_directory" should become "$upload_directory/$content_type" |
| $tolerate_errors | boolean | No | No | False | N/A | N/A | Whether to tolerate missing files (false = give an error) |
| $fake_cma_info | ?array | No | No | Null | N/A | N/A | A map of CMA info overriddes, for complicated cases (null: real info from $content_type) |
Returns
- A map of db_table:id to the new upload URL
- Type: array
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Reorganise upload paths.
*
* @param string $content_type Content type
* @param string $upload_directory Upload directory
* @param string $upload_field Upload field
* @param ?array $where Limit reorganisation to rows matching this WHERE map (null: none)
* @param boolean $append_content_type_to_upload_dir "$upload_directory" should become "$upload_directory/$content_type"
* @param boolean $tolerate_errors Whether to tolerate missing files (false = give an error)
* @param ?array $fake_cma_info A map of CMA info overriddes, for complicated cases (null: real info from $content_type)
* @return array A map of db_table:id to the new upload URL
*/
function reorganise_uploads(string $content_type, string $upload_directory, string $upload_field, ?array $where = [], bool $append_content_type_to_upload_dir = false, bool $tolerate_errors = false, ?array $fake_cma_info = null) : array
* Reorganise upload paths.
*
* @param string $content_type Content type
* @param string $upload_directory Upload directory
* @param string $upload_field Upload field
* @param ?array $where Limit reorganisation to rows matching this WHERE map (null: none)
* @param boolean $append_content_type_to_upload_dir "$upload_directory" should become "$upload_directory/$content_type"
* @param boolean $tolerate_errors Whether to tolerate missing files (false = give an error)
* @param ?array $fake_cma_info A map of CMA info overriddes, for complicated cases (null: real info from $content_type)
* @return array A map of db_table:id to the new upload URL
*/
function reorganise_uploads(string $content_type, string $upload_directory, string $upload_field, ?array $where = [], bool $append_content_type_to_upload_dir = false, bool $tolerate_errors = false, ?array $fake_cma_info = null) : array

