X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Flibraries%2Fsrc%2FStreamWrapper%2FLibraryDefinitionsStream.php;fp=web%2Fmodules%2Fcontrib%2Flibraries%2Fsrc%2FStreamWrapper%2FLibraryDefinitionsStream.php;h=7cf0764ec0c75d3cd9cc2d0384c15f395c2811cd;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/libraries/src/StreamWrapper/LibraryDefinitionsStream.php b/web/modules/contrib/libraries/src/StreamWrapper/LibraryDefinitionsStream.php new file mode 100644 index 000000000..7cf0764ec --- /dev/null +++ b/web/modules/contrib/libraries/src/StreamWrapper/LibraryDefinitionsStream.php @@ -0,0 +1,86 @@ +configFactory = \Drupal::configFactory(); + } + + /** + * {@inheritdoc} + */ + public function getName() { + return t('Library definitions'); + } + + /** + * {@inheritdoc} + */ + public function getDescription() { + return t('Provides access to library definition files.'); + } + + /** + * {@inheritdoc} + */ + public function getDirectoryPath() { + return $this->getConfig('local.path'); + } + + /** + * Fetches a configuration value from the library definitions configuration. + * @param $key + * The configuration key to fetch. + * + * @return array|mixed|null + * The configuration value. + */ + protected function getConfig($key) { + return $this->configFactory + ->get('libraries.settings') + ->get("definitions.$key"); + } + +}