polyfills/pdo-mysql-subclass 问题修复 & 功能扩展

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

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

polyfills/pdo-mysql-subclass

最新稳定版本:v1.0.1

Composer 安装命令:

composer require polyfills/pdo-mysql-subclass

包简介

User-land PHP polyfill for PDO MySQL driver subclass.

README 文档

README

Latest Stable Version License PHP Version Require CI

Provides user-land PHP polyfills for the MySQL subclass provided by PHP 8.4.

Supports PHP 8.1, 8.2, and 8.3. On PHP 8.4 and later, this polyfill is not necessary. Requires pdo_mysql extension compiled with mysqlnd (which is the default and common approach).

It is possible and safe to require this polyfill on PHP 8.4 and later. This polyfill class is autoloadable; on PHP 8.4 and later, PHP will not autoload this polyfill because it's declared natively.

For more information, see PdoMysql on PHP 8.4: PDO Driver-specific sub-classes: MySQL

Installation

composer require polyfills/pdo-mysql-subclass

Usage

Use the provided PdoMysql class to replace PDO MySQL connections.

$mysqlConnection = new PdoMysql(
    'mysql:host=localhost;dbname=phpwatch;charset=utf8mb4;port=33066',
    '<username>',
    '<password>',
);
$mysqlConnection = PdoMysql::connect(
    'mysql:host=localhost;dbname=phpwatch;charset=utf8mb4;port=33066',
    '<username>',
    '<password>',
);

This polyfill adds class-constants to PdoMysql class to match all of the PDO::MYSQL_ constants. For example, PDO::MYSQL_ATTR_SSL_CERT is identical to PdoMysql::ATTR_SSL_CERT.

Features not implemented

  • PDO::connect: This method cannot be polyfilled because it's an existing PHP class that user-land PHP classes cannot modify.
  • PdoMysql::getWarningCount: This method is not implemented in the polfyill.

Contributions

Contributions are welcome either as a GitHub issue or a PR to this repo.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-12