0byt3m1n1
Path:
/
data
/
applications
/
aps
/
b2evolution
/
4.1.5b-1.bak
/
standard
/
htdocs
/
[
Home
]
File: upgrade_aps.php
<?php if(isset($_SERVER['HTTP_USER_AGENT'])) { echo 'This utility may only be run from the command line or command prompt.'; exit(1); } // APS. This code is taken from install/index.php global $inc_path; global $Debuglog; global $Messages; global $DB; global $new_db_version; require_once dirname(__FILE__).'/conf/_config.php'; // Make the includes believe they are being called in the right place... define( 'EVO_MAIN_INIT', true ); /** * Define that we're in the install process. */ define( 'EVO_IS_INSTALLING', true ); $script_start_time = time(); $localtimenow = $script_start_time; // used e.g. for post_datemodified (sample posts) require_once $inc_path.'_core/_class'.floor(PHP_VERSION).'.funcs.php'; require_once $inc_path.'_core/_misc.funcs.php'; load_class('_core/model/_log.class.php'); $Debuglog = & new Log( 'note' ); $Messages = & new Log('error'); load_class('/_core/model/db/_db.class.php'); require_once $conf_path.'_upgrade.php'; require_once $inc_path.'_vars.inc.php'; require_once dirname(__FILE__).'/install/_functions_install.php'; load_class('_core/model/_timer.class.php'); $Timer = & new Timer('main'); // Load all available locale defintions: locales_load_available_defs(); $default_locale = locale_from_httpaccept(); // Activate default locale: if( ! locale_activate( $default_locale ) ) { // Could not activate locale (non-existent?), fallback to en-US: $default_locale = 'en-US'; locale_activate( 'en-US' ); } init_charsets( $current_charset ); $timestamp = time() - 120; // We start dates 2 minutes ago because their dates increase 1 second at a time and we want everything to be visible when the user watches the blogs right after install :P $tmp_evoconf_db = $db_config; // We want a friendly message if we can't connect: $tmp_evoconf_db['halt_on_error'] = false; $tmp_evoconf_db['show_errors'] = false; // Make sure we use the proper charset: $tmp_evoconf_db['connection_charset'] = $evo_charset; // CONNECT TO DB: $DB = new DB( $tmp_evoconf_db ); unset($tmp_evoconf_db); /* * ----------------------------------------------------------------------------------- * EVO UPGRADE: Upgrade data from existing b2evolution database * ----------------------------------------------------------------------------------- */ require_once( dirname(__FILE__). '/install/_functions_evoupgrade.php' ); echo T_('Upgrading data in existing b2evolution database...'); flush(); if( upgrade_b2evo_tables() ) { echo T_('Upgrade completed successfully!'); } else { exit (1); } ?>