您应该考虑使用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);