You are here

function flysystem_dependencies_check in Flysystem 7

Checks that dependencies are installed correctly.

This should be needed during normal operation. Only during certain hooks that might get called before dependencies are installed or loaded.

Return value

bool Returns true on success, and false on failure.

6 calls to flysystem_dependencies_check()
flysystem_config_form in ./flysystem.admin.inc
Page callback for the Flysystem configuration form.
flysystem_cron in ./flysystem.module
Implements hook_cron().
flysystem_file_download in ./flysystem.module
Implements hook_file_download().
flysystem_menu in ./flysystem.module
Implements hook_menu().
flysystem_requirements in ./flysystem.install
Implements hook_requirements().

... See full list

File

./flysystem.module, line 263
Provides access to various filesystem backends using Flysystem.

Code

function flysystem_dependencies_check() {
  $checked =& drupal_static(__FUNCTION__, NULL);
  if (!isset($checked)) {
    $dependencies = array(
      'League\\Flysystem\\Filesystem',
      'League\\Flysystem\\Cached\\CachedAdapter',
      'League\\Flysystem\\Replicate\\ReplicateAdapter',
      'Twistor\\FlysystemStreamWrapper',
      'Drupal\\flysystem\\FlysystemFactory',
    );
    $checked = TRUE;
    foreach ($dependencies as $dependency) {
      $checked = $checked && class_exists($dependency);
    }
  }
  return $checked;
}