Upgrade improvements (faster checksum, fix database upgrade, prompt on checksum failure).

This commit is contained in:
Alexandre Rosenfeld
2010-12-20 15:26:23 +00:00
parent d58f4a7329
commit 1ff196af12
4 changed files with 86 additions and 41 deletions

View File

@@ -47,6 +47,18 @@ function error($message) {
return pakeColor::colorize($message, "ERROR");
}
function prompt($message) {
echo "$message";
$handle = fopen ("php://stdin","r");
$line = fgets($handle);
return $line;
}
function question($message) {
$input = strtolower(prompt("$message [Y/n] "));
return (array_search(trim($input), array("y", "")) !== false);
}
function logging($message, $filename = NULL) {
static $log_file = NULL;
if (isset($filename)) {