developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Ticket #680: cnxPool.diff

File cnxPool.diff, 1.5 KB (added by analogue, 12 years ago)
  • lib/jelix/db/jDb.class.php

     
    44* @subpackage db
    55#if ENABLE_OPTIMIZED_SOURCE
    66* @author     Laurent Jouanneau
    7 * @contributor
     7* @contributor Yannick Le Guédart, Laurent Raufaste
    88* @copyright  2005-2007 Laurent Jouanneau
    99*
    1010* Some of this classes were get originally from the Copix project
     
    2222
    2323#else
    2424* @author     Laurent Jouanneau
    25 * @contributor
     25* @contributor Yannick Le Guédart, Laurent Raufaste
    2626* @copyright  2005-2007 Laurent Jouanneau
    2727*
    2828* API ideas of this class were get originally from the Copix project (CopixDbFactory, Copix 2.3dev20050901, http://www.copix.org)
     
    4747class jDb {
    4848
    4949    static private $_profils =  null;
     50    static private $_cnxPool = array();
    5051
    5152    /**
    5253    * return a database connector
     
    6566            $name = $profil['name'];
    6667        }
    6768
    68         if (!isset ($cnxPool[$name])){
    69             $cnxPool[$name] = self::_createConnector ($profil);
     69        if (!isset (self::$_cnxPool[$name])){
     70            self::$_cnxPool[$name] = self::_createConnector ($profil);
    7071        }
    71         return $cnxPool[$name];
     72        return self::$_cnxPool[$name];
    7273    }
    7374
    7475    /**
     
    212213            self::$_profils = parse_ini_file (JELIX_APP_CONFIG_PATH . $gJConfig->dbProfils, true);
    213214        }
    214215        self::$_profils[$name] = $params;
     216                unset (self::$_cnxPool[$name]);
    215217    }
    216218}