You are here

public static function DrupalFavicon::getFileFromUri in Favicon 7.2

Convert a URI into a file object.

Parameters

string $uri: A file URI.

Return value

object A file object with the uri, filemime, and filesize properties defined.

3 calls to DrupalFavicon::getFileFromUri()
DrupalFavicon::fetchFile in src/DrupalFavicon.php
Fetches the favicon file object.
DrupalFavicon::__construct in src/DrupalFavicon.php
favicon_form_system_theme_settings_validate in ./favicon.module
Form validate handler for the system_theme_settings form.

File

src/DrupalFavicon.php, line 51

Class

DrupalFavicon

Code

public static function getFileFromUri($uri) {

  // Allow the URI to be altered.
  drupal_alter('favicon_file_uri', $uri);
  $file = new stdClass();
  $file->uri = $uri;
  $file->filemime = file_get_mimetype($uri);
  $file->filesize = @filesize($uri);
  static::validateFile($file);

  // Allow modules to alter the generated favicon file.
  drupal_alter('favicon_file', $file);
  return $file;
}