Normalize the random values used in the blocks_dashboard_xxx vars so

that install.sql is more stable.
This commit is contained in:
Bharat Mediratta
2009-06-01 00:22:30 -07:00
parent e4f4c8b2e8
commit c94c11eb3e
2 changed files with 11 additions and 2 deletions

View File

@@ -72,6 +72,15 @@ class Package_Controller extends Controller {
private function _dump_database() {
// We now have a clean install with just the packages that we want. Make sure that the
// database is clean too.
$i = 1;
foreach (array("blocks_dashboard_sidebar", "blocks_dashboard_center") as $key) {
$blocks = array();
foreach (unserialize(module::get_var("gallery", $key)) as $rnd => $value) {
$blocks[++$i] = $value;
}
module::set_var("gallery", $key, serialize($blocks));
}
$db = Database::instance();
$db->query("TRUNCATE {sessions}");
$db->query("TRUNCATE {logs}");