Skip to content

Commit

Permalink
Merge pull request #47 from utopia-php/fix-various-fixes
Browse files Browse the repository at this point in the history
fix: various issues
  • Loading branch information
abnegate authored Oct 7, 2024
2 parents aa996eb + 73b4c7b commit 97b175d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bin/MigrationCLI.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once __DIR__ . '/.././vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';

use Appwrite\Query;
use Dotenv\Dotenv;
Expand Down
2 changes: 1 addition & 1 deletion src/Migration/Destination.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function setSource(Source $source): self
* Transfer Resources to Destination from Source callback
*
* @param array<string> $resources Resources to transfer
* @param callable $callback Callback to run after transfer
* @param callable(array<Resource>): void $callback to run after transfer
* @param string $rootResourceId Root resource ID, If enabled you can only transfer a single root resource
*/
public function run(
Expand Down
13 changes: 6 additions & 7 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function report(array $resources = []): array

/**
* @param array<Resource> $resources
* @param callable $callback
* @param callable(array<Resource>): void $callback
* @return void
*/
#[Override]
Expand Down Expand Up @@ -789,7 +789,6 @@ protected function createIndex(Index $resource): bool

if ($attributeArray === true) {
$lengths[$i] = UtopiaDatabase::ARRAY_INDEX_LENGTH;
$orders[$i] = null;
}
}

Expand Down Expand Up @@ -980,7 +979,7 @@ public function importFile(File $file): File
[
'bucketId' => $bucketId,
'fileId' => $file->getId(),
'file' => new \CurlFile('data://' . $file->getMimeType() . ';base64,' . base64_encode($file->getData()), $file->getMimeType(), $file->getFileName()),
'file' => new \CURLFile('data://' . $file->getMimeType() . ';base64,' . base64_encode($file->getData()), $file->getMimeType(), $file->getFileName()),
'permissions' => $file->getPermissions(),
]
);
Expand All @@ -1003,7 +1002,7 @@ public function importFile(File $file): File
[
'bucketId' => $bucketId,
'fileId' => $file->getId(),
'file' => new \CurlFile('data://' . $file->getMimeType() . ';base64,' . base64_encode($file->getData()), $file->getMimeType(), $file->getFileName()),
'file' => new \CURLFile('data://' . $file->getMimeType() . ';base64,' . base64_encode($file->getData()), $file->getMimeType(), $file->getFileName()),
'permissions' => $file->getPermissions(),
]
);
Expand Down Expand Up @@ -1142,7 +1141,7 @@ public function importPasswordUser(User $user): ?array
);
break;
case Hash::ALGORITHM_SHA256:
$result = $this->users->createShaUser(
$result = $this->users->createSHAUser(
$user->getId(),
$user->getEmail(),
$hash->getHash(),
Expand Down Expand Up @@ -1295,7 +1294,7 @@ private function importDeployment(Deployment $deployment): Resource
],
[
'functionId' => $functionId,
'code' => new \CurlFile('data://application/gzip;base64,' . base64_encode($deployment->getData()), 'application/gzip', 'deployment.tar.gz'),
'code' => new \CURLFile('data://application/gzip;base64,' . base64_encode($deployment->getData()), 'application/gzip', 'deployment.tar.gz'),
'activate' => $deployment->getActivated() ? 'true' : 'false',
'entrypoint' => $deployment->getEntrypoint(),
]
Expand All @@ -1316,7 +1315,7 @@ private function importDeployment(Deployment $deployment): Resource
],
[
'functionId' => $functionId,
'code' => new \CurlFile('data://application/gzip;base64,' . base64_encode($deployment->getData()), 'application/gzip', 'deployment.tar.gz'),
'code' => new \CURLFile('data://application/gzip;base64,' . base64_encode($deployment->getData()), 'application/gzip', 'deployment.tar.gz'),
'activate' => $deployment->getActivated(),
'entrypoint' => $deployment->getEntrypoint(),
]
Expand Down

0 comments on commit 97b175d

Please sign in to comment.