Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 57... Línea 57...
57
    private $uploadedFiles = [];
57
    private $uploadedFiles = [];
Línea 58... Línea 58...
58
 
58
 
59
    /**
59
    /**
60
     * @param string                               $method       HTTP method
60
     * @param string                               $method       HTTP method
61
     * @param string|UriInterface                  $uri          URI
61
     * @param string|UriInterface                  $uri          URI
62
     * @param array<string, string|string[]>       $headers      Request headers
62
     * @param (string|string[])[]                  $headers      Request headers
63
     * @param string|resource|StreamInterface|null $body         Request body
63
     * @param string|resource|StreamInterface|null $body         Request body
64
     * @param string                               $version      Protocol version
64
     * @param string                               $version      Protocol version
65
     * @param array                                $serverParams Typically the $_SERVER superglobal
65
     * @param array                                $serverParams Typically the $_SERVER superglobal
66
     */
66
     */
Línea 142... Línea 142...
142
        $normalizedFiles = [];
142
        $normalizedFiles = [];
Línea 143... Línea 143...
143
 
143
 
144
        foreach (array_keys($files['tmp_name']) as $key) {
144
        foreach (array_keys($files['tmp_name']) as $key) {
145
            $spec = [
145
            $spec = [
146
                'tmp_name' => $files['tmp_name'][$key],
146
                'tmp_name' => $files['tmp_name'][$key],
147
                'size'     => $files['size'][$key],
147
                'size' => $files['size'][$key] ?? null,
148
                'error'    => $files['error'][$key],
148
                'error' => $files['error'][$key] ?? null,
149
                'name'     => $files['name'][$key],
149
                'name' => $files['name'][$key] ?? null,
150
                'type'     => $files['type'][$key],
150
                'type' => $files['type'][$key] ?? null,
151
            ];
151
            ];
152
            $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
152
            $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec);
Línea 153... Línea 153...
153
        }
153
        }
Línea 180... Línea 180...
180
            ->withUploadedFiles(self::normalizeFiles($_FILES));
180
            ->withUploadedFiles(self::normalizeFiles($_FILES));
181
    }
181
    }
Línea 182... Línea 182...
182
 
182
 
183
    private static function extractHostAndPortFromAuthority(string $authority): array
183
    private static function extractHostAndPortFromAuthority(string $authority): array
184
    {
184
    {
185
        $uri = 'http://' . $authority;
185
        $uri = 'http://'.$authority;
186
        $parts = parse_url($uri);
186
        $parts = parse_url($uri);
187
        if (false === $parts) {
187
        if (false === $parts) {
188
            return [null, null];
188
            return [null, null];
Línea 284... Línea 284...
284
 
284
 
285
        return $new;
285
        return $new;
Línea 286... Línea 286...
286
    }
286
    }
287
 
-
 
288
    /**
-
 
289
     * {@inheritdoc}
287
 
290
     *
288
    /**
291
     * @return array|object|null
289
     * @return array|object|null
292
     */
290
     */
293
    public function getParsedBody()
291
    public function getParsedBody()
Línea 307... Línea 305...
307
    {
305
    {
308
        return $this->attributes;
306
        return $this->attributes;
309
    }
307
    }
Línea 310... Línea 308...
310
 
308
 
311
    /**
-
 
312
     * {@inheritdoc}
-
 
313
     *
309
    /**
314
     * @return mixed
310
     * @return mixed
315
     */
311
     */
316
    public function getAttribute($attribute, $default = null)
312
    public function getAttribute($attribute, $default = null)
317
    {
313
    {