Releases: vgrem/phpSPO
Releases · vgrem/phpSPO
Version 3.1.2
Version 3.1.1
Changelog
- SharePoint model updated to
16.0.24106.12014
version - import fixes (patches for 3.1.0 version)
Version 3.1.0
Changelog
- support for authenticate SharePoint API via client certificate flow
- validate access token response in
GraphServiceClient
Example: how to authenticate SharePoint API via client certificate flow
$siteUrl = "https://contoso.sharepoint.com"; //site or web absolute url
$tenant = "contoso.onmicrosoft.com"; //tenant id or name
$thumbprint = "--thumbprint goes here--";
$clientId = "--client app id goes here--";
$privateKetPath = "-- path to private.key file--"
$privateKey = file_get_contents($privateKetPath);
$ctx = (new ClientContext($siteUrl))->withClientCertificate(
$tenant, $clientId, $privateKey, $thumbprint);
$whoami = $ctx->getWeb()->getCurrentUser()->get()->executeQuery();
print $whoami->getLoginName();
Version 3.0.3
Changelog
- support for document sets in SharePoint API
- fix addering issue with web resource
Example: create a Document Set
$credentials = new ClientCredential($clientId, $clientSecret);
$client = (new ClientContext($siteUrl))->withCredentials($credentials);
$docSetName = "Orders";
$lib = $client->getWeb()->defaultDocumentLibrary();
$docSet = DocumentSet::create($client, $lib->getRootFolder(), $docSetName)->executeQuery();
print($docSet->getProperty("ServerRelativeUrl"));
Version 3.0.2
Changelog
- #325 PR: fix composer autoload issue by @menegain-mathieu
Version 3.0.1
Changelog
- #300: add
CcRecipients
property toMessage
class by @DavidBrogli - #304: Http Response improvements by @lbuchs
- #307 add example to obtain available fields of a list by @cweiske
- #318 Support for custom curl options by @drml
ClientObjectCollection
class enhancements, introducedgetAll
method by @vgrem
Example: read list items in a large list via getAll
method:
$ctx = (new ClientContext($siteUrl))->withCredentials($credentials);
$list = $ctx->getWeb()->getLists()->getByTitle("--large list title--");
$allItems = $list->getItems()->getAll(5000, function ($returnType){
print("{$returnType->getPageInfo()} items loaded...\n");
})->executeQuery();
Version 3.0.0
Changelog
- #283: exception handling enhancements for authentication requests by @SuperDJ
- #286: introduced client secret support for
acquireTokenForPassword
method inAADTokenProvider
class by @R-TECH - #287 and #288: captures and validates if response failed by @fr3nch13
- #297: remove minimum-stability from
composer.json
by @cweiske - #298 and #299: deprecation fixes for
PHP 8
and dropPHP 5.5
requirement by @cweiske
Version 2.5.4
Changelog
- SharePoint API File and Folder addressing enhancements, namely supporting % and # in files and folders with the ResourcePath API
- #284: example bug fixed for addressing a file by @la-costa
- #282: improved authorization error handling by @SuperDJ
Version 2.5.3
Changelog
- SharePoint API: improved support for composite field values namely
FieldLookupValue/FieldMultiLookupValue
,FieldMultiChoiceValue
, referexample 1
below ( related issues: #261) - OData request/response serialization optimizations (namely excluding metadata annotations from response by default)
Example : create list item and specify multi lookup & choice fields values:
$list = $ctx->getWeb()->getLists()->getByTitle("Tasks");
$taskProps = array(
'Title' => "New task",
'ParentTask' => new FieldLookupValue($taskLookupId),
'PrimaryManager' => new FieldUserValue($userId),
'Managers' => new FieldMultiLookupValue([$userId]),
'TaskCategories' => new FieldMultiChoiceValue(["Event", "Reminder"])
);
$item = $list->addItem($taskProps)->executeQuery();
Version 2.5.2
Changelog
- introduced
Reports
namespace, refer official documentation for a more details Outlook
namespace model updates- SharePoint API: model updated to
16.0.21729.12001
version
Example: Get details about Microsoft 365 active users
Documentation: reportRoot: getOffice365ActiveUserDetail
use Office365\GraphServiceClient;
use Office365\Runtime\Auth\AADTokenProvider;
use Office365\Runtime\Auth\ClientCredential;
function acquireToken()
{
$resource = "https://graph.microsoft.com";
$provider = new AADTokenProvider($tenantName);
return $provider->acquireTokenForClientCredential($resource,
new ClientCredential($clientId, $clientSecret),["/.default"]);
}
$client = new GraphServiceClient("acquireToken");
$result = $client->getReports()->getOffice365ActivationCounts()->executeQuery();
var_dump($result->getValue());
$result = $client->getReports()->getOffice365ActiveUserDetail("D7")->executeQuery();
var_dump($result->getValue());