tizipso/beyondh

1.0.2 2021-08-11 03:25 UTC

This package is auto-updated.

Last update: 2024-11-11 10:36:27 UTC


README

别样红在线文档

环境要求

安装

composer require tizipso/beyondh

发布配置

php bin/hyperf.php vendor:publish tizipso/beyondh

配置文件位于 config/autoload/beyondh.php

使用

# $config 不传值,将从配置文件中读取
$config = [
    'url' => '',
    'domain' => '',
    'app_key' => '',
    'channel_key' => '',
];

$beyondh = new BeyondhInterface($config);

$request = $beyondh->hotel->GetOrgs(PageIndex: 1);

日志打印到文件

添加以下代码到 config/autoload/logger.php

    'beyondh' => [
        'handler' => [
            'class' => Monolog\Handler\StreamHandler::class,
            'constructor' => [
                'stream' => BASE_PATH . '/runtime/logs/beyondh.log',
                'level' => Monolog\Logger::DEBUG,
            ],
        ],
        'formatter' => [
            'class' => Monolog\Formatter\LineFormatter::class,
            'constructor' => [
                'format' => null,
                'dateFormat' => 'Y-m-d H:i:s',
                'allowInlineLineBreaks' => true,
            ],
        ],
    ],