Update v1.0.6.5
This commit is contained in:
2
vendor/league/flysystem/LICENSE
vendored
2
vendor/league/flysystem/LICENSE
vendored
@@ -1,4 +1,4 @@
|
||||
Copyright (c) 2013-2015 Frank de Jonge
|
||||
Copyright (c) 2013-2016 Frank de Jonge
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
5
vendor/league/flysystem/composer.json
vendored
5
vendor/league/flysystem/composer.json
vendored
@@ -18,10 +18,9 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-fileinfo": "*",
|
||||
"phpunit/phpunit": "~4.8",
|
||||
"phpunit/phpunit": "~4.8 || ~5.0",
|
||||
"mockery/mockery": "~0.9",
|
||||
"phpspec/phpspec": "^2.2",
|
||||
"phpspec/prophecy-phpunit": "~1.0"
|
||||
"phpspec/phpspec": "^2.2"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
|
6
vendor/league/flysystem/src/Adapter/Ftp.php
vendored
6
vendor/league/flysystem/src/Adapter/Ftp.php
vendored
@@ -305,8 +305,8 @@ class Ftp extends AbstractFtpAdapter
|
||||
protected function createActualDirectory($directory, $connection)
|
||||
{
|
||||
// List the current directory
|
||||
$listing = ftp_nlist($connection, '.');
|
||||
|
||||
$listing = ftp_nlist($connection, '.') ?: [];
|
||||
|
||||
foreach ($listing as $key => $item) {
|
||||
if (preg_match('~^\./.*~', $item)) {
|
||||
$listing[$key] = substr($item, 2);
|
||||
@@ -337,7 +337,7 @@ class Ftp extends AbstractFtpAdapter
|
||||
return ['type' => 'dir', 'path' => $path];
|
||||
}
|
||||
|
||||
$listing = ftp_rawlist($connection, str_replace('*', '\\*', $path));
|
||||
$listing = ftp_rawlist($connection, '-A ' . str_replace('*', '\\*', $path));
|
||||
|
||||
if (empty($listing)) {
|
||||
return false;
|
||||
|
@@ -29,7 +29,7 @@ class NullAdapter extends AbstractAdapter
|
||||
public function write($path, $contents, Config $config)
|
||||
{
|
||||
$type = 'file';
|
||||
$result = compact('contents', 'type', 'size', 'path');
|
||||
$result = compact('contents', 'type', 'path');
|
||||
|
||||
if ($visibility = $config->get('visibility')) {
|
||||
$result['visibility'] = $visibility;
|
||||
|
8
vendor/league/flysystem/src/Util.php
vendored
8
vendor/league/flysystem/src/Util.php
vendored
@@ -31,11 +31,7 @@ class Util
|
||||
*/
|
||||
public static function normalizeDirname($dirname)
|
||||
{
|
||||
if ($dirname === '.') {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $dirname;
|
||||
return $dirname === '.' ? '' : $dirname;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,7 +155,7 @@ class Util
|
||||
{
|
||||
$mimeType = MimeType::detectByContent($content);
|
||||
|
||||
if (empty($mimeType) || in_array($mimeType, ['text/plain', 'application/x-empty'])) {
|
||||
if (empty($mimeType) || in_array($mimeType, ['application/x-empty', 'text/plain', 'text/x-asm'])) {
|
||||
$extension = pathinfo($path, PATHINFO_EXTENSION);
|
||||
|
||||
if ($extension) {
|
||||
|
@@ -22,10 +22,7 @@ class MimeType
|
||||
return;
|
||||
}
|
||||
|
||||
$finfo = new Finfo(FILEINFO_MIME_TYPE);
|
||||
$mimeType = $finfo->buffer($content);
|
||||
|
||||
return $mimeType ?: null;
|
||||
return (new Finfo(FILEINFO_MIME_TYPE))->buffer($content) ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,6 +121,7 @@ class MimeType
|
||||
'bmp' => 'image/bmp',
|
||||
'tiff' => 'image/tiff',
|
||||
'tif' => 'image/tiff',
|
||||
'svg' => 'image/svg+xml',
|
||||
'css' => 'text/css',
|
||||
'html' => 'text/html',
|
||||
'htm' => 'text/html',
|
||||
|
36
vendor/league/flysystem/src/Util/StreamHasher.php
vendored
Normal file
36
vendor/league/flysystem/src/Util/StreamHasher.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace League\Flysystem\Util;
|
||||
|
||||
class StreamHasher
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $algo;
|
||||
|
||||
/**
|
||||
* StreamHasher constructor.
|
||||
*
|
||||
* @param string $algo
|
||||
*/
|
||||
public function __construct($algo)
|
||||
{
|
||||
$this->algo = $algo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $resource
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function hash($resource)
|
||||
{
|
||||
rewind($resource);
|
||||
$context = hash_init($this->algo);
|
||||
hash_update_stream($context, $resource);
|
||||
fclose($resource);
|
||||
|
||||
return hash_final($context);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user