private static function AssetFactory::findRootDir

Loops through the root directories and returns the first match.

Parameters

string $path An absolute path:

array $roots An array of root directories:

Return value

string|null The matching root directory, if found

1 call to AssetFactory::findRootDir()
AssetFactory::parseInput in drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php
Parses an input string string into an asset.

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Factory/AssetFactory.php, line 378

Class

AssetFactory
The asset factory creates asset objects.

Namespace

Assetic\Factory

Code

private static function findRootDir($path, array $roots) {
  foreach ($roots as $root) {
    if (0 === strpos($path, $root)) {
      return $root;
    }
  }
}