/** * @param DBPatcher\PatchFile $patchFile * @param callable $superStrategy * @param \FusePump\Cli\Inputs $inputs * @return boolean */ function interactiveStrategy($patchFile, $superStrategy, $inputs) { if (!call_user_func($superStrategy, $patchFile)) { return $inputs->confirm((DBPatcher\Cli\getMarkPatchesOption($inputs) ? 'Mark' : 'Apply') . " patch file {$patchFile->name}?"); } return true; }
<?php /** * Prompt for info */ require dirname(__FILE__) . '/../lib/FusePump/Cli/Inputs.php'; use FusePump\Cli\Inputs; $cli = new Inputs($argv); if (!$cli->parse()) { exit(1); } $username = $cli->prompt('Username: '******'Got ' . $username . "\n"; $password = $cli->prompt('Password (not a real one): ', true); echo 'Got ' . $password . "\n"; $confirm = $cli->confirm('Confirm? (y/n) '); echo var_dump($confirm);