php / php-src

The PHP Interpreter
https://www.php.net
Other
37.57k stars 7.69k forks source link

Add support for Oracle's open source library (ODPI-C) in OCI8 extension #10585

Open ericpp opened 1 year ago

ericpp commented 1 year ago

Description

Oracle has released an "Oracle Database Programming Interface for C" open source client library that can be used as an alternative to their Instant Client binary-only libraries: https://oracle.github.io/odpi/

The Python Oracle libraries have switched to this library as it avoids the need for the user to separately download and install the Instant Client binaries and configure environment variables.

EDIT: After digging into this library more, it looks like it still does require the OCI (Instant Client) libraries 👎 : https://oracle.github.io/odpi/doc/installation.html#oracle-client-library-loading

The ODPI-C library is merely a wrapper around the OCI libraries rather than a replacement for them. It still would solve the issue of the user being prompted for library locations at compile time, but requires the user supply that information at runtime.

The Python driver does work without the OCI libraries because it implements a "thin" client on its own if you don't have them.

New ODPI-C-based Python module:

Old Instant Client-based Python module:

I think this would be a great addition to the OCI8 extension as well. It would make installing the extension as simple as just running pecl install oci8 without any additional libraries, prompts, or parameters.

Danack commented 1 year ago

Hi @ericpp, I have several questions, but before I ask the important ones, you work for Oracle, right?

ericpp commented 1 year ago

Hi @ericpp, I have several questions, but before I ask the important ones, you work for Oracle, right?

Hey @Danack , I don't work for Oracle. I submitted this issue after working with Python and noticing how much easier it is to get Oracle working with Python compared with PHP. I dug into the source code for the python-oracledb module and noticed it was using this new ODPI-C library rather than the Instant Client library.

Danack commented 1 year ago

Okay, I was going to suggest contacting the two people at Oracle who are listed as maintainers for OCI8 as I'm not sure they would see this issue.

I was also going to make some snarky comments about how a change that only benefits a for-profit company, that employs about 140k people, and made about $7 billion last year should probably be done by someone from that company, rather than asking volunteers to do it. But if you don't work for Oracle, you wouldn't be the right recipient for that snark.

ericpp commented 1 year ago

@Danack I can try emailing them and see. It looks like one of them is a contributor for this new library.