/** * Upgrades Elgg * */ function version_upgrade() { $dbversion = (int) datalist_get('version'); // No version number? Oh snap...this is an upgrade from a clean installation < 1.7. // Run all upgrades without error reporting and hope for the best. // See http://trac.elgg.org/elgg/ticket/1432 for more. $quiet = !$dbversion; // Upgrade database if (db_upgrade($dbversion, '', $quiet)) { system_message(elgg_echo('upgrade:db')); } // Upgrade core if (upgrade_code($dbversion, $quiet)) { system_message(elgg_echo('upgrade:core')); } // Now we trigger an event to give the option for plugins to do something $upgrade_details = new stdClass(); $upgrade_details->from = $dbversion; $upgrade_details->to = get_version(); trigger_elgg_event('upgrade', 'upgrade', $upgrade_details); // Update the version datalist_set('version', get_version()); }
/** * Upgrades Elgg Database and code * * @return bool * */ function version_upgrade() { // It's possible large upgrades could exceed the max execution time. set_time_limit(0); $dbversion = (int) datalist_get('version'); // No version number? Oh snap...this is an upgrade from a clean installation < 1.7. // Run all upgrades without error reporting and hope for the best. // See http://trac.elgg.org/elgg/ticket/1432 for more. $quiet = !$dbversion; // Note: Database upgrades are deprecated as of 1.8. Use code upgrades. See #1433 if (db_upgrade($dbversion, '', $quiet)) { system_message(elgg_echo('upgrade:db')); } if (upgrade_code($dbversion, $quiet)) { system_message(elgg_echo('upgrade:core')); // Now we trigger an event to give the option for plugins to do something $upgrade_details = new stdClass(); $upgrade_details->from = $dbversion; $upgrade_details->to = get_version(); elgg_trigger_event('upgrade', 'upgrade', $upgrade_details); return true; } return false; }
/** * Upgrades Elgg * */ function version_upgrade() { $dbversion = (int) datalist_get('version'); // Upgrade database db_upgrade($dbversion); system_message(elgg_echo('upgrade:db')); // Upgrade core if (upgrade_code($dbversion)) { system_message(elgg_echo('upgrade:core')); } // Update the version datalist_set('version', get_version()); }
/** * Upgrades Elgg * */ function version_upgrade() { $dbversion = (int) datalist_get('version'); // Upgrade database db_upgrade($dbversion); system_message(elgg_echo('upgrade:db')); // Upgrade core if (upgrade_code($dbversion)) { system_message(elgg_echo('upgrade:core')); } // Now we trigger an event to give the option for plugins to do something $upgrade_details = stdClass; $upgrade_details->from = $dbversion; $upgrade_details->to = get_version(); trigger_elgg_event('upgrade', 'upgrade', $upgrade_details); // Update the version datalist_set('version', get_version()); }