public InstallStorage::getCoreNames()
Get all configuration names and folders for Drupal core.
Return value
array Folders indexed by configuration name.
File
- core/lib/Drupal/Core/Config/InstallStorage.php, line 216
Class
- InstallStorage
- Storage used by the Drupal installer.
Namespace
Drupal\Core\Config
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | public function getCoreNames() { $extension = '.' . $this ->getFileExtension(); $pattern = '/' . preg_quote( $extension , '/' ) . '$/' ; $folders = array (); $directory = $this ->getCoreFolder(); if ( is_dir ( $directory )) { // glob() directly calls into libc glob(), which is not aware of PHP // stream wrappers. Same for \GlobIterator (which additionally requires an // absolute realpath() on Windows). $files = scandir( $directory ); foreach ( $files as $file ) { if ( $file [0] !== '.' && preg_match( $pattern , $file )) { $folders [ basename ( $file , $extension )] = $directory ; } } } return $folders ; } |
Please login to continue.