You are here

function _auditfiles_not_in_database_include_file in Audit Files 7.3

Checks to see if the file is being included.

@todo Possibly add other file streams that are on the system but not the one being checked to the exclusions check.

Parameters

string $path: The complete file system path to the file.

string $file: The name of the file being checked.

string $exclusions: The list of files and directories that are not to be included in the list of files to check.

Return value

bool Returns TRUE, if the path or file is being included, or FALSE, if the path or file has been excluded.

2 calls to _auditfiles_not_in_database_include_file()
_auditfiles_not_in_database_get_files in ./auditfiles.notindatabase.inc
Retrieves a list of files in the given path.
_auditfiles_not_in_database_report_processing_merge_file_lists in ./auditfiles.notindatabase.inc
Merges one array of files into another.

File

./auditfiles.notindatabase.inc, line 854
Generates a report showing files on the server, but not in the database.

Code

function _auditfiles_not_in_database_include_file($path, $file, $exclusions) {

  // No exclusions have been specified, so all paths and files are included.
  if (empty($exclusions)) {
    return TRUE;
  }
  elseif (!preg_match('@' . $exclusions . '@', $file) && !preg_match('@' . $exclusions . '@', $path . DIRECTORY_SEPARATOR . $file)) {
    return TRUE;
  }

  // This path and/or file are being excluded.
  return FALSE;
}