2declare(strict_types=1);
9use League\Flysystem\Adapter\Local;
37 $this->mapConfigLinkToLocalLinks(
$config->getLinkBehaviour()),
39 self::FILE_ACCESS_KEY => [
40 self::PRIVATE_ACCESS_KEY =>
$config->getFileAccessPrivate(),
41 self::PUBLIC_ACCESS_KEY =>
$config->getFileAccessPublic()
43 self::DIRECTORY_ACCESS_KEY => [
44 self::PRIVATE_ACCESS_KEY =>
$config->getDirectoryAccessPrivate(),
45 self::PUBLIC_ACCESS_KEY =>
$config->getDirectoryAccessPublic()
51 $reflection = new \ReflectionObject($adapter);
52 $property = $reflection->getProperty(
"pathSeparator");
53 $property->setAccessible(
true);
54 $property->setValue($adapter,
'/');
59 $adapter->setPathPrefix($adapter->getPathPrefix());
61 $filesystem = new \League\Flysystem\Filesystem($adapter);
80 switch ($configLinkBehaviour) {
82 return Local::DISALLOW_LINKS;
84 return Local::SKIP_LINKS;
86 throw new \InvalidArgumentException(
"The supplied value \"$configLinkBehaviour\" is not a valid LocalConfig link behaviour constant.");
101 if ($code === LOCK_EX || $code === LOCK_SH) {
105 throw new \InvalidArgumentException(
"The supplied value \"$code\" is not a valid file lock mode please check your local file storage configurations.");
An exception for terminatinating execution or to throw for unit testing.
Class LocalConfig This class is used to configure the local filesystem adapter.
const SKIP_LINKS
Skip encountered links.
const DISALLOW_LINKS
This is the default behaviour because links violate the root filesystem constraint.
Class FlySystemDirectoryAccess.
Class FlySystemFileAccess Fly system file access implementation.
Class FlySystemFileStreamAccess Streaming access implementation of the fly system library.
Class FlySystemLocalFilesystemFactory The local fly system filesystem factory creates instances of th...
const DIRECTORY_ACCESS_KEY
validateFileLockMode($code)
Checks if the supplied file lock mode is valid.
getInstance(LocalConfig $config)
Creates a new instance of the local filesystem adapter used by fly system.
mapConfigLinkToLocalLinks($configLinkBehaviour)
Maps a constant of the LocalConfig class into a constant of the Local class.
Interface Filesystem The filesystem interface provides the public interface for the Filesystem servic...