PHPackages                             bitsnbolts/flysystem-msgraph - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. bitsnbolts/flysystem-msgraph

ActiveLibrary[File &amp; Storage](/categories/file-storage)

bitsnbolts/flysystem-msgraph
============================

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

1.0.3(5y ago)02.5k2MITPHP

Since Feb 19Pushed 5y agoCompare

[ Source](https://github.com/bitsnbolts/flysystem-msgraph)[ Packagist](https://packagist.org/packages/bitsnbolts/flysystem-msgraph)[ RSS](/packages/bitsnbolts-flysystem-msgraph/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

flysystem-msgraph
=================

[](#flysystem-msgraph)

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

Setting Up A Background App For Microsoft Graph
-----------------------------------------------

[](#setting-up-a-background-app-for-microsoft-graph)

This flysystem adapter operates as a Background Service. See  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 .

Using with OneDrive
-------------------

[](#using-with-onedrive)

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

Using with Sharepoint Document Libraries
----------------------------------------

[](#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: )
- $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
-------------

[](#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
- 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.

[](#testing-large-file-uploads)

To test the large file upload, generate a large file here  and save it to `tests/files.50MB.bin`.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

4

Last Release

1914d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4395242ced08362b402e6117b60fe23df915df83e48b9b6bb8940b31ea55a660?d=identicon)[thijsvdanker](/maintainers/thijsvdanker)

---

Top Contributors

[![thijsvdanker](https://avatars.githubusercontent.com/u/429548?v=4)](https://github.com/thijsvdanker "thijsvdanker (25 commits)")[![tdondich](https://avatars.githubusercontent.com/u/3330334?v=4)](https://github.com/tdondich "tdondich (13 commits)")[![gms8994](https://avatars.githubusercontent.com/u/50712?v=4)](https://github.com/gms8994 "gms8994 (6 commits)")[![adiwit-co-th](https://avatars.githubusercontent.com/u/50860673?v=4)](https://github.com/adiwit-co-th "adiwit-co-th (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bitsnbolts-flysystem-msgraph/health.svg)

```
[![Health](https://phpackages.com/badges/bitsnbolts-flysystem-msgraph/health.svg)](https://phpackages.com/packages/bitsnbolts-flysystem-msgraph)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

751291.4k43](/packages/civicrm-civicrm-core)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
