sunchaser/doctrine-pgsql-ip 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

sunchaser/doctrine-pgsql-ip

Composer 安装命令:

composer require sunchaser/doctrine-pgsql-ip

包简介

Doctrine type handlers for PostgreSQL's inet and cidr

README 文档

README

This library adds support for cidr and inet types of PostgreSQL in Doctrine using the rlanvin/php-ip library.

Installation

composer require sunchaser/doctrine-pgsql-ip

Usage

  1. Register types in Doctrine

    <?php
    
    use Doctrine\DBAL\Types\Type;
    use SunChaser\Doctrine\PgSql\InetType;
    use SunChaser\Doctrine\PgSql\CidrType;
    
    Type::addType(InetType::NAME, InetType::class);
    Type::addType(CidrType::NAME, CidrType::class);
  2. Add type handling for schema operations

    <?php
    
    use Doctrine\DBAL\Connection;
    use SunChaser\Doctrine\PgSql\InetType;
    use SunChaser\Doctrine\PgSql\CidrType;
    
    /** @var Connection $conn */
    $conn->getDatabasePlatform()->registerDoctrineTypeMapping(InetType::PG_TYPE, InetType::NAME);
    $conn->getDatabasePlatform()->registerDoctrineTypeMapping(CidrType::PG_TYPE, CidrType::NAME);

inet accepts and retrieves both \PhpIP\IP for individual addresses and \PhpIP\IPBlock for network masks. Please check the type when retrieving the data.

cidr accepts and retrieves only \PhpIP\IPBlock.

Upgrade

Changes in 3.0:

  • Requirements were bumped to PHP 8.1 and Doctrine DBAL 4.0

Changes in 2.0:

  • leth/ip-address was replaced with rlanvin/php-ip
  • Requirements were bumped to PHP 8.0 and Doctrine DBAL 3.0

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: ISC
  • 更新时间: 2020-01-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固