riidme / php-sdk
There is no license information available for the latest version (v1.0.0) of this package.
Official PHP SDK for riid.me URL shortener service
v1.0.0
2025-02-21 08:08 UTC
Requires
- php: ^8.3
- php-http/client-common: ^2.7.2
- php-http/discovery: ^1.20.0
- php-http/message: ^1.16.2
- psr/http-client: ^1.0.3
- psr/http-factory: ^1.1.0
- psr/http-message: ^2.0
- psr/log: ^3.0.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.49.0
- guzzlehttp/guzzle: ^7.9.2
- php-http/mock-client: ^1.6.1
- phpstan/phpstan: ^1.12.19
- phpunit/phpunit: ^11.5.8
- symfony/var-dumper: ^7.2.3
- vlucas/phpdotenv: ^5.6
README
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
- riidme/laravel - Laravel integration for riid.me
🔧 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.