<?php
/**PreInit**************************************************************/
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
/**PreInit**************************************************************/
require_once ('include/easy_console.php');
/**
* Some class, wich we will use as command source
* this is example wich was with Console class
* it works wirh easy_console too.
*/
class Some_User_Class
{
private $email;
private $forename;
private $surname;
public function SetEmail()
{
Console::ClearScreen();
echo "Please enter your email address: ";
$this->email = rtrim(Console::GetLine());
}
public function SetForename()
{
Console::ClearScreen();
echo "Please enter your forename: ";
$this->forename = rtrim(Console::GetLine());
}
public function SetSurname()
{
Console::ClearScreen();
echo "Please enter your surname: ";
$this->surname = rtrim(Console::GetLine());
}
public function ShowConfig()
{
Console::ClearScreen();
echo " Current Configuration\n =====================\n\n";
echo "Email........: ", $this->email, "\n";
echo "Forename.....: ", $this->forename, "\n";
echo "Surname......: ", $this->surname, "\n";
echo "\n\nPlease press enter to continue... [Enter]";
Console::Pause();
}
}
$x= new Some_User_Class();
easy_console::StartCommandLoop($x);
system('PAUSE');
?>
|