3 * @file src/Model/Storage/SystemStorage.php
4 * @brief Storage backend system
7 namespace Friendica\Model\Storage;
9 use \BadMethodCallException;
12 * @brief System resource storage class
14 * This class is used to load system resources, like images.
15 * Is not intended to be selectable by admins as default storage class.
17 class SystemResource implements IStorage
19 const NAME = 'SystemResource';
21 // Valid folders to look for resources
22 const VALID_FOLDERS = ["images"];
27 public function get(string $filename)
29 $folder = dirname($filename);
30 if (!in_array($folder, self::VALID_FOLDERS)) {
33 if (!file_exists($filename)) {
36 return file_get_contents($filename);
42 public function put(string $data, string $filename = '')
44 throw new BadMethodCallException();
47 public function delete(string $filename)
49 throw new BadMethodCallException();
55 public function getOptions()
63 public function saveOptions(array $data)
71 public function __toString()
79 public static function getName()