composeer update

This commit is contained in:
2019-06-23 11:49:01 +00:00
parent fc2380d68c
commit e9efe70112
327 changed files with 5194 additions and 2278 deletions
@@ -29,6 +29,7 @@ abstract class AbstractAdapter implements AdapterInterface
if ($prefix === '') {
$this->pathPrefix = null;
return;
}
+14 -9
View File
@@ -77,7 +77,7 @@ abstract class AbstractFtpAdapter extends AbstractAdapter
protected $safeStorage;
/**
* True to enable timestamps for FTP servers that return unix-style listings
* True to enable timestamps for FTP servers that return unix-style listings.
*
* @var bool
*/
@@ -317,12 +317,14 @@ abstract class AbstractFtpAdapter extends AbstractAdapter
}
/**
* True to enable timestamps for FTP servers that return unix-style listings
* True to enable timestamps for FTP servers that return unix-style listings.
*
* @param bool $bool
*
* @return $this
*/
public function setEnableTimestampsOnUnixListings($bool = false) {
public function setEnableTimestampsOnUnixListings($bool = false)
{
$this->enableTimestampsOnUnixListings = $bool;
return $this;
@@ -450,35 +452,38 @@ abstract class AbstractFtpAdapter extends AbstractAdapter
$timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear);
$result += compact('timestamp');
}
return $result;
}
/**
* Only accurate to the minute (current year), or to the day
* Only accurate to the minute (current year), or to the day.
*
* Inadequacies in timestamp accuracy are due to limitations of the FTP 'LIST' command
*
* Note: The 'MLSD' command is a machine-readable replacement for 'LIST'
* but many FTP servers do not support it :(
*
* @param string $month e.g. 'Aug'
* @param string $day e.g. '19'
* @param string $month e.g. 'Aug'
* @param string $day e.g. '19'
* @param string $timeOrYear e.g. '09:01' OR '2015'
*
* @return int
*/
protected function normalizeUnixTimestamp($month, $day, $timeOrYear) {
protected function normalizeUnixTimestamp($month, $day, $timeOrYear)
{
if (is_numeric($timeOrYear)) {
$year = $timeOrYear;
$hour = '00';
$minute = '00';
$seconds = '00';
}
else {
} else {
$year = date('Y');
list($hour, $minute) = explode(':', $timeOrYear);
$seconds = '00';
}
$dateTime = DateTime::createFromFormat('Y-M-j-G:i:s', "{$year}-{$month}-{$day}-{$hour}:{$minute}:{$seconds}");
return $dateTime->getTimestamp();
}
+4 -2
View File
@@ -4,7 +4,9 @@
namespace League\Flysystem\Adapter;
/**
* Adapters that implement this interface let the Filesystem know that it files can be overwritten using the write
* Adapters that implement this interface let the Filesystem know that files can be overwritten using the write
* functions and don't need the update function to be called. This can help improve performance when asserts are disabled.
*/
interface CanOverwriteFiles {}
interface CanOverwriteFiles
{
}
+7 -2
View File
@@ -204,7 +204,8 @@ class Ftp extends AbstractFtpAdapter
*/
protected function login()
{
set_error_handler(function () {});
set_error_handler(function () {
});
$isLoggedIn = ftp_login(
$this->connection,
$this->getUsername(),
@@ -511,7 +512,9 @@ class Ftp extends AbstractFtpAdapter
foreach ($listing as $item) {
$output[] = $item;
if ($item['type'] !== 'dir') continue;
if ($item['type'] !== 'dir') {
continue;
}
$output = array_merge($output, $this->listDirectoryContentsRecursive($item['path']));
}
@@ -522,6 +525,7 @@ class Ftp extends AbstractFtpAdapter
* Check if the connection is open.
*
* @return bool
*
* @throws ErrorException
*/
public function isConnected()
@@ -562,6 +566,7 @@ class Ftp extends AbstractFtpAdapter
if ($this->isPureFtpd) {
$path = str_replace(' ', '\ ', $path);
}
return ftp_rawlist($connection, $options . ' ' . $path);
}
}
+4 -3
View File
@@ -33,11 +33,11 @@ class Local extends AbstractAdapter
*/
protected static $permissions = [
'file' => [
'public' => 0644,
'public' => 0644,
'private' => 0600,
],
'dir' => [
'public' => 0755,
'dir' => [
'public' => 0755,
'private' => 0700,
],
];
@@ -297,6 +297,7 @@ class Local extends AbstractAdapter
public function getMetadata($path)
{
$location = $this->applyPathPrefix($path);
clearstatcache(false, $location);
$info = new SplFileInfo($location);
return $this->normalizeFileInfo($info);
@@ -34,15 +34,17 @@ trait StreamedCopyTrait
// Required abstract method
/**
* @param string $path
* @param string $path
*
* @return resource
*/
abstract public function readStream($path);
/**
* @param string $path
* @param resource $resource
* @param Config $config
* @param string $path
* @param resource $resource
* @param Config $config
*
* @return resource
*/
abstract public function writeStream($path, $resource, Config $config);