PHP SharePoint Lists API 技术文档
1. 安装指南
使用 Composer 安装
如果你使用 Composer,只需将 thybag/php-sharepoint-lists-api 添加到你的 composer.json 文件中,然后运行 composer install。
{
"require": {
"thybag/php-sharepoint-lists-api": "dev-master"
}
}
手动安装
如果你不使用 Composer,可以手动下载 SharePointAPI 文件,并在你的项目中包含顶层的 SharePointAPI.php 类。
2. 项目的使用说明
创建 SharePointAPI 对象
在使用 PHP SharePoint Lists API 之前,你需要一个具有所需列表权限的有效用户/服务账户。
对于大多数 SharePoint 安装,你可以使用以下方式创建 API 实例:
use Thybag\SharePointAPI;
$sp = new SharePointAPI('<username>', '<password>', '<path_to_WSDL>');
如果你的安装需要 NTLM 认证,可以使用以下方式:
use Thybag\SharePointAPI;
$sp = new SharePointAPI('<username>', '<password>', '<path_to_WSDL>', 'NTLM');
SharePoint Online 用户必须使用以下方式:
use Thybag\SharePointAPI;
$sp = new SharePointAPI('<username>', '<password>', '<path_to_WSDL>', 'SPONLINE');
所有方法默认返回数组。可以使用 SetReturnType 指定结果应作为对象返回。
3. 项目API使用文档
读取列表数据
返回列表中的所有项目
$sp->read('<list_name>');
或
$sp->query('<list_name>')->get();
返回列表中的前10项
$sp->read('<list_name>', 10);
或
$sp->query('<list_name>')->limit(10)->get();
返回姓氏为 "smith" 的所有项目
$sp->read('<list_name>', NULL, array('surname'=>'smith'));
或
$sp->query('<list_name>')->where('surname', '=', 'smith')->get();
返回姓氏为 "smith" 且年龄为 40 的前5项
$sp->read('<list_name>', 5, array('surname'=>'smith','age'=>40));
或
$sp->query('<list_name>')->where('surname', '=', 'smith')->and_where('age', '=', '40')->limit(5)->get();
使用特定视图返回姓氏为 "smith" 的前10项
$sp->read('<list_name>', 10, array('surname'=>'smith','age'=>40),'{0FAKE-GUID001-1001001-10001}');
或
$sp->query('<list_name>')->where('surname', '=', 'smith')->and_where('age', '=', '40')->limit(10)->using('{0FAKE-GUID001-1001001-10001}')->get();
返回姓氏为 "smith" 且按年龄排序的前10项
$sp->read('<list_name>', 10, array('surname'=>'smith'), NULL, array('age' => 'desc'));
或
$sp->query('<list_name>')->where('surname', '=', 'smith')->limit(10)->sort('age','DESC')->get();
返回前5项,包括 "favroite_cake" 和 "favorite_animal" 列
$sp->read('<list_name>', 5, NULL, array("favroite_cake", "favorite_animal"));
或
$sp->query('<list_name>')->fields(array("favroite_cake", "favorite_animal"))->limit(5)->get();
查询列表
查询方法可以用于需要指定复杂查询的情况。查询是通过一系列(希望是表达性的)伪 SQL 方法构建的。
例如,如果你想查询一个宠物列表并返回所有年龄小于5岁的狗(按年龄排序),你可以使用:
$sp->query('list of pets')->where('type','=','dog')->and_where('age','<','5')->sort('age','ASC')->get();
如果你想获取前10个宠物,它们要么是猫要么是仓鼠,你可以使用:
$sp->query('list of pets')->where('type','=','cat')->or_where('type','=','hamster')->limit(10)->get();
添加到列表
要向列表中添加新项目,可以使用 write、add 或 insert 方法(所有方法功能相同)。创建一个包含 forename、surname、age 和 phone 列的新记录可能如下所示:
$sp->write('<list_name>', array('forename'=>'Bob','surname' =>'Smith', 'age'=>40, 'phone'=>'(00000) 000000' ));
你还可以通过以下方式一起运行多个写操作:
$sp->writeMultiple('<list_name>', array(
array('forename' => 'James'),
array('forename' => 'Steve')
));
编辑行
要编辑一行,你需要其 ID。假设上面的行有 ID 5,我们可以将 Bob 的名字改为 James:
$sp->update('<list_name>','5', array('forename'=>'James'));
与 write 方法一样,你也可以通过以下方式一起运行多个更新操作:
$sp->updateMultiple('<list_name>', array(
array('ID'=>5,'job'=>'Intern'),
array('ID'=>6,'job'=>'Intern')
));
删除行
要删除一行,需要其 ID 和列表名称。要删除 ID 为 5 的 James 记录,你可以使用:
$sp->delete('<list_name>', '5');
如果你希望一次删除多个记录,也可以将 ID 数组传递给 deleteMultiple 方法:
$sp->deleteMultiple('<list_name>', array('6','7','8'));
4. 项目安装方式
使用 Composer 安装
{
"require": {
"thybag/php-sharepoint-lists-api": "dev-master"
}
}
手动安装
手动下载 SharePointAPI 文件,并在你的项目中包含顶层的 SharePointAPI.php 类。
Kimi-K2.5Kimi K2.5 是一款开源的原生多模态智能体模型,它在 Kimi-K2-Base 的基础上,通过对约 15 万亿混合视觉和文本 tokens 进行持续预训练构建而成。该模型将视觉与语言理解、高级智能体能力、即时模式与思考模式,以及对话式与智能体范式无缝融合。Python00- QQwen3-Coder-Next2026年2月4日,正式发布的Qwen3-Coder-Next,一款专为编码智能体和本地开发场景设计的开源语言模型。Python00
xw-cli实现国产算力大模型零门槛部署,一键跑通 Qwen、GLM-4.7、Minimax-2.1、DeepSeek-OCR 等模型Go06
PaddleOCR-VL-1.5PaddleOCR-VL-1.5 是 PaddleOCR-VL 的新一代进阶模型,在 OmniDocBench v1.5 上实现了 94.5% 的全新 state-of-the-art 准确率。 为了严格评估模型在真实物理畸变下的鲁棒性——包括扫描伪影、倾斜、扭曲、屏幕拍摄和光照变化——我们提出了 Real5-OmniDocBench 基准测试集。实验结果表明,该增强模型在新构建的基准测试集上达到了 SOTA 性能。此外,我们通过整合印章识别和文本检测识别(text spotting)任务扩展了模型的能力,同时保持 0.9B 的超紧凑 VLM 规模,具备高效率特性。Python00
KuiklyUI基于KMP技术的高性能、全平台开发框架,具备统一代码库、极致易用性和动态灵活性。 Provide a high-performance, full-platform development framework with unified codebase, ultimate ease of use, and dynamic flexibility. 注意:本仓库为Github仓库镜像,PR或Issue请移步至Github发起,感谢支持!Kotlin08
VLOOKVLOOK™ 是优雅好用的 Typora/Markdown 主题包和增强插件。 VLOOK™ is an elegant and practical THEME PACKAGE × ENHANCEMENT PLUGIN for Typora/Markdown.Less00