public FileStorage::read($name)
Implements Drupal\Core\Config\StorageInterface::read().
Throws
\Drupal\Core\Config\UnsupportedDataTypeConfigException
Overrides StorageInterface::read
File
- core/lib/Drupal/Core/Config/FileStorage.php, line 102
Class
- FileStorage
- Defines the file storage.
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 21 | public function read( $name ) { if (! $this ->exists( $name )) { return FALSE; } $filepath = $this ->getFilePath( $name ); if ( $data = $this ->fileCache->get( $filepath )) { return $data ; } $data = file_get_contents ( $filepath ); try { $data = $this ->decode( $data ); } catch (InvalidDataTypeException $e ) { throw new UnsupportedDataTypeConfigException( 'Invalid data type in config ' . $name . ', found in file' . $filepath . ' : ' . $e ->getMessage()); } $this ->fileCache->set( $filepath , $data ); return $data ; } |
Please login to continue.