PHP code example of geniza-ai / geniza-sdk-php

1. Go to this page and download the library: Download geniza-ai/geniza-sdk-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

geniza-ai / geniza-sdk-php example snippets


use Geniza\Geniza;

new Geniza($key, $secretKey);


namespace Config;
use CodeIgniter\Config\BaseConfig;

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

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

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

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



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);
        });
    }
}

composer