定制 bitsnbolts/flysystem-msgraph 二次开发

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

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

bitsnbolts/flysystem-msgraph

Composer 安装命令:

composer require bitsnbolts/flysystem-msgraph

包简介

A Flysystem Adapter that supports Microsoft OneDrive and Sharepoint Document Libraries using Microsoft Graph

README 文档

README

A Flysystem Adapter that supports Microsoft OneDrive and Sharepoint Document Libraries using Microsoft Graph

Setting Up A Background App For Microsoft Graph

This flysystem adapter operates as a Background Service. See https://docs.microsoft.com/en-us/graph/auth-v2-service for more detailed information on how to configure an application.

When setting up permissions, you must add Application Permissions to specify File.ReadWrite.All.

Once your app is completed, you'll need your Administrator to consent to the application using the Azure Portal at https://portal.azure.com/.

Using with OneDrive

  • Currently OneDrive is not supported. Development is continuing to support OneDrive.

Using with Sharepoint Document Libraries

Adapter Constructor Definition:

$adapter = new MSGraphAppSharepoint();

// Generate a token.
$adapter->authorize($tenantId, $appId, $appPassword);

// Setup the site and drive ids.
$adapter->initialize($targetId, $driveName);

$this->fs = new Filesystem($adapter);

$this->fs->write('hello.txt', 'Hello World!');
  • $appId : The Application ID which can be found in the Application Registration
  • $appPassword : The generated password created in the Application Registration
  • $tenantId : The GUID of the tenant.
  • $tokenEndpoint : The OAuth2 Access Token Endpoint for your Azure/Office365 Tenant. (Ex: https://login.microsoftonline.com/example.onmicrosoft.com/oauth2/v2.0/token)
  • $mode : Either 'sharepoint' or 'onedrive' which will specify the target mode. (Note, only Sharepoint is supported currently)
  • $targetId : The target ID for specifying where the files should reside.
    • For Sharepoint, the sharepoint url (Ex: example.sharepoint.com) can be used as well as a URL to the site (Ex: example.sharepoint.com:/sites/EXAMPLE)
  • $driveName : The name of the document library or drive for the specified sharepoint site.

Running Tests

The tests are functional in which a valid Microsoft Office 365/Azure environment must be available. Once you have your application id and password and the application has consent from the administrator, you must provide the credentials through environment variables and then run the phpunit test suites. The environment variables requires are:

  • APP_ID : The application ID you registered
  • APP_PASSWORD : The application Password you generated
  • TENANT_ID : The GUID of the tenant.
  • TEST_SHAREPOINT_SITE_ID : The Sharepoint Site ID to utilize. This should ideally be the FQDN of the sharepoint site (Ex: example.sharepoint.com)
  • OAUTH_AUTHORITY (optional) : The OAuth2 Authority URL to use. Defaults to https://login.microsoftonline.com/common
  • OAUTH_AUTHORIZE_ENDPOINT (optional) : The OAuth2 Authorize Endpoint to use. Defaults to /oauth2/authorize?api-version=1.0
  • OAUTH_TOKEN_ENDPOINT (optional) : The OAuth2 Token Endpoint to use. Defaults to /oauth2/token?api-version=1.0
  • TEST_FILE_PREFIX (optional) : The prefix to add to all file paths for this test suite. Default to no prefix

Testing large file uploads.

To test the large file upload, generate a large file here https://fastest.fish/generate-file and save it to tests/files.50MB.bin.

bitsnbolts/flysystem-msgraph 适用场景与选型建议

bitsnbolts/flysystem-msgraph 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.55k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 03 月 29 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 bitsnbolts/flysystem-msgraph 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bitsnbolts/flysystem-msgraph 我们能提供哪些服务?
定制开发 / 二次开发

基于 bitsnbolts/flysystem-msgraph 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-03-29