upmind/provision-provider-hello-world

此包最新版本(v1.1.0)没有提供许可证信息。

'Hello World' 示例:配置类别和提供者

v1.1.0 2024-02-15 11:01 UTC

This package is auto-updated.

Last update: 2024-09-15 17:49:23 UTC


README

Latest Version on Packagist

此包是配置类别和提供者的基本 'Hello World' 示例。

安装

composer require upmind/provision-provider-hello-world

使用方法

此库使用了 upmind/provision-provider-base 基本组件,我们建议您通过阅读 README 中的使用部分来熟悉这些组件。

快速入门

以下示例演示如何生成问候语

<?php

use Illuminate\Support\Facades\App;
use Upmind\ProvisionBase\ProviderFactory;

$configuration = [
    'api_key' => 'example',
    'api_secret' => 'shhh!',
];

$factory = App::make(ProviderFactory::class);
$provider = $factory->create('hello-world', 'hello-foo', $configuration);

$createParameters = [
    'name' => 'Harry',
];
$function = $provider->makeJob('greeting', $createParameters);

$greetingResult = $function->execute();

if ($greetingResult->isError()) {
    throw new RuntimeException($greetingResult->getMessage(), 0, $greetingResult->getException());
}

/** @var \Upmind\ProvisionProviders\HelloWorld\Data\Greeting */
$greeting = $greetingResult->getData();

// $greeting->sentence; // Hello Harry! From your friend, Foo.
// ...

支持的提供者

以下提供者已实现

  • Hello Foo
  • Hello Bar

函数

greeting()

通过姓名问候一个人。

变更日志

有关最近更改的更多信息,请参阅 CHANGELOG

贡献

有关详细信息,请参阅 CONTRIBUTING

致谢

许可证

GNU 通用公共许可证版本 3 (GPLv3)。有关更多信息,请参阅 许可证文件

Upmind

使用 Upmind.com 卖、管理和支持网络托管、域名、SSL 证书、网站构建器等 - 终极的网络托管计费和管理解决方案。