Download the PHP package tourze/wechat-work-media-bundle without Composer
On this page you can find all versions of the php package tourze/wechat-work-media-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tourze/wechat-work-media-bundle
More information about tourze/wechat-work-media-bundle
Files in tourze/wechat-work-media-bundle
Package wechat-work-media-bundle
Short Description 企业微信媒体资源管理服务包,支持上传和管理图片、语音、视频等媒体文件
License MIT
Informations about the package wechat-work-media-bundle
WechatWork Media Bundle
中文
A Symfony bundle for managing media resources in WeChat Work (WeCom) applications, providing seamless integration for uploading, downloading, and managing temporary media files.
Features
- Upload media files to WeChat Work and get media IDs
- Download media files from WeChat Work
- Support for multiple media types (image, voice, video, file)
- Temporary media management with expiration tracking
- Caching support for improved performance
- Filesystem integration with Flysystem
- JSON-RPC procedure for file transformation
- Entity-based media tracking with Doctrine ORM
System Requirements
- PHP 8.1 or higher
- Symfony 6.4 or higher
- Doctrine ORM 3.0 or higher
Installation
Quick Start
Basic Usage
Entity Usage
JSON-RPC Procedure
Configuration
The bundle registers services automatically. Make sure you have the following dependencies configured:
tourze/wechat-work-bundlefor WeChat Work API integrationtourze/symfony-temp-file-bundlefor temporary file management- A cache service implementing
Psr\SimpleCache\CacheInterface - A filesystem service implementing
League\Flysystem\FilesystemOperator
API Reference
MediaService
uploadAndGetMediaId(AgentInterface $agent, string $path, MediaType $type): string
Uploads a media file to WeChat Work and returns the media ID.
Parameters:
$agent: WeChat Work agent instance$path: Local file path to upload$type: Media type (IMAGE, VOICE, VIDEO, FILE)
Returns: Media ID string (valid for 3 days)
downloadMedia(AgentInterface $agent, string $mediaId, ?string $ext = null): string
Downloads a media file from WeChat Work.
Parameters:
$agent: WeChat Work agent instance$mediaId: Media ID from WeChat Work$ext: Optional file extension
Returns: File path in the storage system
MediaType Enum
MediaType::IMAGE- Image filesMediaType::VOICE- Voice filesMediaType::VIDEO- Video filesMediaType::FILE- General files
Advanced Usage
Custom Cache Configuration
Error Handling
Batch Operations
Contributing
Please see CONTRIBUTING.md for details.
License
The MIT License (MIT). Please see License File for more information.
All versions of wechat-work-media-bundle with dependencies
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
easycorp/easyadmin-bundle Version ^4
knplabs/knp-menu Version ^3.7
league/flysystem Version ^3.10
psr/simple-cache Version ^1.0|^2.0|^3.0
symfony/config Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/framework-bundle Version ^7.3
symfony/http-client-contracts Version ^3.6
symfony/http-foundation Version ^7.3
symfony/http-kernel Version ^7.3
symfony/property-access Version ^7.3
symfony/yaml Version ^7.3
tourze/bundle-dependency Version 1.*
tourze/doctrine-snowflake-bundle Version 1.1.*
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/easy-admin-enum-field-bundle Version 1.0.*
tourze/easy-admin-menu-bundle Version 1.0.*
tourze/enum-extra Version 1.0.*
tourze/http-client-bundle Version 1.1.*
tourze/json-rpc-core Version 1.0.*
tourze/json-rpc-lock-bundle Version 1.0.*
tourze/json-rpc-log-bundle Version 1.0.*
tourze/symfony-dependency-service-loader Version 1.0.*
tourze/symfony-temp-file-bundle Version 1.0.*
tourze/wechat-work-bundle Version 1.1.*
tourze/wechat-work-contracts Version 1.0.*
yiisoft/json Version ^1.0