Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 71... Línea 71...
71
     * zipwriter constructor.
71
     * zipwriter constructor.
72
     *
72
     *
73
     * @param \ZipStream\ZipStream $archive
73
     * @param \ZipStream\ZipStream $archive
74
     * @param stdClass|null $options
74
     * @param stdClass|null $options
75
     */
75
     */
76
    public function __construct(\ZipStream\ZipStream $archive, stdClass $options = null) {
76
    public function __construct(\ZipStream\ZipStream $archive, ?stdClass $options = null) {
77
        $this->archive = $archive;
77
        $this->archive = $archive;
78
        if ($options) {
78
        if ($options) {
79
            $this->parse_options($options);
79
            $this->parse_options($options);
80
        }
80
        }
Línea 138... Línea 138...
138
     *
138
     *
139
     * @param string $filename
139
     * @param string $filename
140
     * @param stdClass|null $exportoptions
140
     * @param stdClass|null $exportoptions
141
     * @return static
141
     * @return static
142
     */
142
     */
143
    public static function get_stream_writer(string $filename, stdClass $exportoptions = null) {
143
    public static function get_stream_writer(string $filename, ?stdClass $exportoptions = null) {
144
        $archive = new \ZipStream\ZipStream(
144
        $archive = new \ZipStream\ZipStream(
145
            outputName: $filename,
145
            outputName: $filename,
146
        );
146
        );
Línea 147... Línea 147...
147
 
147
 
Línea 156... Línea 156...
156
     *
156
     *
157
     * @param string $filename
157
     * @param string $filename
158
     * @param stdClass|null $exportoptions
158
     * @param stdClass|null $exportoptions
159
     * @return static
159
     * @return static
160
     */
160
     */
161
    public static function get_file_writer(string $filename, stdClass $exportoptions = null) {
161
    public static function get_file_writer(string $filename, ?stdClass $exportoptions = null) {
162
        $dir = make_request_directory();
162
        $dir = make_request_directory();
163
        $filepath = $dir . "/$filename";
163
        $filepath = $dir . "/$filename";
164
        $fh = fopen($filepath, 'w');
164
        $fh = fopen($filepath, 'w');
Línea 165... Línea 165...
165
 
165
 
Línea 349... Línea 349...
349
            $path[] = $this->get_context_folder_name($curcontext);
349
            $path[] = $this->get_context_folder_name($curcontext);
350
        }
350
        }
Línea 351... Línea 351...
351
 
351
 
Línea 352... Línea 352...
352
        $path[] = $filepathinzip;
352
        $path[] = $filepathinzip;
Línea 353... Línea 353...
353
 
353
 
354
        $finalpath = implode(DIRECTORY_SEPARATOR, $path);
354
        $finalpath = implode('/', $path);
Línea 355... Línea 355...
355
 
355