mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
Merge branch 'MDL-60001_gzopen' of https://github.com/mrmark/moodle
This commit is contained in:
commit
022dccf2a7
@ -532,7 +532,12 @@ abstract class file_system {
|
||||
* @return resource file handle
|
||||
*/
|
||||
public function get_content_file_handle(stored_file $file, $type = stored_file::FILE_HANDLE_FOPEN) {
|
||||
$path = $this->get_remote_path_from_storedfile($file);
|
||||
if ($type === stored_file::FILE_HANDLE_GZOPEN) {
|
||||
// Local file required for gzopen.
|
||||
$path = $this->get_local_path_from_storedfile($file, true);
|
||||
} else {
|
||||
$path = $this->get_remote_path_from_storedfile($file);
|
||||
}
|
||||
|
||||
return self::get_file_handle_for_path($path, $type);
|
||||
}
|
||||
|
@ -904,8 +904,8 @@ class core_files_file_system_testcase extends advanced_testcase {
|
||||
$filecontent = 'example content';
|
||||
$file = $this->get_stored_file($filecontent);
|
||||
|
||||
$fs = $this->get_testable_mock(['get_remote_path_from_storedfile']);
|
||||
$fs->method('get_remote_path_from_storedfile')
|
||||
$fs = $this->get_testable_mock(['get_local_path_from_storedfile']);
|
||||
$fs->method('get_local_path_from_storedfile')
|
||||
->willReturn(__DIR__ . "/fixtures/test.tgz");
|
||||
|
||||
// Note: We are unable to determine the mode in which the $fh was opened.
|
||||
|
Loading…
x
Reference in New Issue
Block a user