diff options
author | Christopher Ng <chrng8@gmail.com> | 2022-03-10 05:49:33 +0000 |
---|---|---|
committer | Christopher Ng <chrng8@gmail.com> | 2022-03-18 04:51:26 +0000 |
commit | bf79b97718d42c932222738e83690ce2cea06890 (patch) | |
tree | 7da7be6db3ce39aac9149d996381ebc53c3cf243 /apps/settings/lib | |
parent | e5a205fec1d869dc782ae819aba945309bd8aab0 (diff) | |
download | nextcloud-server-bf79b97718d42c932222738e83690ce2cea06890.tar.gz nextcloud-server-bf79b97718d42c932222738e83690ce2cea06890.zip |
Use streams
Signed-off-by: Christopher Ng <chrng8@gmail.com>
Diffstat (limited to 'apps/settings/lib')
-rw-r--r-- | apps/settings/lib/UserMigration/AccountMigrator.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/settings/lib/UserMigration/AccountMigrator.php b/apps/settings/lib/UserMigration/AccountMigrator.php index 58003244767..7129a8f8349 100644 --- a/apps/settings/lib/UserMigration/AccountMigrator.php +++ b/apps/settings/lib/UserMigration/AccountMigrator.php @@ -78,7 +78,7 @@ class AccountMigrator implements IMigrator { $exportFilename = AccountMigrator::EXPORT_AVATAR_BASENAME . '.' . $avatarFile->getExtension(); $output->writeln('Exporting avatar to ' . $exportFilename . '…'); - if ($exportDestination->addFileContents($exportFilename, $avatarFile->getContent()) === false) { + if ($exportDestination->addFileAsStream($exportFilename, $avatarFile->read()) === false) { throw new AccountMigratorException('Could not export avatar'); } } @@ -135,9 +135,9 @@ class AccountMigrator implements IMigrator { $importFilename = reset($avatarFiles); $output->writeln('Importing avatar from ' . $importFilename . '…'); - $data = $importSource->getFileContents($importFilename); + $stream = $importSource->getFileAsStream($importFilename); $image = new \OC_Image(); - $image->loadFromData($data); + $image->loadFromFileHandle($stream); try { $avatar = $this->avatarManager->getAvatar($user->getUID()); |