Added function for reading file contents

h5p/h5p-moodle-plugin#47
HFJ-1844
pull/21/head
Frode Petterson 2016-04-22 11:35:23 +02:00
parent 64de9d53f8
commit e324e298b9
2 changed files with 18 additions and 0 deletions

View File

@ -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.
*

View File

@ -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);
}