Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 64... Línea 64...
64
     * @throws file_exception If file operations fail
64
     * @throws file_exception If file operations fail
65
     * @throws coding_exception If any archive paths do not meet the restrictions
65
     * @throws coding_exception If any archive paths do not meet the restrictions
66
     */
66
     */
67
    public function archive_to_storage(array $files, $contextid,
67
    public function archive_to_storage(array $files, $contextid,
68
            $component, $filearea, $itemid, $filepath, $filename,
68
            $component, $filearea, $itemid, $filepath, $filename,
69
            $userid = null, $ignoreinvalidfiles = true, file_progress $progress = null) {
69
            $userid = null, $ignoreinvalidfiles = true, ?file_progress $progress = null) {
70
        return $this->get_packer_for_archive_operation()->archive_to_storage($files,
70
        return $this->get_packer_for_archive_operation()->archive_to_storage($files,
71
                $contextid, $component, $filearea, $itemid, $filepath, $filename,
71
                $contextid, $component, $filearea, $itemid, $filepath, $filename,
72
                $userid, $ignoreinvalidfiles, $progress);
72
                $userid, $ignoreinvalidfiles, $progress);
73
    }
73
    }
Línea 81... Línea 81...
81
     * @param file_progress $progress Progress indicator callback or null if not required
81
     * @param file_progress $progress Progress indicator callback or null if not required
82
     * @return bool true if file created, false if not
82
     * @return bool true if file created, false if not
83
     * @throws coding_exception If any archive paths do not meet the restrictions
83
     * @throws coding_exception If any archive paths do not meet the restrictions
84
     */
84
     */
85
    public function archive_to_pathname(array $files, $archivefile,
85
    public function archive_to_pathname(array $files, $archivefile,
86
            $ignoreinvalidfiles=true, file_progress $progress = null) {
86
            $ignoreinvalidfiles=true, ?file_progress $progress = null) {
87
        return $this->get_packer_for_archive_operation()->archive_to_pathname($files,
87
        return $this->get_packer_for_archive_operation()->archive_to_pathname($files,
88
                $archivefile, $ignoreinvalidfiles, $progress);
88
                $archivefile, $ignoreinvalidfiles, $progress);
89
    }
89
    }
Línea 90... Línea 90...
90
 
90
 
Línea 99... Línea 99...
99
     * details.
99
     * details.
100
     * @return array list of processed files (name=>true)
100
     * @return array list of processed files (name=>true)
101
     * @throws moodle_exception If error
101
     * @throws moodle_exception If error
102
     */
102
     */
103
    public function extract_to_pathname($archivefile, $pathname,
103
    public function extract_to_pathname($archivefile, $pathname,
104
            array $onlyfiles = null, file_progress $progress = null, $returnbool = false) {
104
            ?array $onlyfiles = null, ?file_progress $progress = null, $returnbool = false) {
105
        return $this->get_packer_for_read_operation($archivefile)->extract_to_pathname(
105
        return $this->get_packer_for_read_operation($archivefile)->extract_to_pathname(
106
                $archivefile, $pathname, $onlyfiles, $progress, $returnbool);
106
                $archivefile, $pathname, $onlyfiles, $progress, $returnbool);
107
    }
107
    }
Línea 108... Línea 108...
108
 
108
 
Línea 120... Línea 120...
120
     * @return array list of processed files (name=>true)
120
     * @return array list of processed files (name=>true)
121
     * @throws moodle_exception If error
121
     * @throws moodle_exception If error
122
     */
122
     */
123
    public function extract_to_storage($archivefile, $contextid,
123
    public function extract_to_storage($archivefile, $contextid,
124
            $component, $filearea, $itemid, $pathbase, $userid = null,
124
            $component, $filearea, $itemid, $pathbase, $userid = null,
125
            file_progress $progress = null) {
125
            ?file_progress $progress = null) {
126
        return $this->get_packer_for_read_operation($archivefile)->extract_to_storage(
126
        return $this->get_packer_for_read_operation($archivefile)->extract_to_storage(
127
                $archivefile, $contextid, $component, $filearea, $itemid, $pathbase,
127
                $archivefile, $contextid, $component, $filearea, $itemid, $pathbase,
128
                $userid, $progress);
128
                $userid, $progress);
129
    }
129
    }