00001 <?php 00002 00003 /******************************************************************************* 00004 * Aliro - the modern, accessible content management system 00005 * 00006 * Aliro is open source software, free to use, and licensed under GPL. 00007 * You can find the full licence at http://www.gnu.org/copyleft/gpl.html GNU/GPL 00008 * 00009 * The author freely draws attention to the fact that Aliro derives from Mambo, 00010 * software that is controlled by the Mambo Foundation. However, this section 00011 * of code is totally new. If it should contain any fragments that are similar 00012 * to Mambo, please bear in mind (1) there are only so many ways to do things 00013 * and (2) the author of Aliro is also the author and copyright owner for large 00014 * parts of Mambo 4.6. 00015 * 00016 * Tribute should be paid to all the developers who took Mambo to the stage 00017 * it had reached at the time Aliro was created. It is a feature rich system 00018 * that contains a good deal of innovation. 00019 * 00020 * Your attention is also drawn to the fact that Aliro relies on other items of 00021 * open source software, which is very much in the spirit of open source. Aliro 00022 * wishes to give credit to those items of code. Please refer to 00023 * http://aliro.org/credits for details. The credits are not included within 00024 * the Aliro package simply to avoid providing a marker that allows hackers to 00025 * identify the system. 00026 * 00027 * Copyright in this code is strictly reserved by its author, Martin Brampton. 00028 * If it seems appropriate, the copyright will be vested in the Aliro Organisation 00029 * at a suitable time. 00030 * 00031 * Copyright (c) 2007 Martin Brampton 00032 * 00033 * http://aliro.org 00034 * 00035 * counterpoint@aliro.org 00036 * 00037 * aliroCoreDatabase is a singleton extension of the abstract database class. 00038 * It is the optionally separate database holding critical tables relating only to 00039 * the core of Aliro, such as information about menus, components, etc. It is also 00040 * the only place where user passwords are stored, thus reducing the impact of 00041 * SQL injection attacks that penetrate only the general database. If it is not 00042 * possible to have two databases, Aliro will run with both being the same. 00043 * 00044 * Other names are purely for compatibility and are deprecated. 00045 * 00046 */ 00047 00048 class aliroCoreDatabase extends aliroDatabase { 00049 00050 protected static $instance = null; 00051 00052 protected function __construct () { 00053 $credentials = aliroCore::getConfigData('corecredentials.php'); 00054 $this->database = new aliroDatabaseHandler ($credentials['dbhost'], $credentials['dbusername'], $credentials['dbpassword'], $credentials['dbname'], $credentials['dbprefix']); 00055 } 00056 00057 public static function &getInstance () { 00058 if (self::$instance == null) self::$instance = new aliroCoreDatabase(); 00059 return self::$instance; 00060 } 00061 }
1.5.5