Download the PHP package gwsn/sharepoint-sdk without Composer
On this page you can find all versions of the php package gwsn/sharepoint-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gwsn/sharepoint-sdk
More information about gwsn/sharepoint-sdk
Files in gwsn/sharepoint-sdk
Package sharepoint-sdk
Short Description Connect to sharepoint drive with PHP
License MIT
Homepage https://github.com/gwsn/sharepoint-sdk
Informations about the package sharepoint-sdk
sharepoint-sdk for the Sharepoint Graph API
Sharepoint SDK to use Sharepoint as filestorage.
For the Flysystem adapter (Symfony and Laravel) see the flysystem package: gwsn/flysystem-sharepoint-adapter
Installation
You can install the package via composer:
First configuration to start 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
Azure Active Directory
- Go to
App registrations
- Click on
new Registration
and follow the wizard.
(give it a name like mine is 'gwsn-sharepoint-connector' 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 last parameter will be the sharepoint 'slug', 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}/Shared%20Documents/Forms/AllItems.aspx
You need to set the$sharepointSite
as{site-slug}
Example:
- Sharepoint site url:
https://GWSN.sharepoint.com/sites/gwsn-documents-store/Shared%20Documents/Forms/AllItems.aspx
- Sharepoint site variable:
$sharepointSite = 'gwsn-documents-store'
- Sharepoint site url:
Basic usage with the flysystem adapter (preferred way!)
Basic needs to be able to use the folder|drive|file service
Usage for managing for Sharepoint drives
include the basic usage and add the following code
Usage for managing Sharepoint folders
include the basic usage and add the following code
Usage for files in Sharepoint drives
include the basic usage and add the following code
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
License
The MIT License (MIT). Please see License File for more information.