定制 riidme/php-sdk 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

riidme/php-sdk

最新稳定版本:v1.0.0

Composer 安装命令:

composer require riidme/php-sdk

包简介

Official PHP SDK for riid.me URL shortener service

README 文档

README

Latest Version on Packagist Tests Total Downloads

Official PHP SDK for the riid.me URL shortener service. This package provides a clean and simple way to interact with the riid.me API.

📦 Related Packages

🔧 Requirements

  • PHP 8.3 or higher
  • PSR-17 HTTP Factory implementation
  • PSR-18 HTTP Client implementation

📥 Installation

You can install the package via composer:

composer require riidme/php-sdk

🚀 Usage

use Riidme\Client;
use Riidme\Exception\RiidmeException;

// Initialize using factory method
$client = Client::create([
    'base_url' => 'https://riid.me',  // Optional
    'timeout'  => 5,                  // Optional
    'retries'  => 3                   // Optional
]);

try {
    $result = $client->shorten('https://example.com/very/long/url');
    echo $result->getShortUrl(); // https://riid.me/abc123
    // or simply
    echo $result; // https://riid.me/abc123
} catch (RiidmeException $e) {
    echo "Error: " . $e->getMessage();
}

🛠️ Laravel Integration

If you're using Laravel, check out our dedicated Laravel package riidme/laravel which provides:

  • Laravel service provider
  • Facade for convenient access
  • Laravel-specific configuration
  • Integration with Laravel's HTTP client
  • Automatic retry handling
  • Queue support

✅ Testing

composer test

🤝 Contributing

Please see CONTRIBUTING for details.

📄 License

The Apache2 License. Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-02-21