suyar/hyperf-umeng 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

suyar/hyperf-umeng

最新稳定版本:v3.1.6

Composer 安装命令:

composer require suyar/hyperf-umeng

包简介

UMeng OpenApi.

README 文档

README

Latest Stable Version Total Downloads License

Installation

Requirements:

  • php: >=8.1
  • ext-swoole: >=5.0 (SWOOLE_HOOK_NATIVE_CURL)
  • Composer >= 2.0
composer require suyar/hyperf-umeng

Usage

Publish the files of the clickhouse component:

php bin/hyperf.php vendor:publish suyar/hyperf-umeng

Modify your config file config/autoload/umeng.php:

<?php

declare(strict_types=1);

use function Hyperf\Support\env;

return [
    'api_key' => (string) env('UMENG_API_KEY'),
    'api_security' => (string) env('UMENG_API_SECURITY'),
    // Guzzle max curl handles.
    'max_handles' => 10,
    // Guzzle default options.
    'options' => [
        'timeout' => 0,
    ],
];

Using the default ApiKey and ApiSecurity by [Inject]:

namespace App\Controller;

use Hyperf\Di\Annotation\Inject;
use Suyar\UMeng\Client;

class IndexController
{
    #[Inject]
    protected Client $client;

    public function index()
    {
        return $this->client->uapp->getAppCount();
    }
}

Or use factory:

namespace App\Controller;

use Hyperf\Di\Annotation\Inject;
use Suyar\UMeng\Client;use Suyar\UMeng\ClientFactory;

class IndexController
{
    #[Inject]
    protected ClientFactory $clientFactory;

    public function index()
    {
        $client = $this->clientFactory->get('apiKey', 'apiSecret');

        return $client->uapp->getAppCount();
    }
}

Methods

$umeng->uApp; // U-App
$umeng->appTrack; // AppTrack
$umeng->uMini; // U-MiniProgram

Refer:

Via JetBrains

Contact

License

MIT

Donate 🍵

If you are using this program or like it, you can support me in the following ways:

  • Star、Fork、Watch 🚀
  • WechatPay、AliPay ❤
WechatPay AliPay
Wechat QRcode AliPay QRcode

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-07-09