Compare commits

..
101 changed files with 2935 additions and 2131 deletions

View file

@ -12,9 +12,7 @@ APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=en_US APP_FAKER_LOCALE=en_US
APP_MAINTENANCE_DRIVER=file APP_MAINTENANCE_DRIVER=file
# APP_MAINTENANCE_STORE=database APP_MAINTENANCE_STORE=database
PHP_CLI_SERVER_WORKERS=4
BCRYPT_ROUNDS=12 BCRYPT_ROUNDS=12
@ -41,7 +39,7 @@ FILESYSTEM_DISK=local
QUEUE_CONNECTION=database QUEUE_CONNECTION=database
CACHE_STORE=database CACHE_STORE=database
# CACHE_PREFIX= CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1 MEMCACHED_HOST=127.0.0.1
@ -51,7 +49,6 @@ REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
MAIL_MAILER=log MAIL_MAILER=log
MAIL_SCHEME=null
MAIL_HOST=127.0.0.1 MAIL_HOST=127.0.0.1
MAIL_PORT=2525 MAIL_PORT=2525
MAIL_USERNAME=null MAIL_USERNAME=null

View file

@ -32,21 +32,18 @@ class ProcessMedia implements ShouldQueue
*/ */
public function handle(ImageManager $manager): void public function handle(ImageManager $manager): void
{ {
// Load file
$file = Storage::disk('local')->get('media/' . $this->filename);
// Open file // Open file
try { try {
$image = $manager->read($file); $image = $manager->read(storage_path('app/media/') . $this->filename);
} catch (DecoderException) { } catch (DecoderException) {
// not an image; delete file and end job // not an image; delete file and end job
Storage::disk('local')->delete('media/' . $this->filename); unlink(storage_path('app/media/') . $this->filename);
return; return;
} }
// Save the file publicly // Save the file publicly
Storage::disk('public')->put('media/' . $this->filename, $file); Storage::disk('local')->copy('media/' . $this->filename, 'public/media/' . $this->filename);
// Create smaller versions if necessary // Create smaller versions if necessary
if ($image->width() > 1000) { if ($image->width() > 1000) {
@ -57,13 +54,13 @@ class ProcessMedia implements ShouldQueue
$basename = trim(implode('.', $filenameParts), '.'); $basename = trim(implode('.', $filenameParts), '.');
$medium = $image->resize(width: 1000); $medium = $image->resize(width: 1000);
Storage::disk('public')->put('media/' . $basename . '-medium.' . $extension, (string) $medium->encode()); Storage::disk('local')->put('public/media/' . $basename . '-medium.' . $extension, (string) $medium->encode());
$small = $image->resize(width: 500); $small = $image->resize(width: 500);
Storage::disk('public')->put('media/' . $basename . '-small.' . $extension, (string) $small->encode()); Storage::disk('local')->put('public/media/' . $basename . '-small.' . $extension, (string) $small->encode());
} }
// Now we can delete the locally saved image // Now we can delete the locally saved image
Storage::disk('local')->delete('media/' . $this->filename); unlink(storage_path('app/media/') . $this->filename);
} }
} }

Some files were not shown because too many files have changed in this diff Show more