|
@@ -1,5 +1,9 @@
|
|
|
<?php
|
|
|
require '../../main/inc/global.inc.php';
|
|
|
+$eol = "<br />\n";
|
|
|
+if (PHP_SAPI == 'cli') {
|
|
|
+ $eol = "\n";
|
|
|
+}
|
|
|
$tables = array(
|
|
|
'user',
|
|
|
'course',
|
|
@@ -8,16 +12,16 @@ $tables = array(
|
|
|
'session_rel_course_rel_user',
|
|
|
'gradebook_category',
|
|
|
);
|
|
|
-echo "\n--- Post-migration count report ---\n";
|
|
|
+echo "$eol--- Post-migration count report ---$eol";
|
|
|
foreach ($tables as $table) {
|
|
|
$sql = "SELECT count(*) FROM $table";
|
|
|
$res = Database::query($sql);
|
|
|
if ($res === false) {
|
|
|
- echo "SQL error in ".$sql."\n";
|
|
|
+ echo "SQL error in ".$sql.$eol;
|
|
|
} else {
|
|
|
$row = Database::fetch_array($res);
|
|
|
$count = $row[0];
|
|
|
- echo "Table $table has $count items after migration\n";
|
|
|
+ echo "Table $table has $count items after migration$eol";
|
|
|
}
|
|
|
}
|
|
|
-echo "\n";
|
|
|
+echo 'The end.'.$eol;
|