简体   繁体   English

PHP和办公室在线365 sharepoint之间的兼容性

[英]Compactibility between PHP and office online 365 sharepoint

I want to do few things with sharepoint online 365 and php. 我想用sharepoint online 365和php做一些事情。

I have a php form with three textbox and when click on submit button by entering data, it should save to custom list which is in office online 365 sharepoint. 我有一个带有三个文本框的PHP表单,当通过输入数据单击提交按钮时,它应该保存到办公室在线365 sharepoint的自定义列表。

is it possible to do like this with office online 365 sharepoint and php compactiblilty 有可能这样办公室在线365 sharepoint和php compactiblilty

With asp.net we can add dll of microsoft.client.runtime do this dll supports in php also. 使用asp.net我们可以添加dll of microsoft.client.runtime这个dll也支持php。

Please have a look over this link: Is this helpful? 请看一下这个链接:这有用吗?

https://gist.github.com/lstak/2404924#file-main-js https://gist.github.com/lstak/2404924#file-main-js

Any help would be appreciated thanks. 任何帮助将不胜感激。

There are a few approaches to running PHP and SharePoint Online. 运行PHP和SharePoint Online有几种方法。

The first would be to use a Provider Hosted App in SharePoint where PHP is the provider hosted aspect of the app. 第一种是在SharePoint中使用提供商托管应用程序,其中PHP是应用程序的提供者托管方面。 You can find out more about Provider Hosted apps on MSDN and there was a great session at the SharePoint Conference that covered this http://channel9.msdn.com/Events/SharePoint-Conference/2012/SPC030 您可以在MSDN上找到有关提供商托管应用程序的更多信息,并且在SharePoint会议上有一个很棒的会话,涵盖了这个http://channel9.msdn.com/Events/SharePoint-Conference/2012/SPC030

The other is to leverage the new Office 365 APIs and Azure AD authentication stack. 另一种方法是利用新的Office 365 API和Azure AD身份验证堆栈。 Right now our focus on these APIs is around Visual Studio project types as per our announcement here. 现在我们关注这些API是围绕Visual Studio项目类型进行的。 http://blogs.office.com/2014/05/12/net-and-javascript-libraries-for-office-365-apis/ http://blogs.office.com/2014/05/12/net-and-javascript-libraries-for-office-365-apis/

We are looking at building out some PHP samples in the future once we get code samples out for the key Visual Studio scenarios around Office 365 APIs. 一旦我们获取围绕Office 365 API的关键Visual Studio场景的代码示例,我们正在考虑构建一些PHP示例。

Both of these approaches do not require you to capture users credentials and call CSOM and REST as everything is handled via OAuth tokens. 这两种方法都不需要您捕获用户凭据并调用CSOM和REST,因为所有内容都是通过OAuth令牌处理的。

phpSPO - SharePoint client for PHP The library provides a SharePoint client for PHP applications. phpSPO - 用于PHPSharePoint客户端该库为PHP应用程序提供SharePoint客户端。 This allows you to performs CRUD operations on SharePoint list data, using an REST/OData based API for SharePoint Online. 这允许您使用基于REST / OData的SharePoint Online API对SharePoint列表数据执行CRUD操作。

The current version supports SharePoint Online using claims based authentication. 当前版本使用基于声明的身份验证支持SharePoint Online。

Examples 例子

<?php

require_once 'SPOClient.php';

$username = 'username@tenant.onmicrosoft.com';
$password = 'password';
$url = "https://tenant.sharepoint.com/";

$client = new SPOClient($url);
$client->signIn($username,$password);

//Get Tasks list
$listTitle = 'Tasks';
$list = $client->getList($listTitle);

//Create a Task item
$itemProperties = array('Title' => 'Order Approval', 'Body' => 'Order approval task');
$taskItem = $list->addItem($itemProperties);
print "Task '{$taskItem->Title}' has been created succesfully.\r\n";

$itemId = $taskItem->Id;
//Update a Task item
$itemProperties = array('PercentComplete' => 1);
$list->updateItem($itemId,$itemProperties);

//Delete a Task item
$list->deleteItem($itemId);

?>

References 参考

SharePoint Online client for PHP 适用于PHP的SharePoint Online客户端

As Vadim stated, phpSPO works, but currently does not support AD SharePoint Implementeations. 正如Vadim所说,phpSPO有效,但目前不支持AD SharePoint Implementeations。 If you use your organizational account to access SharePoint online you'll get "Authentication failed: Direct login to WLID is not allowed for this federated namespace" message when you try to authenticate. 如果您使用组织帐户在线访问SharePoint,则会在尝试进行身份验证时收到“身份验证失败:此联合命名空间不允许直接登录WLID”消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM