取消https验证,并添加vendor文件夹。
This commit is contained in:
44
vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php
vendored
Normal file
44
vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace League\Flysystem\Adapter\Polyfill;
|
||||
|
||||
/**
|
||||
* A helper for adapters that only handle strings to provide read streams.
|
||||
*/
|
||||
trait StreamedReadingTrait
|
||||
{
|
||||
/**
|
||||
* Reads a file as a stream.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return array|false
|
||||
*
|
||||
* @see League\Flysystem\ReadInterface::readStream()
|
||||
*/
|
||||
public function readStream($path)
|
||||
{
|
||||
if ( ! $data = $this->read($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$stream = fopen('php://temp', 'w+b');
|
||||
fwrite($stream, $data['contents']);
|
||||
rewind($stream);
|
||||
$data['stream'] = $stream;
|
||||
unset($data['contents']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a file.
|
||||
*
|
||||
* @param string $path
|
||||
*
|
||||
* @return array|false
|
||||
*
|
||||
* @see League\Flysystem\ReadInterface::read()
|
||||
*/
|
||||
abstract public function read($path);
|
||||
}
|
||||
Reference in New Issue
Block a user