function public static function Bootstrap::fileSystem

8.x-3.x Bootstrap.php public static Bootstrap::fileSystem($method = NULL)

Retrieves the File System service, if it exists.

Parameters

string $method: Optional. A specific method on the file system service to check for its existance.

Return value

\Drupal\Core\File\FileSystemInterface The File System service, if it exists and if $method exists if it was passed.

Deprecated

in bootstrap:8.x-3.22 and is removed from bootstrap:5.0.0. Use the "file_system" service instead.

Class

Bootstrap
The primary class for the Drupal Bootstrap base theme.

Namespace

Drupal\bootstrap

Source src/Bootstrap.php (line 648)

public static function fileSystem($method = NULL) {
  if (!isset(static::$fileSystem)) {
    static::$fileSystem = \Drupal::hasService('file_system') ? \Drupal::service('file_system') : FALSE;
  }
  if ($method) {
    return static::$fileSystem && method_exists(static::$fileSystem, $method) ? static::$fileSystem : FALSE;
  }
  return static::$fileSystem;
}