enabel / flysystem-sharepoint
This package is abandoned and no longer maintained.
No replacement package was suggested.
Adapter for flysystem to work with sharepoint
1.1.2
2022-07-01 11:54 UTC
Requires
- php: ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.4
- league/flysystem: ^3.0
Requires (Dev)
- league/flysystem-adapter-test-utilities: ^3.0
- phpunit/phpunit: ^9.5
- vlucas/phpdotenv: ^5.4
README
This package contains an adapter for Flysystem to work with Sharepoint (Graph API)
Requirement
- You need PHP 8.0 or newer, with json support.
Installation
You can install the package via composer:
composer require enabel/flysystem-sharepoint
Usage
You need to request a new clientId and clientSecret for a new application on Azure.
- Go to
Azure portal
https://portal.azure.com - Go to
Active Directory
- Go to
App registrations
- Click on
new Registration
and 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 permissions
to set the permissions that are required - The click on
Add a permission
and 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$sharepointSite
as{site-slug}
and the$sharepointDrive
as{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'
Use standalone
The documentation is available here.
Use with Symfony
The documentation is available here.
Tests
$ make tests
License
This project is open-sourced software licensed under the GNU AGPLv3 License.
About
Originally designed by Damien Lagae. If you have any questions, please contact Damien Lagae.