tourze / user-track-bundle
用户埋点
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.1
- doctrine/dbal: ^4.0
- doctrine/doctrine-bundle: ^2.13
- doctrine/orm: ^3.0
- doctrine/persistence: ^3.1 || ^4
- nesbot/carbon: ^2.72 || ^3
- psr/log: ^3|^2|^1
- symfony/config: ^6.4
- symfony/dependency-injection: ^6.4
- symfony/event-dispatcher-contracts: ^2.5 | ^3
- symfony/framework-bundle: ^6.4
- symfony/http-kernel: ^6.4
- symfony/security-bundle: ^6.4
- symfony/security-core: ^6.4
- symfony/security-http: ^6.4
- symfony/yaml: ^6.4 || ^7.1
- tourze/arrayable: 0.0.*
- tourze/doctrine-async-bundle: ^0.0.6
- tourze/doctrine-indexed-bundle: 0.0.*
- tourze/doctrine-ip-bundle: 0.0.*
- tourze/doctrine-snowflake-bundle: 0.1.*
- tourze/doctrine-timestamp-bundle: 0.0.*
- tourze/easy-admin-attribute: 0.1.*
- tourze/json-rpc-core: ^0.0.6
- tourze/json-rpc-lock-bundle: 0.1.*
- tourze/symfony-schedule-entity-clean-bundle: 0.1.*
- tourze/user-event-bundle: ~0.0.3
- tourze/user-id-bundle: 0.1.*
- yiisoft/json: ^1.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.0
README
User behavior tracking bundle for recording various user operations in the system.
Features
- Automatic recording of user interaction events
- Support for asynchronous log storage
- Provides RPC interface for manual behavior recording
- Support for automatic cleaning of expired logs
Installation
composer require tourze/user-track-bundle
Testing
Run tests with the following command:
./vendor/bin/phpunit packages/user-track-bundle/tests
Test Plan Status
- Entity tests - Completed
- Event tests - Completed
- Event Subscriber tests - Completed
- RPC Procedure tests - Completed
- Dependency Injection Extension tests - Completed
- Bundle tests - Completed
Usage
- Register the Bundle
// config/bundles.php return [ // ... Tourze\UserTrackBundle\UserTrackBundle::class => ['all' => true], ];
-
Record user behavior by listening to UserInteractionEvent
-
Manually record user behavior via RPC interface
// Using JSON-RPC call $result = $client->call('SubmitCrmTrackLog', [ 'event' => 'user.login', 'params' => ['ip' => $ipAddress] ]);