Download the PHP package tourze/wechat-mini-program-bundle without Composer
On this page you can find all versions of the php package tourze/wechat-mini-program-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package wechat-mini-program-bundle
Wechat Mini Program Bundle
中文
[
]
(https://packagist.org/packages/tourze/wechat-mini-program-bundle)
[
]
(https://packagist.org/packages/tourze/wechat-mini-program-bundle)
[
]
(https://packagist.org/packages/tourze/wechat-mini-program-bundle)
[
]
(https://github.com/tourze/php-monorepo/actions)
[
]
(https://codecov.io/gh/tourze/php-monorepo)
A Symfony bundle for integrating WeChat Mini Program functionality into your application.
Table of Contents
- Features
- Installation
- Configuration
- Usage
- Console Commands
- Services
- Entities
- Exceptions
- Advanced Usage
- Error Handling
- Security
- Dependencies
- Contributing
- License
- Documentation
Features
- WeChat Mini Program API client
- Account management for Mini Program accounts
- Access token automatic refresh and caching
- Launch options handling
- Console commands for debugging and maintenance
- Entity traits for Mini Program integration
- JSON-RPC procedures for API access
Installation
Configuration
Add the bundle to your bundles.php:
Console Commands
Get Access Token
Retrieve access tokens for all valid Mini Program accounts:
This command is designed to run as a cron job every 20 minutes to pre-fetch access tokens, reducing frontend wait times.
Query RID Information
Query RID information for debugging purposes:
Reset API Frequency
Reset API call frequency using AppSecret:
Usage
Basic Client Usage
Account Management
Launch Options
Use the LaunchOptionsAware trait in your entities to handle Mini Program launch options:
Services
Client
The main API client for making requests to WeChat Mini Program APIs:
- Automatic access token handling
- Token refresh on expiration
- Exception handling for API errors
- Caching support
Account Service
Service for managing Mini Program accounts:
- Account validation
- Access token retrieval
- Account configuration management
Launch Option Helper
Helper service for processing Mini Program launch options:
- Query parameter parsing
- Launch option validation
- Path parsing and handling
Entities
Account
Represents a WeChat Mini Program account with:
- Basic account information (name, appId, appSecret)
- Token and encryption key storage
- Timestamps and blame tracking
- IP tracing capabilities
Exceptions
AccountNotFoundException: Thrown when a requested account cannot be foundWechatApiException: Thrown when WeChat API returns an errorDecryptException: Thrown when decryption operations fail
Advanced Usage
Custom API Requests
Create custom API requests by implementing the RequestInterface:
Environment Configuration
Configure different API endpoints for different environments:
Error Handling
The bundle provides comprehensive error handling:
Security
Access Token Security
- Access tokens are automatically cached and refreshed
- Tokens are stored securely using Symfony's cache component
- AppSecret values should be stored as environment variables
Best Practices
- Always validate account credentials before making API calls
- Use HTTPS for all API communications
- Regularly rotate AppSecret values
- Monitor API call frequency to avoid rate limiting
Reporting Security Issues
If you discover a security vulnerability, please send an email to [email protected]. All security vulnerabilities will be promptly addressed.
Dependencies
This bundle requires the following packages:
symfony/framework-bundle: ^7.3- Core Symfony frameworkdoctrine/orm: ^3.0- Object-relational mappingdoctrine/doctrine-bundle: ^2.13- Doctrine integrationtourze/http-client-bundle: 0.1.*- HTTP client functionalitytourze/json-rpc-core: 0.0.*- JSON-RPC supporttourze/backtrace-helper: 0.1.*- Debug tracing utilitieseasycorp/easyadmin-bundle: ^4- Admin interface support
For a complete list of dependencies, see the composer.json file.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This bundle is licensed under the MIT License. See the LICENSE file for details.
Documentation
For more information about WeChat Mini Program development, refer to the official documentation.
All versions of wechat-mini-program-bundle with dependencies
ext-libxml Version *
ext-openssl Version *
ext-simplexml Version *
doctrine/data-fixtures Version ^2.0
doctrine/dbal Version ^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/doctrine-fixtures-bundle Version ^4.0
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
easycorp/easyadmin-bundle Version ^4
knplabs/knp-menu Version ^3.7
monolog/monolog Version ^3.1
nesbot/carbon Version ^2.72 || ^3
psr/link Version ^1.1|^2.0
psr/log Version ^3|^2|^1
symfony/cache-contracts Version ^3
symfony/config Version ^7.3
symfony/console Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/event-dispatcher Version ^7.3
symfony/framework-bundle Version ^7.4
symfony/http-client-contracts Version ^3.6
symfony/http-foundation Version ^7.4
symfony/http-kernel Version ^7.3
symfony/lock Version ^7.3
symfony/property-access Version ^7.3
symfony/security-core Version ^7.3
symfony/yaml Version ^7.3
tourze/arrayable Version 1.*
tourze/backtrace-helper Version 1.*
tourze/bundle-dependency Version 1.*
tourze/doctrine-async-insert-bundle Version 1.0.*
tourze/doctrine-ip-bundle Version 1.1.*
tourze/doctrine-resolve-target-entity-bundle Version 1.*
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/doctrine-track-bundle Version 1.1.*
tourze/doctrine-user-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 2.0.*
tourze/json-rpc-log-bundle Version 2.0.*
tourze/symfony-cron-job-bundle Version 1.1.*
tourze/symfony-dependency-service-loader Version 1.0.*
tourze/wechat-mini-program-appid-contracts Version 1.0.*
yiisoft/arrays Version ^3