Download the PHP package gwsn/flysystem-sharepoint-adapter without Composer

On this page you can find all versions of the php package gwsn/flysystem-sharepoint-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package flysystem-sharepoint-adapter

Flysystem adapter for the Sharepoint Graph API

This package contains a adapter for Flysystem to use Sharepoint as filestorage.

Installation

You can install the package via composer:

Usage

You need to request a new clientId and clientSecret for a new application on Azure.

  1. Go to Azure portal https://portal.azure.com
  2. Go to Azure Active Directory
  3. Go to App registrations
  4. 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)
  5. When created the application is created write down the following details
  6. 'Application (client) id', this will be your $clientId
  7. 'Directory (tenant) id', this will be your $tenantId
  8. Then we go in the menu to the API permissions to set the permissions that are required
  9. The click on Add a permission and add the following permissions:
    Microsoft Graph:
    • Files.ReadWrite.All
    • Sites.ReadWrite.All
    • User.Read
  10. Click on the Grant admin consent for ...Company...
  11. Go in the menu to Certificates & secrets
  12. Click on new client secret
  13. Give it a description and expiry date and the value will be your $clientSecret
  14. 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 like https://{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'

Testing

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Laravel

To use the flysystem in Laravel there are additional steps required:

First we need to create a FlySystemSharepointProvider and register this in the config/app.php

Then we need to create the config into the config/filesystem.php

Create the FlySystemSharepointProvider

we need to create a provider to register the custom FlySystem Adapter

create a new file in the app/Providers directory called FlySystemSharepointProvider.php with the following content:

Register the provider in the App config

Add the bottom of the list with providers we need to add the previous created Provider:

Update the Filesystem config

Add filesystem Disks section we will add a new custom disk: sharepoint.

We use env variables as config but you could also enter them directly as string

Usage in laravel

it is bad practice to use logic into a controller but for example purpose we show it in the controller:

App\Http\Controllers\Controller.php

License

The MIT License (MIT). Please see License File for more information.


All versions of flysystem-sharepoint-adapter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
gwsn/sharepoint-sdk Version ^1.0
league/flysystem Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gwsn/flysystem-sharepoint-adapter contains the following files

Loading the files please wait ....