-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEP Upgrade legue/flysystem to version 3.0
- Loading branch information
Sabina Talipova
committed
Oct 21, 2022
1 parent
a730c06
commit 0267ab7
Showing
26 changed files
with
231 additions
and
147 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Assets\Flysystem; | ||
|
||
use League\Flysystem\Filesystem; | ||
use League\Flysystem\FilesystemAdapter; | ||
use League\Flysystem\PathNormalizer; | ||
|
||
class ExtendedFilesystem extends Filesystem | ||
{ | ||
private $adapter; | ||
|
||
public function __construct( | ||
FilesystemAdapter $adapter, | ||
array $config = [], | ||
PathNormalizer $pathNormalizer = null | ||
) { | ||
$this->adapter = $adapter; | ||
parent::__construct($adapter, $config, $pathNormalizer); | ||
} | ||
|
||
/** | ||
* @return FilesystemAdapter | ||
*/ | ||
public function getAdapter(): FilesystemAdapter | ||
{ | ||
return $this->adapter; | ||
} | ||
} |
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,32 @@ | ||
<?php | ||
|
||
namespace SilverStripe\Assets\Flysystem; | ||
|
||
use League\Flysystem\Local\LocalFilesystemAdapter; | ||
use League\Flysystem\PathPrefixer; | ||
use League\Flysystem\UnixVisibility\VisibilityConverter; | ||
use League\MimeTypeDetection\MimeTypeDetector; | ||
|
||
class ExtendedLocalFilesystemAdapter extends LocalFilesystemAdapter | ||
{ | ||
/** | ||
* @var PathPrefixer | ||
*/ | ||
private $pathPrefixer; | ||
|
||
public function __construct( | ||
string $location, | ||
VisibilityConverter $visibility = null, | ||
int $writeFlags = LOCK_EX, | ||
int $linkHandling = self::DISALLOW_LINKS, | ||
MimeTypeDetector $mimeTypeDetector = null | ||
) { | ||
$this->pathPrefixer = new PathPrefixer($location); | ||
parent::__construct($location, $visibility, $writeFlags, $linkHandling, $mimeTypeDetector); | ||
} | ||
|
||
public function prefixPath(string $path): string | ||
{ | ||
return $this->pathPrefixer->prefixPath($path); | ||
} | ||
} |
Oops, something went wrong.