Automattic / Automattic/VIP-Coding-Standards

Sniff for using PDO to connect to DB

未关闭
#710 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Good First Issue Type: Enhancement
主要语言
PHP
星标
261
派生
44
平均合并
19 分钟
30 天内合并 PR
1

描述

## What problem would the enhancement address for VIP?
The PDO_MYSQL module is not enabled on VIP. Plugins reliant on PDO like MailPoet are therefore currently not compatible with VIP.

## Describe the solution you'd like

An error should be thrown on an attempt to create a PDO connection.

## What code should be reported as a violation?

`$db = new PDO();`

## What code should *not* be reported as a violation?

Any attempt to use PDO should be reported.

贡献指南

打开贡献指南

调研方向

Issue 中没有指定文件或测试。首先定位仓库中现有的 PHP_CodeSniffer sniff 及其测试,然后确定用于检测数据库 API 使用情况的入口点;当使用 PDO 的尝试会被报告,且测试套件覆盖所述违规时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
php
领域
tooling
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。