X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Flibraries%2Fsrc%2FPlugin%2Flibraries%2FLocator%2FChainLocator.php;fp=web%2Fmodules%2Fcontrib%2Flibraries%2Fsrc%2FPlugin%2Flibraries%2FLocator%2FChainLocator.php;h=4e0acff84e1630c44e5552e2114e32b7eb9538de;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/libraries/src/Plugin/libraries/Locator/ChainLocator.php b/web/modules/contrib/libraries/src/Plugin/libraries/Locator/ChainLocator.php new file mode 100644 index 000000000..4e0acff84 --- /dev/null +++ b/web/modules/contrib/libraries/src/Plugin/libraries/Locator/ChainLocator.php @@ -0,0 +1,53 @@ +locators[] = $locator; + return $this; + } + + /** + * Locates a library. + * + * @param \Drupal\libraries\ExternalLibrary\Local\LocalLibraryInterface $library + * The library to locate. + * + * @see \Drupal\libraries\ExternalLibrary\Local\LocatorInterface::locate() + */ + public function locate(LocalLibraryInterface $library) { + foreach ($this->locators as $locator) { + $locator->locate($library); + if ($library->isInstalled()) { + return; + } + } + $library->setUninstalled(); + } + +}