本文整理匯總了PHP中Index::input方法的典型用法代碼示例。如果您正苦於以下問題:PHP Index::input方法的具體用法?PHP Index::input怎麽用?PHP Index::input使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Index
的用法示例。
在下文中一共展示了Index::input方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setup
/**
* Tries to gather what we need for this task to run
*
* @param array $args CLI arguments
*
* @return Eve\Framework\Cli\Install
*/
public function setup($args)
{
if (!class_exists('\\ZipArchive')) {
Index::error('Install needs the ZipArchive class. ' . 'See: http://php.net/manual/en/class.ziparchive.php');
}
$this->databases['default']['host'] = Index::input('What is your database host (127.0.0.1)', '127.0.0.1');
$this->databases['default']['name'] = Index::input('What is your database name (eve_framework)', 'eve_framework');
$this->databases['default']['user'] = Index::input('What is your database username ? (root)', 'root');
$this->databases['default']['pass'] = Index::input('What is your database password ? (<nothing>)', '');
Index::error('Thanks. ' . floor(rand() % 1000) . ' questions to go..', false);
Index::input('Continue ? (yes)');
Index::success('Just kidding, we are good to go :)');
if (!is_dir($this->cwd . '/tmp')) {
mkdir($this->cwd . '/tmp');
}
$this->file = fopen($this->cwd . '/tmp/framework.zip', 'w');
return $this;
}