marbobley/entities-visitor-bundle
最新稳定版本:V1.3.0
Composer 安装命令:
composer require marbobley/entities-visitor-bundle
包简介
Manage visitor connexion information in Doctrine entities
README 文档
README
Package to manage visitors with DB persistence in Symfony
Installation
composer require marbobley/entities-visitor-bundle
Usage
Create an entity Visitor and extends it from VisitorInformation
- Create the migration script: symfony console make:migration
- Migrate the script : symfony console doctrine:migrations:migrate
When someone visits your site, the event listener will create an entry into the VisitorInformation table
Features
Currently, the bundle only supports Doctrine ORM.
Column saved :
- client ip
- user Agent
- visited at
- method
- route
- control
- path
Setting :
Create a config file :
- In config/packages/entities_visitor_bundle.yaml
entities_visitor_bundle:
enable: false #To activate or desactive the check of visitor
Example
<?php
namespace App\Entity;
use App\Repository\VisitorInformationRepository;
use Doctrine\ORM\Mapping as ORM;
use Marbobley\EntitiesVisitorBundle\Model\VisitorInformation as VisitorInformationModel;
#[ORM\Entity(repositoryClass: VisitorInformationRepository::class)]
class VisitorInformation extends VisitorInformationModel
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
public function getId(): ?int
{
return $this->id;
}
}
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-30