June 2010
4 posts
3 tags
CakePHP Oracle Connection
I just had trouble telling cakephp to connect to my oracle 11g R2 but I finally found a solution: class DATABASE_CONFIG { var $default = array( 'driver' => 'oracle', 'persistent' => false, 'connect' => 'oci_connect', 'login' => 'OE', 'password' => 'yourpassword', 'database' => 'localhost:1521/orcl', 'prefix' => '', ); } Works! Now I can go on playing...
Jun 30th
2 tags
Inserting an item into an array at specified...
Bastian and me; we just talked about how you would insert an item into a simple array at a specified position. The solution was easy: function array_insert_item_at_position($array, $position, $item) { $new_array_before = array_slice($array, 0, $position, true); $new_array_after = array_slice($array, $position, count($array), true); $final_array = array_merge($new_array_before,...
Jun 13th
4 tags
Improved accessor methods in php5
Moin! Yesterday I was telling you how to write better get and set methods. However, there is another way of doing it even better but I first thought it would limit you in your ability to write useful get and set methods but it’s not. Just keep in mind that whenever you set a property php5 calls __get or __set and you can use them to make accessor methods like in ruby and I first thought...
Jun 2nd
4 tags
Simple and clean get/setter methods in PHP5
Moin! When I played with ruby I found some nice features of the language that I’d really like to see in php as well but apparently most of the syntactic sugar is not part of php5 at all. However, due to that you will often see classes with get and setter methods that basically do nothing special. In your getter and setter methods you can work on the data passed around which is very useful...
Jun 1st