承接 geniza-ai/geniza-sdk-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

geniza-ai/geniza-sdk-php

最新稳定版本:v0.3.1

Composer 安装命令:

composer require geniza-ai/geniza-sdk-php

包简介

SDK for interacting with Geniza.ai API endpoints

README 文档

README

Php_version Package version License

This SDK is the best and easiest way to connect to the Geniza.ai API.

Installation

Install using composer:

composer require geniza-ai/geniza-sdk-php

Usage

use Geniza\Geniza;

new Geniza($key, $secretKey);

Detailed information on how to use the methods contained in this SDK can be found on in our API documentation.

Framework Integrations

CodeIgniter 4

Add the key and secret key to a config class.

<?php
namespace Config;
use CodeIgniter\Config\BaseConfig;

class Geniza extends BaseConfig {
	public string $key = '';
	public string $secretKey = '';
}

Note: These values should be set and overridden by your environment variables.

Add the following to your \Config\Services.php file:

	public static function geniza(bool $getShared = true) {
		if($getShared) {
			return static::getSharedInstance('geniza');
		}

		return new \Geniza\Geniza(
			config('Geniza')->key,
			config('Geniza')->secretKey
		);
	}

You can then instantiate your Geniza handle by simply calling the service method:

	$geniza = \Config\Services::geniza(true);

Laravel

This is an example service provider which registers a shared Optimus instance for your entire application:

<?php

namespace App\Providers;

use Geniza\Geniza;
use Illuminate\Support\ServiceProvider;

class GenizaServiceProvider extends ServiceProvider
{
    public function register()
    {
        $this->app->singleton(Geniza::class, function ($app) {
            $key = 'abcd1234';
            $secretKey = 'efgh5678';
            return new Geniza($key, $secretKey);
        });
    }
}

Once you have created the service provider, add it to the providers array in your config/app.php configuration file:

App\Providers\GenizaServiceProvider::class,

More information: https://laravel.com/docs/5.3/container#resolving

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-16