12:34pm December 04, 2007
Oracle Powered CakePHP
I've started heavily developing some stuff for work using CakePHP 1.2. We decided to go with the beta version as it currently is because of a number of changes. One of the major changes that we needed was better integration with Oracle.

The only issue with getting Oracle and CakePHP working nicely together is that in the default appconfigdatabase.php file, there is a missing value from the $default and $test arrays. var $default = array( 'driver' => 'oracle', 'persistent' => false, 'host' => '', 'port' => '', 'login' => '', 'password' => '', 'database' => '', 'schema' => '', 'prefix' => 'cake_', 'encoding' => '' ); should be var $default = array( 'driver' => 'oracle', 'persistent' => false, 'host' => '', 'port' => '', 'login' => '', 'password' => '', 'database' => '', 'schema' => '', 'prefix' => 'cake_', 'encoding' => '', 'connect' => 'oci_connect' ); Yesterday, we spent the entire day integrating the latest nightly build with all of the modifications that we had already made to the beta files. This took us most of the day and once we had it all completed, we started moving all of our models and controllers in to sub-folders. This was the main reason for integrating the nightly build. Recently, the CakePHP dev team added the auto scanning of sub-folders for models and controllers. We had to rename a great deal of our files and variables, but it makes for much more organized code.
Views  2922 Comments  3
Filed under: CakePHP, Oracle
Add Comment
Okky
Hi, Chris! I'm developing with CakePHP and Oracle right now, but I couldn't successfully connected with Oracle. The connection test successful in CakePHP 1.1 with these config: var $default = array( 'driver' => 'oracle', 'connect' => 'oci_connect', 'host' => 'localhost', 'port' => '1521', 'login' => 'username', 'password' => 'password', 'database' => 'localhost:1521/xe', 'schema' => 'schema'); But, how come it didn't succeeded in CakePHP 1.2? Which do you prefer developing with Oracle, the 1.1 or the 1.2RC3? Thanks, heavily needed some help here...
Chris
Okky, I use CakePHP 1.2 exclusively. Does CakePHP give you any errors when attempting to connect to the Oracle database? Have you checked the logs?
Okky

Yes, I noticed also that Oracle support was officially supported as of CakePHP 1.2..

The CakePHP local home page when using CakePHP 1.1 said that it could connect to the Oracle database.
-> "Cake is able to connect to the database."

But when I use the same $default in CakePHP 1.2RC3, it said that it couldn't connect to the Oracle database.
-> "Cake is NOT able to connect to the database."

I just checked my error.log file, but I think it only concerns about the HTML Helper..

2008-10-13 23:20:36 Warning: Warning (512): Method HtmlHelper::input does not exist in [CORE/cake/libs/view/helper.php, line 148] 2008-10-13 23:20:36 Warning: Warning (512): Method HtmlHelper::tagErrorMsg does not exist in [CORE/cake/libs/view/helper.php, line 148] 2008-10-13 23:20:36 Warning: Warning (512): Method HtmlHelper::textarea does not exist in [CORE/cake/libs/view/helper.php, line 148] 2008-10-13 23:20:36 Warning: Warning (512): Method HtmlHelper::submit does not exist in [CORE/cake/libs/view/helper.php, line 148]

View Chris Thompson's profile on LinkedIn
Loading...