You are here

public function ClamAVConfigForm::get_overridden_schemes in ClamAV 8

Same name and namespace in other branches
  1. 2.x src/Form/ClamAVConfigForm.php \Drupal\clamav\Form\ClamAVConfigForm::get_overridden_schemes()

List which schemes have been overridden.

Parameters

string $type: Type of stream-wrapper: either 'local' or 'remote'.

array $schemes_to_scan: Unindexed array, listing the schemes that should be scanned.

Return value

array List of the schemes that have been overridden for this particular stream-wrapper type.

1 call to ClamAVConfigForm::get_overridden_schemes()
ClamAVConfigForm::submitForm in src/Form/ClamAVConfigForm.php
Form submission handler.

File

src/Form/ClamAVConfigForm.php, line 323

Class

ClamAVConfigForm
Configure file system settings for this site.

Namespace

Drupal\clamav\Form

Code

public function get_overridden_schemes($type, $schemes_to_scan) {
  $available_schemes = $this
    ->scheme_wrappers_available($type);
  switch ($type) {
    case 'local':
      $overridden = array_diff_key($available_schemes, $schemes_to_scan);
      return array_keys($overridden);
    case 'remote':
      $overridden = array_intersect_key($available_schemes, $schemes_to_scan);
      return array_keys($overridden);
  }
}