Adding are_you_sure()
This commit is contained in:
parent
4f56388218
commit
d7d06bbc30
|
@ -1132,3 +1132,15 @@ if(!function_exists('str_ends_with'))
|
|||
return $needle === "" || (($temp = strlen($haystack) - strlen($needle)) >= 0 && strpos($haystack, $needle, $temp) !== false);
|
||||
}
|
||||
}
|
||||
|
||||
function are_you_sure()
|
||||
{
|
||||
echo "Are you sure you want to proceed?(type YES): ";
|
||||
$resp = trim(fread(STDIN, 10));
|
||||
//var_dump($resp);
|
||||
if($resp != "YES")
|
||||
{
|
||||
echo "exiting then\n";
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue