Example #1
0
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GetBoo 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 GetBoo; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
***************************************************************************/
/*
 * Optional configuration: Constants
 */
if (!$from_install) {
    global $SETTINGS;
    if (isset($SETTINGS['path_mod'])) {
        $path = $SETTINGS['path_mod'];
    }
    require_once dirname(__FILE__) . '/configuration.php';
    $configVars = Configuration::LoadConfig("all", $path, $dblink);
    if (!empty($configVars)) {
        foreach ($configVars as $key => $configVar) {
            define("{$key}", "{$configVar}");
        }
    }
}
require_once dirname(__FILE__) . '/gettext.php';
// Misc files to include in all pages
require_once dirname(__FILE__) . '/prototype.php';
Example #2
0
    $table_prefix = TABLE_PREFIX;
    writeConfig($table_prefix, $dbhost, $dbport, $dbuname, $dbpass, $dbname, $dbtype);
    $from_upgrade = false;
    if (!defined("VERSION_NUMBER")) {
        require_once '../includes/configuration.php';
        $configs = Configuration::LoadConfig("VERSION", "../");
        define("VERSION_NUMBER", $configs['VERSION']);
    }
    $from_install = false;
} else {
    if ($upgradeFrom == "database") {
        // Create new config file
        writeConfig($table_prefix, $dbhost, $dbport, $dbuname, $dbpass, $dbname, $dbtype);
        // Get version number from db. If no config, then version is prior to 1.02
        require_once '../includes/configuration.php';
        $configs = Configuration::LoadConfig("VERSION", "../");
        if (empty($configs['VERSION'])) {
            $configs['VERSION'] = "1.01";
        }
        define("VERSION_NUMBER", $configs['VERSION']);
        $from_upgrade = false;
    }
}
include "../conn.php";
// Do changes from current version to the latest
switch (VERSION_NUMBER) {
    case "1.0":
    case "1.01":
        //Create configs table to database
        $Query = "CREATE TABLE " . TABLE_PREFIX . "configs (\r\n\t\t\t\t\t\tconfig_name VARCHAR( 100 ) NOT NULL ,\r\n\t\t\t\t\t\tconfig_value VARCHAR( 255 ) NOT NULL ,\r\n\t\t\t\t\t\tconfig_description TEXT NOT NULL ,\r\n\t\t\t\t\t\tPRIMARY KEY ( config_name )\r\n\t\t\t\t\t\t) ENGINE = MYISAM COMMENT = 'Configuration variables';";
        $AffectedRows = $dblink->exec($Query);