問題描述
我不熟悉 Sharepoint.我想使用 PHP 查詢或讀取 Sharepoint 數據庫.
I am not familiar with Sharepoint. I would like to query or read Sharepoint database using PHP.
有沒有辦法做到這一點?
Is there a way I can do that?
提前謝謝你.非常感謝任何幫助.
Thank you in advanc. Any help is greatly appreciated.
推薦答案
您應該考慮使用適用于 SharePoint 的 Camelot PHP 工具,它是專為 SharePoint 列表構建的 Camelot XML 格式的一個有據可查的 php 框架.
You should consider using the Camelot PHP Tools for SharePoint, it's a well documented php framework for the Camelot XML format specially constructed for SharePoint lists.
文檔和下載
- http://docs.bendsoft.com/camelot-php-tools/
- http://www.bendsoft.com/downloads/sharepoint-php-tools/
您還需要 Camelot SharePoint 集成工具包、http://camelottoolkit.codeplex.com/ 和 Camelot .NET 連接器(http://www.bendsoft.com/net-sharepoint-connector/).
You will also need the Camelot SharePoint Integration Toolkit, http://camelottoolkit.codeplex.com/ and the Camelot .NET Connector (http://www.bendsoft.com/net-sharepoint-connector/).
在可以訪問 SharePoint 服務器的盒子上安裝連接器,這可能是與 SharePoint 服務器相同的服務器,然后在與連接器相同的服務器上安裝集成工具包.設置集成工具包中包含的集成服務(按照說明操作),然后就完成了.網站上還有一些說明視頻.
Install the Connector on a box that can reach the SharePoint server, this may be the same server as the SharePoint server, then install the Integration Toolkit on the same server as the Connector. Set up the integration service that is included in the integration toolkit (follow the instructions) and then you are done. There are a few instruction videos on the websites as well.
使用它的好處是您將能夠使用常見的 SQL 查詢通過 API 與 SharePoint 列表和庫進行對話,從不使用基礎 mssql 數據庫.
The upsides of using this is that you will be able to talk to SharePoint lists and libraries through the API by using common SQL queries, the underlying mssql database is never used.
使用 SQL 從 SharePoint 中選擇數據
$SharePointQuery = new SharePointQuery(array(
'sql' => "SELECT * FROM Tasks WHERE ID > 10",
'connection_name' => 'SharePointConnection1'
));
按列表和視圖名稱從 SharePoint 中選擇數據
$SharePointQuery = new SharePointQuery(
array(
'listName' => 'Tasks',
'viewName' => 'All Tasks',
'includeAttachements' => false,
'connection_name' => 'SharePointConnection1',
'columns' => ''
)
);
使用 SQL 和 SharePointNonQuery 在 SharePoint 中插入數據
$SharePointNonQuery = new SharePointNonQuery(array(
'sql' => "INSERT INTO Tasks (Title,AssignedTo,Status,Priority,DueDate,PercentComplete) VALUES ('Test task from PHP',1,'In Progress','(1) High', '". date('Y-m-d H:i:s') ."',0.95)",
'method' => 'ExecuteNonQuery',
'connection_name' => 'SharePointConnection1'
));
還有一些存儲過程可以幫助您進行一些操作,例如文檔庫的高級處理
There are also stored procedures to help you with some operations, like advanced handling of document libraries
下載文件
$download = new CamelotDownloadFile(array(
"file" => $_GET["file"],
"listName" => 'Shared Documents',
"connection_name" => 'SharePointConnection1'
));
$download->download_file();
上傳文件
$args = array(
"file" => $_FILES,
"listName" => 'Shared Documents',
"folder" => 'Folder/',
"connection_name" => 'SharePointConnection2'
);
$UploadFile = new CamelotUploadFile($args);
這篇關于通過 PHP 連接 Sharepoint 數據庫的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!