Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 3dd46b1b96bcedc74e1a363a671472b1 > files > 12

ezcomponents-ConsoleTools-1.6.1-3.mga4.noarch.rpm

<?php

require_once "Base/src/base.php";

function __autoload( $className )
{
    ezcBase::autoload( $className );
}

$out = new ezcConsoleOutput();

$opts = new ezcConsoleQuestionDialogOptions();
$opts->text = "How old are you?";
$opts->showResults = true;
$opts->validator = new ezcConsoleQuestionDialogTypeValidator(
    ezcConsoleQuestionDialogTypeValidator::TYPE_INT
);

$dialog = new ezcConsoleQuestionDialog( $out, $opts );

if ( ( $res = ezcConsoleDialogViewer::displayDialog( $dialog ) ) < 8 )
{
    echo "Sorry, I can not believe that you are $res years old!\n";
}
else
{
    echo "Hey, you're still young! :)\n";
}

?>