Download the PHP package pdjshog/onedrive-php-sdk without Composer

On this page you can find all versions of the php package pdjshog/onedrive-php-sdk. 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 onedrive-php-sdk

OneDrive SDK for PHP

OneDrive SDK for PHP is an open source library that allows PHP applications to interact programmatically with the OneDrive REST API.

It supports operations such as creating, reading, updating, deleting (CRUD) files and folders, as well as moving or copying them to other folders.

Requirements

Using the OneDrive SDK for PHP requires the following:

Testing

For development, you also require:

Installation

The recommended way to install OneDrive SDK for PHP is to install it using Composer:

If you are not already using Composer in your PHP project, refer to the Composer documentation to learn how to set it up first.

Quick start

When using OneDrive SDK for PHP, you are assumed to have an application exposing a URL receiving user authentication data from OneDrive. Typically, this URL, referred to as your application's Redirect URI, is a PHP script accepting this data to expose functionality interacting with your users' OneDrive contents. An example of such an application is our functional test suite.

You also need to register a OneDrive application. To do this, first sign in to Microsoft Azure, then visit App registrations and add a registration for your application. While registering your application, you are given the option to set its Redirect URI, explained above. We currently only support Web redirect URIs. Once created, your application is assigned an Application (client) ID, referred to as its Client ID, and in Certificate & secrets, you need to add at least one Client secret. Warning: Client Secrets are similar to passwords or private keys, they allow applications to identify as yours: they should be handled securely and not be disclosed to third-parties.

Once you have a Redirect URI, a Client ID, and a Client Secret, your application can start using the OneDrive SDK for PHP in three steps.

Step 1: create your configuration

As you may need them from several scripts, we recommend saving your Client ID, Client secret and Redirect URI in a configuration file, for example:

Step 2: direct your users to the sign in page

This script is responsible for, given a set of privileges, fetching a login URL from the OneDrive API. It then needs to guide the users to this URL so they initiate their log in and privilege granting process. The script should look like this:

Step 3: get an OAuth access token

After the users follow this URL, they are required to sign in using a valid Microsoft account, and they are asked whether they agree to allow your application to access their OneDrive account.

If they do, they are redirected back to your Redirect URI and a code is passed in the query string of this URL. The script residing at this URL essentially:

  1. Instantiates a Client from your configuration and the state from previous instantiations
  2. Obtains an OAuth access token using Client::obtainAccessToken() passing it the code received
  3. May start interacting with the files and folders stored in their OneDrive account, or delegates this responsibility to other scripts instantiating a Client from the same state

It typically looks like (replace /path/to by the appropriate values):

For details about classes and methods available, see the API reference or the project page on Krizalys.

Versioning

OneDrive SDK for PHP adheres to semantic versioning: we are committed not to introduce breaking changes to the public API without incrementing the major version number. We also try to document such changes in the changelog.

However, we only consider symbols marked with the @api annotation to be part of the public API and subject to the Semantic Versioning requirements. Other symbols are internal to this library; they may change or get removed regardless of the major version number. You should not rely on these in your code.

Testing

To run the functional test suite:

  1. Set your application configuration at test/functional/config.php ;
  2. Run your WebDriver server, for example:

  3. Run the functional test suite (it assumes that WebDriver listening on port 4444):

  4. Repeat step 3 as needed.

License

The OneDrive SDK for PHP is licensed under the 3-Clause BSD License.

Credits

The OneDrive SDK for PHP is developed and maintained by Christophe Vidal.


All versions of onedrive-php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.0
guzzlehttp/guzzle Version ^6.3.3
microsoft/microsoft-graph Version ^1.7.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 pdjshog/onedrive-php-sdk contains the following files

Loading the files please wait ....