Function __global->_url_to_filename

Definitions

sources/urls2.php

  • Takes a URL, and converts it into a file system storable filename. This is used to cache URL contents to the servers filesystem.This returns a URL-safe base-64 salted SHA-256 hash of the URL, which makes it conform to OS length limits and will be hard to scrape.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: string

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$url_full URLPATH No No required parameter N/A N/A The URL to convert to an encoded filename

Returns

  • A usable filename based on the URL
  • Type: string
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Takes a URL, and converts it into a file system storable filename. This is used to cache URL contents to the servers filesystem.This returns a URL-safe base-64 salted SHA-256 hash of the URL, which makes it conform to OS length limits and will be hard to scrape.
 *
 * @param  URLPATH $url_full The URL to convert to an encoded filename
 * @return string A usable filename based on the URL
 */

function _url_to_filename(string $url_full) : string