Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-07-10 10:28:05 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
c44314def3f84e449c92357d178599bb474706ae
c44314de
1 parent
8b899a9c
Added check for s3 bucket name to choose shortest url
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
app/Services/ImageService.php
app/Services/ImageService.php
View file @
c44314d
...
...
@@ -259,9 +259,15 @@ class ImageService
$storageUrl
=
config
(
'filesystems.url'
);
// Get the standard public s3 url if s3 is set as storage type
// Uses the nice, short URL if bucket name has no periods in otherwise the longer
// region-based url will be used to prevent http issues.
if
(
$storageUrl
==
false
&&
config
(
'filesystems.default'
)
===
's3'
)
{
$storageDetails
=
config
(
'filesystems.disks.s3'
);
$storageUrl
=
'https://'
.
$storageDetails
[
'bucket'
]
.
'.s3.amazonaws.com'
;
if
(
strpos
(
$storageDetails
[
'bucket'
],
'.'
)
===
false
)
{
$storageUrl
=
'https://'
.
$storageDetails
[
'bucket'
]
.
'.s3.amazonaws.com'
;
}
else
{
$storageUrl
=
'https://s3-'
.
$storageDetails
[
'region'
]
.
'.amazonaws.com/'
.
$storageDetails
[
'bucket'
];
}
}
$this
->
storageUrl
=
$storageUrl
;
...
...
Please
register
or
sign in
to post a comment