You are here

function include_verify in Include 8

Same name and namespace in other branches
  1. 6 include.module \include_verify()
  2. 7 include.module \include_verify()

Verifies that a file exists on the include path.

Parameters

$filename: The filename to verify, relative to the include path.

$cache: (optional) FALSE to ignore previously-cached results. Defaults to TRUE.

Return value

TRUE if the file exists; otherwise FALSE.

1 call to include_verify()
include_check_path in ./include.module
Verifies or installs a file or directory into the include repository.

File

./include.module, line 103
The Include module manages files on the include_files path.

Code

function include_verify($filename, $cache = TRUE) {
  $files =& drupal_static(__FUNCTION__, array());
  if ($cache && isset($files[$filename])) {
    return $files[$filename];
  }
  if ($fd = @fopen($filename, 'r', TRUE)) {
    fclose($fd);
    return $files[$filename] = TRUE;
  }
  return $files[$filename] = FALSE;
}