定制 jamesiarmes/php-ntlm 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jamesiarmes/php-ntlm

最新稳定版本:1.0.0

Composer 安装命令:

composer require jamesiarmes/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.

Scrutinizer Total Downloads

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.

  1. The constructor accepts a required 'user' and 'password' index in the $options array.
  2. The constructor accepts an optional 'curlopts' index in the $options array 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.

统计信息

  • 总下载量: 2.61M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 56
  • 点击次数: 1
  • 依赖项目数: 6
  • 推荐数: 0

GitHub 信息

  • Stars: 56
  • Watchers: 1
  • Forks: 27
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-11-29