taq/pdooci
Composer 安装命令:
composer require taq/pdooci
包简介
Replacement for the PHP PDO OCI class
README 文档
README
| ⚠️ WARNING This software is abandonware. As the creator and maintainer, I don't even use PHP or Oracle for years, so, I can't support it anymore. It should work ok for PHP untill version 7, but seems that with 8.1 there are some alerts. Feel free to fork it and keep it going. |
|---|
Wrapping on PHP OCI functions to simulate a PDO object, using just pure PHP and the oci_* functions.
Let's face it. Installing PHP, PDO, Oracle drivers and PDO OCI is not a pleasant task. Is more pleasant to insert bamboo sticks under your fingernails than make all the voodoo needed to accomplish that task. And there are two big problems with that:
-
If you install
pdo_ociwithpeclyou'll get a version from 2005 (http://pecl.php.net/package/PDO_OCI). Even Christian Bale is now far from the things from 2005, and wow, he had a cool suit and a very nice car. And all came in black. -
If you follow the official docs, you'll need to compile PHP and still get an experimental extension (http://www.php.net/manual/ref.pdo-oci.php). Come on. We can't (yeah, we know how to do it!) compile PHP on every server we need and just for an experimental feature?
That's why I made PDOOCI.
Installation
First install the Oracle drivers (I like the instant client versions) and the
oci8 package (with pecl, this one seems to be updated often).
With Composer
$ composer require taq/pdooci
{
"require": {
"taq/pdooci": "^1.0"
}
}
<?php require_once 'vendor/autoload.php'; $pdo = new PDOOCI\PDO("mydatabase", "user", "password");
Without Composer
Why are you not using composer? Download the src
folder from the repo and rename it to PDOOCI, then require the
PDOOCI/PDO.php file.
require_once "PDOOCI/PDO.php"; $pdo = new PDOOCI\PDO("mydatabase", "user", "password");
Yeah, the rest should work exactly the same as if you were using a PDO object. :-)
Testing
There is a test suite (using PHPUnit with a version bigger than 6.x) on the
test directory. If you want to test (you must test your code!), create a table
called people with two columns:
nameasvarchar2(50)emailasvarchar2(30)
And some environment variables:
PDOOCI_userwith the database user namePDOOCI_pwdwith the database passwordPDOOCI_strwith the database connection string
Don't forget to run composer install!
And then go to the test dir and run PHPUnit like:
phpunit --colors .
taq/pdooci 适用场景与选型建议
taq/pdooci 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 148.82k 次下载、GitHub Stars 达 67, 最近一次更新时间为 2015 年 07 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「pdo」 「oracle」 「pdo_oci」 「oci」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 taq/pdooci 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 taq/pdooci 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 taq/pdooci 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
oracle per progetti Fifree2
The lightweight PHP database framework to accelerate development
Mapper for accessing resources in KWCMS
用于 thinkphp6 框架上的基于 OCI 的 Oracle 数据库驱动。thinkphp5.1 请使用 1.0 版本
统计信息
- 总下载量: 148.82k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 67
- 点击次数: 21
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2015-07-07