mecxer713/wialon-package
Composer 安装命令:
composer require mecxer713/wialon-package
包简介
Laravel and Symfony SDK for the Wialon (Gurtam) API: auto authentication, facade, simplified calls, and local SSL handling.
README 文档
README
🚀 A developer-first, production-ready SDK to integrate the Wialon (Gurtam) API into Laravel & Symfony — with zero-auth pain, zero-SSL pain, and a clean architecture you’ll actually enjoy using.
📚 Table of Contents
- Wialon SDK for Laravel & Symfony
Overview
Wialon SDK for Laravel & Symfony is a modern, open-source PHP SDK designed to make Wialon API integration simple, reliable, and enjoyable.
It abstracts away the two biggest pain points developers face when working with Wialon:
- 🔐 Session management (SID) — handled automatically, transparently, and safely
- 🔒 SSL & cURL certificate errors — fixed out of the box, even on Windows
Built around a pure PHP core and wrapped with native Laravel & Symfony integrations, this package lets you focus on business logic instead of boilerplate, edge cases, and environment issues.
Whether you are building a fleet management system, an internal dashboard, or a production SaaS, this SDK is designed to scale with confidence.
✨ Key Highlights
-
🔐 Zero-config authentication: automatic session (
sid) lifecycle management -
🧠 Pure PHP core: reusable, testable, framework-independent logic
-
🧩 Native integrations:
- Laravel Facade & Artisan command
- Symfony Bundle, DI & Console command
-
🛠 Built-in SSL fixer: automatic CA certificate download (cURL 60/77)
-
🚀 Developer Experience (DX) focused
📦 Package Identity
-
Name:
mecxer713/wialon-package -
Type: Hybrid SDK (Laravel & Symfony)
-
Core dependencies:
guzzlehttp/guzzleilluminate/support(Laravel)symfony/http-kernel(Symfony)
-
Compatibility:
- Laravel 10, 11, 12
- Symfony 6, 7
2️⃣ Laravel Integration Layer
Designed to feel 100% native to Laravel developers.
Components:
WialonServiceProvider– container binding & config publishingFacades/Wialon.php– static access (Wialon::call())Commands/TestWialonConnection.php– Artisan diagnostic commandconfig/wialon.php– Laravel configuration
3️⃣ Symfony Integration Layer
Delivered as a standard Symfony Bundle.
Components:
WialonBundle.php– bundle entry pointDependencyInjection/WialonExtension.php– service injectionDependencyInjection/Configuration.php– YAML config validationCommands/WialonCheckCommand.php– Console diagnostic command
📥 Installation
composer require mecxer713/wialon-package
Laravel
php artisan vendor:publish --tag=wialon-config
Symfony
Enable the bundle (if not using Flex auto-discovery):
// config/bundles.php Mecxer\WialonPackage\WialonBundle::class => ['all' => true],
⚙️ Configuration
Environment variables
WIALON_TOKEN=your_token_here WIALON_BASE_URL=https://hst-api.wialon.com/wialon/ajax.html WIALON_DEFAULT_METHOD=POST
- Laravel:
config/wialon.php - Symfony:
config/packages/wialon.yaml
🚀 Quick Usage
Laravel (Facade)
use Mecxer\WialonPackage\Facades\Wialon; Wialon::login(); $units = Wialon::getUnits();
Symfony (Dependency Injection)
use Mecxer\WialonPackage\WialonClient; public function index(WialonClient $wialon) { $units = $wialon->getUnits(); }
🌐 Generic API Calls
Wialon::call('core/search_items', [ 'spec' => [ 'itemsType' => 'avl_unit', 'propName' => 'sys_name', 'propValueMask' => '*', 'sortType' => 'sys_name' ], 'force' => 1, 'flags' => 1, 'from' => 0, 'to' => 0 ]);
🔁 GET vs POST
// POST (default & recommended) Wialon::callPost('core/search_items', [...]); // GET (optional) Wialon::callGet('core/get_statistics', [...]);
🔐 SSL & Certificate Handling (Killer Feature)
Automatic Fix
php artisan wialon:check --download
# or
php bin/console wialon:check --download
✔ Downloads a valid Mozilla CA bundle ✔ Fixes cURL error 60 / 77 (Windows) ✔ Tests API connectivity
Certificate location:
storage/certif/cacert.pem
🧪 Error Handling
try { $data = Wialon::getUnits(); } catch (\RuntimeException $e) { // Handle HTTP or API errors }
✅ Tests
vendor/bin/phpunit
📌 Why This Package?
✔ One SDK for Laravel & Symfony ✔ No SID headaches ✔ No SSL headaches ✔ Clean architecture ✔ Production-ready
📜 License
MIT
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-04