Download the PHP package microsoft/microsoft-graph-core without Composer

On this page you can find all versions of the php package microsoft/microsoft-graph-core. 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 microsoft-graph-core

Get started with the Microsoft Graph Core SDK for PHP

Latest Stable Version Coverage

Install the Core Library

To install the microsoft-graph-core library with Composer, either run composer require microsoft/microsoft-graph-core, or edit your composer.json file:

Get started with Microsoft Graph

1. Register your application

Register your application to use the Microsoft Graph API by following the steps at Register an application with the Microsoft Identity platform.

2. Authenticate with the Microsoft Graph service

The Microsoft Graph Core SDK for PHP does not include any default authentication implementations. The thephpleague/oauth2-client library will handle the OAuth2 flow for you and provide a usable token for querying the Graph.

To authenticate as an application, please see this guide to configure the right permissions.

You can use the Guzzle HTTP client, which comes preinstalled with this library, to get an access token like this:

3. Create a Guzzle HTTP client object

You can create a Guzzle HTTP client object pre-configured for use with the Graph API using our GraphClientFactory. The GraphClientFactory sets some Guzzle config defaults such as connection and request timeouts, and the base_uri to your preferred National Cloud endpoint.

In the near future, the GraphClientFactory will provide some default middleware to use with the Graph API such as retry handlers.

4. Call Microsoft Graph using the v1.0 endpoint

The following is an example that shows how to call Microsoft Graph.

We provide Microsoft Graph models for easy serialization and deserialization.

If you would like to leverage the models we provide, please take a look at the Microsoft Graph PHP SDK and for beta models - the Microsoft Graph Beta PHP SDK.

Documentation and resources

Develop

Run Tests

Run

from the base directory.

Debug tests on Windows

This SDK has an XDebug run configuration that attaches the debugger to VS Code so that you can debug tests.

  1. Install the PHP Debug extension into Visual Studio Code.
  2. From the root of this repo, using PowerShell, run php .\tests\GetPhpInfo.php | clip from the repo root. This will copy PHP configuration information into the clipboard which we will use in the next step.
  3. Paste your clipboard into the XDebug Installation Wizard and select Analyse my phpinfo() output.
  4. Follow the generated instructions for installing XDebug. Note that the /ext directory is located in your PHP directory.
  5. Add the following info to your php.ini file:

Now you can hit a Visual Studio Code breakpoint in a test. Try this:

  1. Add a breakpoint to testCreateWithConfigCreatesClient in .\tests\Http\GraphClientFactoryTest.php.
  2. Run the Listen for XDebug configuration in VS Code.
  3. Run .\vendor\bin\phpunit --filter testCreateWithConfigCreatesClient from the PowerShell terminal to run the test and hit the breakpoint.

Issues

View or log issues on the Issues tab in the repo.

Contribute

Please read our Contributing guidelines carefully for advice on how to contribute to this repo.

Copyright and license

Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT license.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.


All versions of microsoft-graph-core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0 || ^7.4
microsoft/kiota-authentication-phpleague Version ^1.1.0
microsoft/kiota-http-guzzle Version ^1.3.0
microsoft/kiota-serialization-json Version ^1.2.0
microsoft/kiota-serialization-text Version ^1.1.0
microsoft/kiota-serialization-form Version ^1.1.0
microsoft/kiota-serialization-multipart Version ^1.0.0
ext-json Version *
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 microsoft/microsoft-graph-core contains the following files

Loading the files please wait ....