Code Monkey home page Code Monkey logo

php-skydrive's Introduction

php-skydrive

A PHP client library for Microsoft SkyDrive/OneDrive. This is very much a work in progress! See the Wiki for updates and documentation!

Update 19-May-2014 - Composer.

  • By request, I've created a composer.json and published "lovattj/php-skydrive": "v1.0" on Packagist.
  • I've also added an autoloader definition.
  • I've not got much Composer or autoloading experience, so if it doesn't work please let me know!

Update 18-May-2014 - IMPORTANT CHANGE.

  • get_folder now returns a multidimensional array.
  • $array['data'] is now the array of files.
  • $array['paging'] is an array of page tokens used for pagination.
  • Previous behavior was that $array on it's own was the array of files only.
  • Please update code accordingly and see the Wiki or example project for more information.

Update 19-Feb-2014:

  • Yes! It works with OneDrive fine (new name for SkyDrive).
  • Added support for refresh tokens.
  • You can now build apps that don't require re-authentication every 60 minutes.
  • Also implemented functions to help you build a token store, to help you store tokens if you want to.
  • See the Wiki for more information - there are some major changes.

Update 1-Nov-2013:

  • Converted into a Class
  • First, edit functions.inc.php and include your Live Client ID, Secret Key and oAuth callback URL.
  • Call skydrive_auth::build_oauth_url(); to obtain an oAuth URL.
  • Redirect your user to that URL, then call skydrive_auth::get_oauth_token($_GET['code']); on the callback to obtain an access token.
  • Once you have an access token, create a new object - $sd = new skydrive($access_token);.
  • Then call the specified method - $response = $sd->get_folder();
  • Exceptions will be thrown when a non-200 HTTP status code is encountered.
  • I'll update the Wiki with new class documentation. Thanks!

System Requirements:

  • PHP 5 (I tested with 5.3.3)
  • cURL extension for PHP

How to install manually:

  • Clone project
  • Edit "src/functions.inc.php" and include your Live Client ID, Secret Key and oAuth callback URL in relevant places.
  • Require "src/functions.inc.php", create an object and start calling functions!

How to install via Composer:

  • Require "lovattj/php-skydrive": "v1.0" in your composer.json
  • Edit "vendor/lovattj/php-skydrive/src/functions.inc.php" and include your Live Client ID, Secret Key and oAuth callback URL in relevant places.
  • Require "vendor/lovattj/php-skydrive/src/functions.inc.php", create an object and start calling functions!

How to get the example running:

  • Deploy to your web server
  • Make sure the file "example/tokens" is read+writable by your web user.
  • Edit "src/functions.inc.php" and include your Live Client ID, Secret Key and oAuth callback URL in relevant places.
  • Hit "example/index.php" and follow the prompts to login with SkyDrive!

Questions/Comments:

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.