Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 621
Zeile 94... Zeile 94...
94
 
94
 
95
        return (string) $uri;
95
        return (string) $uri;
Zeile 96... Zeile 96...
96
    }
96
    }
-
 
97
 
-
 
98
    /**
-
 
99
     * Get a temporary upload URL for the file at the given path.
-
 
100
     *
-
 
101
     * @param  string  $path
-
 
102
     * @param  \DateTimeInterface  $expiration
-
 
103
     * @param  array  $options
-
 
104
     * @return array
-
 
105
     */
-
 
106
    public function temporaryUploadUrl($path, $expiration, array $options = [])
-
 
107
    {
-
 
108
        $command = $this->client->getCommand('PutObject', array_merge([
-
 
109
            'Bucket' => $this->config['bucket'],
-
 
110
            'Key' => $this->prefixer->prefixPath($path),
-
 
111
        ], $options));
-
 
112
 
-
 
113
        $signedRequest = $this->client->createPresignedRequest(
-
 
114
            $command, $expiration, $options
-
 
115
        );
-
 
116
 
-
 
117
        $uri = $signedRequest->getUri();
-
 
118
 
-
 
119
        // If an explicit base URL has been set on the disk configuration then we will use
-
 
120
        // it as the base URL instead of the default path. This allows the developer to
-
 
121
        // have full control over the base path for this filesystem's generated URLs.
-
 
122
        if (isset($this->config['temporary_url'])) {
-
 
123
            $uri = $this->replaceBaseUrl($uri, $this->config['temporary_url']);
-
 
124
        }
-
 
125
 
-
 
126
        return [
-
 
127
            'url' => (string) $uri,
-
 
128
            'headers' => $signedRequest->getHeaders(),
-
 
129
        ];
-
 
130
    }
97
 
131
 
98
    /**
132
    /**
99
     * Get the underlying S3 client.
133
     * Get the underlying S3 client.
100
     *
134
     *
101
     * @return \Aws\S3\S3Client
135
     * @return \Aws\S3\S3Client