Skip to content

Commit 11a60e5

Browse files
committed
Get the available space on the mysql datadir directory.
1 parent a69489b commit 11a60e5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

public_html/lists/admin/converttoutf8.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
$maxsize = $row['tablesize'];
3030
}
3131
}
32-
$maxsize = (int) $maxsize;
33-
$avail = disk_free_space('/'); //# we have no idea where MySql stores the data, so this is only a crude check and warning.
34-
3532
$maxsize = (int) ($maxsize * 1.2); //# add another 20%
33+
$row = Sql_Fetch_Row_Query('select @@datadir');
34+
$dataDir = $row[0];
35+
$avail = disk_free_space($dataDir);
3636

3737
$require_confirmation = !isset($_GET['force']) || $_GET['force'] != 'yes';
3838

public_html/lists/admin/upgrade.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,10 @@ function output($message)
229229
$maxsize = $row['tablesize'];
230230
}
231231
}
232-
$maxsize = (int) $maxsize;
233-
$avail = disk_free_space('/'); //# we have no idea where MySql stores the data, so this is only a crude check and warning.
234232
$maxsize = (int) ($maxsize * 1.2); //# add another 20%
233+
$row = Sql_Fetch_Row_Query('select @@datadir');
234+
$dataDir = $row[0];
235+
$avail = disk_free_space($dataDir);
235236

236237
//# convert to UTF8
237238
$dbname = $GLOBALS['database_name'];

0 commit comments

Comments
 (0)