-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
463 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace AnyCloud\File\Store; | ||
|
||
class Dropbox extends Flysystem | ||
{ | ||
public function getUri($storagePath) | ||
{ | ||
return $this->filesystem->temporaryUrl($storagePath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace AnyCloud\File\Store; | ||
|
||
use League\Flysystem\Filesystem; | ||
use League\Flysystem\Visibility; | ||
use Omeka\File\Store\StoreInterface; | ||
|
||
class Flysystem implements StoreInterface | ||
{ | ||
protected $filesystem; | ||
|
||
public function __construct(Filesystem $filesystem) | ||
{ | ||
$this->filesystem = $filesystem; | ||
} | ||
|
||
public function put($source, $storagePath) | ||
{ | ||
$fh = fopen($source, 'r'); | ||
if ($fh === false) { | ||
throw new \Omeka\File\Exception\RuntimeException(sprintf('Failed to open "%s"', $source)); | ||
} | ||
|
||
$config = ['visibility' => Visibility::PUBLIC]; | ||
$this->filesystem->writeStream($storagePath, $fh, $config); | ||
fclose($fh); | ||
} | ||
|
||
public function delete($storagePath) | ||
{ | ||
$this->filesystem->delete($storagePath); | ||
} | ||
|
||
public function getUri($storagePath) | ||
{ | ||
return $this->filesystem->publicUrl($storagePath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace AnyCloud\FilesystemAdapter; | ||
|
||
use DateTimeInterface; | ||
use League\Flysystem\Config; | ||
use League\Flysystem\UrlGeneration\TemporaryUrlGenerator; | ||
|
||
class DropboxAdapter extends \Spatie\FlysystemDropbox\DropboxAdapter implements TemporaryUrlGenerator | ||
{ | ||
public function temporaryUrl(string $path, DateTimeInterface $expiresAt, Config $config): string | ||
{ | ||
return $this->client->getTemporaryLink($path); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.