php sharepoint,通过PHP连接到Sharepoint数据库

您应该考虑使用Camelot PHP Tools for SharePoint,它是专门为SharePoint列表构建的Camelot XML格式的详细文档php框架.

文档和下载

您还需要Camelot SharePoint集成工具包,http://camelottoolkit.codeplex.com/和Camelot .NET Connector(http://www.bendsoft.com/net-sharepoint-connector/).

在可以访问SharePoint服务器的框上安装Connector,这可能是与SharePoint服务器相同的服务器,然后将Integration Toolkit安装在与Connector相同的服务器上.设置集成工具包中包含的集成服务(按照说明进行操作),然后就完成了.网站上也有一些说明视频.

使用它的好处是,您可以使用常见的SQL查询通过API与SharePoint列表和库进行通信,从不使用底层的mssql数据库.

使用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'

));

还有一些存储过程可以帮助您完成某些操作,例如文档库的高级处理

下载文件

$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);

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值