/** * Возвращает объект класса 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)); }
/** * @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; }
/** * @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); } }
/** * @param IO_Stream_AbstractStream $stream */ public function __construct(IO_Stream_AbstractStream $stream = null) { $this->stream = Core::if_null($stream, IO::stderr()); }
/** */ 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()); }
/** * @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; }