Function Hook_import_smf2->data_to_disk
Definitions
sources/hooks/modules/admin_import/smf2.php
- Convert an SMF database file to a software uploaded file (stored on disk).
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: string
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $data | string | No | No | required parameter | N/A | N/A | The file data |
| $filename | string | No | No | required parameter | N/A | N/A | The optimal filename |
| $sections | ID_TEXT | No | No | required parameter | N/A | N/A | The upload type (e.g. cns_photos) |
| $id_folder | integer | No | No | required parameter | N/A | N/A | The attachmentUploadDir where the file is located |
| $db | object | No | No | required parameter | N/A | N/A | The database connector to import from |
| $table_prefix | string | No | No | Blank (empty string) | N/A | N/A | The table prefix the target prefix is using |
| $output_filename | string | No | No | Blank (empty string) | N/A | N/A | The filename to output to |
| $file_base | PATH | No | No | Blank (empty string) | N/A | N/A | The base directory we are importing from |
| $attachment_id | string | No | No | Blank (empty string) | N/A | N/A | The attachment ID |
| $ext | string | No | No | .png | N/A | N/A | The file extension to use |
Returns
- The URL
- Type: URLPATH
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Convert an SMF database file to a software uploaded file (stored on disk).
*
* @param string $data The file data
* @param string $filename The optimal filename
* @param ID_TEXT $sections The upload type (e.g. cns_photos)
* @param integer $id_folder The attachmentUploadDir where the file is located
* @param object $db The database connector to import from
* @param string $table_prefix The table prefix the target prefix is using
* @param string $output_filename The filename to output to
* @param PATH $file_base The base directory we are importing from
* @param string $attachment_id The attachment ID
* @param string $ext The file extension to use
* @return URLPATH The URL
*/
public function data_to_disk(string $data, string $filename, string $sections, int $id_folder, object $db, string $table_prefix = '', string $output_filename = '', string $file_base = '', string $attachment_id = '', string $ext = '.png') : string
* Convert an SMF database file to a software uploaded file (stored on disk).
*
* @param string $data The file data
* @param string $filename The optimal filename
* @param ID_TEXT $sections The upload type (e.g. cns_photos)
* @param integer $id_folder The attachmentUploadDir where the file is located
* @param object $db The database connector to import from
* @param string $table_prefix The table prefix the target prefix is using
* @param string $output_filename The filename to output to
* @param PATH $file_base The base directory we are importing from
* @param string $attachment_id The attachment ID
* @param string $ext The file extension to use
* @return URLPATH The URL
*/
public function data_to_disk(string $data, string $filename, string $sections, int $id_folder, object $db, string $table_prefix = '', string $output_filename = '', string $file_base = '', string $attachment_id = '', string $ext = '.png') : string

