定制 jerodev/flysystem-v3-smb-adapter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jerodev/flysystem-v3-smb-adapter

最新稳定版本:1.2.0

Composer 安装命令:

composer require jerodev/flysystem-v3-smb-adapter

包简介

SMB adapter for Flysystem v3

README 文档

README

run-tests Latest Stable Version

This package enables you to communicate with SMB shares through Flysystem v3.

Installation

composer require jerodev/flysystem-v3-smb-adapter

Usage

The adapter uses the Icewind SMB package to communicate with the share.
To use the flysystem adapter, you have to pass it an instance of \Icewind\SMB\IShare. Below is an example of how to create a share instance using the factory provided by Icewind SMB.

$server = (new \Icewind\SMB\ServerFactory())->createServer(
    $config->host,
    new \Icewind\SMB\BasicAuth(
        $config->user,
        'test',
        $config->password
    )
);
$share = $server->getShare($config->share);

return new \Jerodev\Flysystem\Smb\SmbAdapter($share, '');

Laravel Filesystem

The package also ships with a Laravel service provider that automatically registers a driver for you. Laravel will discover this provider for you when installing this package. All you have to do is configure the share in your config/filesystems.php similar to the example below.

'disks' => [
    'smb_share' => [
        'driver' => 'smb',
        'workgroup' => 'WORKGROUP',
        'host' => \env('SMB_HOST', '127.0.0.1'),
        'path' => \env('SMB_PATH', 'test'),
        'username' => \env('SMB_USERNAME', ''),
        'password' => \env('SMB_PASSWORD', ''),
        
        // Optional Icewind SMB options
        'smb_version_min' => \Icewind\SMB\IOptions::PROTOCOL_SMB2,
        'smb_version_max' => \Icewind\SMB\IOptions::PROTOCOL_SMB2_24,
        'timeout' => 20,
    ],
],

统计信息

  • 总下载量: 82k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-15