本文整理匯總了PHP中IO::stderr方法的典型用法代碼示例。如果您正苦於以下問題:PHP IO::stderr方法的具體用法?PHP IO::stderr怎麽用?PHP IO::stderr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類IO
的用法示例。
在下文中一共展示了IO::stderr方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stderr
/**
* Возвращает объект класса IO.Stream.ResourceStream, соответствующий stderr.
*
* @return IO_Stream_ResourceStream
*/
public static function stderr($stderr = null)
{
if ($stderr instanceof IO_Stream_AbstractStream) {
self::$stderr = $stderr;
}
return self::$stderr ? self::$stderr : (self::$stderr = IO_Stream::ResourceStream(STDERR));
}
示例2: __construct
/**
* @param IO_Stream_AbstractStream $stream
* @param bool $explain
*/
public function __construct(IO_Stream_AbstractStream $stream = null, $explain = false)
{
$this->stream = Core::if_null($stream, IO::stderr());
$this->explain = $explain;
}
示例3: dump_errors
/**
* @param Dev_Source_InvalidSourceException $exception
*/
protected function dump_errors(Dev_Source_InvalidSourceException $exception)
{
$stderr = IO::stderr();
$stderr->write("{$exception->message}\n\n");
foreach (Text::Tokenizer($exception->source) as $no => $line) {
$stderr->format("%05d: %s\n", $no + 1, $line);
}
$stderr->write("\n");
foreach ($exception->errors as $error) {
$stderr->format("%d : %s", $error->line, $error->message);
}
}
示例4: __construct
/**
* @param IO_Stream_AbstractStream $stream
*/
public function __construct(IO_Stream_AbstractStream $stream = null)
{
$this->stream = Core::if_null($stream, IO::stderr());
}
示例5: setup
/**
*/
protected function setup()
{
$this->options->brief('Service.Twitter ' . Service_Twitter_Application::VERSION . ': Twitter')->string_option('config_file', '-c', '--config', 'Use configuration file')->string_option('store_dns', '-d', '--dns', 'Cache dns string')->int_option('store_to', '-t', '--timeout', 'Cache timeout')->string_option('consumer_key', '-k', '--key', 'Consumer key')->string_option('consumer_secret', '-s', '--secret', 'Consumer secret')->string_option('request_token_url', '-r', '--rtoken', 'Request token url')->string_option('access_token_url', '-a', '--atoken', 'Access token url')->string_option('authorize_url', '-o', '--authurl', 'Authorize url')->string_option('message', '-m', '--message', 'Sendign message');
$this->config->message = '';
$this->config->store_dns = '';
$this->config->config_file = '';
$this->config->store_to = 0;
// 60*60*24*365*10;
$this->config->consumer_key = '';
$this->config->consumer_secret = '';
$this->config->request_token_url = 'https://twitter.com/oauth/request_token';
$this->config->access_token_url = 'https://twitter.com/oauth/access_token';
$this->config->authorize_url = 'https://twitter.com/oauth/authorize';
$this->log->dispatcher->to_stream(IO::stderr());
}
示例6: setup
/**
* @return Dev_Unit_Test_Application
*/
protected function setup()
{
$this->options->brief('Dev.Unit.Run.Text' . Dev_Unit_Run_Text::VERSION . "\n" . 'Specify test class or test module names as arguments')->string_option('prefix', '-p', '--prefix', 'Test class prefix')->boolean_option('noprefix', '-n', '--no-prefix', 'Don\'t use class prefix');
$this->log->dispatcher->to_stream(IO::stderr())->where('module', '=', Core_Types::module_name_for($this));
$this->config->prefix = 'Test.';
$this->config->noprefix = false;
}