A set of useful utility functions.
Install via Composer:
{
"require": {
"zeptech/fun-box": "dev-master"
}
}
In order to use functions Fun Box must be initialized because php doesn't
provide function autoloading. Once initialized, functions are included using the
ensureFn
function.
<?php
// ... Initialize composer
FunBox::init();
ensureFn('passwordPrompt');
// ...
if ($interactive) {
$pw = passwordPrompt();
}
List of functions provided by Fun Box
Output a countdown to the command line.
announceWait($waitTime, $message = 'Commencing');
- @param waitTime integer Number of seconds to count down before continuing.
- @param message string What will happen when the countdown is complete.
Prompt the user for a password from the command line.
passwordPrompt($prompt = 'password: ');
- @param prompt string The prompt for the user.