|Last Updated|| ||Ratings|| ||Unique User Downloads|| ||Download Rankings|| || |
|2015-08-11 (1 month ago) ||Not enough user ratings||Total: 374 This week: 1||All time: 6,266 This week: 1,181|
|Description|| ||Author|| || |
This class can access Oracle databases using a PDO class wrapper.
It provides a replacement for the PDO class that wraps around PHP Oracle OCI functions to access Oracle databases.
The class gets the available PDO drivers and insert the oci driver if it is not supported in the current PHP PDO installation.
What is the best PHP oracle oci8 class?
DB class with CRUD, Function calls, Stored Procedures
Prize: One downloadable e-book of choice by O'Reilly
|PDO is a PHP extension that was introduced to provide a certain level of abstraction to access different types of databases.
However, sometimes it is necessary to access a database from components that use PDO, but the driver extension to access the specific type of database is not available in the current PHP environment.
This class implements a pure PHP replacement for PDO Oracle database driver, so it works with the OCI extension when the PDO OCI driver is not available.
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
- If you install
pecl you'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
What is needed
Just install the Oracle drivers (I like the instant client versions) and the
oci8 package (with
pecl, this one seems to be updated often). Then require
pdooci.php file and change some existing code like
$pdo = new PDO("oci:dbname=mydatabase;charset=utf8", "user", "password");
$pdo = new PDOOCI\PDO("mydatabase", "user", "password");
Yeah, the rest should work exactly the same as if you were using a PDO object. :-)
There is a test suite (using
PHPUnit) on the
test directory. If you want to
test (you must test your code!), create a table called
people with two
And some environment variables:
PDOOCI_user with the database user name
PDOOCI_pwd with the database password
PDOOCI_str with the database connection string
And then go to the
test dir and run
phpunit --colors .
||Applications that use this package
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.