diff --git a/h5p-default-storage.class.php b/h5p-default-storage.class.php index 27b250b..fbbe583 100644 --- a/h5p-default-storage.class.php +++ b/h5p-default-storage.class.php @@ -244,6 +244,16 @@ class H5PDefaultStorage implements \H5PFileStorage { } } + /** + * Read file content of given file and then return it. + * + * @param string $file_path + * @return string + */ + public function getContent($file_path) { + return file_get_contents($this->path . $file_path); + } + /** * Recursive function for copying directories. * diff --git a/h5p-file-storage.interface.php b/h5p-file-storage.interface.php index dfaa67a..b75625e 100644 --- a/h5p-file-storage.interface.php +++ b/h5p-file-storage.interface.php @@ -117,4 +117,12 @@ interface H5PFileStorage { * The hash keys of removed files */ public function deleteCachedAssets($keys); + + /** + * Read file content of given file and then return it. + * + * @param string $file_path + * @return string contents + */ + public function getContent($file_path); }