Function Hook_import_vb3->data_to_disk

Definitions

sources/hooks/modules/admin_import/vb3.php

  • Convert a VB database file to a software uploaded file (stored on disk).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

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)
$thumbnail_data string No No Blank (empty string) N/A N/A Thumbnail data (blank: no thumbnail / generate one if asked)
$obfuscate boolean No No False N/A N/A Whether to obfuscate the file type

Returns

  • A tuple containing the URL, and if requested, the thumbnail
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Convert a VB 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  string $thumbnail_data Thumbnail data (blank: no thumbnail / generate one if asked)
 * @param  boolean $obfuscate Whether to obfuscate the file type
 * @return array A tuple containing the URL, and if requested, the thumbnail
 */

public function data_to_disk(string $data, string $filename, string $sections, string $thumbnail_data = '', bool $obfuscate = false) : array