This package contains an adapter for Flysystem to work with Sharepoint (Graph API)
- You need PHP 8.0 or newer, with json support.
You can install the package via composer:
composer require enabel/flysystem-sharepointYou need to request a new clientId and clientSecret for a new application on Azure.
- Go to
Azure portalhttps://portal.azure.com - Go to
Active Directory - Go to
App registrations - Click on
new Registrationand follow the wizard.
(give it a name like 'sharepoint-connector-APP_NAME' and make a decision on the supported accounts, single tenant should be enough but this depends on your organisation) - When created the application is created write down the following details
- 'Application (client) id', this will be your
$clientId - 'Directory (tenant) id', this will be your
$tenantId - Then we go in the menu to the
API permissionsto set the permissions that are required - The click on
Add a permissionand add the following permissions:
Microsoft Graph:- Files.ReadWrite.All
- Sites.ReadWrite.All
- User.Read
- Click on the
Grant admin consent for ...Company... - Go in the menu to
Certificates & secrets - Click on
new client secret - Give it a description and expiry date and the value will be your
$clientSecret - The two last parameter will be the sharepoint 'slug' & 'library', this is part of the url of the sharepoint site what you want to use and creation of sharepoint site is out of scope of this readme.
When you sharepoint url is likehttps://{tenant}.sharepoint.com/sites/{site-slug}/{site-library}/Forms/AllItems.aspx
You need to set the$sharepointSiteas{site-slug}and the$sharepointDriveas{site-library}by defaultShared%20Documents
Example:
- Sharepoint site url:
https://enabelbe.sharepoint.com/sites/test-storage/Documentations/Forms/AllItems.aspx - Sharepoint site variable:
$sharepointSite = 'test-storage' - Sharepoint drive variable:
$sharepointDrive = 'Documentations'
The documentation is available here.
The documentation is available here.
$ make testsThis project is open-sourced software licensed under the GNU AGPLv3 License.
Originally designed by Damien Lagae. If you have any questions, please contact Damien Lagae.