-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for oracle database #1188
Conversation
Setting up an oracle server for testing and thus maintaining ds has been problematic for the team, which is why currently it's not available in the core. Perhaps this new ds should be added in the Datasources repo instead which is maintained with the help of the community. |
The code needs to be upgraded to PHP5 and especially CakePHP coding standards, by the way. |
@ADmad It's sad that there is no official support for oracle. The last commit on the Datasources repo is more than a year ago. I think it don't make any sense to do a pull request to this outdated repo. @dereuromark What do you mean with "upgrade to PHP5"? Could you please give me an example? |
Try running it in PHP5.3/5.4 or through code sniffer with CakePHP standard. Both will through lots of errors. |
|
@ADmad perhaps the 2.0 branch of Datasources should become the master branch? |
@markstory Yup it should, to be consistent with the main repo. The datasources repo needs some love in terms of maintenance 😄 |
it needs the pull-request-hack http://felixge.de/2013/03/11/the-pull-request-hack.html 2013/3/20 ADmad notifications@github.com
|
The criteria mentioned in that blog post for awarding commit access to PR initiators seem nice. |
👍 |
Closing this PR as per my initial comments. |
This will add support for oracle databases. It's nearly the same code as pasted on this page: http://snipt.org/zKib2.
Tested with:
Client: Windows 32-bit, PHP 5.4.4, cakephp 2.3.1, OCI instantclient-basic-nt-11.2.0.3.0
Database server: Oracle 10g
You have to install OCI (Oracle Instant Client), enable the php extensions "php_oci8" and "php_pdo_oci" and change your database config.
Here is an example of it:
public $default = array( 'datasource' => 'Database/Oracle', 'driver' => 'oracle', 'connect' => 'oci_connect', 'persistent' => false, 'host' => 'oracle-server', 'port' => '1521', 'login' => 'login', 'password' => 'password', 'database' => '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP) (HOST=oracle-server)(PORT = 1521))) (CONNECT_DATA =(SID = mysid)(SERVER = DEDICATED)))', 'prefix' => '' );
There is one problem if you use caching: The 'database' string from the database config is used as a part of the name of the caching file. On windows I get multiple errors, because SPL has problems with several underscores somehow. I added a new value in the config file called 'alias' and replaced the part of the caching file name with it and it works, but this was a workaround only. What would you suggest is the best way to fix this issue?