本文整理匯總了PHP中IO::stdin方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::stdin方法的具體用法?PHP IO::stdin怎麽用?PHP IO::stdin使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::stdin方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stdin
/**
* Возвращает объект класса IO.Stream.ResourceStream, соответствующий stdin.
*
* @return IO_Stream_ResourceStream
*/
public static function stdin($stdin = null)
{
if ($stdin instanceof IO_Stream_AbstractStream) {
self::$stdin = $stdin;
}
return self::$stdin ? self::$stdin : (self::$stdin = IO_Stream::ResourceStream(STDIN));
}
示例2: initialize
public static function initialize(array $options = array())
{
self::options($options);
if (!class_exists('Google_Client') && set_include_path(get_include_path() . PATH_SEPARATOR . self::option('lib_path') . 'src/')) {
if (!@(include_once 'Google_Client.php')) {
throw new Service_Google_API_ClientLibraryModuleNotFoundException('src/Google_Client.php', self::option('lib_path'));
}
}
self::$cache = Cache::connect(self::option('cache_path'), 0);
self::$stdin = IO::stdin();
}
示例3: get_token
/**
*/
protected function get_token()
{
$this->client->get_request_token();
$this->client->save_token($k = 'request_token');
$this->log->debug('Get and save request token: %s', var_export($this->store->get($k), true));
printf("\nGo to:\n%s\nGet PIN and enter:\n", $this->client->get_auth_url(true));
$verifier = trim(IO::stdin()->read());
$this->log->debug('You enter PIN: %d', $verifier);
$this->client->get_access_token($verifier);
$this->client->save_token($k = 'access_token');
$this->log->debug('Get and save access token: %s', var_export($this->store->get($k), true));
}