This is very wrong but I didn't had the time to make this better.
Hopefully there will be someone that will correct me.. if not.. at
least, this works.

I dbo_oracle.php that you will find in the core libs I changed (my
head is going to roll) the connect function to this:

        function connect() {
                $config = $this->config;
                $tns = "
                                                                (DESCRIPTION =
                                                                    
(ADDRESS_LIST =
                                                                      (ADDRESS 
= (PROTOCOL = TCP)(PORT = 123)(HOST = 1.2.3.4))
                                                                    )
                                                                    
(CONNECT_DATA =
                                                                      (SID = 
MyBD)
                                                                    )
                                                                  )
                                                       ";

        $this->connection = oci_pconnect($config['login'],
$config['password'], $tns, "AL32UTF8");


                if ($this->connection) {
                        $this->connected = true;
                        if (!empty($config['nls_sort'])) {
                                $this->execute('ALTER SESSION SET 
NLS_SORT='.$config['nls_sort']);
                        }

                        if (!empty($config['nls_comp'])) {
                                $this->execute('ALTER SESSION SET 
NLS_COMP='.$config['nls_comp']);
                        }
                        $this->execute("ALTER SESSION SET 
NLS_DATE_FORMAT='YYYY-MM-DD
HH24:MI:SS'");
                } else {
                        $this->connected = false;
                }
                return $this->connected;
        }

I think I could have TNS working in the database configuration file..
or there is a better way.. I said I didn't had much time, so please
don't flame me :)

Btw my class configuration file:

class DATABASE_CONFIG {

        var $default = array(
                'driver' => 'oracle',
                'persistent' => false,
                'login' => 'user',
                'password' => 'password',
                'database' => 'scheme',
                'prefix' => ''
        );


}

Hope this will help you

On Oct 15, 10:29 pm, Kristopher <[EMAIL PROTECTED]> wrote:
> I was wondering if it might be smart to actually define the variables
> in some PHP file using:
>
>   PutEnv("ORACLE_SID= ... ");
>   PutEnv("ORACLE_HOME= ... ");
>   PutEnv("TNS_ADMIN= ... ");
>   ...
>
> The problem is being a newbie to CakePHP, I'm not sure is this is a
> good idea (to actually try to solve my problem) and the other issue is
> that I am uncertain as to which PHP file I should place these
> statements in.
>
> Anyone care to comment?
>
> Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to