Last code optimization before release.

This commit is contained in:
James Cole
2018-07-28 10:45:16 +02:00
parent d35470a79e
commit 0c7b652a70
42 changed files with 217 additions and 301 deletions

View File

@@ -25,6 +25,8 @@ namespace FireflyIII\Services\Internal\File;
use Crypt;
use FireflyIII\Exceptions\FireflyException;
use Illuminate\Contracts\Encryption\EncryptException;
use Log;
/**
* Class EncryptService
@@ -43,7 +45,13 @@ class EncryptService
throw new FireflyException(sprintf('File "%s" does not seem to exist.', $file));
}
$content = file_get_contents($file);
$content = Crypt::encrypt($content);
try {
$content = Crypt::encrypt($content);
} catch (EncryptException $e) {
$message = sprintf('Could not encrypt file: %s', $e->getMessage());
Log::error($message);
throw new FireflyException($message);
}
$newName = sprintf('%s.upload', $key);
$path = storage_path('upload') . '/' . $newName;