romanchehh/yaroc-v4
Composer 安装命令:
composer require romanchehh/yaroc-v4
包简介
YAROC fork for Random.org API v4 with Flexible Gambling support.
关键字:
README 文档
README
Yet Another Random.org Client — now with Flexible Gambling Support and extended configuration capabilities.
YAROC v4 is a modern PHP client for the Random.org JSON-RPC API, providing full support for the Realise 4 endpoints.
This fork extends the original drupol/yaroc with enhanced flexibility, additional configuration options, and improved license data management.
Why Upgrade to YAROC v4
YAROC v4 introduces full support for Random.org Signed API Release 4, which is required for Flexible Gambling licenses.
Background
- Random.org informed that Release 2 of the Signed API does not properly handle Flexible Gambling licenses.
Previously, it would appear to work, but this was a bug. - Starting 15 August 2025, Release 2 will reject any API key using a Flexible Gambling license with an
API_KEY_INVALID_VERSIONerror.
What YAROC v4 Provides
- Full compatibility with Signed API Release 4.
- Mandatory
licenseDatasupport for all API calls, allowing you to provide license-specific metadata (e.g.,maxPayoutValue). - Default license payload included automatically if
licenseDatais not provided. - Seamless migration path from previous versions without breaking your existing API integration.
Note: Users with Flexible Gambling licenses must upgrade to v4 to avoid service interruptions.
Requirements
- PHP >= 7.4
- An HTTP client (recommended: symfony/http-client)
Installation
composer require romanchehh/yaroc-v4
If you don’t have an HTTP client installed yet:
composer require symfony/http-client
Usage
First request an API Key or use the temporary key.
The temporary API key used in the examples will be disabled when the beta ends.
Currently support all the Random.org API method calls in the basic and signed APIs.
Examples
Basic Example
<?php require 'vendor/autoload.php'; use Romanchehh\Yaroc\Plugin\Provider; use Romanchehh\Yaroc\RandomOrgAPI; // Create a provider for integer generation $provider = (new Provider()) ->withResource('generateIntegers') ->withParameters(['n' => 10, 'min' => 0, 'max' => 100]); // Create API client with default license data $result = (new RandomOrgAPI()) ->withApiKey('00000000-0000-0000-0000-000000000000') ->getData($provider); print_r($result);
️ Example with Custom License Data
You can provide your own license data.
Example
<?php require 'vendor/autoload.php'; use Romanchehh\Yaroc\Plugin\Provider; use Romanchehh\Yaroc\RandomOrgAPI; // Prepare provider for generating random strings $provider = (new Provider()) ->withResource('generateStrings') ->withParameters([ 'n' => 5, 'length' => 10, 'characters' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ]); // Initialize API client with your API key and license metadata $api = (new RandomOrgAPI()) ->withApiKey('your-api-key') ->withLicenseData([ 'maxPayoutValue' => [ 'currency' => 'USD', 'amount' => 99, ], ]); // Send request and print the response $result = $api->getData($provider); print_r($result);
romanchehh/yaroc-v4 适用场景与选型建议
romanchehh/yaroc-v4 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 61 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「client」 「random」 「random.org」 「RNG」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 romanchehh/yaroc-v4 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 romanchehh/yaroc-v4 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 romanchehh/yaroc-v4 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Mock PSR-18 HTTP client
PHP class and Laravel implementation for Random.org
Faker Japanese is a Faker provider that generates fake Japanese related data for you.
Gambling Algorithms for Certification.
Asynchronous MQTT client built on React
YAROC: Yet Another Random.Org Client.
统计信息
- 总下载量: 61
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 27
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-13