PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / trunk
Booking for Appointments and Events Calendar – Amelia vtrunk
2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / microsoft / microsoft-graph / README.md
ameliabooking / vendor / microsoft / microsoft-graph Last commit date
.github 1 year ago .vscode 1 year ago scripts 1 year ago src 5 months ago .editorconfig 1 year ago CONTRIBUTING.md 5 years ago LICENSE 5 years ago README.md 1 year ago THIRD PARTY NOTICES 5 years ago composer.json 1 year ago msgraph-sdk-php.yml 1 year ago phpdoc.dist.xml 1 year ago phpstan.neon 1 year ago phpunit.xml 1 year ago
README.md
164 lines
1 # Get started with the Microsoft Graph SDK for PHP
2
3 [](https://travis-ci.org/microsoftgraph/msgraph-sdk-php![Build Status](https://travis-ci.org/microsoftgraph/msgraph-sdk-php.svg?branch=master)](https://travis-ci.org/microsoftgraph/msgraph-sdk-php](https://travis-ci.org/microsoftgraph/msgraph-sdk-php)
4 [](https://packagist.org/packages/microsoft/microsoft-graph![Latest Stable Version](https://poser.pugx.org/microsoft/microsoft-graph/version)](https://packagist.org/packages/microsoft/microsoft-graph](https://packagist.org/packages/microsoft/microsoft-graph)
5
6 ## Get started with the PHP Connect Sample
7 If you want to play around with the PHP library, you can get up and running quickly with the [](https://github.com/microsoftgraph/php-connect-samplePHP Connect Sample](https://github.com/microsoftgraph/php-connect-sample](https://github.com/microsoftgraph/php-connect-sample). This sample will start you with a little Laravel project that helps you with registration, authentication, and making a simple call to the service.
8
9 ## Install the SDK
10 You can install the PHP SDK with Composer, either run `composer require microsoft/microsoft-graph`, or edit your `composer.json` file:
11 ```
12 {
13 "require": {
14 "microsoft/microsoft-graph": "^1.61.0"
15 }
16 }
17 ```
18 ## Get started with Microsoft Graph
19
20 ### Register your application
21
22 Register your application to use the Microsoft Graph API using [](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBladeMicrosoft Azure Active Directory](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade) in your tenant's Active Directory to support work or school users for your tenant, or multiple tenants.
23
24 ### Authenticate with the Microsoft Graph service
25
26 The Microsoft Graph SDK for PHP does not include any default authentication implementations. The [](https://github.com/thephpleague/oauth2-client`thephpleague/oauth2-client`](https://github.com/thephpleague/oauth2-client](https://github.com/thephpleague/oauth2-client) library will handle the OAuth2 flow for you and provide a usable token for querying the Graph.
27
28 To authenticate as an application you can use the [](http://docs.guzzlephp.org/en/stable/Guzzle HTTP client](http://docs.guzzlephp.org/en/stable/](http://docs.guzzlephp.org/en/stable/), which comes preinstalled with this library, for example like this:
29 ```php
30 $guzzle = new \GuzzleHttp\Client();
31 $url = 'https://login.microsoftonline.com/' . $tenantId . '/oauth2/v2.0/token';
32 $token = json_decode($guzzle->post($url, [
33 'form_params' => [
34 'client_id' => $clientId,
35 'client_secret' => $clientSecret,
36 'scope' => 'https://graph.microsoft.com/.default',
37 'grant_type' => 'client_credentials',
38 ],
39 ])->getBody()->getContents());
40 $accessToken = $token->access_token;
41 ```
42 For an integrated example on how to use Oauth2 in a Laravel application and use the Graph, see the [](https://github.com/microsoftgraph/php-connect-samplePHP Connect Sample](https://github.com/microsoftgraph/php-connect-sample](https://github.com/microsoftgraph/php-connect-sample).
43
44 ### Call Microsoft Graph using the v1.0 endpoint and models
45
46 The following is an example that shows how to call Microsoft Graph.
47
48 ```php
49 use Microsoft\Graph\Graph;
50 use Microsoft\Graph\Model;
51
52 class UsageExample
53 {
54 public function run()
55 {
56 $accessToken = 'xxx';
57
58 $graph = new Graph();
59 $graph->setAccessToken($accessToken);
60
61 $user = $graph->createRequest("GET", "/me")
62 ->setReturnType(Model\User::class)
63 ->execute();
64
65 echo "Hello, I am {$user->getGivenName()}.";
66 }
67 }
68 ```
69
70 ### Call Microsoft Graph using the beta endpoint and models
71
72 The following is an example that shows how to call Microsoft Graph.
73
74 ```php
75 use Microsoft\Graph\Graph;
76 use Beta\Microsoft\Graph\Model as BetaModel;
77
78 class UsageExample
79 {
80 public function run()
81 {
82 $accessToken = 'xxx';
83
84 $graph = new Graph();
85 $graph->setAccessToken($accessToken);
86
87 $user = $graph->setApiVersion("beta")
88 ->createRequest("GET", "/me")
89 ->setReturnType(BetaModel\User::class)
90 ->execute();
91
92 echo "Hello, I am $user->getGivenName() ";
93 }
94 }
95 ```
96
97 ## Develop
98
99 ### Debug
100 You can use the library with a proxy such as [](http://www.telerik.com/fiddlerFiddler](http://www.telerik.com/fiddler](http://www.telerik.com/fiddler) or [](https://www.charlesproxy.com/Charles Proxy](https://www.charlesproxy.com/](https://www.charlesproxy.com/) to debug requests and responses as they come across the wire. Set the proxy port on the Graph object like this:
101 ```php
102 $graph->setProxyPort("localhost:8888");
103 ```
104 Then, open your proxy client to view the requests & responses sent using the library.
105
106 ![Screenshot of Fiddler /me/sendmail request and response](https://github.com/microsoftgraph/msgraph-sdk-php/blob/master/docs/images/Fiddler.PNG)
107
108 This is especially helpful when the library does not return the results you expected to determine whether there are bugs in the API or this SDK. Therefore, you may be asked to provide this information when attempting to triage an issue you file.
109
110 ### Run Tests
111
112 Run
113 ```shell
114 vendor/bin/phpunit --exclude-group functional
115 ```
116 from the base directory.
117
118 *The set of functional tests are meant to be run against a test account. Currently, the
119 tests to do not restore state of the account.*
120
121 #### Debug tests on Windows
122
123 This SDK has an XDebug run configuration that attaches the debugger to VS Code so that you can debug tests.
124
125 1. Install the [](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debugPHP Debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug](https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug) extension into Visual Studio Code.
126 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.
127 3. Paste your clipboard into the [](https://xdebug.org/wizardXDebug Installation Wizard](https://xdebug.org/wizard](https://xdebug.org/wizard) and select **Analyse my phpinfo() output**.
128 4. Follow the generated instructions for installing XDebug. Note that the `/ext` directory is located in your PHP directory.
129 5. Add the following info to your php.ini file:
130
131 ```
132 [XDebug]
133 xdebug.remote_enable = 1
134 xdebug.remote_autostart = 1
135 ```
136
137 Now you can hit a Visual Studio Code breakpoint in a test. Try this:
138
139 1. Add a breakpoint to `testGetCalendarView` in *.\tests\Functional\EventTest.php*.
140 2. Run the **Listen for XDebug** configuration in VS Code.
141 3. Run `.\vendor\bin\phpunit --filter testGetCalendarView` from the PowerShell terminal to run the test and hit the breakpoint.
142
143 ## Documentation and resources
144
145 * [](docs/index.htmlDocumentation](docs/index.html](docs/index.html)
146
147 * [](docs/Examples.mdExamples](docs/Examples.md](docs/Examples.md)
148
149 * [](https://developer.microsoft.com/en-us/graph/Microsoft Graph website](https://developer.microsoft.com/en-us/graph/](https://developer.microsoft.com/en-us/graph/)
150
151 ## Issues
152
153 View or log issues on the [](https://github.com/microsoftgraph/msgraph-sdk-php/issuesIssues](https://github.com/microsoftgraph/msgraph-sdk-php/issues](https://github.com/microsoftgraph/msgraph-sdk-php/issues) tab in the repo.
154
155 ## Contribute
156
157 Please read our [](CONTRIBUTING.mdContributing](CONTRIBUTING.md](CONTRIBUTING.md) guidelines carefully for advice on how to contribute to this repo.
158
159 ## Copyright and license
160
161 Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT [](LICENSElicense](LICENSE](LICENSE).
162
163 This project has adopted the [](https://opensource.microsoft.com/codeofconduct/Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/](https://opensource.microsoft.com/codeofconduct/). For more information see the [](https://opensource.microsoft.com/codeofconduct/faq/Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/](https://opensource.microsoft.com/codeofconduct/faq/) or contact [](mailto:opencode@microsoft.comopencode@microsoft.com](mailto:opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
164