You are here

function ServiceAuditFilesNotInDatabase::_auditfiles_not_in_database_include_file in Audit Files 8

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

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

1 call to ServiceAuditFilesNotInDatabase::_auditfiles_not_in_database_include_file()
ServiceAuditFilesNotInDatabase::_auditfiles_not_in_database_get_files in src/ServiceAuditFilesNotInDatabase.php
Retrieves a list of files in the given path.

File

src/ServiceAuditFilesNotInDatabase.php, line 269
providing the service that used in not in database functionality.

Class

ServiceAuditFilesNotInDatabase

Namespace

Drupal\auditfiles

Code

function _auditfiles_not_in_database_include_file($path, $file, $exclusions) {
  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;
}