承接 dayploy/doctrine-extensions-bundle 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dayploy/doctrine-extensions-bundle

最新稳定版本:1.0.1

Composer 安装命令:

composer require dayploy/doctrine-extensions-bundle

包简介

README 文档

README

Encrypt your sensitive data in your database.

How it works

Your property is in your entity but not stored directly in the database.

Before persisting in db, it is encrypted using a nonce and the encrypted value is stored in the encryptedValue.

The reverse process is done when the entity is loaded from the db.

Anyone that acces your db can not read the value without the encryption key.

Entity update

In your entity, add your cryptable property. This property is not stored in database.

It can be nullable or not, it depends of your context, but it must be a string.

In this example: $myValue.

The nonce and encrypted value must be stored in binary.

#[ORM\Entity()]
class MyClass
{
    #[Cryptable(
        nonceProperty: 'myValueNonce',
        encryptedProperty: 'myValueEncrypted',
    )]
    private ?string $myValue = null; // this value is not stored in DB

    #[ORM\Column(type: Types::BINARY, nullable: true, length: 2500)]
    private ?string $myValueEncrypted = null;
    #[ORM\Column(type: Types::BINARY, nullable: true)]
    private ?string $myValueNonce = null;

    ...
}

Configuration

Add the bundle to your project

composer require dayploy/doctrine-extensions-bundle

Enable the bundle

Add the bundle to config/bundles.php:

<?php

return [
    ...
    Dayploy\DoctrineExtensionsBundle\DayployDoctrineExtensionsBundle::class => ['all' => true],
];

Encryption Generation

First, generate a new DOCTRINE_ENCRYPTION_KEY:

./bin/console dayploy:doctrine-extensions:generate

put the generated DOCTRINE_ENCRYPTION_KEY in your .env

Of course, use an encryption key per environment ! Do not lose this encryption key, without it, your data is lost

统计信息

  • 总下载量: 590
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固