mishanki/php-ntlm
Composer 安装命令:
composer require mishanki/php-ntlm
包简介
Library for communicating with Microsoft services using NTLM authentication.
README 文档
README
The PHP NTLM library (php-ntlm) is intended to provide various methods to aid in communicating with Microsoft services that utilize NTLM authentication from within PHP.
Dependencies
- Composer
- PHP 8.1
- cURL with NTLM support (7.23.0+ recommended)
Installation
The preferred installation method is via Composer, which will automatically handle autoloading of classes.
{
"require": {
"jamesiarmes/php-ntlm": "~1.0"
}
}
Usage
SoapClient
The \jamesiarmes\PhpNtlm\SoapClient class extends PHP's built in SoapClient
class and can be used in the same manner with a few minor changes.
- The constructor accepts a required 'user' and 'password' index in the
$optionsarray. - The constructor accepts an optional 'curlopts' index in the
$optionsarray that can be used to set or override the default curl options.
Basic example:
$client = new SoapClient( $wsdl, array('user' => 'username', 'password' => '12345') );
Example that skips SSL certificate validation:
$client = new SoapClient( $wsdl, array( 'user' => 'username', 'password' => '12345', 'curlopts' => array(CURLOPT_SSL_VERIFYPEER => false), ) );
Available options
The basic options available on the constructor can be found at http://php.net/manual/en/soapclient.soapclient.php. The trace option is not necessary, as the last request and response methods will always be available. In addition to these options, the following additional options are available:
- user (string, required): The user to authenticate with.
- password (string, required): The password to use when authenticating the user.
- curlopts (array): Array of options to set on the curl handler when making the request. This can be used to override any cURL options with the exception of the following: CURLOPT_HEADER, CURLOPT_POST, CURLOPT_POSTFIELDS.
- strip_bad_chars (boolean, default: true): Whether or not to strip invalid characters from the XML response. This can lead to content being returned differently than it actually is on the host service, but can also prevent the "looks like we got no XML document" SoapFault when the response includes invalid characters.
- warn_on_bad_chars (boolean, default: false): Trigger a warning if bad characters are stripped. This has no affect unless strip_bad_chars is true.
Projects that use php-ntlm
The following is a list of known projects that use this library. If you would like to add your project to the list, please open a pull request to update this document.
mishanki/php-ntlm 适用场景与选型建议
mishanki/php-ntlm 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 204 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 11 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mishanki/php-ntlm 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mishanki/php-ntlm 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 204
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 13
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-21