class LibrariesDirectoryFileFinder (View source)

Finds files that are located in the supported 'libraries' directories.

Properties

protected string $root

The app root.

protected string $sitePath

The site path.

protected ExtensionList $profileExtensionList

The profile extension list.

protected string $installProfile

The install profile.

Methods

__construct(string $root, string $site_path, ProfileExtensionList $profile_extension_list, string $install_profile)

Constructs a new LibrariesDirectoryFileFinder instance.

string|false
find(string $path)

Finds files that are located in the supported 'libraries' directories.

Details

__construct(string $root, string $site_path, ProfileExtensionList $profile_extension_list, string $install_profile)

Constructs a new LibrariesDirectoryFileFinder instance.

Parameters

string $root

The app root.

string $site_path

The site path.

ProfileExtensionList $profile_extension_list

The profile extension list.

string $install_profile

The install profile.

string|false find(string $path)

Finds files that are located in the supported 'libraries' directories.

It searches the following locations:

  • A libraries directory in the current site directory, for example: sites/default/libraries.
  • The root libraries directory.
  • A libraries directory in the selected installation profile, for example: profiles/my_install_profile/libraries. If the same library is present in multiple locations the first location found will be used. The locations are searched in the order listed.

Parameters

string $path

The path for the library file to find.

Return Value

string|false

The real path to the library file relative to the root directory. If the library cannot be found then FALSE.