#6508: Suggestion:  Remove 'connect' from $_baseConfig in DboPostgres
-----------------------------+----------------------------------------------
    Reporter:  cuppett       |         Owner:           
        Type:  Optimization  |        Status:  new      
    Priority:  Very Low      |     Milestone:  1.2.x.x  
   Component:  PostgreSQL    |       Version:  1.2 Final
    Severity:  Trivial       |    Resolution:           
    Keywords:                |   Php_version:  PHP 5    
Cake_version:  1.2.3         |  
-----------------------------+----------------------------------------------
Comment (by cuppett):

 Also, have another possible fix to match the way MySQL behaves here:[[BR]]
 [[BR]]
 
[http://thechaw.com/forks/cuppett/cakephp/commits/view/f4d9af9f75b62e8762ccbc2ee6620f06331b4e4a
 f4d9af9f75b62e8762ccbc2ee6620f06331b4e4a][[BR]]
 [[BR]]

 {{{
 diff --git a/cake/libs/model/datasources/dbo/dbo_postgres.php
 b/cake/libs/model/datasources/dbo/dbo_postgres.php
 index 23a7566..e56e06d 100644
 --- a/cake/libs/model/datasources/dbo/dbo_postgres.php
 +++ b/cake/libs/model/datasources/dbo/dbo_postgres.php
 @@ -59,6 +59,7 @@ class DboPostgres extends DboSource {
   * @access protected
   */
         var $_baseConfig = array(
 +               'connect' => 'pg_pconnect',
                 'persistent' => true,
                 'host' => 'localhost',
                 'login' => 'root',
 @@ -102,13 +103,14 @@ class DboPostgres extends DboSource {
   */
         function connect() {
                 $config = $this->config;
 +               $connect = $config['connect'];
                 $conn  = "host='{$config['host']}'
 port='{$config['port']}' dbname='{$config['database']}' ";
                 $conn .= "user='{$config['login']}'
 password='{$config['password']}'";

                 if (!$config['persistent']) {
                         $this->connection = pg_connect($conn,
 PGSQL_CONNECT_FORCE_NEW);
                 } else {
 -                       $this->connection = pg_pconnect($conn);
 +                       $this->connection = $connect($conn);
                 }
                 $this->connected = false;
 }}}

-- 
Ticket URL: <https://trac.cakephp.org/ticket/6508#comment:2>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design 
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. 
Our primary goal is to provide a structured framework that enables PHP users at 
all levels to rapidly develop robust web applications, without any loss to 
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tickets cakephp" 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/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to