]> git.llucax.com Git - mecon/intranet.git/blob - sistema/local_lib/intranetdb.php
BugFixes
[mecon/intranet.git] / sistema / local_lib / intranetdb.php
1 <?php
2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // -------------------------------------------------------------------
4 //                      Ministerio de Economía                        
5 //                             Intranet                               
6 // -------------------------------------------------------------------
7 // This file is part of Intranet.                                     
8 //                                                                    
9 // Intranet is free software; you can redistribute it and/or modify   
10 // it under the terms of the GNU General Public License as published  
11 // by the Free Software Foundation; either version 2 of the License,  
12 // or (at your option) any later version.                             
13 //                                                                    
14 // Intranet is distributed in the hope that it will be useful, but          
15 // WITHOUT ANY WARRANTY; without even the implied warranty of         
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU   
17 // General Public License for more details.                           
18 //                                                                    
19 // You should have received a copy of the GNU General Public License  
20 // along with Intrane; if not, write to the Free Software Foundation,   
21 // Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA      
22 // -------------------------------------------------------------------
23 // Created: Mon Jun 9 17:53:31 2003
24 // Author:  Gonzalo Merayo <gmeray@mecon.gov.ar>
25 // -------------------------------------------------------------------
26 //
27 // $Id$
28 //
29
30 require_once 'DB.php';
31
32 /**
33  * @access public
34  */
35 class IntranetDB extends DB {
36
37     /**
38      * @return void
39      * @access public
40      */
41     function connect()
42     {
43         $config = @parse_ini_file(dirname(__FILE__).'/../conf/db.ini');
44         $dsn = @$config['dsn'] ? $config['dsn'] : 'mysql://intranet:p007b2036@localhost/intranet';
45         $db = DB::connect($dsn, isset($config['persistent']) ? $config['persistent'] : true);
46         if (DB::isError($db)) {
47             trigger_error($db->getMessage(), E_USER_ERROR);
48         }
49         return $db;
50     }
51
52 }
53 ?>