Location: PHPKode > projects > Alliances Manager > libs/ModeloBase.php
<?php
/*
 *  Alliances Manager (Gestionador de Alianzas) - Travian
 *  Copyright (C) 2008-12  Viva Mayer, Francisco Mesías <hide@address.com>
 *
 *  This program 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 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
*/

abstract class ModeloBase 
{
	protected $db;
	protected $config;
	protected static $texto; // Instanciación única del idioma elegido

	public function __construct()
	{
		/* $this->db = SPDO::singleton(); */
		// Conexión con MySQL y selección de la base de datos
		$this->config = Config::singleton();
		
		$this->db = mysql_connect($this->config->get('dbhost'), $this->config->get('dbuser'), $this->config->get('dbpass')) OR die(mysql_error($this->db));
		mysql_select_db($this->config->get('dbname'), $this->db) OR die(mysql_error($this->db));
		
		self::$texto = Idioma::singleton();
	}
}
?>
Return current item: Alliances Manager