GithubHelp home page GithubHelp logo

anthonyvancauwenberghe / flysystem-sharepoint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from delaneymethod/flysystem-sharepoint

0.0 1.0 0.0 21 KB

A flysystem driver for Sharepoint API built using PHP.

License: MIT License

PHP 100.00%

flysystem-sharepoint's Introduction

Flysystem adapter for the Sharepoint API

Latest Version on Packagist Total Downloads

This package contains a Flysystem adapter for Sharepoint 2013 REST API. Under the hood, the Sharepoint 2013 REST API is used.

Installation

You can install the package via composer:

composer require delaneymethod/flysystem-sharepoint

Usage

The first thing you need to do is get an authorisation token from Sharepoint. Sharepoint has made this very easy. You can register a new App within your Sharepoint Site that can be used to generate a client ID and Secret. You'll find more info at Authorizing REST API calls against SharePoint Site.

You can read the whole article for additional knowledge but the first step is the only step you're interested in for our flysystem-sharepoint adapter to work.

With an authorisation token you can instantiate a DelaneyMethod\Sharepoint\Client.

use League\Flysystem\Filesystem;
use DelaneyMethod\Sharepoint\Client as SharepointClient;
use DelaneyMethod\FlysystemSharepoint\SharepointAdapter;

$siteName = 'YOUR_TEAM_SITE_NAME';
$siteUrl = 'https://YOUR_SITE.sharepoint.com';
$publicUrl = 'https://YOUR_SITE.sharepoint.com/:i:/r/sites/YOUR_TEAM_SITE_NAME/Shared%20Documents'
$clientId = 'YOUR_CLIENT_ID';
$clientSecret = 'YOUR_CLIENT_SECRET';
$verify = false; // See http://docs.guzzlephp.org/en/stable/request-options.html#verify
$accessToken = 'YOUR_ACCESS_TOKEN';

$client = new SharepointClient($siteName, $siteUrl, $publicUrl, $clientId, $clientSecret, $verify, $accessToken);
			
$adapter = new SharepointAdapter($client);

$filesystem = new Filesystem($adapter, ['url' => $publicUrl]);

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

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.

flysystem-sharepoint's People

Contributors

anthonyvancauwenberghe avatar guusleeuw-ign avatar seandelaney avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.