moduleRunner()->dbMigrateStatus(); $appliedCount = count($status['applied']); $pendingCount = count($status['pending']); echo sprintf("db-migrate-status: %d applied, %d pending\n\n", $appliedCount, $pendingCount); echo "applied:\n"; if ($appliedCount === 0) { echo " (none)\n"; } else { foreach ($status['applied'] as $filename) { echo ' ' . $filename . PHP_EOL; } } echo "\npending:\n"; if ($pendingCount === 0) { echo " (none)\n"; } else { foreach ($status['pending'] as $filename) { echo ' ' . $filename . PHP_EOL; } } return 0; } $result = $this->moduleRunner()->dbMigrate(); if ($result['exit_code'] === 0) { echo $result['message'] . PHP_EOL; } else { fwrite(STDERR, $result['message'] . PHP_EOL); } return (int) $result['exit_code']; } }