通过 PHP 连接 Sharepoint 数据库

Connect to Sharepoint Database through PHP(通过 PHP 连接 Sharepoint 数据库)
本文介绍了通过 PHP 连接 Sharepoint 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我不熟悉 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 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)