diff options
Diffstat (limited to 'vendor/league/flysystem/src')
| -rw-r--r-- | vendor/league/flysystem/src/Adapter/Ftp.php | 4 | ||||
| -rw-r--r-- | vendor/league/flysystem/src/Adapter/Local.php | 1 | ||||
| -rw-r--r-- | vendor/league/flysystem/src/Filesystem.php | 3 | ||||
| -rw-r--r-- | vendor/league/flysystem/src/Util/ContentListingFormatter.php | 28 |
4 files changed, 21 insertions, 15 deletions
diff --git a/vendor/league/flysystem/src/Adapter/Ftp.php b/vendor/league/flysystem/src/Adapter/Ftp.php index fd0660d2b4..a3ebaa75fd 100644 --- a/vendor/league/flysystem/src/Adapter/Ftp.php +++ b/vendor/league/flysystem/src/Adapter/Ftp.php @@ -380,13 +380,11 @@ class Ftp extends AbstractFtpAdapter */ public function getMetadata($path) { - $connection = $this->getConnection(); - if ($path === '') { return ['type' => 'dir', 'path' => '']; } - if (@ftp_chdir($connection, $path) === true) { + if (@ftp_chdir($this->getConnection(), $path) === true) { $this->setConnectionRoot(); return ['type' => 'dir', 'path' => $path]; diff --git a/vendor/league/flysystem/src/Adapter/Local.php b/vendor/league/flysystem/src/Adapter/Local.php index 1bdf51d81f..eea8cb6e70 100644 --- a/vendor/league/flysystem/src/Adapter/Local.php +++ b/vendor/league/flysystem/src/Adapter/Local.php @@ -106,6 +106,7 @@ class Local extends AbstractAdapter } umask($umask); + clearstatcache(false, $root); if ( ! is_dir($root)) { $errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : ''; diff --git a/vendor/league/flysystem/src/Filesystem.php b/vendor/league/flysystem/src/Filesystem.php index 7e9881fb54..8b0f9bdadc 100644 --- a/vendor/league/flysystem/src/Filesystem.php +++ b/vendor/league/flysystem/src/Filesystem.php @@ -270,7 +270,8 @@ class Filesystem implements FilesystemInterface $directory = Util::normalizePath($directory); $contents = $this->getAdapter()->listContents($directory, $recursive); - return (new ContentListingFormatter($directory, $recursive))->formatListing($contents); + return (new ContentListingFormatter($directory, $recursive, $this->config->get('case_sensitive', true))) + ->formatListing($contents); } /** diff --git a/vendor/league/flysystem/src/Util/ContentListingFormatter.php b/vendor/league/flysystem/src/Util/ContentListingFormatter.php index 5a8c95a8d9..ae0d3b91d2 100644 --- a/vendor/league/flysystem/src/Util/ContentListingFormatter.php +++ b/vendor/league/flysystem/src/Util/ContentListingFormatter.php @@ -13,19 +13,26 @@ class ContentListingFormatter * @var string */ private $directory; + /** * @var bool */ private $recursive; /** + * @var bool + */ + private $caseSensitive; + + /** * @param string $directory * @param bool $recursive */ - public function __construct($directory, $recursive) + public function __construct($directory, $recursive, $caseSensitive = true) { - $this->directory = $directory; + $this->directory = rtrim($directory, '/'); $this->recursive = $recursive; + $this->caseSensitive = $caseSensitive; } /** @@ -37,14 +44,9 @@ class ContentListingFormatter */ public function formatListing(array $listing) { - $listing = array_values( - array_map( - [$this, 'addPathInfo'], - array_filter($listing, [$this, 'isEntryOutOfScope']) - ) - ); + $listing = array_filter(array_map([$this, 'addPathInfo'], $listing), [$this, 'isEntryOutOfScope']); - return $this->sortListing($listing); + return $this->sortListing(array_values($listing)); } private function addPathInfo(array $entry) @@ -85,7 +87,9 @@ class ContentListingFormatter return true; } - return strpos($entry['path'], $this->directory . '/') === 0; + return $this->caseSensitive + ? strpos($entry['path'], $this->directory . '/') === 0 + : stripos($entry['path'], $this->directory . '/') === 0; } /** @@ -97,7 +101,9 @@ class ContentListingFormatter */ private function isDirectChild(array $entry) { - return Util::dirname($entry['path']) === $this->directory; + return $this->caseSensitive + ? $entry['dirname'] === $this->directory + : strcasecmp($this->directory, $entry['dirname']) === 0; } /** |
