3 * @file src/Model/Storage/SystemStorage.php
4 * @brief Storage backend system
7 namespace Friendica\Model\Storage;
10 * @brief System resource storage class
12 * This class is used to load system resources, like images.
13 * Is not itended to be selectable by admins as default storage class.
15 class SystemResource implements IStorage
17 // Valid folders to look for resources
18 const VALID_FOLDERS = [ "images" ];
20 public static function get($filename)
22 $folder = dirname($filename);
23 if (!in_array($folder, self::VALID_FOLDERS)) return "";
24 if (!file_exists($filename)) return "";
25 return file_get_contents($filename);
29 public static function put($data, $filename=null)
31 throw new \BadMethodCallException();
34 public static function delete($filename)
36 throw new \BadMethodCallException();