X-Git-Url: https://git.llucax.com/mecon/intranet.git/blobdiff_plain/e54c0e22cd808855fdc1171d1bc70d00175e1ad0..22697d7dcb9c700a75c795c618d8a2fe3e51a9bd:/sistema/local_lib/intranetdb.php?ds=sidebyside diff --git a/sistema/local_lib/intranetdb.php b/sistema/local_lib/intranetdb.php index f47978c..80e717b 100644 --- a/sistema/local_lib/intranetdb.php +++ b/sistema/local_lib/intranetdb.php @@ -1,57 +1,53 @@ -// +----------------------------------------------------------------------+ +// ------------------------------------------------------------------- +// Ministerio de Economía +// Intranet +// ------------------------------------------------------------------- +// This file is part of Intranet. +// +// Intranet is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published +// by the Free Software Foundation; either version 2 of the License, +// or (at your option) any later version. +// +// Intranet is distributed in the hope that it will be useful, but +// WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Intrane; if not, write to the Free Software Foundation, +// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// ------------------------------------------------------------------- +// Created: Mon Jun 9 17:53:31 2003 +// Author: Gonzalo Merayo +// ------------------------------------------------------------------- // -// $Id: bandadb.php 12 2003-06-24 16:54:23Z gmeray $ -// $Author: gmeray $ -// $URL: http://portal.mecon.ar/svn/bandas/sistema/lib/bandadb.php $ -// $Date: 2003-06-24 13:54:23 -0300 (Tue, 24 Jun 2003) $ -// $Rev: 12 $ +// $Id$ // -#require_once 'PEAR.php'; require_once 'DB.php'; - - -// +X2C Class 121 :BandaDB /** * @access public */ class IntranetDB extends DB { - // ~X2C - // +X2C Operation 122 - /** - * @return void - * @access public - */ - function connect() // ~X2C - { - $conf = include 'configuracion.php'; - $dsn = $conf['db_type'].'://'.$conf['db_user'].':'.$conf['db_pass'].'@'.$conf['db_host'].'/'.$conf['db_name']; - $db = DB::connect($dsn,true); - if (DB::isError($db)) { - die ($db->getMessage()); + /** + * @return void + * @access public + */ + function connect() + { + $config = @parse_ini_file(dirname(__FILE__).'/../conf/db.ini'); + $dsn = @$config['dsn'] ? $config['dsn'] : 'mysql://intranet:p007b2036@localhost/intranet'; + $db = DB::connect($dsn, isset($config['persistent']) ? $config['persistent'] : true); + if (DB::isError($db)) { + trigger_error($db->getMessage(), E_USER_ERROR); + } + return $db; } - return $db; - } - // -X2C -} // -X2C Class :BandaDB +} ?>