We had an issue while accessing export_scorm.php file, where the server would return a 503 error on request, but no exceptions were logged in php-fpm logs. We use Moodle 4.5 with 4.6.7 version of the plugin.
In the file there is a class, which is apparently only used once and only for a method that creates a temporary file:
class block_exacomp_ZipArchive extends \ZipArchive {
/**
* @return ZipArchive
*/
public static function create_temp_file() {
global $CFG;
$file = tempname($CFG->tempdir, "zip");
$zip = new \ZipArchive();
$zip->open($file, ZipArchive::OVERWRITE);
return $zip;
}
}
global $zip, $existingfilesarray;
$zip = block_exacomp_ZipArchive::create_temp_file();
Removing this class fixes the issue and makes the code more concise:
global $zip, $existingfilesarray;
$file = tempnam($CFG->tempdir, "zip");
$zip = new ZipArchive();
$zip->open($file, ZipArchive::OVERWRITE);
$existingfilesarray = array();
We had an issue while accessing export_scorm.php file, where the server would return a 503 error on request, but no exceptions were logged in php-fpm logs. We use Moodle 4.5 with 4.6.7 version of the plugin.
In the file there is a class, which is apparently only used once and only for a method that creates a temporary file:
Removing this class fixes the issue and makes the code more concise: