patch
stringlengths 17
31.2k
| y
int64 1
1
| oldf
stringlengths 0
2.21M
| idx
int64 1
1
| id
int64 4.29k
68.4k
| msg
stringlengths 8
843
| proj
stringclasses 212
values | lang
stringclasses 9
values |
---|---|---|---|---|---|---|---|
@@ -3,7 +3,9 @@ export function getDisplayPlayMethod(session) {
return null;
}
- if (session.TranscodingInfo && session.TranscodingInfo.IsVideoDirect) {
+ if (session.TranscodingInfo && session.TranscodingInfo.IsVideoDirect && session.TranscodingInfo.IsAudioDirect) {
+ return 'Remux';
+ } else if (session.TranscodingInfo && session.TranscodingInfo.IsVideoDirect) {
return 'DirectStream';
} else if (session.PlayState.PlayMethod === 'Transcode') {
return 'Transcode'; | 1 | export function getDisplayPlayMethod(session) {
if (!session.NowPlayingItem) {
return null;
}
if (session.TranscodingInfo && session.TranscodingInfo.IsVideoDirect) {
return 'DirectStream';
} else if (session.PlayState.PlayMethod === 'Transcode') {
return 'Transcode';
} else if (session.PlayState.PlayMethod === 'DirectStream') {
return 'DirectPlay';
} else if (session.PlayState.PlayMethod === 'DirectPlay') {
return 'DirectPlay';
}
}
export default {
getDisplayPlayMethod: getDisplayPlayMethod
};
| 1 | 18,070 | @MrTimscampi don't we want to remove this term entirely? Might as well do it now if that's the case. | jellyfin-jellyfin-web | js |
@@ -36,7 +36,7 @@ module Asciidoctor
opts_parser = OptionParser.new do |opts|
opts.banner = <<-EOS
Usage: asciidoctor [OPTION]... [FILE]
-Translate the AsciiDoc source FILE into the backend output format (e.g., HTML 5, DocBook 4.5, etc.)
+Translate the AsciiDoc source FILE, or multiple FILE(s) into the backend output format (e.g., HTML 5, DocBook 4.5, etc.)
By default, the output is written to a file with the basename of the source file and the appropriate extension.
Example: asciidoctor -b html5 source.asciidoc
| 1 | require 'optparse'
module Asciidoctor
module Cli
# Public: List of options that can be specified on the command line
class Options < Hash
def initialize(options = {})
self[:attributes] = options[:attributes] || {}
self[:input_file] = options[:input_file] || nil
self[:output_file] = options[:output_file] || nil
self[:safe] = options[:safe] || SafeMode::UNSAFE
self[:header_footer] = options[:header_footer] || true
self[:template_dirs] = options[:template_dirs] || nil
self[:template_engine] = options[:template_engine] || nil
if options[:doctype]
self[:attributes]['doctype'] = options[:doctype]
end
if options[:backend]
self[:attributes]['backend'] = options[:backend]
end
self[:eruby] = options[:eruby] || nil
self[:compact] = options[:compact] || false
self[:verbose] = options[:verbose] || false
self[:base_dir] = options[:base_dir]
self[:destination_dir] = options[:destination_dir] || nil
self[:trace] = false
end
def self.parse!(args)
Options.new.parse! args
end
def parse!(args)
opts_parser = OptionParser.new do |opts|
opts.banner = <<-EOS
Usage: asciidoctor [OPTION]... [FILE]
Translate the AsciiDoc source FILE into the backend output format (e.g., HTML 5, DocBook 4.5, etc.)
By default, the output is written to a file with the basename of the source file and the appropriate extension.
Example: asciidoctor -b html5 source.asciidoc
EOS
opts.on('-v', '--verbose', 'enable verbose mode (default: false)') do |verbose|
self[:verbose] = true
end
opts.on('-b', '--backend BACKEND', 'set output format backend (default: html5)') do |backend|
self[:attributes]['backend'] = backend
end
opts.on('-d', '--doctype DOCTYPE', ['article', 'book', 'inline'],
'document type to use when rendering output: [article, book, inline] (default: article)') do |doc_type|
self[:attributes]['doctype'] = doc_type
end
opts.on('-o', '--out-file FILE', 'output file (default: based on input file path); use - to output to STDOUT') do |output_file|
self[:output_file] = output_file
end
opts.on('--safe',
'set safe mode level to safe (default: unsafe)',
'enables include macros, but restricts access to ancestor paths of source file',
'provided for compatibility with the asciidoc command') do
self[:safe] = SafeMode::SAFE
end
opts.on('-S', '--safe-mode SAFE_MODE', ['unsafe', 'safe', 'server', 'secure'],
'set safe mode level explicitly: [unsafe, safe, server, secure] (default: unsafe)',
'disables potentially dangerous macros in source files, such as include::[]') do |safe_mode|
self[:safe] = SafeMode.const_get(safe_mode.upcase)
end
opts.on('-s', '--no-header-footer', 'suppress output of header and footer (default: false)') do
self[:header_footer] = false
end
opts.on('-n', '--section-numbers', 'auto-number section titles in the HTML backend; disabled by default') do
self[:attributes]['numbered'] = ''
end
opts.on('-e', '--eruby ERUBY', ['erb', 'erubis'],
'specify eRuby implementation to render built-in templates: [erb, erubis] (default: erb)') do |eruby|
self[:eruby] = eruby
end
opts.on('-C', '--compact', 'compact the output by removing blank lines (default: false)') do
self[:compact] = true
end
opts.on('-a', '--attribute key[=value],key2[=value2],...', Array,
'a list of document attributes to set in the form of key, key! or key=value pair',
'unless @ is appended to the value, these attributes take precedence over attributes',
'defined in the source document') do |attribs|
attribs.each do |attrib|
key, val = attrib.split '=', 2
self[:attributes][key] = val || ''
end
end
opts.on('-T', '--template-dir DIR', 'a directory containing custom render templates that override the built-in set (requires tilt gem)',
'may be specified multiple times') do |template_dir|
if self[:template_dirs].nil?
self[:template_dirs] = [template_dir]
elsif self[:template_dirs].is_a? Array
self[:template_dirs].push template_dir
else
self[:template_dirs] = [self[:template_dirs], template_dir]
end
end
opts.on('-E', '--template-engine NAME', 'template engine to use for the custom render templates (loads gem on demand)') do |template_engine|
self[:template_engine] = template_engine
end
opts.on('-B', '--base-dir DIR', 'base directory containing the document and resources (default: directory of source file)') do |base_dir|
self[:base_dir] = base_dir
end
opts.on('-D', '--destination-dir DIR', 'destination output directory (default: directory of source file)') do |dest_dir|
self[:destination_dir] = dest_dir
end
opts.on('--trace', 'include backtrace information on errors (default: false)') do |trace|
self[:trace] = true
end
opts.on_tail('-h', '--help', 'show this message') do
$stdout.puts opts
return 0
end
opts.on_tail('-V', '--version', 'display the version') do
$stdout.puts "Asciidoctor #{Asciidoctor::VERSION} [http://asciidoctor.org]"
return 0
end
end
begin
# shave off the file to process so that options errors appear correctly
if args.last && (args.last == '-' || !args.last.start_with?('-'))
self[:input_file] = args.pop
end
opts_parser.parse!(args)
if args.size > 0
# warn, but don't panic; we may have enough to proceed, so we won't force a failure
$stderr.puts "asciidoctor: WARNING: extra arguments detected (unparsed arguments: #{args.map{|a| "'#{a}'"} * ', '})"
end
if self[:input_file].nil? || self[:input_file].empty?
$stderr.puts opts_parser
return 1
elsif self[:input_file] != '-' && !File.readable?(self[:input_file])
$stderr.puts "asciidoctor: FAILED: input file #{self[:input_file]} missing or cannot be read"
return 1
elsif !self[:template_dirs].nil?
begin
require 'tilt'
rescue LoadError
$stderr.puts 'asciidoctor: FAILED: tilt could not be loaded; to use a custom backend, you must have the tilt gem installed (gem install tilt)'
return 1
end
end
rescue OptionParser::MissingArgument
$stderr.puts "asciidoctor: option #{$!.message}"
$stdout.puts opts_parser
return 1
rescue OptionParser::InvalidOption, OptionParser::InvalidArgument
$stderr.puts "asciidoctor: #{$!.message}"
$stdout.puts opts_parser
return 1
end
self
end # parse()
end
end
end
| 1 | 4,491 | I have followed the convention of `cp` | asciidoctor-asciidoctor | rb |
@@ -8390,11 +8390,11 @@ return [
'mysql_xdevapi\tableupdate::where' => ['mysql_xdevapi\TableUpdate', 'where_expr'=>'string'],
'mysqli::__construct' => ['void', 'hostname='=>'string|null', 'username='=>'string|null', 'password='=>'string|null', 'database='=>'string|null', 'port='=>'int|null', 'socket='=>'string|null'],
'mysqli::autocommit' => ['bool', 'enable'=>'bool'],
-'mysqli::begin_transaction' => ['bool', 'flags='=>'int', 'name='=>'string'],
+'mysqli::begin_transaction' => ['bool', 'flags='=>'int', 'name='=>'?string'],
'mysqli::change_user' => ['bool', 'username'=>'string', 'password'=>'string', 'database'=>'string'],
'mysqli::character_set_name' => ['string'],
'mysqli::close' => ['bool'],
-'mysqli::commit' => ['bool', 'flags='=>'int', 'name='=>'string'],
+'mysqli::commit' => ['bool', 'flags='=>'int', 'name='=>'?string'],
'mysqli::connect' => ['bool', 'hostname='=>'string|null', 'username='=>'string|null', 'password='=>'string|null', 'database='=>'string|null', 'port='=>'int|null', 'socket='=>'string|null'],
'mysqli::debug' => ['bool', 'options'=>'string'],
'mysqli::disable_reads_from_master' => ['bool'], | 1 | <?php // phpcs:ignoreFile
namespace Phan\Language\Internal;
/**
* CURRENT PHP TARGET VERSION: 8.1
* The version above has to match Psalm\Internal\Codebase\InternalCallMapHandler::PHP_(MAJOR|MINOR)_VERSION
*
* Format
*
* '<function_name>' => ['<return_type>, '<arg_name>'=>'<arg_type>']
* alternative signature for the same function
* '<function_name\'1>' => ['<return_type>, '<arg_name>'=>'<arg_type>']
*
* A '&' in front of the <arg_name> means the arg is always passed by reference.
* (i.e. ReflectionParameter->isPassedByReference())
* This was previously only used in cases where the function actually created the
* variable in the local scope.
* Some reference arguments will have prefixes in <arg_name> to indicate the way the argument is used.
* Currently, the only prefixes with meaning are 'rw_' (read-write) and 'w_' (write).
* Those prefixes don't mean anything for non-references.
* Code using these signatures should remove those prefixes from messages rendered to the user.
* 1. '&rw_<arg_name>' indicates that a parameter with a value is expected to be passed in, and may be modified.
* Phan will warn if the variable has an incompatible type, or is undefined.
* 2. '&w_<arg_name>' indicates that a parameter is expected to be passed in, and the value will be ignored, and may be overwritten.
* 3. The absence of a prefix is treated by Phan the same way as having the prefix 'w_' (Some may be changed to 'rw_name'). These will have prefixes added later.
*
* So, for functions like sort() where technically the arg is by-ref,
* indicate the reference param's signature by-ref and read-write,
* as `'&rw_array'=>'array'`
* so that Phan won't create it in the local scope
*
* However, for a function like preg_match() where the 3rd arg is an array of sub-pattern matches (and optional),
* this arg needs to be marked as by-ref and write-only, as `'&w_matches='=>'array'`.
*
* A '=' following the <arg_name> indicates this arg is optional.
*
* The <arg_name> can begin with '...' to indicate the arg is variadic.
* '...args=' indicates it is both variadic and optional.
*
* Some reference arguments will have prefixes in <arg_name> to indicate the way the argument is used.
* Currently, the only prefixes with meaning are 'rw_' and 'w_'.
* Code using these signatures should remove those prefixes from messages rendered to the user.
* 1. '&rw_name' indicates that a parameter with a value is expected to be passed in, and may be modified.
* 2. '&w_name' indicates that a parameter is expected to be passed in, and the value will be ignored, and may be overwritten.
*
* This file contains the signatures for the most recent minor release of PHP supported by phan (php 7.2)
*
* Changes:
*
* In Phan 0.12.3,
*
* - This started using array shapes for union types (array{...}).
*
* \Phan\Language\UnionType->withFlattenedArrayShapeOrLiteralTypeInstances() may be of help to programmatically convert these to array<string,T1>|array<string,T2>
*
* - This started using array shapes with optional fields for union types (array{key?:int}).
* A `?` after the array shape field's key indicates that the field is optional.
*
* - This started adding param signatures and return signatures to `callable` types.
* E.g. 'usort' => ['bool', '&rw_array_arg'=>'array', 'cmp_function'=>'callable(mixed,mixed):int'].
* See NEWS.md for 0.12.3 for possible syntax. A suffix of `=` within `callable(...)` means that a parameter is optional.
*
* (Phan assumes that callbacks with optional arguments can be cast to callbacks with/without those args (Similar to inheritance checks)
* (e.g. callable(T1,T2=) can be cast to callable(T1) or callable(T1,T2), in the same way that a subclass would check).
* For some signatures, e.g. set_error_handler, this results in repetition, because callable(T1=) can't cast to callable(T1).
*
* Sources of stub info:
*
* 1. Reflection
* 2. docs.php.net's SVN repo or website, and examples (See internal/internalsignatures.php)
*
* See https://secure.php.net/manual/en/copyright.php
*
* The PHP manual text and comments are covered by the [Creative Commons Attribution 3.0 License](http://creativecommons.org/licenses/by/3.0/legalcode),
* copyright (c) the PHP Documentation Group
* 3. Various websites documenting individual extensions
* 4. PHPStorm stubs (For anything missing from the above sources)
* See internal/internalsignatures.php
*
* Available from https://github.com/JetBrains/phpstorm-stubs under the [Apache 2 license](https://www.apache.org/licenses/LICENSE-2.0)
*
* @phan-file-suppress PhanPluginMixedKeyNoKey (read by Phan when analyzing this file)
*
* Note: Some of Phan's inferences about return types are written as plugins for functions/methods where the return type depends on the parameter types.
* E.g. src/Phan/Plugin/Internal/DependentReturnTypeOverridePlugin.php is one plugin
*/
return [
'_' => ['string', 'message'=>'string'],
'__halt_compiler' => ['void'],
'abs' => ['int', 'num'=>'int'],
'abs\'1' => ['float', 'num'=>'float'],
'abs\'2' => ['numeric', 'num'=>'numeric'],
'accelerator_get_configuration' => ['array'],
'accelerator_get_scripts' => ['array'],
'accelerator_get_status' => ['array', 'fetch_scripts'=>'bool'],
'accelerator_reset' => [''],
'accelerator_set_status' => ['void', 'status'=>'bool'],
'acos' => ['float', 'num'=>'float'],
'acosh' => ['float', 'num'=>'float'],
'addcslashes' => ['string', 'string'=>'string', 'characters'=>'string'],
'addslashes' => ['string', 'string'=>'string'],
'AMQPBasicProperties::__construct' => ['void', 'content_type='=>'string', 'content_encoding='=>'string', 'headers='=>'array', 'delivery_mode='=>'int', 'priority='=>'int', 'correlation_id='=>'string', 'reply_to='=>'string', 'expiration='=>'string', 'message_id='=>'string', 'timestamp='=>'int', 'type='=>'string', 'user_id='=>'string', 'app_id='=>'string', 'cluster_id='=>'string'],
'AMQPBasicProperties::getAppId' => ['string'],
'AMQPBasicProperties::getClusterId' => ['string'],
'AMQPBasicProperties::getContentEncoding' => ['string'],
'AMQPBasicProperties::getContentType' => ['string'],
'AMQPBasicProperties::getCorrelationId' => ['string'],
'AMQPBasicProperties::getDeliveryMode' => ['int'],
'AMQPBasicProperties::getExpiration' => ['string'],
'AMQPBasicProperties::getHeaders' => ['array'],
'AMQPBasicProperties::getMessageId' => ['string'],
'AMQPBasicProperties::getPriority' => ['int'],
'AMQPBasicProperties::getReplyTo' => ['string'],
'AMQPBasicProperties::getTimestamp' => ['string'],
'AMQPBasicProperties::getType' => ['string'],
'AMQPBasicProperties::getUserId' => ['string'],
'AMQPChannel::__construct' => ['void', 'amqp_connection'=>'AMQPConnection'],
'AMQPChannel::basicRecover' => ['', 'requeue='=>'bool'],
'AMQPChannel::close' => [''],
'AMQPChannel::commitTransaction' => ['bool'],
'AMQPChannel::confirmSelect' => [''],
'AMQPChannel::getChannelId' => ['int'],
'AMQPChannel::getConnection' => ['AMQPConnection'],
'AMQPChannel::getConsumers' => ['AMQPQueue[]'],
'AMQPChannel::getPrefetchCount' => ['int'],
'AMQPChannel::getPrefetchSize' => ['int'],
'AMQPChannel::isConnected' => ['bool'],
'AMQPChannel::qos' => ['bool', 'size'=>'int', 'count'=>'int'],
'AMQPChannel::rollbackTransaction' => ['bool'],
'AMQPChannel::setConfirmCallback' => ['', 'ack_callback='=>'?callable', 'nack_callback='=>'?callable'],
'AMQPChannel::setPrefetchCount' => ['bool', 'count'=>'int'],
'AMQPChannel::setPrefetchSize' => ['bool', 'size'=>'int'],
'AMQPChannel::setReturnCallback' => ['', 'return_callback='=>'?callable'],
'AMQPChannel::startTransaction' => ['bool'],
'AMQPChannel::waitForBasicReturn' => ['', 'timeout='=>'float'],
'AMQPChannel::waitForConfirm' => ['', 'timeout='=>'float'],
'AMQPConnection::__construct' => ['void', 'credentials='=>'array'],
'AMQPConnection::connect' => ['bool'],
'AMQPConnection::disconnect' => ['bool'],
'AMQPConnection::getCACert' => ['string'],
'AMQPConnection::getCert' => ['string'],
'AMQPConnection::getHeartbeatInterval' => ['int'],
'AMQPConnection::getHost' => ['string'],
'AMQPConnection::getKey' => ['string'],
'AMQPConnection::getLogin' => ['string'],
'AMQPConnection::getMaxChannels' => ['?int'],
'AMQPConnection::getMaxFrameSize' => ['int'],
'AMQPConnection::getPassword' => ['string'],
'AMQPConnection::getPort' => ['int'],
'AMQPConnection::getReadTimeout' => ['float'],
'AMQPConnection::getTimeout' => ['float'],
'AMQPConnection::getUsedChannels' => ['int'],
'AMQPConnection::getVerify' => ['bool'],
'AMQPConnection::getVhost' => ['string'],
'AMQPConnection::getWriteTimeout' => ['float'],
'AMQPConnection::isConnected' => ['bool'],
'AMQPConnection::isPersistent' => ['?bool'],
'AMQPConnection::pconnect' => ['bool'],
'AMQPConnection::pdisconnect' => ['bool'],
'AMQPConnection::preconnect' => ['bool'],
'AMQPConnection::reconnect' => ['bool'],
'AMQPConnection::setCACert' => ['', 'cacert'=>'string'],
'AMQPConnection::setCert' => ['', 'cert'=>'string'],
'AMQPConnection::setHost' => ['bool', 'host'=>'string'],
'AMQPConnection::setKey' => ['', 'key'=>'string'],
'AMQPConnection::setLogin' => ['bool', 'login'=>'string'],
'AMQPConnection::setPassword' => ['bool', 'password'=>'string'],
'AMQPConnection::setPort' => ['bool', 'port'=>'int'],
'AMQPConnection::setReadTimeout' => ['bool', 'timeout'=>'int'],
'AMQPConnection::setTimeout' => ['bool', 'timeout'=>'int'],
'AMQPConnection::setVerify' => ['', 'verify'=>'bool'],
'AMQPConnection::setVhost' => ['bool', 'vhost'=>'string'],
'AMQPConnection::setWriteTimeout' => ['bool', 'timeout'=>'int'],
'AMQPDecimal::__construct' => ['void', 'exponent'=>'', 'significand'=>''],
'AMQPDecimal::getExponent' => ['int'],
'AMQPDecimal::getSignificand' => ['int'],
'AMQPEnvelope::__construct' => ['void'],
'AMQPEnvelope::getAppId' => ['string'],
'AMQPEnvelope::getBody' => ['string'],
'AMQPEnvelope::getClusterId' => ['string'],
'AMQPEnvelope::getConsumerTag' => ['string'],
'AMQPEnvelope::getContentEncoding' => ['string'],
'AMQPEnvelope::getContentType' => ['string'],
'AMQPEnvelope::getCorrelationId' => ['string'],
'AMQPEnvelope::getDeliveryMode' => ['int'],
'AMQPEnvelope::getDeliveryTag' => ['string'],
'AMQPEnvelope::getExchangeName' => ['string'],
'AMQPEnvelope::getExpiration' => ['string'],
'AMQPEnvelope::getHeader' => ['string|false', 'header_key'=>'string'],
'AMQPEnvelope::getHeaders' => ['array'],
'AMQPEnvelope::getMessageId' => ['string'],
'AMQPEnvelope::getPriority' => ['int'],
'AMQPEnvelope::getReplyTo' => ['string'],
'AMQPEnvelope::getRoutingKey' => ['string'],
'AMQPEnvelope::getTimeStamp' => ['string'],
'AMQPEnvelope::getType' => ['string'],
'AMQPEnvelope::getUserId' => ['string'],
'AMQPEnvelope::hasHeader' => ['bool', 'header_key'=>'string'],
'AMQPEnvelope::isRedelivery' => ['bool'],
'AMQPExchange::__construct' => ['void', 'amqp_channel'=>'AMQPChannel'],
'AMQPExchange::bind' => ['bool', 'exchange_name'=>'string', 'routing_key='=>'string', 'arguments='=>'array'],
'AMQPExchange::declareExchange' => ['bool'],
'AMQPExchange::delete' => ['bool', 'exchangeName='=>'string', 'flags='=>'int'],
'AMQPExchange::getArgument' => ['int|string|false', 'key'=>'string'],
'AMQPExchange::getArguments' => ['array'],
'AMQPExchange::getChannel' => ['AMQPChannel'],
'AMQPExchange::getConnection' => ['AMQPConnection'],
'AMQPExchange::getFlags' => ['int'],
'AMQPExchange::getName' => ['string'],
'AMQPExchange::getType' => ['string'],
'AMQPExchange::hasArgument' => ['bool', 'key'=>'string'],
'AMQPExchange::publish' => ['bool', 'message'=>'string', 'routing_key='=>'string', 'flags='=>'int', 'attributes='=>'array'],
'AMQPExchange::setArgument' => ['bool', 'key'=>'string', 'value'=>'int|string'],
'AMQPExchange::setArguments' => ['bool', 'arguments'=>'array'],
'AMQPExchange::setFlags' => ['bool', 'flags'=>'int'],
'AMQPExchange::setName' => ['bool', 'exchange_name'=>'string'],
'AMQPExchange::setType' => ['bool', 'exchange_type'=>'string'],
'AMQPExchange::unbind' => ['bool', 'exchange_name'=>'string', 'routing_key='=>'string', 'arguments='=>'array'],
'AMQPQueue::__construct' => ['void', 'amqp_channel'=>'AMQPChannel'],
'AMQPQueue::ack' => ['bool', 'delivery_tag'=>'string', 'flags='=>'int'],
'AMQPQueue::bind' => ['bool', 'exchange_name'=>'string', 'routing_key='=>'string', 'arguments='=>'array'],
'AMQPQueue::cancel' => ['bool', 'consumer_tag='=>'string'],
'AMQPQueue::consume' => ['void', 'callback='=>'?callable', 'flags='=>'int', 'consumerTag='=>'string'],
'AMQPQueue::declareQueue' => ['int'],
'AMQPQueue::delete' => ['int', 'flags='=>'int'],
'AMQPQueue::get' => ['AMQPEnvelope|false', 'flags='=>'int'],
'AMQPQueue::getArgument' => ['int|string|false', 'key'=>'string'],
'AMQPQueue::getArguments' => ['array'],
'AMQPQueue::getChannel' => ['AMQPChannel'],
'AMQPQueue::getConnection' => ['AMQPConnection'],
'AMQPQueue::getConsumerTag' => ['?string'],
'AMQPQueue::getFlags' => ['int'],
'AMQPQueue::getName' => ['string'],
'AMQPQueue::hasArgument' => ['bool', 'key'=>'string'],
'AMQPQueue::nack' => ['bool', 'delivery_tag'=>'string', 'flags='=>'int'],
'AMQPQueue::purge' => ['bool'],
'AMQPQueue::reject' => ['bool', 'delivery_tag'=>'string', 'flags='=>'int'],
'AMQPQueue::setArgument' => ['bool', 'key'=>'string', 'value'=>'mixed'],
'AMQPQueue::setArguments' => ['bool', 'arguments'=>'array'],
'AMQPQueue::setFlags' => ['bool', 'flags'=>'int'],
'AMQPQueue::setName' => ['bool', 'queue_name'=>'string'],
'AMQPQueue::unbind' => ['bool', 'exchange_name'=>'string', 'routing_key='=>'string', 'arguments='=>'array'],
'AMQPTimestamp::__construct' => ['void', 'timestamp'=>'string'],
'AMQPTimestamp::__toString' => ['string'],
'AMQPTimestamp::getTimestamp' => ['string'],
'apache_child_terminate' => ['bool'],
'apache_get_modules' => ['array'],
'apache_get_version' => ['string|false'],
'apache_getenv' => ['string|false', 'variable'=>'string', 'walk_to_top='=>'bool'],
'apache_lookup_uri' => ['object', 'filename'=>'string'],
'apache_note' => ['string|false', 'note_name'=>'string', 'note_value='=>'string'],
'apache_request_headers' => ['array|false'],
'apache_reset_timeout' => ['bool'],
'apache_response_headers' => ['array|false'],
'apache_setenv' => ['bool', 'variable'=>'string', 'value'=>'string', 'walk_to_top='=>'bool'],
'apc_add' => ['bool', 'key'=>'string', 'var'=>'mixed', 'ttl='=>'int'],
'apc_add\'1' => ['array', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'],
'apc_bin_dump' => ['string|false|null', 'files='=>'array', 'user_vars='=>'array'],
'apc_bin_dumpfile' => ['int|false', 'files'=>'array', 'user_vars'=>'array', 'filename'=>'string', 'flags='=>'int', 'context='=>'resource'],
'apc_bin_load' => ['bool', 'data'=>'string', 'flags='=>'int'],
'apc_bin_loadfile' => ['bool', 'filename'=>'string', 'context='=>'resource', 'flags='=>'int'],
'apc_cache_info' => ['array|false', 'cache_type='=>'string', 'limited='=>'bool'],
'apc_cas' => ['bool', 'key'=>'string', 'old'=>'int', 'new'=>'int'],
'apc_clear_cache' => ['bool', 'cache_type='=>'string'],
'apc_compile_file' => ['bool', 'filename'=>'string', 'atomic='=>'bool'],
'apc_dec' => ['int|false', 'key'=>'string', 'step='=>'int', '&w_success='=>'bool'],
'apc_define_constants' => ['bool', 'key'=>'string', 'constants'=>'array', 'case_sensitive='=>'bool'],
'apc_delete' => ['bool', 'key'=>'string|string[]|APCIterator'],
'apc_delete_file' => ['bool|string[]', 'keys'=>'mixed'],
'apc_exists' => ['bool', 'keys'=>'string'],
'apc_exists\'1' => ['array', 'keys'=>'string[]'],
'apc_fetch' => ['mixed|false', 'key'=>'string', '&w_success='=>'bool'],
'apc_fetch\'1' => ['array|false', 'key'=>'string[]', '&w_success='=>'bool'],
'apc_inc' => ['int|false', 'key'=>'string', 'step='=>'int', '&w_success='=>'bool'],
'apc_load_constants' => ['bool', 'key'=>'string', 'case_sensitive='=>'bool'],
'apc_sma_info' => ['array|false', 'limited='=>'bool'],
'apc_store' => ['bool', 'key'=>'string', 'var'=>'', 'ttl='=>'int'],
'apc_store\'1' => ['array', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'],
'APCIterator::__construct' => ['void', 'cache'=>'string', 'search='=>'null|string|string[]', 'format='=>'int', 'chunk_size='=>'int', 'list='=>'int'],
'APCIterator::current' => ['mixed|false'],
'APCIterator::getTotalCount' => ['int|false'],
'APCIterator::getTotalHits' => ['int|false'],
'APCIterator::getTotalSize' => ['int|false'],
'APCIterator::key' => ['string'],
'APCIterator::next' => ['void'],
'APCIterator::rewind' => ['void'],
'APCIterator::valid' => ['bool'],
'apcu_add' => ['bool', 'key'=>'string', 'var'=>'', 'ttl='=>'int'],
'apcu_add\'1' => ['array<string,int>', 'values'=>'array<string,mixed>', 'unused='=>'', 'ttl='=>'int'],
'apcu_cache_info' => ['array<string,mixed>|false', 'limited='=>'bool'],
'apcu_cas' => ['bool', 'key'=>'string', 'old'=>'int', 'new'=>'int'],
'apcu_clear_cache' => ['bool'],
'apcu_dec' => ['int|false', 'key'=>'string', 'step='=>'int', '&w_success='=>'bool', 'ttl='=>'int'],
'apcu_delete' => ['bool', 'key'=>'string|APCuIterator'],
'apcu_delete\'1' => ['list<string>', 'key'=>'string[]'],
'apcu_enabled' => ['bool'],
'apcu_entry' => ['mixed', 'key'=>'string', 'generator'=>'callable', 'ttl='=>'int'],
'apcu_exists' => ['bool', 'keys'=>'string'],
'apcu_exists\'1' => ['array', 'keys'=>'string[]'],
'apcu_fetch' => ['mixed|false', 'key'=>'string', '&w_success='=>'bool'],
'apcu_fetch\'1' => ['array|false', 'key'=>'string[]', '&w_success='=>'bool'],
'apcu_inc' => ['int|false', 'key'=>'string', 'step='=>'int', '&w_success='=>'bool', 'ttl='=>'int'],
'apcu_key_info' => ['?array', 'key'=>'string'],
'apcu_sma_info' => ['array|false', 'limited='=>'bool'],
'apcu_store' => ['bool', 'key'=>'string', 'var='=>'', 'ttl='=>'int'],
'apcu_store\'1' => ['array', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'],
'APCuIterator::__construct' => ['void', 'search='=>'string|string[]|null', 'format='=>'int', 'chunk_size='=>'int', 'list='=>'int'],
'APCuIterator::current' => ['mixed'],
'APCuIterator::getTotalCount' => ['int'],
'APCuIterator::getTotalHits' => ['int'],
'APCuIterator::getTotalSize' => ['int'],
'APCuIterator::key' => ['string'],
'APCuIterator::next' => ['void'],
'APCuIterator::rewind' => ['void'],
'APCuIterator::valid' => ['bool'],
'apd_breakpoint' => ['bool', 'debug_level'=>'int'],
'apd_callstack' => ['array'],
'apd_clunk' => ['void', 'warning'=>'string', 'delimiter='=>'string'],
'apd_continue' => ['bool', 'debug_level'=>'int'],
'apd_croak' => ['void', 'warning'=>'string', 'delimiter='=>'string'],
'apd_dump_function_table' => ['void'],
'apd_dump_persistent_resources' => ['array'],
'apd_dump_regular_resources' => ['array'],
'apd_echo' => ['bool', 'output'=>'string'],
'apd_get_active_symbols' => ['array'],
'apd_set_pprof_trace' => ['string', 'dump_directory='=>'string', 'fragment='=>'string'],
'apd_set_session' => ['void', 'debug_level'=>'int'],
'apd_set_session_trace' => ['void', 'debug_level'=>'int', 'dump_directory='=>'string'],
'apd_set_session_trace_socket' => ['bool', 'tcp_server'=>'string', 'socket_type'=>'int', 'port'=>'int', 'debug_level'=>'int'],
'AppendIterator::__construct' => ['void'],
'AppendIterator::append' => ['void', 'iterator'=>'Iterator'],
'AppendIterator::current' => ['mixed'],
'AppendIterator::getArrayIterator' => ['ArrayIterator'],
'AppendIterator::getInnerIterator' => ['Iterator'],
'AppendIterator::getIteratorIndex' => ['int'],
'AppendIterator::key' => ['int|string|float|bool'],
'AppendIterator::next' => ['void'],
'AppendIterator::rewind' => ['void'],
'AppendIterator::valid' => ['bool'],
'ArgumentCountError::__clone' => ['void'],
'ArgumentCountError::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?Error'],
'ArgumentCountError::__toString' => ['string'],
'ArgumentCountError::__wakeup' => ['void'],
'ArgumentCountError::getCode' => ['int'],
'ArgumentCountError::getFile' => ['string'],
'ArgumentCountError::getLine' => ['int'],
'ArgumentCountError::getMessage' => ['string'],
'ArgumentCountError::getPrevious' => ['?Throwable'],
'ArgumentCountError::getTrace' => ['list<array<string,mixed>>'],
'ArgumentCountError::getTraceAsString' => ['string'],
'ArithmeticError::__clone' => ['void'],
'ArithmeticError::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?Error'],
'ArithmeticError::__toString' => ['string'],
'ArithmeticError::__wakeup' => ['void'],
'ArithmeticError::getCode' => ['int'],
'ArithmeticError::getFile' => ['string'],
'ArithmeticError::getLine' => ['int'],
'ArithmeticError::getMessage' => ['string'],
'ArithmeticError::getPrevious' => ['?Throwable'],
'ArithmeticError::getTrace' => ['list<array<string,mixed>>'],
'ArithmeticError::getTraceAsString' => ['string'],
'array_change_key_case' => ['associative-array', 'array'=>'array', 'case='=>'int'],
'array_chunk' => ['list<array[]>', 'array'=>'array', 'length'=>'int', 'preserve_keys='=>'bool'],
'array_column' => ['array', 'array'=>'array', 'column_key'=>'mixed', 'index_key='=>'mixed'],
'array_combine' => ['associative-array', 'keys'=>'string[]|int[]', 'values'=>'array'],
'array_count_values' => ['associative-array<mixed,int>', 'array'=>'array'],
'array_diff' => ['associative-array', 'array'=>'array', 'arrays'=>'array', '...args='=>'array'],
'array_diff_assoc' => ['associative-array', 'array'=>'array', 'arrays'=>'array', '...args='=>'array'],
'array_diff_key' => ['associative-array', 'array'=>'array', 'arrays'=>'array', '...args='=>'array'],
'array_diff_uassoc' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'data_comp_func'=>'callable(mixed,mixed):int'],
'array_diff_uassoc\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'],
'array_diff_ukey' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'key_comp_func'=>'callable(mixed,mixed):int'],
'array_diff_ukey\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'],
'array_fill' => ['array<int,mixed>', 'start_index'=>'int', 'count'=>'int', 'value'=>'mixed'],
'array_fill_keys' => ['array', 'keys'=>'array', 'value'=>'mixed'],
'array_filter' => ['associative-array', 'array'=>'array', 'callback='=>'callable(mixed,mixed=):scalar', 'mode='=>'int'],
'array_flip' => ['associative-array<mixed,int>|associative-array<mixed,string>', 'array'=>'array'],
'array_intersect' => ['associative-array', 'array'=>'array', 'arrays'=>'array', '...args='=>'array'],
'array_intersect_assoc' => ['associative-array', 'array'=>'array', 'arrays'=>'array', '...args='=>'array'],
'array_intersect_key' => ['associative-array', 'array'=>'array', 'arrays'=>'array', '...args='=>'array'],
'array_intersect_uassoc' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'key_compare_func'=>'callable(mixed,mixed):int'],
'array_intersect_uassoc\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest'=>'array|callable(mixed,mixed):int'],
'array_intersect_ukey' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'key_compare_func'=>'callable(mixed,mixed):int'],
'array_intersect_ukey\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest'=>'array|callable(mixed,mixed):int'],
'array_is_list' => ['bool', 'array'=>'array'],
'array_key_exists' => ['bool', 'key'=>'string|int', 'array'=>'array|ArrayObject'],
'array_key_first' => ['int|string|null', 'array'=>'array'],
'array_key_last' => ['int|string|null', 'array'=>'array'],
'array_keys' => ['list<string|int>', 'array'=>'array', 'filter_value='=>'mixed', 'strict='=>'bool'],
'array_map' => ['array', 'callback'=>'?callable', 'array'=>'array', '...arrays='=>'array'],
'array_merge' => ['array', 'arrays'=>'array', '...args='=>'array'],
'array_merge_recursive' => ['array', 'arrays'=>'array', '...args='=>'array'],
'array_multisort' => ['bool', '&rw_array'=>'array', 'rest='=>'array|int', 'array1_sort_flags='=>'array|int', '...args='=>'array|int'],
'array_pad' => ['array', 'array'=>'array', 'length'=>'int', 'value'=>'mixed'],
'array_pop' => ['mixed', '&rw_array'=>'array'],
'array_product' => ['int|float', 'array'=>'array'],
'array_push' => ['int', '&rw_array'=>'array', 'values'=>'mixed', '...vars='=>'mixed'],
'array_rand' => ['int|string|array<int,int>|array<int,string>', 'array'=>'non-empty-array', 'num'=>'int'],
'array_rand\'1' => ['int|string', 'array'=>'array'],
'array_reduce' => ['mixed', 'array'=>'array', 'callback'=>'callable(mixed,mixed):mixed', 'initial='=>'mixed'],
'array_replace' => ['array', 'array'=>'array', 'replacements'=>'array', '...args='=>'array'],
'array_replace_recursive' => ['array', 'array'=>'array', 'replacements'=>'array', '...args='=>'array'],
'array_reverse' => ['array', 'array'=>'array', 'preserve_keys='=>'bool'],
'array_search' => ['int|string|false', 'needle'=>'mixed', 'haystack'=>'array', 'strict='=>'bool'],
'array_shift' => ['mixed|null', '&rw_array'=>'array'],
'array_slice' => ['array', 'array'=>'array', 'offset'=>'int', 'length='=>'?int', 'preserve_keys='=>'bool'],
'array_splice' => ['array', '&rw_array'=>'array', 'offset'=>'int', 'length='=>'int', 'replacement='=>'array|string'],
'array_sum' => ['int|float', 'array'=>'array'],
'array_udiff' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'data_comp_func'=>'callable(mixed,mixed):int'],
'array_udiff\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'],
'array_udiff_assoc' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'key_comp_func'=>'callable(mixed,mixed):int'],
'array_udiff_assoc\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'],
'array_udiff_uassoc' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'data_comp_func'=>'callable(mixed,mixed):int', 'key_comp_func'=>'callable(mixed,mixed):int'],
'array_udiff_uassoc\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', 'arg5'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'],
'array_uintersect' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'data_compare_func'=>'callable(mixed,mixed):int'],
'array_uintersect\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'],
'array_uintersect_assoc' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'data_compare_func'=>'callable(mixed,mixed):int'],
'array_uintersect_assoc\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable', '...rest='=>'array|callable(mixed,mixed):int'],
'array_uintersect_uassoc' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'data_compare_func'=>'callable(mixed,mixed):int', 'key_compare_func'=>'callable(mixed,mixed):int'],
'array_uintersect_uassoc\'1' => ['associative-array', 'array'=>'array', 'rest'=>'array', 'arr3'=>'array', 'arg4'=>'array|callable(mixed,mixed):int', 'arg5'=>'array|callable(mixed,mixed):int', '...rest='=>'array|callable(mixed,mixed):int'],
'array_unique' => ['associative-array', 'array'=>'array', 'flags='=>'int'],
'array_unshift' => ['int', '&rw_array'=>'array', 'values'=>'mixed', '...vars='=>'mixed'],
'array_values' => ['list<mixed>', 'array'=>'array'],
'array_walk' => ['bool', '&rw_array'=>'array', 'callback'=>'callable', 'arg='=>'mixed'],
'array_walk\'1' => ['bool', '&rw_array'=>'object', 'callback'=>'callable', 'arg='=>'mixed'],
'array_walk_recursive' => ['bool', '&rw_array'=>'array', 'callback'=>'callable', 'arg='=>'mixed'],
'array_walk_recursive\'1' => ['bool', '&rw_array'=>'object', 'callback'=>'callable', 'arg='=>'mixed'],
'ArrayAccess::offsetExists' => ['bool', 'offset'=>'mixed'],
'ArrayAccess::offsetGet' => ['mixed', 'offset'=>'mixed'],
'ArrayAccess::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'],
'ArrayAccess::offsetUnset' => ['void', 'offset'=>'mixed'],
'ArrayIterator::__construct' => ['void', 'array='=>'array|object', 'flags='=>'int'],
'ArrayIterator::append' => ['void', 'value'=>'mixed'],
'ArrayIterator::asort' => ['void'],
'ArrayIterator::count' => ['int'],
'ArrayIterator::current' => ['mixed'],
'ArrayIterator::getArrayCopy' => ['array'],
'ArrayIterator::getFlags' => ['int'],
'ArrayIterator::key' => ['int|string|false'],
'ArrayIterator::ksort' => ['void'],
'ArrayIterator::natcasesort' => ['void'],
'ArrayIterator::natsort' => ['void'],
'ArrayIterator::next' => ['void'],
'ArrayIterator::offsetExists' => ['bool', 'index'=>'string|int'],
'ArrayIterator::offsetGet' => ['mixed', 'index'=>'string|int'],
'ArrayIterator::offsetSet' => ['void', 'index'=>'string|int', 'newval'=>'mixed'],
'ArrayIterator::offsetUnset' => ['void', 'index'=>'string|int'],
'ArrayIterator::rewind' => ['void'],
'ArrayIterator::seek' => ['void', 'position'=>'int'],
'ArrayIterator::serialize' => ['string'],
'ArrayIterator::setFlags' => ['void', 'flags'=>'string'],
'ArrayIterator::uasort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'],
'ArrayIterator::uksort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'],
'ArrayIterator::unserialize' => ['void', 'serialized'=>'string'],
'ArrayIterator::valid' => ['bool'],
'ArrayObject::__construct' => ['void', 'input='=>'array|object', 'flags='=>'int', 'iterator_class='=>'string'],
'ArrayObject::append' => ['void', 'value'=>'mixed'],
'ArrayObject::asort' => ['void'],
'ArrayObject::count' => ['int'],
'ArrayObject::exchangeArray' => ['array', 'ar'=>'mixed'],
'ArrayObject::getArrayCopy' => ['array'],
'ArrayObject::getFlags' => ['int'],
'ArrayObject::getIterator' => ['ArrayIterator'],
'ArrayObject::getIteratorClass' => ['string'],
'ArrayObject::ksort' => ['void'],
'ArrayObject::natcasesort' => ['void'],
'ArrayObject::natsort' => ['void'],
'ArrayObject::offsetExists' => ['bool', 'index'=>'int|string'],
'ArrayObject::offsetGet' => ['mixed|null', 'index'=>'int|string'],
'ArrayObject::offsetSet' => ['void', 'index'=>'int|string', 'newval'=>'mixed'],
'ArrayObject::offsetUnset' => ['void', 'index'=>'int|string'],
'ArrayObject::serialize' => ['string'],
'ArrayObject::setFlags' => ['void', 'flags'=>'int'],
'ArrayObject::setIteratorClass' => ['void', 'iterator_class'=>'string'],
'ArrayObject::uasort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'],
'ArrayObject::uksort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'],
'ArrayObject::unserialize' => ['void', 'serialized'=>'string'],
'arsort' => ['bool', '&rw_array'=>'array', 'flags='=>'int'],
'asin' => ['float', 'num'=>'float'],
'asinh' => ['float', 'num'=>'float'],
'asort' => ['bool', '&rw_array'=>'array', 'flags='=>'int'],
'assert' => ['bool', 'assertion'=>'string|bool|int', 'description='=>'string|Throwable|null'],
'assert_options' => ['mixed|false', 'option'=>'int', 'value='=>'mixed'],
'ast\get_kind_name' => ['string', 'kind'=>'int'],
'ast\get_metadata' => ['array<int,ast\Metadata>'],
'ast\get_supported_versions' => ['array<int,int>', 'exclude_deprecated='=>'bool'],
'ast\kind_uses_flags' => ['bool', 'kind'=>'int'],
'ast\Node::__construct' => ['void', 'kind='=>'int', 'flags='=>'int', 'children='=>'ast\Node\Decl[]|ast\Node[]|int[]|string[]|float[]|bool[]|null[]', 'start_line='=>'int'],
'ast\parse_code' => ['ast\Node', 'code'=>'string', 'version'=>'int', 'filename='=>'string'],
'ast\parse_file' => ['ast\Node', 'filename'=>'string', 'version'=>'int'],
'atan' => ['float', 'num'=>'float'],
'atan2' => ['float', 'y'=>'float', 'x'=>'float'],
'atanh' => ['float', 'num'=>'float'],
'BadFunctionCallException::__clone' => ['void'],
'BadFunctionCallException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?BadFunctionCallException'],
'BadFunctionCallException::__toString' => ['string'],
'BadFunctionCallException::getCode' => ['int'],
'BadFunctionCallException::getFile' => ['string'],
'BadFunctionCallException::getLine' => ['int'],
'BadFunctionCallException::getMessage' => ['string'],
'BadFunctionCallException::getPrevious' => ['?Throwable|?BadFunctionCallException'],
'BadFunctionCallException::getTrace' => ['list<array<string,mixed>>'],
'BadFunctionCallException::getTraceAsString' => ['string'],
'BadMethodCallException::__clone' => ['void'],
'BadMethodCallException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?BadMethodCallException'],
'BadMethodCallException::__toString' => ['string'],
'BadMethodCallException::getCode' => ['int'],
'BadMethodCallException::getFile' => ['string'],
'BadMethodCallException::getLine' => ['int'],
'BadMethodCallException::getMessage' => ['string'],
'BadMethodCallException::getPrevious' => ['?Throwable|?BadMethodCallException'],
'BadMethodCallException::getTrace' => ['list<array<string,mixed>>'],
'BadMethodCallException::getTraceAsString' => ['string'],
'base64_decode' => ['string|false', 'string'=>'string', 'strict='=>'bool'],
'base64_encode' => ['string', 'string'=>'string'],
'base_convert' => ['string', 'num'=>'string', 'from_base'=>'int', 'to_base'=>'int'],
'basename' => ['string', 'path'=>'string', 'suffix='=>'string'],
'bbcode_add_element' => ['bool', 'bbcode_container'=>'resource', 'tag_name'=>'string', 'tag_rules'=>'array'],
'bbcode_add_smiley' => ['bool', 'bbcode_container'=>'resource', 'smiley'=>'string', 'replace_by'=>'string'],
'bbcode_create' => ['resource', 'bbcode_initial_tags='=>'array'],
'bbcode_destroy' => ['bool', 'bbcode_container'=>'resource'],
'bbcode_parse' => ['string', 'bbcode_container'=>'resource', 'to_parse'=>'string'],
'bbcode_set_arg_parser' => ['bool', 'bbcode_container'=>'resource', 'bbcode_arg_parser'=>'resource'],
'bbcode_set_flags' => ['bool', 'bbcode_container'=>'resource', 'flags'=>'int', 'mode='=>'int'],
'bcadd' => ['numeric-string', 'num1'=>'numeric-string', 'num2'=>'numeric-string', 'scale='=>'int|null'],
'bccomp' => ['int', 'num1'=>'numeric-string', 'num2'=>'numeric-string', 'scale='=>'int|null'],
'bcdiv' => ['numeric-string|null', 'dividend'=>'numeric-string', 'divisor'=>'numeric-string', 'scale='=>'int|null'],
'bcmod' => ['numeric-string|null', 'dividend'=>'numeric-string', 'divisor'=>'numeric-string', 'scale='=>'int|null'],
'bcmul' => ['numeric-string', 'num1'=>'numeric-string', 'num2'=>'numeric-string', 'scale='=>'int|null'],
'bcompiler_load' => ['bool', 'filename'=>'string'],
'bcompiler_load_exe' => ['bool', 'filename'=>'string'],
'bcompiler_parse_class' => ['bool', 'class'=>'string', 'callback'=>'string'],
'bcompiler_read' => ['bool', 'filehandle'=>'resource'],
'bcompiler_write_class' => ['bool', 'filehandle'=>'resource', 'classname'=>'string', 'extends='=>'string'],
'bcompiler_write_constant' => ['bool', 'filehandle'=>'resource', 'constantname'=>'string'],
'bcompiler_write_exe_footer' => ['bool', 'filehandle'=>'resource', 'startpos'=>'int'],
'bcompiler_write_file' => ['bool', 'filehandle'=>'resource', 'filename'=>'string'],
'bcompiler_write_footer' => ['bool', 'filehandle'=>'resource'],
'bcompiler_write_function' => ['bool', 'filehandle'=>'resource', 'functionname'=>'string'],
'bcompiler_write_functions_from_file' => ['bool', 'filehandle'=>'resource', 'filename'=>'string'],
'bcompiler_write_header' => ['bool', 'filehandle'=>'resource', 'write_ver='=>'string'],
'bcompiler_write_included_filename' => ['bool', 'filehandle'=>'resource', 'filename'=>'string'],
'bcpow' => ['numeric-string', 'num'=>'numeric-string', 'exponent'=>'numeric-string', 'scale='=>'int|null'],
'bcpowmod' => ['numeric-string|false', 'base'=>'numeric-string', 'exponent'=>'numeric-string', 'modulus'=>'numeric-string', 'scale='=>'int|null'],
'bcscale' => ['int', 'scale='=>'int|null'],
'bcsqrt' => ['numeric-string|null', 'num'=>'numeric-string', 'scale='=>'int|null'],
'bcsub' => ['numeric-string', 'num1'=>'numeric-string', 'num2'=>'numeric-string', 'scale='=>'int|null'],
'bin2hex' => ['string', 'string'=>'string'],
'bind_textdomain_codeset' => ['string', 'domain'=>'string', 'codeset'=>'string'],
'bindec' => ['float|int', 'binary_string'=>'string'],
'bindtextdomain' => ['string', 'domain'=>'string', 'directory'=>'string'],
'birdstep_autocommit' => ['bool', 'index'=>'int'],
'birdstep_close' => ['bool', 'id'=>'int'],
'birdstep_commit' => ['bool', 'index'=>'int'],
'birdstep_connect' => ['int', 'server'=>'string', 'user'=>'string', 'pass'=>'string'],
'birdstep_exec' => ['int', 'index'=>'int', 'exec_str'=>'string'],
'birdstep_fetch' => ['bool', 'index'=>'int'],
'birdstep_fieldname' => ['string', 'index'=>'int', 'col'=>'int'],
'birdstep_fieldnum' => ['int', 'index'=>'int'],
'birdstep_freeresult' => ['bool', 'index'=>'int'],
'birdstep_off_autocommit' => ['bool', 'index'=>'int'],
'birdstep_result' => ['', 'index'=>'int', 'col'=>''],
'birdstep_rollback' => ['bool', 'index'=>'int'],
'blenc_encrypt' => ['string', 'plaintext'=>'string', 'encodedfile'=>'string', 'encryption_key='=>'string'],
'boolval' => ['bool', 'value'=>'mixed'],
'bson_decode' => ['array', 'bson'=>'string'],
'bson_encode' => ['string', 'anything'=>'mixed'],
'bzclose' => ['bool', 'bz'=>'resource'],
'bzcompress' => ['string|int', 'data'=>'string', 'block_size='=>'int', 'work_factor='=>'int'],
'bzdecompress' => ['string|int', 'data'=>'string', 'use_less_memory='=>'int'],
'bzerrno' => ['int', 'bz'=>'resource'],
'bzerror' => ['array', 'bz'=>'resource'],
'bzerrstr' => ['string', 'bz'=>'resource'],
'bzflush' => ['bool', 'bz'=>'resource'],
'bzopen' => ['resource|false', 'file'=>'string|resource', 'mode'=>'string'],
'bzread' => ['string|false', 'bz'=>'resource', 'length='=>'int'],
'bzwrite' => ['int|false', 'bz'=>'resource', 'data'=>'string', 'length='=>'int'],
'CachingIterator::__construct' => ['void', 'iterator'=>'Iterator', 'flags='=>''],
'CachingIterator::__toString' => ['string'],
'CachingIterator::count' => ['int'],
'CachingIterator::current' => ['mixed'],
'CachingIterator::getCache' => ['array'],
'CachingIterator::getFlags' => ['int'],
'CachingIterator::getInnerIterator' => ['Iterator'],
'CachingIterator::hasNext' => ['bool'],
'CachingIterator::key' => ['int|string|float|bool'],
'CachingIterator::next' => ['void'],
'CachingIterator::offsetExists' => ['bool', 'index'=>'string'],
'CachingIterator::offsetGet' => ['mixed', 'index'=>'string'],
'CachingIterator::offsetSet' => ['void', 'index'=>'string', 'newval'=>'mixed'],
'CachingIterator::offsetUnset' => ['void', 'index'=>'string'],
'CachingIterator::rewind' => ['void'],
'CachingIterator::setFlags' => ['void', 'flags'=>'int'],
'CachingIterator::valid' => ['bool'],
'Cairo::availableFonts' => ['array'],
'Cairo::availableSurfaces' => ['array'],
'Cairo::statusToString' => ['string', 'status'=>'int'],
'Cairo::version' => ['int'],
'Cairo::versionString' => ['string'],
'cairo_append_path' => ['', 'path'=>'cairopath', 'context'=>'cairocontext'],
'cairo_arc' => ['', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'angle1'=>'float', 'angle2'=>'float', 'context'=>'cairocontext'],
'cairo_arc_negative' => ['', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'angle1'=>'float', 'angle2'=>'float', 'context'=>'cairocontext'],
'cairo_available_fonts' => ['array'],
'cairo_available_surfaces' => ['array'],
'cairo_clip' => ['', 'context'=>'cairocontext'],
'cairo_clip_extents' => ['array', 'context'=>'cairocontext'],
'cairo_clip_preserve' => ['', 'context'=>'cairocontext'],
'cairo_clip_rectangle_list' => ['array', 'context'=>'cairocontext'],
'cairo_close_path' => ['', 'context'=>'cairocontext'],
'cairo_copy_page' => ['', 'context'=>'cairocontext'],
'cairo_copy_path' => ['CairoPath', 'context'=>'cairocontext'],
'cairo_copy_path_flat' => ['CairoPath', 'context'=>'cairocontext'],
'cairo_create' => ['CairoContext', 'surface'=>'cairosurface'],
'cairo_curve_to' => ['', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float', 'context'=>'cairocontext'],
'cairo_device_to_user' => ['array', 'x'=>'float', 'y'=>'float', 'context'=>'cairocontext'],
'cairo_device_to_user_distance' => ['array', 'x'=>'float', 'y'=>'float', 'context'=>'cairocontext'],
'cairo_fill' => ['', 'context'=>'cairocontext'],
'cairo_fill_extents' => ['array', 'context'=>'cairocontext'],
'cairo_fill_preserve' => ['', 'context'=>'cairocontext'],
'cairo_font_extents' => ['array', 'context'=>'cairocontext'],
'cairo_font_face_get_type' => ['int', 'fontface'=>'cairofontface'],
'cairo_font_face_status' => ['int', 'fontface'=>'cairofontface'],
'cairo_font_options_create' => ['CairoFontOptions'],
'cairo_font_options_equal' => ['bool', 'options'=>'cairofontoptions', 'other'=>'cairofontoptions'],
'cairo_font_options_get_antialias' => ['int', 'options'=>'cairofontoptions'],
'cairo_font_options_get_hint_metrics' => ['int', 'options'=>'cairofontoptions'],
'cairo_font_options_get_hint_style' => ['int', 'options'=>'cairofontoptions'],
'cairo_font_options_get_subpixel_order' => ['int', 'options'=>'cairofontoptions'],
'cairo_font_options_hash' => ['int', 'options'=>'cairofontoptions'],
'cairo_font_options_merge' => ['void', 'options'=>'cairofontoptions', 'other'=>'cairofontoptions'],
'cairo_font_options_set_antialias' => ['void', 'options'=>'cairofontoptions', 'antialias'=>'int'],
'cairo_font_options_set_hint_metrics' => ['void', 'options'=>'cairofontoptions', 'hint_metrics'=>'int'],
'cairo_font_options_set_hint_style' => ['void', 'options'=>'cairofontoptions', 'hint_style'=>'int'],
'cairo_font_options_set_subpixel_order' => ['void', 'options'=>'cairofontoptions', 'subpixel_order'=>'int'],
'cairo_font_options_status' => ['int', 'options'=>'cairofontoptions'],
'cairo_format_stride_for_width' => ['int', 'format'=>'int', 'width'=>'int'],
'cairo_get_antialias' => ['int', 'context'=>'cairocontext'],
'cairo_get_current_point' => ['array', 'context'=>'cairocontext'],
'cairo_get_dash' => ['array', 'context'=>'cairocontext'],
'cairo_get_dash_count' => ['int', 'context'=>'cairocontext'],
'cairo_get_fill_rule' => ['int', 'context'=>'cairocontext'],
'cairo_get_font_face' => ['', 'context'=>'cairocontext'],
'cairo_get_font_matrix' => ['', 'context'=>'cairocontext'],
'cairo_get_font_options' => ['', 'context'=>'cairocontext'],
'cairo_get_group_target' => ['', 'context'=>'cairocontext'],
'cairo_get_line_cap' => ['int', 'context'=>'cairocontext'],
'cairo_get_line_join' => ['int', 'context'=>'cairocontext'],
'cairo_get_line_width' => ['float', 'context'=>'cairocontext'],
'cairo_get_matrix' => ['', 'context'=>'cairocontext'],
'cairo_get_miter_limit' => ['float', 'context'=>'cairocontext'],
'cairo_get_operator' => ['int', 'context'=>'cairocontext'],
'cairo_get_scaled_font' => ['', 'context'=>'cairocontext'],
'cairo_get_source' => ['', 'context'=>'cairocontext'],
'cairo_get_target' => ['', 'context'=>'cairocontext'],
'cairo_get_tolerance' => ['float', 'context'=>'cairocontext'],
'cairo_glyph_path' => ['', 'glyphs'=>'array', 'context'=>'cairocontext'],
'cairo_has_current_point' => ['bool', 'context'=>'cairocontext'],
'cairo_identity_matrix' => ['', 'context'=>'cairocontext'],
'cairo_image_surface_create' => ['CairoImageSurface', 'format'=>'int', 'width'=>'int', 'height'=>'int'],
'cairo_image_surface_create_for_data' => ['CairoImageSurface', 'data'=>'string', 'format'=>'int', 'width'=>'int', 'height'=>'int', 'stride='=>'int'],
'cairo_image_surface_create_from_png' => ['CairoImageSurface', 'file'=>'string'],
'cairo_image_surface_get_data' => ['string', 'surface'=>'cairoimagesurface'],
'cairo_image_surface_get_format' => ['int', 'surface'=>'cairoimagesurface'],
'cairo_image_surface_get_height' => ['int', 'surface'=>'cairoimagesurface'],
'cairo_image_surface_get_stride' => ['int', 'surface'=>'cairoimagesurface'],
'cairo_image_surface_get_width' => ['int', 'surface'=>'cairoimagesurface'],
'cairo_in_fill' => ['bool', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_in_stroke' => ['bool', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_line_to' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_mask' => ['', 'pattern'=>'cairopattern', 'context'=>'cairocontext'],
'cairo_mask_surface' => ['', 'surface'=>'cairosurface', 'x='=>'string', 'y='=>'string', 'context='=>'cairocontext'],
'cairo_matrix_create_scale' => ['object', 'sx'=>'float', 'sy'=>'float'],
'cairo_matrix_init' => ['object', 'xx='=>'float', 'yx='=>'float', 'xy='=>'float', 'yy='=>'float', 'x0='=>'float', 'y0='=>'float'],
'cairo_matrix_init_identity' => ['object'],
'cairo_matrix_init_rotate' => ['object', 'radians'=>'float'],
'cairo_matrix_init_scale' => ['object', 'sx'=>'float', 'sy'=>'float'],
'cairo_matrix_init_translate' => ['object', 'tx'=>'float', 'ty'=>'float'],
'cairo_matrix_invert' => ['void', 'matrix'=>'cairomatrix'],
'cairo_matrix_multiply' => ['CairoMatrix', 'matrix1'=>'cairomatrix', 'matrix2'=>'cairomatrix'],
'cairo_matrix_rotate' => ['', 'matrix'=>'cairomatrix', 'radians'=>'float'],
'cairo_matrix_scale' => ['', 'sx'=>'float', 'sy'=>'float', 'context'=>'cairocontext'],
'cairo_matrix_transform_distance' => ['array', 'matrix'=>'cairomatrix', 'dx'=>'float', 'dy'=>'float'],
'cairo_matrix_transform_point' => ['array', 'matrix'=>'cairomatrix', 'dx'=>'float', 'dy'=>'float'],
'cairo_matrix_translate' => ['void', 'matrix'=>'cairomatrix', 'tx'=>'float', 'ty'=>'float'],
'cairo_move_to' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_new_path' => ['', 'context'=>'cairocontext'],
'cairo_new_sub_path' => ['', 'context'=>'cairocontext'],
'cairo_paint' => ['', 'context'=>'cairocontext'],
'cairo_paint_with_alpha' => ['', 'alpha'=>'string', 'context'=>'cairocontext'],
'cairo_path_extents' => ['array', 'context'=>'cairocontext'],
'cairo_pattern_add_color_stop_rgb' => ['void', 'pattern'=>'cairogradientpattern', 'offset'=>'float', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'cairo_pattern_add_color_stop_rgba' => ['void', 'pattern'=>'cairogradientpattern', 'offset'=>'float', 'red'=>'float', 'green'=>'float', 'blue'=>'float', 'alpha'=>'float'],
'cairo_pattern_create_for_surface' => ['CairoPattern', 'surface'=>'cairosurface'],
'cairo_pattern_create_linear' => ['CairoPattern', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float'],
'cairo_pattern_create_radial' => ['CairoPattern', 'x0'=>'float', 'y0'=>'float', 'r0'=>'float', 'x1'=>'float', 'y1'=>'float', 'r1'=>'float'],
'cairo_pattern_create_rgb' => ['CairoPattern', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'cairo_pattern_create_rgba' => ['CairoPattern', 'red'=>'float', 'green'=>'float', 'blue'=>'float', 'alpha'=>'float'],
'cairo_pattern_get_color_stop_count' => ['int', 'pattern'=>'cairogradientpattern'],
'cairo_pattern_get_color_stop_rgba' => ['array', 'pattern'=>'cairogradientpattern', 'index'=>'int'],
'cairo_pattern_get_extend' => ['int', 'pattern'=>'string'],
'cairo_pattern_get_filter' => ['int', 'pattern'=>'cairosurfacepattern'],
'cairo_pattern_get_linear_points' => ['array', 'pattern'=>'cairolineargradient'],
'cairo_pattern_get_matrix' => ['CairoMatrix', 'pattern'=>'cairopattern'],
'cairo_pattern_get_radial_circles' => ['array', 'pattern'=>'cairoradialgradient'],
'cairo_pattern_get_rgba' => ['array', 'pattern'=>'cairosolidpattern'],
'cairo_pattern_get_surface' => ['CairoSurface', 'pattern'=>'cairosurfacepattern'],
'cairo_pattern_get_type' => ['int', 'pattern'=>'cairopattern'],
'cairo_pattern_set_extend' => ['void', 'pattern'=>'string', 'extend'=>'string'],
'cairo_pattern_set_filter' => ['void', 'pattern'=>'cairosurfacepattern', 'filter'=>'int'],
'cairo_pattern_set_matrix' => ['void', 'pattern'=>'cairopattern', 'matrix'=>'cairomatrix'],
'cairo_pattern_status' => ['int', 'pattern'=>'cairopattern'],
'cairo_pdf_surface_create' => ['CairoPdfSurface', 'file'=>'string', 'width'=>'float', 'height'=>'float'],
'cairo_pdf_surface_set_size' => ['void', 'surface'=>'cairopdfsurface', 'width'=>'float', 'height'=>'float'],
'cairo_pop_group' => ['', 'context'=>'cairocontext'],
'cairo_pop_group_to_source' => ['', 'context'=>'cairocontext'],
'cairo_ps_get_levels' => ['array'],
'cairo_ps_level_to_string' => ['string', 'level'=>'int'],
'cairo_ps_surface_create' => ['CairoPsSurface', 'file'=>'string', 'width'=>'float', 'height'=>'float'],
'cairo_ps_surface_dsc_begin_page_setup' => ['void', 'surface'=>'cairopssurface'],
'cairo_ps_surface_dsc_begin_setup' => ['void', 'surface'=>'cairopssurface'],
'cairo_ps_surface_dsc_comment' => ['void', 'surface'=>'cairopssurface', 'comment'=>'string'],
'cairo_ps_surface_get_eps' => ['bool', 'surface'=>'cairopssurface'],
'cairo_ps_surface_restrict_to_level' => ['void', 'surface'=>'cairopssurface', 'level'=>'int'],
'cairo_ps_surface_set_eps' => ['void', 'surface'=>'cairopssurface', 'level'=>'bool'],
'cairo_ps_surface_set_size' => ['void', 'surface'=>'cairopssurface', 'width'=>'float', 'height'=>'float'],
'cairo_push_group' => ['', 'context'=>'cairocontext'],
'cairo_push_group_with_content' => ['', 'content'=>'string', 'context'=>'cairocontext'],
'cairo_rectangle' => ['', 'x'=>'string', 'y'=>'string', 'width'=>'string', 'height'=>'string', 'context'=>'cairocontext'],
'cairo_rel_curve_to' => ['', 'x1'=>'string', 'y1'=>'string', 'x2'=>'string', 'y2'=>'string', 'x3'=>'string', 'y3'=>'string', 'context'=>'cairocontext'],
'cairo_rel_line_to' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_rel_move_to' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_reset_clip' => ['', 'context'=>'cairocontext'],
'cairo_restore' => ['', 'context'=>'cairocontext'],
'cairo_rotate' => ['', 'sx'=>'string', 'sy'=>'string', 'context'=>'cairocontext', 'angle'=>'string'],
'cairo_save' => ['', 'context'=>'cairocontext'],
'cairo_scale' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_scaled_font_create' => ['CairoScaledFont', 'fontface'=>'cairofontface', 'matrix'=>'cairomatrix', 'ctm'=>'cairomatrix', 'fontoptions'=>'cairofontoptions'],
'cairo_scaled_font_extents' => ['array', 'scaledfont'=>'cairoscaledfont'],
'cairo_scaled_font_get_ctm' => ['CairoMatrix', 'scaledfont'=>'cairoscaledfont'],
'cairo_scaled_font_get_font_face' => ['CairoFontFace', 'scaledfont'=>'cairoscaledfont'],
'cairo_scaled_font_get_font_matrix' => ['CairoFontOptions', 'scaledfont'=>'cairoscaledfont'],
'cairo_scaled_font_get_font_options' => ['CairoFontOptions', 'scaledfont'=>'cairoscaledfont'],
'cairo_scaled_font_get_scale_matrix' => ['CairoMatrix', 'scaledfont'=>'cairoscaledfont'],
'cairo_scaled_font_get_type' => ['int', 'scaledfont'=>'cairoscaledfont'],
'cairo_scaled_font_glyph_extents' => ['array', 'scaledfont'=>'cairoscaledfont', 'glyphs'=>'array'],
'cairo_scaled_font_status' => ['int', 'scaledfont'=>'cairoscaledfont'],
'cairo_scaled_font_text_extents' => ['array', 'scaledfont'=>'cairoscaledfont', 'text'=>'string'],
'cairo_select_font_face' => ['', 'family'=>'string', 'slant='=>'string', 'weight='=>'string', 'context='=>'cairocontext'],
'cairo_set_antialias' => ['', 'antialias='=>'string', 'context='=>'cairocontext'],
'cairo_set_dash' => ['', 'dashes'=>'array', 'offset='=>'string', 'context='=>'cairocontext'],
'cairo_set_fill_rule' => ['', 'setting'=>'string', 'context'=>'cairocontext'],
'cairo_set_font_face' => ['', 'fontface'=>'cairofontface', 'context'=>'cairocontext'],
'cairo_set_font_matrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'],
'cairo_set_font_options' => ['', 'fontoptions'=>'cairofontoptions', 'context'=>'cairocontext'],
'cairo_set_font_size' => ['', 'size'=>'string', 'context'=>'cairocontext'],
'cairo_set_line_cap' => ['', 'setting'=>'string', 'context'=>'cairocontext'],
'cairo_set_line_join' => ['', 'setting'=>'string', 'context'=>'cairocontext'],
'cairo_set_line_width' => ['', 'width'=>'string', 'context'=>'cairocontext'],
'cairo_set_matrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'],
'cairo_set_miter_limit' => ['', 'limit'=>'string', 'context'=>'cairocontext'],
'cairo_set_operator' => ['', 'setting'=>'string', 'context'=>'cairocontext'],
'cairo_set_scaled_font' => ['', 'scaledfont'=>'cairoscaledfont', 'context'=>'cairocontext'],
'cairo_set_source' => ['', 'red'=>'string', 'green'=>'string', 'blue'=>'string', 'alpha'=>'string', 'context'=>'cairocontext', 'pattern'=>'cairopattern'],
'cairo_set_source_surface' => ['', 'surface'=>'cairosurface', 'x='=>'string', 'y='=>'string', 'context='=>'cairocontext'],
'cairo_set_tolerance' => ['', 'tolerance'=>'string', 'context'=>'cairocontext'],
'cairo_show_page' => ['', 'context'=>'cairocontext'],
'cairo_show_text' => ['', 'text'=>'string', 'context'=>'cairocontext'],
'cairo_status' => ['int', 'context'=>'cairocontext'],
'cairo_status_to_string' => ['string', 'status'=>'int'],
'cairo_stroke' => ['', 'context'=>'cairocontext'],
'cairo_stroke_extents' => ['array', 'context'=>'cairocontext'],
'cairo_stroke_preserve' => ['', 'context'=>'cairocontext'],
'cairo_surface_copy_page' => ['void', 'surface'=>'cairosurface'],
'cairo_surface_create_similar' => ['CairoSurface', 'surface'=>'cairosurface', 'content'=>'int', 'width'=>'float', 'height'=>'float'],
'cairo_surface_finish' => ['void', 'surface'=>'cairosurface'],
'cairo_surface_flush' => ['void', 'surface'=>'cairosurface'],
'cairo_surface_get_content' => ['int', 'surface'=>'cairosurface'],
'cairo_surface_get_device_offset' => ['array', 'surface'=>'cairosurface'],
'cairo_surface_get_font_options' => ['CairoFontOptions', 'surface'=>'cairosurface'],
'cairo_surface_get_type' => ['int', 'surface'=>'cairosurface'],
'cairo_surface_mark_dirty' => ['void', 'surface'=>'cairosurface'],
'cairo_surface_mark_dirty_rectangle' => ['void', 'surface'=>'cairosurface', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'],
'cairo_surface_set_device_offset' => ['void', 'surface'=>'cairosurface', 'x'=>'float', 'y'=>'float'],
'cairo_surface_set_fallback_resolution' => ['void', 'surface'=>'cairosurface', 'x'=>'float', 'y'=>'float'],
'cairo_surface_show_page' => ['void', 'surface'=>'cairosurface'],
'cairo_surface_status' => ['int', 'surface'=>'cairosurface'],
'cairo_surface_write_to_png' => ['void', 'surface'=>'cairosurface', 'stream'=>'resource'],
'cairo_svg_get_versions' => ['array'],
'cairo_svg_surface_create' => ['CairoSvgSurface', 'file'=>'string', 'width'=>'float', 'height'=>'float'],
'cairo_svg_surface_get_versions' => ['array'],
'cairo_svg_surface_restrict_to_version' => ['void', 'surface'=>'cairosvgsurface', 'version'=>'int'],
'cairo_svg_version_to_string' => ['string', 'version'=>'int'],
'cairo_text_extents' => ['array', 'text'=>'string', 'context'=>'cairocontext'],
'cairo_text_path' => ['', 'string'=>'string', 'context'=>'cairocontext', 'text'=>'string'],
'cairo_transform' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'],
'cairo_translate' => ['', 'tx'=>'string', 'ty'=>'string', 'context'=>'cairocontext', 'x'=>'string', 'y'=>'string'],
'cairo_user_to_device' => ['array', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_user_to_device_distance' => ['array', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'cairo_version' => ['int'],
'cairo_version_string' => ['string'],
'CairoContext::__construct' => ['void', 'surface'=>'CairoSurface'],
'CairoContext::appendPath' => ['', 'path'=>'cairopath', 'context'=>'cairocontext'],
'CairoContext::arc' => ['', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'angle1'=>'float', 'angle2'=>'float', 'context'=>'cairocontext'],
'CairoContext::arcNegative' => ['', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'angle1'=>'float', 'angle2'=>'float', 'context'=>'cairocontext'],
'CairoContext::clip' => ['', 'context'=>'cairocontext'],
'CairoContext::clipExtents' => ['array', 'context'=>'cairocontext'],
'CairoContext::clipPreserve' => ['', 'context'=>'cairocontext'],
'CairoContext::clipRectangleList' => ['array', 'context'=>'cairocontext'],
'CairoContext::closePath' => ['', 'context'=>'cairocontext'],
'CairoContext::copyPage' => ['', 'context'=>'cairocontext'],
'CairoContext::copyPath' => ['CairoPath', 'context'=>'cairocontext'],
'CairoContext::copyPathFlat' => ['CairoPath', 'context'=>'cairocontext'],
'CairoContext::curveTo' => ['', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float', 'context'=>'cairocontext'],
'CairoContext::deviceToUser' => ['array', 'x'=>'float', 'y'=>'float', 'context'=>'cairocontext'],
'CairoContext::deviceToUserDistance' => ['array', 'x'=>'float', 'y'=>'float', 'context'=>'cairocontext'],
'CairoContext::fill' => ['', 'context'=>'cairocontext'],
'CairoContext::fillExtents' => ['array', 'context'=>'cairocontext'],
'CairoContext::fillPreserve' => ['', 'context'=>'cairocontext'],
'CairoContext::fontExtents' => ['array', 'context'=>'cairocontext'],
'CairoContext::getAntialias' => ['int', 'context'=>'cairocontext'],
'CairoContext::getCurrentPoint' => ['array', 'context'=>'cairocontext'],
'CairoContext::getDash' => ['array', 'context'=>'cairocontext'],
'CairoContext::getDashCount' => ['int', 'context'=>'cairocontext'],
'CairoContext::getFillRule' => ['int', 'context'=>'cairocontext'],
'CairoContext::getFontFace' => ['', 'context'=>'cairocontext'],
'CairoContext::getFontMatrix' => ['', 'context'=>'cairocontext'],
'CairoContext::getFontOptions' => ['', 'context'=>'cairocontext'],
'CairoContext::getGroupTarget' => ['', 'context'=>'cairocontext'],
'CairoContext::getLineCap' => ['int', 'context'=>'cairocontext'],
'CairoContext::getLineJoin' => ['int', 'context'=>'cairocontext'],
'CairoContext::getLineWidth' => ['float', 'context'=>'cairocontext'],
'CairoContext::getMatrix' => ['', 'context'=>'cairocontext'],
'CairoContext::getMiterLimit' => ['float', 'context'=>'cairocontext'],
'CairoContext::getOperator' => ['int', 'context'=>'cairocontext'],
'CairoContext::getScaledFont' => ['', 'context'=>'cairocontext'],
'CairoContext::getSource' => ['', 'context'=>'cairocontext'],
'CairoContext::getTarget' => ['', 'context'=>'cairocontext'],
'CairoContext::getTolerance' => ['float', 'context'=>'cairocontext'],
'CairoContext::glyphPath' => ['', 'glyphs'=>'array', 'context'=>'cairocontext'],
'CairoContext::hasCurrentPoint' => ['bool', 'context'=>'cairocontext'],
'CairoContext::identityMatrix' => ['', 'context'=>'cairocontext'],
'CairoContext::inFill' => ['bool', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::inStroke' => ['bool', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::lineTo' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::mask' => ['', 'pattern'=>'cairopattern', 'context'=>'cairocontext'],
'CairoContext::maskSurface' => ['', 'surface'=>'cairosurface', 'x='=>'string', 'y='=>'string', 'context='=>'cairocontext'],
'CairoContext::moveTo' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::newPath' => ['', 'context'=>'cairocontext'],
'CairoContext::newSubPath' => ['', 'context'=>'cairocontext'],
'CairoContext::paint' => ['', 'context'=>'cairocontext'],
'CairoContext::paintWithAlpha' => ['', 'alpha'=>'string', 'context'=>'cairocontext'],
'CairoContext::pathExtents' => ['array', 'context'=>'cairocontext'],
'CairoContext::popGroup' => ['', 'context'=>'cairocontext'],
'CairoContext::popGroupToSource' => ['', 'context'=>'cairocontext'],
'CairoContext::pushGroup' => ['', 'context'=>'cairocontext'],
'CairoContext::pushGroupWithContent' => ['', 'content'=>'string', 'context'=>'cairocontext'],
'CairoContext::rectangle' => ['', 'x'=>'string', 'y'=>'string', 'width'=>'string', 'height'=>'string', 'context'=>'cairocontext'],
'CairoContext::relCurveTo' => ['', 'x1'=>'string', 'y1'=>'string', 'x2'=>'string', 'y2'=>'string', 'x3'=>'string', 'y3'=>'string', 'context'=>'cairocontext'],
'CairoContext::relLineTo' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::relMoveTo' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::resetClip' => ['', 'context'=>'cairocontext'],
'CairoContext::restore' => ['', 'context'=>'cairocontext'],
'CairoContext::rotate' => ['', 'angle'=>'string', 'context'=>'cairocontext'],
'CairoContext::save' => ['', 'context'=>'cairocontext'],
'CairoContext::scale' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::selectFontFace' => ['', 'family'=>'string', 'slant='=>'string', 'weight='=>'string', 'context='=>'cairocontext'],
'CairoContext::setAntialias' => ['', 'antialias='=>'string', 'context='=>'cairocontext'],
'CairoContext::setDash' => ['', 'dashes'=>'array', 'offset='=>'string', 'context='=>'cairocontext'],
'CairoContext::setFillRule' => ['', 'setting'=>'string', 'context'=>'cairocontext'],
'CairoContext::setFontFace' => ['', 'fontface'=>'cairofontface', 'context'=>'cairocontext'],
'CairoContext::setFontMatrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'],
'CairoContext::setFontOptions' => ['', 'fontoptions'=>'cairofontoptions', 'context'=>'cairocontext'],
'CairoContext::setFontSize' => ['', 'size'=>'string', 'context'=>'cairocontext'],
'CairoContext::setLineCap' => ['', 'setting'=>'string', 'context'=>'cairocontext'],
'CairoContext::setLineJoin' => ['', 'setting'=>'string', 'context'=>'cairocontext'],
'CairoContext::setLineWidth' => ['', 'width'=>'string', 'context'=>'cairocontext'],
'CairoContext::setMatrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'],
'CairoContext::setMiterLimit' => ['', 'limit'=>'string', 'context'=>'cairocontext'],
'CairoContext::setOperator' => ['', 'setting'=>'string', 'context'=>'cairocontext'],
'CairoContext::setScaledFont' => ['', 'scaledfont'=>'cairoscaledfont', 'context'=>'cairocontext'],
'CairoContext::setSource' => ['', 'pattern'=>'cairopattern', 'context'=>'cairocontext'],
'CairoContext::setSourceRGB' => ['', 'red'=>'string', 'green'=>'string', 'blue'=>'string', 'context'=>'cairocontext', 'pattern'=>'cairopattern'],
'CairoContext::setSourceRGBA' => ['', 'red'=>'string', 'green'=>'string', 'blue'=>'string', 'alpha'=>'string', 'context'=>'cairocontext', 'pattern'=>'cairopattern'],
'CairoContext::setSourceSurface' => ['', 'surface'=>'cairosurface', 'x='=>'string', 'y='=>'string', 'context='=>'cairocontext'],
'CairoContext::setTolerance' => ['', 'tolerance'=>'string', 'context'=>'cairocontext'],
'CairoContext::showPage' => ['', 'context'=>'cairocontext'],
'CairoContext::showText' => ['', 'text'=>'string', 'context'=>'cairocontext'],
'CairoContext::status' => ['int', 'context'=>'cairocontext'],
'CairoContext::stroke' => ['', 'context'=>'cairocontext'],
'CairoContext::strokeExtents' => ['array', 'context'=>'cairocontext'],
'CairoContext::strokePreserve' => ['', 'context'=>'cairocontext'],
'CairoContext::textExtents' => ['array', 'text'=>'string', 'context'=>'cairocontext'],
'CairoContext::textPath' => ['', 'string'=>'string', 'context'=>'cairocontext', 'text'=>'string'],
'CairoContext::transform' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'],
'CairoContext::translate' => ['', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::userToDevice' => ['array', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoContext::userToDeviceDistance' => ['array', 'x'=>'string', 'y'=>'string', 'context'=>'cairocontext'],
'CairoFontFace::__construct' => ['void'],
'CairoFontFace::getType' => ['int'],
'CairoFontFace::status' => ['int', 'fontface'=>'cairofontface'],
'CairoFontOptions::__construct' => ['void'],
'CairoFontOptions::equal' => ['bool', 'other'=>'string'],
'CairoFontOptions::getAntialias' => ['int', 'context'=>'cairocontext'],
'CairoFontOptions::getHintMetrics' => ['int'],
'CairoFontOptions::getHintStyle' => ['int'],
'CairoFontOptions::getSubpixelOrder' => ['int'],
'CairoFontOptions::hash' => ['int'],
'CairoFontOptions::merge' => ['void', 'other'=>'string'],
'CairoFontOptions::setAntialias' => ['', 'antialias='=>'string', 'context='=>'cairocontext'],
'CairoFontOptions::setHintMetrics' => ['void', 'hint_metrics'=>'string'],
'CairoFontOptions::setHintStyle' => ['void', 'hint_style'=>'string'],
'CairoFontOptions::setSubpixelOrder' => ['void', 'subpixel_order'=>'string'],
'CairoFontOptions::status' => ['int', 'context'=>'cairocontext'],
'CairoFormat::strideForWidth' => ['int', 'format'=>'int', 'width'=>'int'],
'CairoGradientPattern::addColorStopRgb' => ['void', 'offset'=>'string', 'red'=>'string', 'green'=>'string', 'blue'=>'string'],
'CairoGradientPattern::addColorStopRgba' => ['void', 'offset'=>'string', 'red'=>'string', 'green'=>'string', 'blue'=>'string', 'alpha'=>'string'],
'CairoGradientPattern::getColorStopCount' => ['int'],
'CairoGradientPattern::getColorStopRgba' => ['array', 'index'=>'string'],
'CairoGradientPattern::getExtend' => ['int'],
'CairoGradientPattern::setExtend' => ['void', 'extend'=>'int'],
'CairoImageSurface::__construct' => ['void', 'format'=>'int', 'width'=>'int', 'height'=>'int'],
'CairoImageSurface::createForData' => ['void', 'data'=>'string', 'format'=>'int', 'width'=>'int', 'height'=>'int', 'stride='=>'int'],
'CairoImageSurface::createFromPng' => ['CairoImageSurface', 'file'=>'string'],
'CairoImageSurface::getData' => ['string'],
'CairoImageSurface::getFormat' => ['int'],
'CairoImageSurface::getHeight' => ['int'],
'CairoImageSurface::getStride' => ['int'],
'CairoImageSurface::getWidth' => ['int'],
'CairoLinearGradient::__construct' => ['void', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float'],
'CairoLinearGradient::getPoints' => ['array'],
'CairoMatrix::__construct' => ['void', 'xx='=>'float', 'yx='=>'float', 'xy='=>'float', 'yy='=>'float', 'x0='=>'float', 'y0='=>'float'],
'CairoMatrix::initIdentity' => ['object'],
'CairoMatrix::initRotate' => ['object', 'radians'=>'float'],
'CairoMatrix::initScale' => ['object', 'sx'=>'float', 'sy'=>'float'],
'CairoMatrix::initTranslate' => ['object', 'tx'=>'float', 'ty'=>'float'],
'CairoMatrix::invert' => ['void'],
'CairoMatrix::multiply' => ['CairoMatrix', 'matrix1'=>'cairomatrix', 'matrix2'=>'cairomatrix'],
'CairoMatrix::rotate' => ['', 'sx'=>'string', 'sy'=>'string', 'context'=>'cairocontext', 'angle'=>'string'],
'CairoMatrix::scale' => ['', 'sx'=>'float', 'sy'=>'float', 'context'=>'cairocontext'],
'CairoMatrix::transformDistance' => ['array', 'dx'=>'string', 'dy'=>'string'],
'CairoMatrix::transformPoint' => ['array', 'dx'=>'string', 'dy'=>'string'],
'CairoMatrix::translate' => ['', 'tx'=>'string', 'ty'=>'string', 'context'=>'cairocontext', 'x'=>'string', 'y'=>'string'],
'CairoPattern::__construct' => ['void'],
'CairoPattern::getMatrix' => ['', 'context'=>'cairocontext'],
'CairoPattern::getType' => ['int'],
'CairoPattern::setMatrix' => ['', 'matrix'=>'cairomatrix', 'context'=>'cairocontext'],
'CairoPattern::status' => ['int', 'context'=>'cairocontext'],
'CairoPdfSurface::__construct' => ['void', 'file'=>'string', 'width'=>'float', 'height'=>'float'],
'CairoPdfSurface::setSize' => ['void', 'width'=>'string', 'height'=>'string'],
'CairoPsSurface::__construct' => ['void', 'file'=>'string', 'width'=>'float', 'height'=>'float'],
'CairoPsSurface::dscBeginPageSetup' => ['void'],
'CairoPsSurface::dscBeginSetup' => ['void'],
'CairoPsSurface::dscComment' => ['void', 'comment'=>'string'],
'CairoPsSurface::getEps' => ['bool'],
'CairoPsSurface::getLevels' => ['array'],
'CairoPsSurface::levelToString' => ['string', 'level'=>'int'],
'CairoPsSurface::restrictToLevel' => ['void', 'level'=>'string'],
'CairoPsSurface::setEps' => ['void', 'level'=>'string'],
'CairoPsSurface::setSize' => ['void', 'width'=>'string', 'height'=>'string'],
'CairoRadialGradient::__construct' => ['void', 'x0'=>'float', 'y0'=>'float', 'r0'=>'float', 'x1'=>'float', 'y1'=>'float', 'r1'=>'float'],
'CairoRadialGradient::getCircles' => ['array'],
'CairoScaledFont::__construct' => ['void', 'font_face'=>'CairoFontFace', 'matrix'=>'CairoMatrix', 'ctm'=>'CairoMatrix', 'options'=>'CairoFontOptions'],
'CairoScaledFont::extents' => ['array'],
'CairoScaledFont::getCtm' => ['CairoMatrix'],
'CairoScaledFont::getFontFace' => ['', 'context'=>'cairocontext'],
'CairoScaledFont::getFontMatrix' => ['', 'context'=>'cairocontext'],
'CairoScaledFont::getFontOptions' => ['', 'context'=>'cairocontext'],
'CairoScaledFont::getScaleMatrix' => ['void'],
'CairoScaledFont::getType' => ['int'],
'CairoScaledFont::glyphExtents' => ['array', 'glyphs'=>'string'],
'CairoScaledFont::status' => ['int', 'context'=>'cairocontext'],
'CairoScaledFont::textExtents' => ['array', 'text'=>'string', 'context'=>'cairocontext'],
'CairoSolidPattern::__construct' => ['void', 'red'=>'float', 'green'=>'float', 'blue'=>'float', 'alpha='=>'float'],
'CairoSolidPattern::getRgba' => ['array'],
'CairoSurface::__construct' => ['void'],
'CairoSurface::copyPage' => ['', 'context'=>'cairocontext'],
'CairoSurface::createSimilar' => ['void', 'other'=>'cairosurface', 'content'=>'int', 'width'=>'string', 'height'=>'string'],
'CairoSurface::finish' => ['void'],
'CairoSurface::flush' => ['void'],
'CairoSurface::getContent' => ['int'],
'CairoSurface::getDeviceOffset' => ['array'],
'CairoSurface::getFontOptions' => ['', 'context'=>'cairocontext'],
'CairoSurface::getType' => ['int'],
'CairoSurface::markDirty' => ['void'],
'CairoSurface::markDirtyRectangle' => ['void', 'x'=>'string', 'y'=>'string', 'width'=>'string', 'height'=>'string'],
'CairoSurface::setDeviceOffset' => ['void', 'x'=>'string', 'y'=>'string'],
'CairoSurface::setFallbackResolution' => ['void', 'x'=>'string', 'y'=>'string'],
'CairoSurface::showPage' => ['', 'context'=>'cairocontext'],
'CairoSurface::status' => ['int', 'context'=>'cairocontext'],
'CairoSurface::writeToPng' => ['void', 'file'=>'string'],
'CairoSurfacePattern::__construct' => ['void', 'surface'=>'CairoSurface'],
'CairoSurfacePattern::getExtend' => ['int'],
'CairoSurfacePattern::getFilter' => ['int'],
'CairoSurfacePattern::getSurface' => ['void'],
'CairoSurfacePattern::setExtend' => ['void', 'extend'=>'int'],
'CairoSurfacePattern::setFilter' => ['void', 'filter'=>'string'],
'CairoSvgSurface::__construct' => ['void', 'file'=>'string', 'width'=>'float', 'height'=>'float'],
'CairoSvgSurface::getVersions' => ['array'],
'CairoSvgSurface::restrictToVersion' => ['void', 'version'=>'string'],
'CairoSvgSurface::versionToString' => ['string', 'version'=>'int'],
'cal_days_in_month' => ['int', 'calendar'=>'int', 'month'=>'int', 'year'=>'int'],
'cal_from_jd' => ['false|array{date:string,month:int,day:int,year:int,dow:int,abbrevdayname:string,dayname:string,abbrevmonth:string,monthname:string}', 'julian_day'=>'int', 'calendar'=>'int'],
'cal_info' => ['array', 'calendar='=>'int'],
'cal_to_jd' => ['int', 'calendar'=>'int', 'month'=>'int', 'day'=>'int', 'year'=>'int'],
'calcul_hmac' => ['string', 'clent'=>'string', 'siretcode'=>'string', 'price'=>'string', 'reference'=>'string', 'validity'=>'string', 'taxation'=>'string', 'devise'=>'string', 'language'=>'string'],
'calculhmac' => ['string', 'clent'=>'string', 'data'=>'string'],
'call_user_func' => ['mixed|false', 'callback'=>'callable', '...args='=>'mixed'],
'call_user_func_array' => ['mixed|false', 'callback'=>'callable', 'args'=>'list<mixed>'],
'call_user_method' => ['mixed', 'method_name'=>'string', 'object'=>'object', 'parameter='=>'mixed', '...args='=>'mixed'],
'call_user_method_array' => ['mixed', 'method_name'=>'string', 'object'=>'object', 'params'=>'list<mixed>'],
'CallbackFilterIterator::__construct' => ['void', 'iterator'=>'Iterator', 'func'=>'callable(mixed):bool|callable(mixed,mixed):bool|callable(mixed,mixed,mixed):bool'],
'CallbackFilterIterator::accept' => ['bool'],
'CallbackFilterIterator::current' => ['mixed'],
'CallbackFilterIterator::getInnerIterator' => ['Iterator'],
'CallbackFilterIterator::key' => ['mixed'],
'CallbackFilterIterator::next' => ['void'],
'CallbackFilterIterator::rewind' => ['void'],
'CallbackFilterIterator::valid' => ['bool'],
'ceil' => ['float', 'num'=>'float'],
'chdb::__construct' => ['void', 'pathname'=>'string'],
'chdb::get' => ['string', 'key'=>'string'],
'chdb_create' => ['bool', 'pathname'=>'string', 'data'=>'array'],
'chdir' => ['bool', 'directory'=>'string'],
'checkdate' => ['bool', 'month'=>'int', 'day'=>'int', 'year'=>'int'],
'checkdnsrr' => ['bool', 'hostname'=>'string', 'type='=>'string'],
'chgrp' => ['bool', 'filename'=>'string', 'group'=>'string|int'],
'chmod' => ['bool', 'filename'=>'string', 'permissions'=>'int'],
'chop' => ['string', 'string'=>'string', 'characters='=>'string'],
'chown' => ['bool', 'filename'=>'string', 'user'=>'string|int'],
'chr' => ['string', 'codepoint'=>'int'],
'chroot' => ['bool', 'directory'=>'string'],
'chunk_split' => ['string', 'string'=>'string', 'length='=>'int', 'separator='=>'string'],
'class_alias' => ['bool', 'class'=>'string', 'alias'=>'string', 'autoload='=>'bool'],
'class_exists' => ['bool', 'class'=>'string', 'autoload='=>'bool'],
'class_implements' => ['array<string,string>|false', 'object_or_class'=>'object|string', 'autoload='=>'bool'],
'class_parents' => ['array<string, class-string>|false', 'object_or_class'=>'object|string', 'autoload='=>'bool'],
'class_uses' => ['array<string,string>|false', 'object_or_class'=>'object|string', 'autoload='=>'bool'],
'classkit_import' => ['array', 'filename'=>'string'],
'classkit_method_add' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'args'=>'string', 'code'=>'string', 'flags='=>'int'],
'classkit_method_copy' => ['bool', 'dclass'=>'string', 'dmethod'=>'string', 'sclass'=>'string', 'smethod='=>'string'],
'classkit_method_redefine' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'args'=>'string', 'code'=>'string', 'flags='=>'int'],
'classkit_method_remove' => ['bool', 'classname'=>'string', 'methodname'=>'string'],
'classkit_method_rename' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'newname'=>'string'],
'classObj::__construct' => ['void', 'layer'=>'layerObj', 'class'=>'classObj'],
'classObj::addLabel' => ['int', 'label'=>'labelObj'],
'classObj::convertToString' => ['string'],
'classObj::createLegendIcon' => ['imageObj', 'width'=>'int', 'height'=>'int'],
'classObj::deletestyle' => ['int', 'index'=>'int'],
'classObj::drawLegendIcon' => ['int', 'width'=>'int', 'height'=>'int', 'im'=>'imageObj', 'dstX'=>'int', 'dstY'=>'int'],
'classObj::free' => ['void'],
'classObj::getExpressionString' => ['string'],
'classObj::getLabel' => ['labelObj', 'index'=>'int'],
'classObj::getMetaData' => ['int', 'name'=>'string'],
'classObj::getStyle' => ['styleObj', 'index'=>'int'],
'classObj::getTextString' => ['string'],
'classObj::movestyledown' => ['int', 'index'=>'int'],
'classObj::movestyleup' => ['int', 'index'=>'int'],
'classObj::ms_newClassObj' => ['classObj', 'layer'=>'layerObj', 'class'=>'classObj'],
'classObj::removeLabel' => ['labelObj', 'index'=>'int'],
'classObj::removeMetaData' => ['int', 'name'=>'string'],
'classObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'classObj::setExpression' => ['int', 'expression'=>'string'],
'classObj::setMetaData' => ['int', 'name'=>'string', 'value'=>'string'],
'classObj::settext' => ['int', 'text'=>'string'],
'classObj::updateFromString' => ['int', 'snippet'=>'string'],
'clearstatcache' => ['void', 'clear_realpath_cache='=>'bool', 'filename='=>'string'],
'cli_get_process_title' => ['string'],
'cli_set_process_title' => ['bool', 'title'=>'string'],
'ClosedGeneratorException::__clone' => ['void'],
'ClosedGeneratorException::__toString' => ['string'],
'ClosedGeneratorException::getCode' => ['int'],
'ClosedGeneratorException::getFile' => ['string'],
'ClosedGeneratorException::getLine' => ['int'],
'ClosedGeneratorException::getMessage' => ['string'],
'ClosedGeneratorException::getPrevious' => ['Throwable|ClosedGeneratorException|null'],
'ClosedGeneratorException::getTrace' => ['list<array<string,mixed>>'],
'ClosedGeneratorException::getTraceAsString' => ['string'],
'closedir' => ['void', 'dir_handle='=>'resource'],
'closelog' => ['bool'],
'Closure::__construct' => ['void'],
'Closure::__invoke' => ['', '...args='=>''],
'Closure::bind' => ['Closure|false', 'old'=>'Closure', 'to'=>'?object', 'scope='=>'object|string'],
'Closure::bindTo' => ['Closure|false', 'new'=>'?object', 'newscope='=>'object|string'],
'Closure::call' => ['', 'to'=>'object', '...parameters='=>''],
'Closure::fromCallable' => ['Closure', 'callable'=>'callable'],
'clusterObj::convertToString' => ['string'],
'clusterObj::getFilterString' => ['string'],
'clusterObj::getGroupString' => ['string'],
'clusterObj::setFilter' => ['int', 'expression'=>'string'],
'clusterObj::setGroup' => ['int', 'expression'=>'string'],
'Collator::__construct' => ['void', 'locale'=>'string'],
'Collator::asort' => ['bool', '&rw_arr'=>'array', 'sort_flag='=>'int'],
'Collator::compare' => ['int|false', 'string1'=>'string', 'string2'=>'string'],
'Collator::create' => ['?Collator', 'locale'=>'string'],
'Collator::getAttribute' => ['int|false', 'attr'=>'int'],
'Collator::getErrorCode' => ['int'],
'Collator::getErrorMessage' => ['string'],
'Collator::getLocale' => ['string', 'type'=>'int'],
'Collator::getSortKey' => ['string|false', 'string'=>'string'],
'Collator::getStrength' => ['int|false'],
'Collator::setAttribute' => ['bool', 'attr'=>'int', 'value'=>'int'],
'Collator::setStrength' => ['bool', 'strength'=>'int'],
'Collator::sort' => ['bool', '&rw_arr'=>'array', 'sort_flags='=>'int'],
'Collator::sortWithSortKeys' => ['bool', '&rw_arr'=>'array'],
'collator_asort' => ['bool', 'object'=>'collator', '&rw_array'=>'array', 'flags='=>'int'],
'collator_compare' => ['int', 'object'=>'collator', 'string1'=>'string', 'string2'=>'string'],
'collator_create' => ['Collator', 'locale'=>'string'],
'collator_get_attribute' => ['int|false', 'object'=>'collator', 'attribute'=>'int'],
'collator_get_error_code' => ['int', 'object'=>'collator'],
'collator_get_error_message' => ['string', 'object'=>'collator'],
'collator_get_locale' => ['string', 'object'=>'collator', 'type'=>'int'],
'collator_get_sort_key' => ['string', 'object'=>'collator', 'string'=>'string'],
'collator_get_strength' => ['int|false', 'object'=>'collator'],
'collator_set_attribute' => ['bool', 'object'=>'collator', 'attribute'=>'int', 'value'=>'int'],
'collator_set_strength' => ['bool', 'object'=>'collator', 'strength'=>'int'],
'collator_sort' => ['bool', 'object'=>'collator', '&rw_array'=>'array', 'flags='=>'int'],
'collator_sort_with_sort_keys' => ['bool', 'object'=>'collator', '&rw_array'=>'array'],
'Collectable::isGarbage' => ['bool'],
'Collectable::setGarbage' => ['void'],
'colorObj::setHex' => ['int', 'hex'=>'string'],
'colorObj::toHex' => ['string'],
'COM::__call' => ['', 'name'=>'', 'args'=>''],
'COM::__construct' => ['void', 'module_name'=>'string', 'server_name='=>'mixed', 'codepage='=>'int', 'typelib='=>'string'],
'COM::__get' => ['', 'name'=>''],
'COM::__set' => ['void', 'name'=>'', 'value'=>''],
'com_addref' => [''],
'com_create_guid' => ['string'],
'com_event_sink' => ['bool', 'variant'=>'VARIANT', 'sink_object'=>'object', 'sink_interface='=>'mixed'],
'com_get_active_object' => ['VARIANT', 'prog_id'=>'string', 'codepage='=>'int'],
'com_isenum' => ['bool', 'com_module'=>'variant'],
'com_load_typelib' => ['bool', 'typelib_name'=>'string', 'case_insensitive='=>'true'],
'com_message_pump' => ['bool', 'timeout_milliseconds='=>'int'],
'com_print_typeinfo' => ['bool', 'variant'=>'object', 'dispatch_interface='=>'string', 'display_sink='=>'bool'],
'commonmark\cql::__invoke' => ['', 'root'=>'CommonMark\Node', 'handler'=>'callable'],
'commonmark\interfaces\ivisitable::accept' => ['void', 'visitor'=>'CommonMark\Interfaces\IVisitor'],
'commonmark\interfaces\ivisitor::enter' => ['?int|IVisitable', 'visitable'=>'IVisitable'],
'commonmark\interfaces\ivisitor::leave' => ['?int|IVisitable', 'visitable'=>'IVisitable'],
'commonmark\node::accept' => ['void', 'visitor'=>'CommonMark\Interfaces\IVisitor'],
'commonmark\node::appendChild' => ['CommonMark\Node', 'child'=>'CommonMark\Node'],
'commonmark\node::insertAfter' => ['CommonMark\Node', 'sibling'=>'CommonMark\Node'],
'commonmark\node::insertBefore' => ['CommonMark\Node', 'sibling'=>'CommonMark\Node'],
'commonmark\node::prependChild' => ['CommonMark\Node', 'child'=>'CommonMark\Node'],
'commonmark\node::replace' => ['CommonMark\Node', 'target'=>'CommonMark\Node'],
'commonmark\node::unlink' => ['void'],
'commonmark\parse' => ['CommonMark\Node', 'content'=>'string', 'options='=>'int'],
'commonmark\parser::finish' => ['CommonMark\Node'],
'commonmark\parser::parse' => ['void', 'buffer'=>'string'],
'commonmark\render' => ['string', 'node'=>'CommonMark\Node', 'options='=>'int', 'width='=>'int'],
'commonmark\render\html' => ['string', 'node'=>'CommonMark\Node', 'options='=>'int'],
'commonmark\render\latex' => ['string', 'node'=>'CommonMark\Node', 'options='=>'int', 'width='=>'int'],
'commonmark\render\man' => ['string', 'node'=>'CommonMark\Node', 'options='=>'int', 'width='=>'int'],
'commonmark\render\xml' => ['string', 'node'=>'CommonMark\Node', 'options='=>'int'],
'compact' => ['array<string, mixed>', 'var_name'=>'string|array', '...var_names='=>'string|array'],
'COMPersistHelper::__construct' => ['void', 'variant'=>'object'],
'COMPersistHelper::GetCurFile' => ['string'],
'COMPersistHelper::GetCurFileName' => ['string'],
'COMPersistHelper::GetMaxStreamSize' => ['int'],
'COMPersistHelper::InitNew' => ['int'],
'COMPersistHelper::LoadFromFile' => ['bool', 'filename'=>'string', 'flags'=>'int'],
'COMPersistHelper::LoadFromStream' => ['', 'stream'=>''],
'COMPersistHelper::SaveToFile' => ['bool', 'filename'=>'string', 'remember'=>'bool'],
'COMPersistHelper::SaveToStream' => ['int', 'stream'=>''],
'componere\abstract\definition::addInterface' => ['Componere\Abstract\Definition', 'interface'=>'string'],
'componere\abstract\definition::addMethod' => ['Componere\Abstract\Definition', 'name'=>'string', 'method'=>'Componere\Method'],
'componere\abstract\definition::addTrait' => ['Componere\Abstract\Definition', 'trait'=>'string'],
'componere\abstract\definition::getReflector' => ['ReflectionClass'],
'componere\cast' => ['object', 'arg1'=>'string', 'object'=>'object'],
'componere\cast_by_ref' => ['object', 'arg1'=>'string', 'object'=>'object'],
'componere\definition::addConstant' => ['Componere\Definition', 'name'=>'string', 'value'=>'Componere\Value'],
'componere\definition::addProperty' => ['Componere\Definition', 'name'=>'string', 'value'=>'Componere\Value'],
'componere\definition::getClosure' => ['Closure', 'name'=>'string'],
'componere\definition::getClosures' => ['Closure[]'],
'componere\definition::isRegistered' => ['bool'],
'componere\definition::register' => ['void'],
'componere\method::getReflector' => ['ReflectionMethod'],
'componere\method::setPrivate' => ['Method'],
'componere\method::setProtected' => ['Method'],
'componere\method::setStatic' => ['Method'],
'componere\patch::apply' => ['void'],
'componere\patch::derive' => ['Componere\Patch', 'instance'=>'object'],
'componere\patch::getClosure' => ['Closure', 'name'=>'string'],
'componere\patch::getClosures' => ['Closure[]'],
'componere\patch::isApplied' => ['bool'],
'componere\patch::revert' => ['void'],
'componere\value::hasDefault' => ['bool'],
'componere\value::isPrivate' => ['bool'],
'componere\value::isProtected' => ['bool'],
'componere\value::isStatic' => ['bool'],
'componere\value::setPrivate' => ['Value'],
'componere\value::setProtected' => ['Value'],
'componere\value::setStatic' => ['Value'],
'Cond::broadcast' => ['bool', 'condition'=>'long'],
'Cond::create' => ['long'],
'Cond::destroy' => ['bool', 'condition'=>'long'],
'Cond::signal' => ['bool', 'condition'=>'long'],
'Cond::wait' => ['bool', 'condition'=>'long', 'mutex'=>'long', 'timeout='=>'long'],
'confirm_pdo_ibm_compiled' => [''],
'connection_aborted' => ['int'],
'connection_status' => ['int'],
'connection_timeout' => ['int'],
'constant' => ['mixed', 'name'=>'string'],
'convert_cyr_string' => ['string', 'string'=>'string', 'from'=>'string', 'to'=>'string'],
'convert_uudecode' => ['string', 'string'=>'string'],
'convert_uuencode' => ['string', 'string'=>'string'],
'copy' => ['bool', 'from'=>'string', 'to'=>'string', 'context='=>'resource'],
'cos' => ['float', 'num'=>'float'],
'cosh' => ['float', 'num'=>'float'],
'Couchbase\AnalyticsQuery::__construct' => ['void'],
'Couchbase\AnalyticsQuery::fromString' => ['Couchbase\AnalyticsQuery', 'statement'=>'string'],
'Couchbase\basicDecoderV1' => ['mixed', 'bytes'=>'string', 'flags'=>'int', 'datatype'=>'int', 'options'=>'array'],
'Couchbase\basicEncoderV1' => ['array', 'value'=>'mixed', 'options'=>'array'],
'Couchbase\BooleanFieldSearchQuery::__construct' => ['void'],
'Couchbase\BooleanFieldSearchQuery::boost' => ['Couchbase\BooleanFieldSearchQuery', 'boost'=>'float'],
'Couchbase\BooleanFieldSearchQuery::field' => ['Couchbase\BooleanFieldSearchQuery', 'field'=>'string'],
'Couchbase\BooleanFieldSearchQuery::jsonSerialize' => ['array'],
'Couchbase\BooleanSearchQuery::__construct' => ['void'],
'Couchbase\BooleanSearchQuery::boost' => ['Couchbase\BooleanSearchQuery', 'boost'=>'float'],
'Couchbase\BooleanSearchQuery::jsonSerialize' => ['array'],
'Couchbase\BooleanSearchQuery::must' => ['Couchbase\BooleanSearchQuery', '...queries='=>'array<int,Couchbase\SearchQueryPart>'],
'Couchbase\BooleanSearchQuery::mustNot' => ['Couchbase\BooleanSearchQuery', '...queries='=>'array<int,Couchbase\SearchQueryPart>'],
'Couchbase\BooleanSearchQuery::should' => ['Couchbase\BooleanSearchQuery', '...queries='=>'array<int,Couchbase\SearchQueryPart>'],
'Couchbase\Bucket::__construct' => ['void'],
'Couchbase\Bucket::__get' => ['int', 'name'=>'string'],
'Couchbase\Bucket::__set' => ['int', 'name'=>'string', 'value'=>'int'],
'Couchbase\Bucket::append' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'],
'Couchbase\Bucket::counter' => ['Couchbase\Document|array', 'ids'=>'array|string', 'delta='=>'int', 'options='=>'array'],
'Couchbase\Bucket::decryptFields' => ['array', 'document'=>'array', 'fieldOptions'=>'', 'prefix='=>'string'],
'Couchbase\Bucket::diag' => ['array', 'reportId='=>'string'],
'Couchbase\Bucket::encryptFields' => ['array', 'document'=>'array', 'fieldOptions'=>'', 'prefix='=>'string'],
'Couchbase\Bucket::get' => ['Couchbase\Document|array', 'ids'=>'array|string', 'options='=>'array'],
'Couchbase\Bucket::getAndLock' => ['Couchbase\Document|array', 'ids'=>'array|string', 'lockTime'=>'int', 'options='=>'array'],
'Couchbase\Bucket::getAndTouch' => ['Couchbase\Document|array', 'ids'=>'array|string', 'expiry'=>'int', 'options='=>'array'],
'Couchbase\Bucket::getFromReplica' => ['Couchbase\Document|array', 'ids'=>'array|string', 'options='=>'array'],
'Couchbase\Bucket::getName' => ['string'],
'Couchbase\Bucket::insert' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'],
'Couchbase\Bucket::listExists' => ['bool', 'id'=>'string', 'value'=>'mixed'],
'Couchbase\Bucket::listGet' => ['mixed', 'id'=>'string', 'index'=>'int'],
'Couchbase\Bucket::listPush' => ['', 'id'=>'string', 'value'=>'mixed'],
'Couchbase\Bucket::listRemove' => ['', 'id'=>'string', 'index'=>'int'],
'Couchbase\Bucket::listSet' => ['', 'id'=>'string', 'index'=>'int', 'value'=>'mixed'],
'Couchbase\Bucket::listShift' => ['', 'id'=>'string', 'value'=>'mixed'],
'Couchbase\Bucket::listSize' => ['int', 'id'=>'string'],
'Couchbase\Bucket::lookupIn' => ['Couchbase\LookupInBuilder', 'id'=>'string'],
'Couchbase\Bucket::manager' => ['Couchbase\BucketManager'],
'Couchbase\Bucket::mapAdd' => ['', 'id'=>'string', 'key'=>'string', 'value'=>'mixed'],
'Couchbase\Bucket::mapGet' => ['mixed', 'id'=>'string', 'key'=>'string'],
'Couchbase\Bucket::mapRemove' => ['', 'id'=>'string', 'key'=>'string'],
'Couchbase\Bucket::mapSize' => ['int', 'id'=>'string'],
'Couchbase\Bucket::mutateIn' => ['Couchbase\MutateInBuilder', 'id'=>'string', 'cas'=>'string'],
'Couchbase\Bucket::ping' => ['array', 'services='=>'int', 'reportId='=>'string'],
'Couchbase\Bucket::prepend' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'],
'Couchbase\Bucket::query' => ['object', 'query'=>'Couchbase\AnalyticsQuery|Couchbase\N1qlQuery|Couchbase\SearchQuery|Couchbase\SpatialViewQuery|Couchbase\ViewQuery', 'jsonAsArray='=>'bool'],
'Couchbase\Bucket::queueAdd' => ['', 'id'=>'string', 'value'=>'mixed'],
'Couchbase\Bucket::queueExists' => ['bool', 'id'=>'string', 'value'=>'mixed'],
'Couchbase\Bucket::queueRemove' => ['mixed', 'id'=>'string'],
'Couchbase\Bucket::queueSize' => ['int', 'id'=>'string'],
'Couchbase\Bucket::remove' => ['Couchbase\Document|array', 'ids'=>'array|string', 'options='=>'array'],
'Couchbase\Bucket::replace' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'],
'Couchbase\Bucket::retrieveIn' => ['Couchbase\DocumentFragment', 'id'=>'string', '...paths='=>'array<int,string>'],
'Couchbase\Bucket::setAdd' => ['', 'id'=>'string', 'value'=>'bool|float|int|string'],
'Couchbase\Bucket::setExists' => ['bool', 'id'=>'string', 'value'=>'bool|float|int|string'],
'Couchbase\Bucket::setRemove' => ['', 'id'=>'string', 'value'=>'bool|float|int|string'],
'Couchbase\Bucket::setSize' => ['int', 'id'=>'string'],
'Couchbase\Bucket::setTranscoder' => ['', 'encoder'=>'callable', 'decoder'=>'callable'],
'Couchbase\Bucket::touch' => ['Couchbase\Document|array', 'ids'=>'array|string', 'expiry'=>'int', 'options='=>'array'],
'Couchbase\Bucket::unlock' => ['Couchbase\Document|array', 'ids'=>'array|string', 'options='=>'array'],
'Couchbase\Bucket::upsert' => ['Couchbase\Document|array', 'ids'=>'array|string', 'value'=>'mixed', 'options='=>'array'],
'Couchbase\BucketManager::__construct' => ['void'],
'Couchbase\BucketManager::createN1qlIndex' => ['', 'name'=>'string', 'fields'=>'array', 'whereClause='=>'string', 'ignoreIfExist='=>'bool', 'defer='=>'bool'],
'Couchbase\BucketManager::createN1qlPrimaryIndex' => ['', 'customName='=>'string', 'ignoreIfExist='=>'bool', 'defer='=>'bool'],
'Couchbase\BucketManager::dropN1qlIndex' => ['', 'name'=>'string', 'ignoreIfNotExist='=>'bool'],
'Couchbase\BucketManager::dropN1qlPrimaryIndex' => ['', 'customName='=>'string', 'ignoreIfNotExist='=>'bool'],
'Couchbase\BucketManager::flush' => [''],
'Couchbase\BucketManager::getDesignDocument' => ['array', 'name'=>'string'],
'Couchbase\BucketManager::info' => ['array'],
'Couchbase\BucketManager::insertDesignDocument' => ['', 'name'=>'string', 'document'=>'array'],
'Couchbase\BucketManager::listDesignDocuments' => ['array'],
'Couchbase\BucketManager::listN1qlIndexes' => ['array'],
'Couchbase\BucketManager::removeDesignDocument' => ['', 'name'=>'string'],
'Couchbase\BucketManager::upsertDesignDocument' => ['', 'name'=>'string', 'document'=>'array'],
'Couchbase\ClassicAuthenticator::bucket' => ['', 'name'=>'string', 'password'=>'string'],
'Couchbase\ClassicAuthenticator::cluster' => ['', 'username'=>'string', 'password'=>'string'],
'Couchbase\Cluster::__construct' => ['void', 'connstr'=>'string'],
'Couchbase\Cluster::authenticate' => ['null', 'authenticator'=>'Couchbase\Authenticator'],
'Couchbase\Cluster::authenticateAs' => ['null', 'username'=>'string', 'password'=>'string'],
'Couchbase\Cluster::manager' => ['Couchbase\ClusterManager', 'username='=>'string', 'password='=>'string'],
'Couchbase\Cluster::openBucket' => ['Couchbase\Bucket', 'name='=>'string', 'password='=>'string'],
'Couchbase\ClusterManager::__construct' => ['void'],
'Couchbase\ClusterManager::createBucket' => ['', 'name'=>'string', 'options='=>'array'],
'Couchbase\ClusterManager::getUser' => ['array', 'username'=>'string', 'domain='=>'int'],
'Couchbase\ClusterManager::info' => ['array'],
'Couchbase\ClusterManager::listBuckets' => ['array'],
'Couchbase\ClusterManager::listUsers' => ['array', 'domain='=>'int'],
'Couchbase\ClusterManager::removeBucket' => ['', 'name'=>'string'],
'Couchbase\ClusterManager::removeUser' => ['', 'name'=>'string', 'domain='=>'int'],
'Couchbase\ClusterManager::upsertUser' => ['', 'name'=>'string', 'settings'=>'Couchbase\UserSettings', 'domain='=>'int'],
'Couchbase\ConjunctionSearchQuery::__construct' => ['void'],
'Couchbase\ConjunctionSearchQuery::boost' => ['Couchbase\ConjunctionSearchQuery', 'boost'=>'float'],
'Couchbase\ConjunctionSearchQuery::every' => ['Couchbase\ConjunctionSearchQuery', '...queries='=>'array<int,Couchbase\SearchQueryPart>'],
'Couchbase\ConjunctionSearchQuery::jsonSerialize' => ['array'],
'Couchbase\DateRangeSearchFacet::__construct' => ['void'],
'Couchbase\DateRangeSearchFacet::addRange' => ['Couchbase\DateRangeSearchFacet', 'name'=>'string', 'start'=>'int|string', 'end'=>'int|string'],
'Couchbase\DateRangeSearchFacet::jsonSerialize' => ['array'],
'Couchbase\DateRangeSearchQuery::__construct' => ['void'],
'Couchbase\DateRangeSearchQuery::boost' => ['Couchbase\DateRangeSearchQuery', 'boost'=>'float'],
'Couchbase\DateRangeSearchQuery::dateTimeParser' => ['Couchbase\DateRangeSearchQuery', 'dateTimeParser'=>'string'],
'Couchbase\DateRangeSearchQuery::end' => ['Couchbase\DateRangeSearchQuery', 'end'=>'int|string', 'inclusive='=>'bool'],
'Couchbase\DateRangeSearchQuery::field' => ['Couchbase\DateRangeSearchQuery', 'field'=>'string'],
'Couchbase\DateRangeSearchQuery::jsonSerialize' => ['array'],
'Couchbase\DateRangeSearchQuery::start' => ['Couchbase\DateRangeSearchQuery', 'start'=>'int|string', 'inclusive='=>'bool'],
'Couchbase\defaultDecoder' => ['mixed', 'bytes'=>'string', 'flags'=>'int', 'datatype'=>'int'],
'Couchbase\defaultEncoder' => ['array', 'value'=>'mixed'],
'Couchbase\DisjunctionSearchQuery::__construct' => ['void'],
'Couchbase\DisjunctionSearchQuery::boost' => ['Couchbase\DisjunctionSearchQuery', 'boost'=>'float'],
'Couchbase\DisjunctionSearchQuery::either' => ['Couchbase\DisjunctionSearchQuery', '...queries='=>'array<int,Couchbase\SearchQueryPart>'],
'Couchbase\DisjunctionSearchQuery::jsonSerialize' => ['array'],
'Couchbase\DisjunctionSearchQuery::min' => ['Couchbase\DisjunctionSearchQuery', 'min'=>'int'],
'Couchbase\DocIdSearchQuery::__construct' => ['void'],
'Couchbase\DocIdSearchQuery::boost' => ['Couchbase\DocIdSearchQuery', 'boost'=>'float'],
'Couchbase\DocIdSearchQuery::docIds' => ['Couchbase\DocIdSearchQuery', '...documentIds='=>'array<int,string>'],
'Couchbase\DocIdSearchQuery::field' => ['Couchbase\DocIdSearchQuery', 'field'=>'string'],
'Couchbase\DocIdSearchQuery::jsonSerialize' => ['array'],
'Couchbase\fastlzCompress' => ['string', 'data'=>'string'],
'Couchbase\fastlzDecompress' => ['string', 'data'=>'string'],
'Couchbase\GeoBoundingBoxSearchQuery::__construct' => ['void'],
'Couchbase\GeoBoundingBoxSearchQuery::boost' => ['Couchbase\GeoBoundingBoxSearchQuery', 'boost'=>'float'],
'Couchbase\GeoBoundingBoxSearchQuery::field' => ['Couchbase\GeoBoundingBoxSearchQuery', 'field'=>'string'],
'Couchbase\GeoBoundingBoxSearchQuery::jsonSerialize' => ['array'],
'Couchbase\GeoDistanceSearchQuery::__construct' => ['void'],
'Couchbase\GeoDistanceSearchQuery::boost' => ['Couchbase\GeoDistanceSearchQuery', 'boost'=>'float'],
'Couchbase\GeoDistanceSearchQuery::field' => ['Couchbase\GeoDistanceSearchQuery', 'field'=>'string'],
'Couchbase\GeoDistanceSearchQuery::jsonSerialize' => ['array'],
'Couchbase\LookupInBuilder::__construct' => ['void'],
'Couchbase\LookupInBuilder::execute' => ['Couchbase\DocumentFragment'],
'Couchbase\LookupInBuilder::exists' => ['Couchbase\LookupInBuilder', 'path'=>'string', 'options='=>'array'],
'Couchbase\LookupInBuilder::get' => ['Couchbase\LookupInBuilder', 'path'=>'string', 'options='=>'array'],
'Couchbase\LookupInBuilder::getCount' => ['Couchbase\LookupInBuilder', 'path'=>'string', 'options='=>'array'],
'Couchbase\MatchAllSearchQuery::__construct' => ['void'],
'Couchbase\MatchAllSearchQuery::boost' => ['Couchbase\MatchAllSearchQuery', 'boost'=>'float'],
'Couchbase\MatchAllSearchQuery::jsonSerialize' => ['array'],
'Couchbase\MatchNoneSearchQuery::__construct' => ['void'],
'Couchbase\MatchNoneSearchQuery::boost' => ['Couchbase\MatchNoneSearchQuery', 'boost'=>'float'],
'Couchbase\MatchNoneSearchQuery::jsonSerialize' => ['array'],
'Couchbase\MatchPhraseSearchQuery::__construct' => ['void'],
'Couchbase\MatchPhraseSearchQuery::analyzer' => ['Couchbase\MatchPhraseSearchQuery', 'analyzer'=>'string'],
'Couchbase\MatchPhraseSearchQuery::boost' => ['Couchbase\MatchPhraseSearchQuery', 'boost'=>'float'],
'Couchbase\MatchPhraseSearchQuery::field' => ['Couchbase\MatchPhraseSearchQuery', 'field'=>'string'],
'Couchbase\MatchPhraseSearchQuery::jsonSerialize' => ['array'],
'Couchbase\MatchSearchQuery::__construct' => ['void'],
'Couchbase\MatchSearchQuery::analyzer' => ['Couchbase\MatchSearchQuery', 'analyzer'=>'string'],
'Couchbase\MatchSearchQuery::boost' => ['Couchbase\MatchSearchQuery', 'boost'=>'float'],
'Couchbase\MatchSearchQuery::field' => ['Couchbase\MatchSearchQuery', 'field'=>'string'],
'Couchbase\MatchSearchQuery::fuzziness' => ['Couchbase\MatchSearchQuery', 'fuzziness'=>'int'],
'Couchbase\MatchSearchQuery::jsonSerialize' => ['array'],
'Couchbase\MatchSearchQuery::prefixLength' => ['Couchbase\MatchSearchQuery', 'prefixLength'=>'int'],
'Couchbase\MutateInBuilder::__construct' => ['void'],
'Couchbase\MutateInBuilder::arrayAddUnique' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'],
'Couchbase\MutateInBuilder::arrayAppend' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'],
'Couchbase\MutateInBuilder::arrayAppendAll' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'values'=>'array', 'options='=>'array|bool'],
'Couchbase\MutateInBuilder::arrayInsert' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array'],
'Couchbase\MutateInBuilder::arrayInsertAll' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'values'=>'array', 'options='=>'array'],
'Couchbase\MutateInBuilder::arrayPrepend' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'],
'Couchbase\MutateInBuilder::arrayPrependAll' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'values'=>'array', 'options='=>'array|bool'],
'Couchbase\MutateInBuilder::counter' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'delta'=>'int', 'options='=>'array|bool'],
'Couchbase\MutateInBuilder::execute' => ['Couchbase\DocumentFragment'],
'Couchbase\MutateInBuilder::insert' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'],
'Couchbase\MutateInBuilder::modeDocument' => ['', 'mode'=>'int'],
'Couchbase\MutateInBuilder::remove' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'options='=>'array'],
'Couchbase\MutateInBuilder::replace' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array'],
'Couchbase\MutateInBuilder::upsert' => ['Couchbase\MutateInBuilder', 'path'=>'string', 'value'=>'mixed', 'options='=>'array|bool'],
'Couchbase\MutateInBuilder::withExpiry' => ['Couchbase\MutateInBuilder', 'expiry'=>'Couchbase\expiry'],
'Couchbase\MutationState::__construct' => ['void'],
'Couchbase\MutationState::add' => ['', 'source'=>'Couchbase\Document|Couchbase\DocumentFragment|array'],
'Couchbase\MutationState::from' => ['Couchbase\MutationState', 'source'=>'Couchbase\Document|Couchbase\DocumentFragment|array'],
'Couchbase\MutationToken::__construct' => ['void'],
'Couchbase\MutationToken::bucketName' => ['string'],
'Couchbase\MutationToken::from' => ['', 'bucketName'=>'string', 'vbucketId'=>'int', 'vbucketUuid'=>'string', 'sequenceNumber'=>'string'],
'Couchbase\MutationToken::sequenceNumber' => ['string'],
'Couchbase\MutationToken::vbucketId' => ['int'],
'Couchbase\MutationToken::vbucketUuid' => ['string'],
'Couchbase\N1qlIndex::__construct' => ['void'],
'Couchbase\N1qlQuery::__construct' => ['void'],
'Couchbase\N1qlQuery::adhoc' => ['Couchbase\N1qlQuery', 'adhoc'=>'bool'],
'Couchbase\N1qlQuery::consistency' => ['Couchbase\N1qlQuery', 'consistency'=>'int'],
'Couchbase\N1qlQuery::consistentWith' => ['Couchbase\N1qlQuery', 'state'=>'Couchbase\MutationState'],
'Couchbase\N1qlQuery::crossBucket' => ['Couchbase\N1qlQuery', 'crossBucket'=>'bool'],
'Couchbase\N1qlQuery::fromString' => ['Couchbase\N1qlQuery', 'statement'=>'string'],
'Couchbase\N1qlQuery::maxParallelism' => ['Couchbase\N1qlQuery', 'maxParallelism'=>'int'],
'Couchbase\N1qlQuery::namedParams' => ['Couchbase\N1qlQuery', 'params'=>'array'],
'Couchbase\N1qlQuery::pipelineBatch' => ['Couchbase\N1qlQuery', 'pipelineBatch'=>'int'],
'Couchbase\N1qlQuery::pipelineCap' => ['Couchbase\N1qlQuery', 'pipelineCap'=>'int'],
'Couchbase\N1qlQuery::positionalParams' => ['Couchbase\N1qlQuery', 'params'=>'array'],
'Couchbase\N1qlQuery::profile' => ['', 'profileType'=>'string'],
'Couchbase\N1qlQuery::readonly' => ['Couchbase\N1qlQuery', 'readonly'=>'bool'],
'Couchbase\N1qlQuery::scanCap' => ['Couchbase\N1qlQuery', 'scanCap'=>'int'],
'Couchbase\NumericRangeSearchFacet::__construct' => ['void'],
'Couchbase\NumericRangeSearchFacet::addRange' => ['Couchbase\NumericRangeSearchFacet', 'name'=>'string', 'min'=>'float', 'max'=>'float'],
'Couchbase\NumericRangeSearchFacet::jsonSerialize' => ['array'],
'Couchbase\NumericRangeSearchQuery::__construct' => ['void'],
'Couchbase\NumericRangeSearchQuery::boost' => ['Couchbase\NumericRangeSearchQuery', 'boost'=>'float'],
'Couchbase\NumericRangeSearchQuery::field' => ['Couchbase\NumericRangeSearchQuery', 'field'=>'string'],
'Couchbase\NumericRangeSearchQuery::jsonSerialize' => ['array'],
'Couchbase\NumericRangeSearchQuery::max' => ['Couchbase\NumericRangeSearchQuery', 'max'=>'float', 'inclusive='=>'bool'],
'Couchbase\NumericRangeSearchQuery::min' => ['Couchbase\NumericRangeSearchQuery', 'min'=>'float', 'inclusive='=>'bool'],
'Couchbase\passthruDecoder' => ['string', 'bytes'=>'string', 'flags'=>'int', 'datatype'=>'int'],
'Couchbase\passthruEncoder' => ['array', 'value'=>'string'],
'Couchbase\PasswordAuthenticator::password' => ['Couchbase\PasswordAuthenticator', 'password'=>'string'],
'Couchbase\PasswordAuthenticator::username' => ['Couchbase\PasswordAuthenticator', 'username'=>'string'],
'Couchbase\PhraseSearchQuery::__construct' => ['void'],
'Couchbase\PhraseSearchQuery::boost' => ['Couchbase\PhraseSearchQuery', 'boost'=>'float'],
'Couchbase\PhraseSearchQuery::field' => ['Couchbase\PhraseSearchQuery', 'field'=>'string'],
'Couchbase\PhraseSearchQuery::jsonSerialize' => ['array'],
'Couchbase\PrefixSearchQuery::__construct' => ['void'],
'Couchbase\PrefixSearchQuery::boost' => ['Couchbase\PrefixSearchQuery', 'boost'=>'float'],
'Couchbase\PrefixSearchQuery::field' => ['Couchbase\PrefixSearchQuery', 'field'=>'string'],
'Couchbase\PrefixSearchQuery::jsonSerialize' => ['array'],
'Couchbase\QueryStringSearchQuery::__construct' => ['void'],
'Couchbase\QueryStringSearchQuery::boost' => ['Couchbase\QueryStringSearchQuery', 'boost'=>'float'],
'Couchbase\QueryStringSearchQuery::jsonSerialize' => ['array'],
'Couchbase\RegexpSearchQuery::__construct' => ['void'],
'Couchbase\RegexpSearchQuery::boost' => ['Couchbase\RegexpSearchQuery', 'boost'=>'float'],
'Couchbase\RegexpSearchQuery::field' => ['Couchbase\RegexpSearchQuery', 'field'=>'string'],
'Couchbase\RegexpSearchQuery::jsonSerialize' => ['array'],
'Couchbase\SearchQuery::__construct' => ['void', 'indexName'=>'string', 'queryPart'=>'Couchbase\SearchQueryPart'],
'Couchbase\SearchQuery::addFacet' => ['Couchbase\SearchQuery', 'name'=>'string', 'facet'=>'Couchbase\SearchFacet'],
'Couchbase\SearchQuery::boolean' => ['Couchbase\BooleanSearchQuery'],
'Couchbase\SearchQuery::booleanField' => ['Couchbase\BooleanFieldSearchQuery', 'value'=>'bool'],
'Couchbase\SearchQuery::conjuncts' => ['Couchbase\ConjunctionSearchQuery', '...queries='=>'array<int,Couchbase\SearchQueryPart>'],
'Couchbase\SearchQuery::consistentWith' => ['Couchbase\SearchQuery', 'state'=>'Couchbase\MutationState'],
'Couchbase\SearchQuery::dateRange' => ['Couchbase\DateRangeSearchQuery'],
'Couchbase\SearchQuery::dateRangeFacet' => ['Couchbase\DateRangeSearchFacet', 'field'=>'string', 'limit'=>'int'],
'Couchbase\SearchQuery::disjuncts' => ['Couchbase\DisjunctionSearchQuery', '...queries='=>'array<int,Couchbase\SearchQueryPart>'],
'Couchbase\SearchQuery::docId' => ['Couchbase\DocIdSearchQuery', '...documentIds='=>'array<int,string>'],
'Couchbase\SearchQuery::explain' => ['Couchbase\SearchQuery', 'explain'=>'bool'],
'Couchbase\SearchQuery::fields' => ['Couchbase\SearchQuery', '...fields='=>'array<int,string>'],
'Couchbase\SearchQuery::geoBoundingBox' => ['Couchbase\GeoBoundingBoxSearchQuery', 'topLeftLongitude'=>'float', 'topLeftLatitude'=>'float', 'bottomRightLongitude'=>'float', 'bottomRightLatitude'=>'float'],
'Couchbase\SearchQuery::geoDistance' => ['Couchbase\GeoDistanceSearchQuery', 'longitude'=>'float', 'latitude'=>'float', 'distance'=>'string'],
'Couchbase\SearchQuery::highlight' => ['Couchbase\SearchQuery', 'style'=>'string', '...fields='=>'array<int,string>'],
'Couchbase\SearchQuery::jsonSerialize' => ['array'],
'Couchbase\SearchQuery::limit' => ['Couchbase\SearchQuery', 'limit'=>'int'],
'Couchbase\SearchQuery::match' => ['Couchbase\MatchSearchQuery', 'match'=>'string'],
'Couchbase\SearchQuery::matchAll' => ['Couchbase\MatchAllSearchQuery'],
'Couchbase\SearchQuery::matchNone' => ['Couchbase\MatchNoneSearchQuery'],
'Couchbase\SearchQuery::matchPhrase' => ['Couchbase\MatchPhraseSearchQuery', '...terms='=>'array<int,string>'],
'Couchbase\SearchQuery::numericRange' => ['Couchbase\NumericRangeSearchQuery'],
'Couchbase\SearchQuery::numericRangeFacet' => ['Couchbase\NumericRangeSearchFacet', 'field'=>'string', 'limit'=>'int'],
'Couchbase\SearchQuery::prefix' => ['Couchbase\PrefixSearchQuery', 'prefix'=>'string'],
'Couchbase\SearchQuery::queryString' => ['Couchbase\QueryStringSearchQuery', 'queryString'=>'string'],
'Couchbase\SearchQuery::regexp' => ['Couchbase\RegexpSearchQuery', 'regexp'=>'string'],
'Couchbase\SearchQuery::serverSideTimeout' => ['Couchbase\SearchQuery', 'serverSideTimeout'=>'int'],
'Couchbase\SearchQuery::skip' => ['Couchbase\SearchQuery', 'skip'=>'int'],
'Couchbase\SearchQuery::sort' => ['Couchbase\SearchQuery', '...sort='=>'array<int,Couchbase\sort>'],
'Couchbase\SearchQuery::term' => ['Couchbase\TermSearchQuery', 'term'=>'string'],
'Couchbase\SearchQuery::termFacet' => ['Couchbase\TermSearchFacet', 'field'=>'string', 'limit'=>'int'],
'Couchbase\SearchQuery::termRange' => ['Couchbase\TermRangeSearchQuery'],
'Couchbase\SearchQuery::wildcard' => ['Couchbase\WildcardSearchQuery', 'wildcard'=>'string'],
'Couchbase\SearchSort::__construct' => ['void'],
'Couchbase\SearchSort::field' => ['Couchbase\SearchSortField', 'field'=>'string'],
'Couchbase\SearchSort::geoDistance' => ['Couchbase\SearchSortGeoDistance', 'field'=>'string', 'longitude'=>'float', 'latitude'=>'float'],
'Couchbase\SearchSort::id' => ['Couchbase\SearchSortId'],
'Couchbase\SearchSort::score' => ['Couchbase\SearchSortScore'],
'Couchbase\SearchSortField::__construct' => ['void'],
'Couchbase\SearchSortField::descending' => ['Couchbase\SearchSortField', 'descending'=>'bool'],
'Couchbase\SearchSortField::field' => ['Couchbase\SearchSortField', 'field'=>'string'],
'Couchbase\SearchSortField::geoDistance' => ['Couchbase\SearchSortGeoDistance', 'field'=>'string', 'longitude'=>'float', 'latitude'=>'float'],
'Couchbase\SearchSortField::id' => ['Couchbase\SearchSortId'],
'Couchbase\SearchSortField::jsonSerialize' => ['mixed'],
'Couchbase\SearchSortField::missing' => ['', 'missing'=>'string'],
'Couchbase\SearchSortField::mode' => ['', 'mode'=>'string'],
'Couchbase\SearchSortField::score' => ['Couchbase\SearchSortScore'],
'Couchbase\SearchSortField::type' => ['', 'type'=>'string'],
'Couchbase\SearchSortGeoDistance::__construct' => ['void'],
'Couchbase\SearchSortGeoDistance::descending' => ['Couchbase\SearchSortGeoDistance', 'descending'=>'bool'],
'Couchbase\SearchSortGeoDistance::field' => ['Couchbase\SearchSortField', 'field'=>'string'],
'Couchbase\SearchSortGeoDistance::geoDistance' => ['Couchbase\SearchSortGeoDistance', 'field'=>'string', 'longitude'=>'float', 'latitude'=>'float'],
'Couchbase\SearchSortGeoDistance::id' => ['Couchbase\SearchSortId'],
'Couchbase\SearchSortGeoDistance::jsonSerialize' => ['mixed'],
'Couchbase\SearchSortGeoDistance::score' => ['Couchbase\SearchSortScore'],
'Couchbase\SearchSortGeoDistance::unit' => ['Couchbase\SearchSortGeoDistance', 'unit'=>'string'],
'Couchbase\SearchSortId::__construct' => ['void'],
'Couchbase\SearchSortId::descending' => ['Couchbase\SearchSortId', 'descending'=>'bool'],
'Couchbase\SearchSortId::field' => ['Couchbase\SearchSortField', 'field'=>'string'],
'Couchbase\SearchSortId::geoDistance' => ['Couchbase\SearchSortGeoDistance', 'field'=>'string', 'longitude'=>'float', 'latitude'=>'float'],
'Couchbase\SearchSortId::id' => ['Couchbase\SearchSortId'],
'Couchbase\SearchSortId::jsonSerialize' => ['mixed'],
'Couchbase\SearchSortId::score' => ['Couchbase\SearchSortScore'],
'Couchbase\SearchSortScore::__construct' => ['void'],
'Couchbase\SearchSortScore::descending' => ['Couchbase\SearchSortScore', 'descending'=>'bool'],
'Couchbase\SearchSortScore::field' => ['Couchbase\SearchSortField', 'field'=>'string'],
'Couchbase\SearchSortScore::geoDistance' => ['Couchbase\SearchSortGeoDistance', 'field'=>'string', 'longitude'=>'float', 'latitude'=>'float'],
'Couchbase\SearchSortScore::id' => ['Couchbase\SearchSortId'],
'Couchbase\SearchSortScore::jsonSerialize' => ['mixed'],
'Couchbase\SearchSortScore::score' => ['Couchbase\SearchSortScore'],
'Couchbase\SpatialViewQuery::__construct' => ['void'],
'Couchbase\SpatialViewQuery::bbox' => ['Couchbase\SpatialViewQuery', 'bbox'=>'array'],
'Couchbase\SpatialViewQuery::consistency' => ['Couchbase\SpatialViewQuery', 'consistency'=>'int'],
'Couchbase\SpatialViewQuery::custom' => ['', 'customParameters'=>'array'],
'Couchbase\SpatialViewQuery::encode' => ['array'],
'Couchbase\SpatialViewQuery::endRange' => ['Couchbase\SpatialViewQuery', 'range'=>'array'],
'Couchbase\SpatialViewQuery::limit' => ['Couchbase\SpatialViewQuery', 'limit'=>'int'],
'Couchbase\SpatialViewQuery::order' => ['Couchbase\SpatialViewQuery', 'order'=>'int'],
'Couchbase\SpatialViewQuery::skip' => ['Couchbase\SpatialViewQuery', 'skip'=>'int'],
'Couchbase\SpatialViewQuery::startRange' => ['Couchbase\SpatialViewQuery', 'range'=>'array'],
'Couchbase\TermRangeSearchQuery::__construct' => ['void'],
'Couchbase\TermRangeSearchQuery::boost' => ['Couchbase\TermRangeSearchQuery', 'boost'=>'float'],
'Couchbase\TermRangeSearchQuery::field' => ['Couchbase\TermRangeSearchQuery', 'field'=>'string'],
'Couchbase\TermRangeSearchQuery::jsonSerialize' => ['array'],
'Couchbase\TermRangeSearchQuery::max' => ['Couchbase\TermRangeSearchQuery', 'max'=>'string', 'inclusive='=>'bool'],
'Couchbase\TermRangeSearchQuery::min' => ['Couchbase\TermRangeSearchQuery', 'min'=>'string', 'inclusive='=>'bool'],
'Couchbase\TermSearchFacet::__construct' => ['void'],
'Couchbase\TermSearchFacet::jsonSerialize' => ['array'],
'Couchbase\TermSearchQuery::__construct' => ['void'],
'Couchbase\TermSearchQuery::boost' => ['Couchbase\TermSearchQuery', 'boost'=>'float'],
'Couchbase\TermSearchQuery::field' => ['Couchbase\TermSearchQuery', 'field'=>'string'],
'Couchbase\TermSearchQuery::fuzziness' => ['Couchbase\TermSearchQuery', 'fuzziness'=>'int'],
'Couchbase\TermSearchQuery::jsonSerialize' => ['array'],
'Couchbase\TermSearchQuery::prefixLength' => ['Couchbase\TermSearchQuery', 'prefixLength'=>'int'],
'Couchbase\UserSettings::fullName' => ['Couchbase\UserSettings', 'fullName'=>'string'],
'Couchbase\UserSettings::password' => ['Couchbase\UserSettings', 'password'=>'string'],
'Couchbase\UserSettings::role' => ['Couchbase\UserSettings', 'role'=>'string', 'bucket='=>'string'],
'Couchbase\ViewQuery::__construct' => ['void'],
'Couchbase\ViewQuery::consistency' => ['Couchbase\ViewQuery', 'consistency'=>'int'],
'Couchbase\ViewQuery::custom' => ['Couchbase\ViewQuery', 'customParameters'=>'array'],
'Couchbase\ViewQuery::encode' => ['array'],
'Couchbase\ViewQuery::from' => ['Couchbase\ViewQuery', 'designDocumentName'=>'string', 'viewName'=>'string'],
'Couchbase\ViewQuery::fromSpatial' => ['Couchbase\SpatialViewQuery', 'designDocumentName'=>'string', 'viewName'=>'string'],
'Couchbase\ViewQuery::group' => ['Couchbase\ViewQuery', 'group'=>'bool'],
'Couchbase\ViewQuery::groupLevel' => ['Couchbase\ViewQuery', 'groupLevel'=>'int'],
'Couchbase\ViewQuery::idRange' => ['Couchbase\ViewQuery', 'startKeyDocumentId'=>'string', 'endKeyDocumentId'=>'string'],
'Couchbase\ViewQuery::key' => ['Couchbase\ViewQuery', 'key'=>'mixed'],
'Couchbase\ViewQuery::keys' => ['Couchbase\ViewQuery', 'keys'=>'array'],
'Couchbase\ViewQuery::limit' => ['Couchbase\ViewQuery', 'limit'=>'int'],
'Couchbase\ViewQuery::order' => ['Couchbase\ViewQuery', 'order'=>'int'],
'Couchbase\ViewQuery::range' => ['Couchbase\ViewQuery', 'startKey'=>'mixed', 'endKey'=>'mixed', 'inclusiveEnd='=>'bool'],
'Couchbase\ViewQuery::reduce' => ['Couchbase\ViewQuery', 'reduce'=>'bool'],
'Couchbase\ViewQuery::skip' => ['Couchbase\ViewQuery', 'skip'=>'int'],
'Couchbase\ViewQueryEncodable::encode' => ['array'],
'Couchbase\WildcardSearchQuery::__construct' => ['void'],
'Couchbase\WildcardSearchQuery::boost' => ['Couchbase\WildcardSearchQuery', 'boost'=>'float'],
'Couchbase\WildcardSearchQuery::field' => ['Couchbase\WildcardSearchQuery', 'field'=>'string'],
'Couchbase\WildcardSearchQuery::jsonSerialize' => ['array'],
'Couchbase\zlibCompress' => ['string', 'data'=>'string'],
'Couchbase\zlibDecompress' => ['string', 'data'=>'string'],
'count' => ['int', 'value'=>'Countable|array|SimpleXMLElement|ResourceBundle', 'mode='=>'int'],
'count_chars' => ['array<int,int>|string', 'input'=>'string', 'mode='=>'int'],
'Countable::count' => ['int'],
'crack_check' => ['bool', 'dictionary'=>'', 'password'=>'string'],
'crack_closedict' => ['bool', 'dictionary='=>'resource'],
'crack_getlastmessage' => ['string'],
'crack_opendict' => ['resource|false', 'dictionary'=>'string'],
'crash' => [''],
'crc32' => ['int', 'string'=>'string'],
'crypt' => ['string', 'string'=>'string', 'salt='=>'string'],
'ctype_alnum' => ['bool', 'text'=>'string|int'],
'ctype_alpha' => ['bool', 'text'=>'string|int'],
'ctype_cntrl' => ['bool', 'text'=>'string|int'],
'ctype_digit' => ['bool', 'text'=>'string|int'],
'ctype_graph' => ['bool', 'text'=>'string|int'],
'ctype_lower' => ['bool', 'text'=>'string|int'],
'ctype_print' => ['bool', 'text'=>'string|int'],
'ctype_punct' => ['bool', 'text'=>'string|int'],
'ctype_space' => ['bool', 'text'=>'string|int'],
'ctype_upper' => ['bool', 'text'=>'string|int'],
'ctype_xdigit' => ['bool', 'text'=>'string|int'],
'cubrid_affected_rows' => ['int', 'req_identifier='=>''],
'cubrid_bind' => ['bool', 'req_identifier'=>'resource', 'bind_param'=>'int', 'bind_value'=>'mixed', 'bind_value_type='=>'string'],
'cubrid_client_encoding' => ['string', 'conn_identifier='=>''],
'cubrid_close' => ['bool', 'conn_identifier='=>''],
'cubrid_close_prepare' => ['bool', 'req_identifier'=>'resource'],
'cubrid_close_request' => ['bool', 'req_identifier'=>'resource'],
'cubrid_col_get' => ['array', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string'],
'cubrid_col_size' => ['int', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string'],
'cubrid_column_names' => ['array', 'req_identifier'=>'resource'],
'cubrid_column_types' => ['array', 'req_identifier'=>'resource'],
'cubrid_commit' => ['bool', 'conn_identifier'=>'resource'],
'cubrid_connect' => ['resource', 'host'=>'string', 'port'=>'int', 'dbname'=>'string', 'userid='=>'string', 'passwd='=>'string'],
'cubrid_connect_with_url' => ['resource', 'conn_url'=>'string', 'userid='=>'string', 'passwd='=>'string'],
'cubrid_current_oid' => ['string', 'req_identifier'=>'resource'],
'cubrid_data_seek' => ['bool', 'req_identifier'=>'', 'row_number'=>'int'],
'cubrid_db_name' => ['string', 'result'=>'array', 'index'=>'int'],
'cubrid_db_parameter' => ['array', 'conn_identifier'=>'resource'],
'cubrid_disconnect' => ['bool', 'conn_identifier'=>'resource'],
'cubrid_drop' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string'],
'cubrid_errno' => ['int', 'conn_identifier='=>''],
'cubrid_error' => ['string', 'connection='=>''],
'cubrid_error_code' => ['int'],
'cubrid_error_code_facility' => ['int'],
'cubrid_error_msg' => ['string'],
'cubrid_execute' => ['bool', 'conn_identifier'=>'', 'sql'=>'string', 'option='=>'int', 'request_identifier='=>''],
'cubrid_fetch' => ['mixed', 'result'=>'resource', 'type='=>'int'],
'cubrid_fetch_array' => ['array', 'result'=>'resource', 'type='=>'int'],
'cubrid_fetch_assoc' => ['array', 'result'=>'resource'],
'cubrid_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'],
'cubrid_fetch_lengths' => ['array', 'result'=>'resource'],
'cubrid_fetch_object' => ['object', 'result'=>'resource', 'class_name='=>'string', 'params='=>'array'],
'cubrid_fetch_row' => ['array', 'result'=>'resource'],
'cubrid_field_flags' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
'cubrid_field_len' => ['int', 'result'=>'resource', 'field_offset'=>'int'],
'cubrid_field_name' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
'cubrid_field_seek' => ['bool', 'result'=>'resource', 'field_offset='=>'int'],
'cubrid_field_table' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
'cubrid_field_type' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
'cubrid_free_result' => ['bool', 'req_identifier'=>'resource'],
'cubrid_get' => ['mixed', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr='=>'mixed'],
'cubrid_get_autocommit' => ['bool', 'conn_identifier'=>'resource'],
'cubrid_get_charset' => ['string', 'conn_identifier'=>'resource'],
'cubrid_get_class_name' => ['string', 'conn_identifier'=>'resource', 'oid'=>'string'],
'cubrid_get_client_info' => ['string'],
'cubrid_get_db_parameter' => ['array', 'conn_identifier'=>'resource'],
'cubrid_get_query_timeout' => ['int', 'req_identifier'=>'resource'],
'cubrid_get_server_info' => ['string', 'conn_identifier'=>'resource'],
'cubrid_insert_id' => ['string', 'conn_identifier='=>'resource'],
'cubrid_is_instance' => ['int', 'conn_identifier'=>'resource', 'oid'=>'string'],
'cubrid_list_dbs' => ['array', 'conn_identifier'=>'resource'],
'cubrid_load_from_glo' => ['int', 'conn_identifier'=>'', 'oid'=>'string', 'file_name'=>'string'],
'cubrid_lob2_bind' => ['bool', 'req_identifier'=>'resource', 'bind_index'=>'int', 'bind_value'=>'mixed', 'bind_value_type='=>'string'],
'cubrid_lob2_close' => ['bool', 'lob_identifier'=>'resource'],
'cubrid_lob2_export' => ['bool', 'lob_identifier'=>'resource', 'file_name'=>'string'],
'cubrid_lob2_import' => ['bool', 'lob_identifier'=>'resource', 'file_name'=>'string'],
'cubrid_lob2_new' => ['resource', 'conn_identifier='=>'resource', 'type='=>'string'],
'cubrid_lob2_read' => ['string', 'lob_identifier'=>'resource', 'length'=>'int'],
'cubrid_lob2_seek' => ['bool', 'lob_identifier'=>'resource', 'offset'=>'int', 'origin='=>'int'],
'cubrid_lob2_seek64' => ['bool', 'lob_identifier'=>'resource', 'offset'=>'string', 'origin='=>'int'],
'cubrid_lob2_size' => ['int', 'lob_identifier'=>'resource'],
'cubrid_lob2_size64' => ['string', 'lob_identifier'=>'resource'],
'cubrid_lob2_tell' => ['int', 'lob_identifier'=>'resource'],
'cubrid_lob2_tell64' => ['string', 'lob_identifier'=>'resource'],
'cubrid_lob2_write' => ['bool', 'lob_identifier'=>'resource', 'buf'=>'string'],
'cubrid_lob_close' => ['bool', 'lob_identifier_array'=>'array'],
'cubrid_lob_export' => ['bool', 'conn_identifier'=>'resource', 'lob_identifier'=>'resource', 'path_name'=>'string'],
'cubrid_lob_get' => ['array', 'conn_identifier'=>'resource', 'sql'=>'string'],
'cubrid_lob_send' => ['bool', 'conn_identifier'=>'resource', 'lob_identifier'=>'resource'],
'cubrid_lob_size' => ['string', 'lob_identifier'=>'resource'],
'cubrid_lock_read' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string'],
'cubrid_lock_write' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string'],
'cubrid_move_cursor' => ['int', 'req_identifier'=>'resource', 'offset'=>'int', 'origin='=>'int'],
'cubrid_new_glo' => ['string', 'conn_identifier'=>'', 'class_name'=>'string', 'file_name'=>'string'],
'cubrid_next_result' => ['bool', 'result'=>'resource'],
'cubrid_num_cols' => ['int', 'req_identifier'=>'resource'],
'cubrid_num_fields' => ['int', 'result'=>'resource'],
'cubrid_num_rows' => ['int', 'req_identifier'=>'resource'],
'cubrid_pconnect' => ['resource', 'host'=>'string', 'port'=>'int', 'dbname'=>'string', 'userid='=>'string', 'passwd='=>'string'],
'cubrid_pconnect_with_url' => ['resource', 'conn_url'=>'string', 'userid='=>'string', 'passwd='=>'string'],
'cubrid_ping' => ['bool', 'conn_identifier='=>''],
'cubrid_prepare' => ['resource', 'conn_identifier'=>'resource', 'prepare_stmt'=>'string', 'option='=>'int'],
'cubrid_put' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr='=>'string', 'value='=>'mixed'],
'cubrid_query' => ['resource', 'query'=>'string', 'conn_identifier='=>''],
'cubrid_real_escape_string' => ['string', 'unescaped_string'=>'string', 'conn_identifier='=>''],
'cubrid_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field='=>''],
'cubrid_rollback' => ['bool', 'conn_identifier'=>'resource'],
'cubrid_save_to_glo' => ['int', 'conn_identifier'=>'', 'oid'=>'string', 'file_name'=>'string'],
'cubrid_schema' => ['array', 'conn_identifier'=>'resource', 'schema_type'=>'int', 'class_name='=>'string', 'attr_name='=>'string'],
'cubrid_send_glo' => ['int', 'conn_identifier'=>'', 'oid'=>'string'],
'cubrid_seq_add' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'seq_element'=>'string'],
'cubrid_seq_drop' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'index'=>'int'],
'cubrid_seq_insert' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'index'=>'int', 'seq_element'=>'string'],
'cubrid_seq_put' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'index'=>'int', 'seq_element'=>'string'],
'cubrid_set_add' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'set_element'=>'string'],
'cubrid_set_autocommit' => ['bool', 'conn_identifier'=>'resource', 'mode'=>'bool'],
'cubrid_set_db_parameter' => ['bool', 'conn_identifier'=>'resource', 'param_type'=>'int', 'param_value'=>'int'],
'cubrid_set_drop' => ['bool', 'conn_identifier'=>'resource', 'oid'=>'string', 'attr_name'=>'string', 'set_element'=>'string'],
'cubrid_set_query_timeout' => ['bool', 'req_identifier'=>'resource', 'timeout'=>'int'],
'cubrid_unbuffered_query' => ['resource', 'query'=>'string', 'conn_identifier='=>''],
'cubrid_version' => ['string'],
'curl_close' => ['void', 'handle'=>'CurlHandle'],
'curl_copy_handle' => ['CurlHandle', 'handle'=>'CurlHandle'],
'curl_errno' => ['int', 'handle'=>'CurlHandle'],
'curl_error' => ['string', 'handle'=>'CurlHandle'],
'curl_escape' => ['string|false', 'handle'=>'CurlHandle', 'string'=>'string'],
'curl_exec' => ['bool|string', 'handle'=>'CurlHandle'],
'curl_file_create' => ['CURLFile', 'filename'=>'string', 'mime_type='=>'string|null', 'posted_filename='=>'string|null'],
'curl_getinfo' => ['mixed', 'handle'=>'CurlHandle', 'option='=>'int'],
'curl_init' => ['CurlHandle|false', 'url='=>'string'],
'curl_multi_add_handle' => ['int', 'multi_handle'=>'CurlMultiHandle', 'handle'=>'CurlHandle'],
'curl_multi_close' => ['void', 'multi_handle'=>'CurlMultiHandle'],
'curl_multi_errno' => ['int', 'multi_handle'=>'CurlMultiHandle'],
'curl_multi_exec' => ['int', 'multi_handle'=>'CurlMultiHandle', '&w_still_running'=>'int'],
'curl_multi_getcontent' => ['string', 'handle'=>'CurlHandle'],
'curl_multi_info_read' => ['array|false', 'multi_handle'=>'CurlMultiHandle', '&w_queued_messages='=>'int'],
'curl_multi_init' => ['CurlMultiHandle|false'],
'curl_multi_remove_handle' => ['int', 'multi_handle'=>'CurlMultiHandle', 'handle'=>'CurlHandle'],
'curl_multi_select' => ['int', 'multi_handle'=>'CurlMultiHandle', 'timeout='=>'float'],
'curl_multi_setopt' => ['bool', 'multi_handle'=>'CurlMultiHandle', 'option'=>'int', 'value'=>'mixed'],
'curl_multi_strerror' => ['?string', 'error_code'=>'int'],
'curl_pause' => ['int', 'handle'=>'CurlHandle', 'flags'=>'int'],
'curl_reset' => ['void', 'handle'=>'CurlHandle'],
'curl_setopt' => ['bool', 'handle'=>'CurlHandle', 'option'=>'int', 'value'=>'callable|mixed'],
'curl_setopt_array' => ['bool', 'handle'=>'CurlHandle', 'options'=>'array'],
'curl_share_close' => ['void', 'share_handle'=>'CurlShareHandle'],
'curl_share_errno' => ['int', 'share_handle'=>'CurlShareHandle'],
'curl_share_init' => ['CurlShareHandle'],
'curl_share_setopt' => ['bool', 'share_handle'=>'CurlShareHandle', 'option'=>'int', 'value'=>'mixed'],
'curl_share_strerror' => ['?string', 'error_code'=>'int'],
'curl_strerror' => ['?string', 'error_code'=>'int'],
'curl_unescape' => ['string|false', 'handle'=>'CurlShareHandle', 'string'=>'string'],
'curl_version' => ['array', 'version='=>'int'],
'CURLFile::__construct' => ['void', 'filename'=>'string', 'mimetype='=>'string', 'postfilename='=>'string'],
'CURLFile::__wakeup' => ['void'],
'CURLFile::getFilename' => ['string'],
'CURLFile::getMimeType' => ['string'],
'CURLFile::getPostFilename' => ['string'],
'CURLFile::setMimeType' => ['void', 'mime'=>'string'],
'CURLFile::setPostFilename' => ['void', 'name'=>'string'],
'CURLStringFile::__construct' => ['void', 'data'=>'string', 'postname'=>'string', 'mime='=>'string'],
'current' => ['mixed|false', 'array'=>'array|object'],
'cyrus_authenticate' => ['void', 'connection'=>'resource', 'mechlist='=>'string', 'service='=>'string', 'user='=>'string', 'minssf='=>'int', 'maxssf='=>'int', 'authname='=>'string', 'password='=>'string'],
'cyrus_bind' => ['bool', 'connection'=>'resource', 'callbacks'=>'array'],
'cyrus_close' => ['bool', 'connection'=>'resource'],
'cyrus_connect' => ['resource', 'host='=>'string', 'port='=>'string', 'flags='=>'int'],
'cyrus_query' => ['array', 'connection'=>'resource', 'query'=>'string'],
'cyrus_unbind' => ['bool', 'connection'=>'resource', 'trigger_name'=>'string'],
'date' => ['string', 'format'=>'string', 'timestamp='=>'?int'],
'date_add' => ['DateTime|false', 'object'=>'DateTime', 'interval'=>'DateInterval'],
'date_create' => ['DateTime|false', 'datetime='=>'string', 'timezone='=>'?DateTimeZone'],
'date_create_from_format' => ['DateTime|false', 'format'=>'string', 'datetime'=>'string', 'timezone='=>'?\DateTimeZone'],
'date_create_immutable' => ['DateTimeImmutable|false', 'datetime='=>'string', 'timezone='=>'?DateTimeZone'],
'date_create_immutable_from_format' => ['DateTimeImmutable|false', 'format'=>'string', 'datetime'=>'string', 'timezone='=>'?DateTimeZone'],
'date_date_set' => ['DateTime|false', 'object'=>'DateTime', 'year'=>'int', 'month'=>'int', 'day'=>'int'],
'date_default_timezone_get' => ['string'],
'date_default_timezone_set' => ['bool', 'timezoneId'=>'string'],
'date_diff' => ['DateInterval|false', 'baseObject'=>'DateTimeInterface', 'targetObject'=>'DateTimeInterface', 'absolute='=>'bool'],
'date_format' => ['string', 'object'=>'DateTimeInterface', 'format'=>'string'],
'date_get_last_errors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
'date_interval_create_from_date_string' => ['DateInterval', 'datetime'=>'string'],
'date_interval_format' => ['string', 'object'=>'DateInterval', 'format'=>'string'],
'date_isodate_set' => ['DateTime|false', 'object'=>'DateTime', 'year'=>'int', 'week'=>'int', 'dayOfWeek='=>'int|mixed'],
'date_modify' => ['DateTime|false', 'object'=>'DateTime', 'modifier'=>'string'],
'date_offset_get' => ['int|false', 'object'=>'DateTimeInterface'],
'date_parse' => ['array|false', 'datetime'=>'string'],
'date_parse_from_format' => ['array', 'format'=>'string', 'datetime'=>'string'],
'date_sub' => ['DateTime|false', 'object'=>'DateTime', 'interval'=>'DateInterval'],
'date_sun_info' => ['array|false', 'timestamp'=>'int', 'latitude'=>'float', 'longitude'=>'float'],
'date_sunrise' => ['mixed', 'timestamp'=>'int', 'returnFormat='=>'int', 'latitude='=>'float', 'longitude='=>'float', 'zenith='=>'float', 'utcOffset='=>'float'],
'date_sunset' => ['mixed', 'timestamp'=>'int', 'returnFormat='=>'int', 'latitude='=>'float', 'longitude='=>'float', 'zenith='=>'float', 'utcOffset='=>'float'],
'date_time_set' => ['DateTime|false', 'object'=>'', 'hour'=>'', 'minute'=>'', 'second='=>'', 'microsecond='=>''],
'date_timestamp_get' => ['int', 'object'=>'DateTimeInterface'],
'date_timestamp_set' => ['DateTime|false', 'object'=>'DateTime', 'timestamp'=>'int'],
'date_timezone_get' => ['DateTimeZone|false', 'object'=>'DateTimeInterface'],
'date_timezone_set' => ['DateTime|false', 'object'=>'DateTime', 'timezone'=>'DateTimeZone'],
'datefmt_create' => ['IntlDateFormatter|false', 'locale'=>'?string', 'dateType'=>'?int', 'timeType'=>'?int', 'timezone='=>'string|DateTimeZone|IntlTimeZone|null', 'calendar='=>'int|IntlCalendar|null', 'pattern='=>'string'],
'datefmt_format' => ['string|false', 'formatter'=>'IntlDateFormatter', 'datetime'=>'DateTime|IntlCalendar|array|int'],
'datefmt_format_object' => ['string|false', 'datetime'=>'object', 'format='=>'mixed', 'locale='=>'string'],
'datefmt_get_calendar' => ['int', 'formatter'=>'IntlDateFormatter'],
'datefmt_get_calendar_object' => ['IntlCalendar', 'formatter'=>'IntlDateFormatter'],
'datefmt_get_datetype' => ['int', 'formatter'=>'IntlDateFormatter'],
'datefmt_get_error_code' => ['int', 'formatter'=>'IntlDateFormatter'],
'datefmt_get_error_message' => ['string', 'formatter'=>'IntlDateFormatter'],
'datefmt_get_locale' => ['string|false', 'formatter'=>'IntlDateFormatter', 'type='=>'int'],
'datefmt_get_pattern' => ['string', 'formatter'=>'IntlDateFormatter'],
'datefmt_get_timetype' => ['int', 'formatter'=>'IntlDateFormatter'],
'datefmt_get_timezone' => ['IntlTimeZone|false'],
'datefmt_get_timezone_id' => ['string', 'formatter'=>'IntlDateFormatter'],
'datefmt_is_lenient' => ['bool', 'formatter'=>'IntlDateFormatter'],
'datefmt_localtime' => ['array|false', 'formatter'=>'IntlDateFormatter', 'string='=>'string', '&rw_offset='=>'int'],
'datefmt_parse' => ['int|false', 'formatter'=>'IntlDateFormatter', 'string='=>'string', '&rw_offset='=>'int'],
'datefmt_set_calendar' => ['bool', 'formatter'=>'IntlDateFormatter', 'calendar'=>'int'],
'datefmt_set_lenient' => ['?bool', 'formatter'=>'IntlDateFormatter', 'lenient'=>'bool'],
'datefmt_set_pattern' => ['bool', 'formatter'=>'IntlDateFormatter', 'pattern'=>'string'],
'datefmt_set_timezone' => ['bool', 'formatter'=>'mixed'],
'datefmt_set_timezone_id' => ['bool', 'fmt'=>'IntlDateFormatter', 'zone'=>'string'],
'DateInterval::__construct' => ['void', 'spec'=>'string'],
'DateInterval::__set_state' => ['DateInterval', 'array'=>'array'],
'DateInterval::__wakeup' => ['void'],
'DateInterval::createFromDateString' => ['DateInterval', 'time'=>'string'],
'DateInterval::format' => ['string', 'format'=>'string'],
'DatePeriod::__construct' => ['void', 'start'=>'DateTimeInterface', 'interval'=>'DateInterval', 'recur'=>'int', 'options='=>'int'],
'DatePeriod::__construct\'1' => ['void', 'start'=>'DateTimeInterface', 'interval'=>'DateInterval', 'end'=>'DateTimeInterface', 'options='=>'int'],
'DatePeriod::__construct\'2' => ['void', 'iso'=>'string', 'options='=>'int'],
'DatePeriod::__wakeup' => ['void'],
'DatePeriod::getDateInterval' => ['DateInterval'],
'DatePeriod::getEndDate' => ['?DateTimeInterface'],
'DatePeriod::getStartDate' => ['DateTimeInterface'],
'DateTime::__construct' => ['void', 'time='=>'string'],
'DateTime::__construct\'1' => ['void', 'time'=>'?string', 'timezone'=>'?DateTimeZone'],
'DateTime::__set_state' => ['static', 'array'=>'array'],
'DateTime::__wakeup' => ['void'],
'DateTime::add' => ['static', 'interval'=>'DateInterval'],
'DateTime::createFromFormat' => ['static|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'?DateTimeZone'],
'DateTime::createFromImmutable' => ['static', 'object'=>'DateTimeImmutable'],
'DateTime::createFromInterface' => ['self', 'object' => 'DateTimeInterface'],
'DateTime::diff' => ['DateInterval|false', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTime::format' => ['string', 'format'=>'string'],
'DateTime::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
'DateTime::getOffset' => ['int'],
'DateTime::getTimestamp' => ['int|false'],
'DateTime::getTimezone' => ['DateTimeZone|false'],
'DateTime::modify' => ['static|false', 'modify'=>'string'],
'DateTime::setDate' => ['static', 'year'=>'int', 'month'=>'int', 'day'=>'int'],
'DateTime::setISODate' => ['static', 'year'=>'int', 'week'=>'int', 'day='=>'int'],
'DateTime::setTime' => ['static|false', 'hour'=>'int', 'minute'=>'int', 'second='=>'int', 'microseconds='=>'int'],
'DateTime::setTimestamp' => ['static', 'unixtimestamp'=>'int'],
'DateTime::setTimezone' => ['static', 'timezone'=>'DateTimeZone'],
'DateTime::sub' => ['static', 'interval'=>'DateInterval'],
'DateTimeImmutable::__construct' => ['void', 'time='=>'string'],
'DateTimeImmutable::__construct\'1' => ['void', 'time'=>'?string', 'timezone'=>'?DateTimeZone'],
'DateTimeImmutable::__set_state' => ['static', 'array'=>'array'],
'DateTimeImmutable::__wakeup' => ['void'],
'DateTimeImmutable::add' => ['static', 'interval'=>'DateInterval'],
'DateTimeImmutable::createFromFormat' => ['static|false', 'format'=>'string', 'time'=>'string', 'timezone='=>'?DateTimeZone'],
'DateTimeImmutable::createFromInterface' => ['self', 'object' => 'DateTimeInterface'],
'DateTimeImmutable::createFromMutable' => ['static', 'datetime'=>'DateTime'],
'DateTimeImmutable::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTimeImmutable::format' => ['string', 'format'=>'string'],
'DateTimeImmutable::getLastErrors' => ['array{warning_count:int,warnings:array<int,string>,error_count:int,errors:array<int,string>}'],
'DateTimeImmutable::getOffset' => ['int'],
'DateTimeImmutable::getTimestamp' => ['int|false'],
'DateTimeImmutable::getTimezone' => ['DateTimeZone|false'],
'DateTimeImmutable::modify' => ['static', 'modify'=>'string'],
'DateTimeImmutable::setDate' => ['static|false', 'year'=>'int', 'month'=>'int', 'day'=>'int'],
'DateTimeImmutable::setISODate' => ['static|false', 'year'=>'int', 'week'=>'int', 'day='=>'int'],
'DateTimeImmutable::setTime' => ['static|false', 'hour'=>'int', 'minute'=>'int', 'second='=>'int', 'microseconds='=>'int'],
'DateTimeImmutable::setTimestamp' => ['static|false', 'unixtimestamp'=>'int'],
'DateTimeImmutable::setTimezone' => ['static|false', 'timezone'=>'DateTimeZone'],
'DateTimeImmutable::sub' => ['static|false', 'interval'=>'DateInterval'],
'DateTimeInterface::diff' => ['DateInterval', 'datetime2'=>'DateTimeInterface', 'absolute='=>'bool'],
'DateTimeInterface::format' => ['string', 'format'=>'string'],
'DateTimeInterface::getOffset' => ['int'],
'DateTimeInterface::getTimestamp' => ['int|false'],
'DateTimeInterface::getTimezone' => ['DateTimeZone|false'],
'DateTimeZone::__construct' => ['void', 'timezone'=>'string'],
'DateTimeZone::__set_state' => ['DateTimeZone', 'array'=>'array'],
'DateTimeZone::__wakeup' => ['void'],
'DateTimeZone::getLocation' => ['array|false'],
'DateTimeZone::getName' => ['string'],
'DateTimeZone::getOffset' => ['int|false', 'datetime'=>'DateTimeInterface'],
'DateTimeZone::getTransitions' => ['list<array{ts: int, time: string, offset: int, isdst: bool, abbr: string}>|false', 'timestamp_begin='=>'int', 'timestamp_end='=>'int'],
'DateTimeZone::listAbbreviations' => ['array<string, list<array{dst: bool, offset: int, timezone_id: string|null}>>|false'],
'DateTimeZone::listIdentifiers' => ['list<string>', 'timezoneGroup='=>'int', 'countryCode='=>'string|null'],
'db2_autocommit' => ['mixed', 'connection'=>'resource', 'value='=>'int'],
'db2_bind_param' => ['bool', 'stmt'=>'resource', 'parameter_number'=>'int', 'variable_name'=>'string', 'parameter_type='=>'int', 'data_type='=>'int', 'precision='=>'int', 'scale='=>'int'],
'db2_client_info' => ['object|false', 'connection'=>'resource'],
'db2_close' => ['bool', 'connection'=>'resource'],
'db2_column_privileges' => ['resource|false', 'connection'=>'resource', 'qualifier='=>'string', 'schema='=>'string', 'table_name='=>'string', 'column_name='=>'string'],
'db2_columns' => ['resource|false', 'connection'=>'resource', 'qualifier='=>'string', 'schema='=>'string', 'table_name='=>'string', 'column_name='=>'string'],
'db2_commit' => ['bool', 'connection'=>'resource'],
'db2_conn_error' => ['string', 'connection='=>'resource'],
'db2_conn_errormsg' => ['string', 'connection='=>'resource'],
'db2_connect' => ['resource|false', 'database'=>'string', 'username'=>'string', 'password'=>'string', 'options='=>'array'],
'db2_cursor_type' => ['int', 'stmt'=>'resource'],
'db2_escape_string' => ['string', 'string_literal'=>'string'],
'db2_exec' => ['resource|false', 'connection'=>'resource', 'statement'=>'string', 'options='=>'array'],
'db2_execute' => ['bool', 'stmt'=>'resource', 'parameters='=>'array'],
'db2_fetch_array' => ['array|false', 'stmt'=>'resource', 'row_number='=>'int'],
'db2_fetch_assoc' => ['array|false', 'stmt'=>'resource', 'row_number='=>'int'],
'db2_fetch_both' => ['array|false', 'stmt'=>'resource', 'row_number='=>'int'],
'db2_fetch_object' => ['object|false', 'stmt'=>'resource', 'row_number='=>'int'],
'db2_fetch_row' => ['bool', 'stmt'=>'resource', 'row_number='=>'int'],
'db2_field_display_size' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'],
'db2_field_name' => ['string|false', 'stmt'=>'resource', 'column'=>'mixed'],
'db2_field_num' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'],
'db2_field_precision' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'],
'db2_field_scale' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'],
'db2_field_type' => ['string|false', 'stmt'=>'resource', 'column'=>'mixed'],
'db2_field_width' => ['int|false', 'stmt'=>'resource', 'column'=>'mixed'],
'db2_foreign_keys' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'table_name'=>'string'],
'db2_free_result' => ['bool', 'stmt'=>'resource'],
'db2_free_stmt' => ['bool', 'stmt'=>'resource'],
'db2_get_option' => ['string|false', 'resource'=>'resource', 'option'=>'string'],
'db2_last_insert_id' => ['string', 'resource'=>'resource'],
'db2_lob_read' => ['string|false', 'stmt'=>'resource', 'colnum'=>'int', 'length'=>'int'],
'db2_next_result' => ['resource|false', 'stmt'=>'resource'],
'db2_num_fields' => ['int|false', 'stmt'=>'resource'],
'db2_num_rows' => ['int', 'stmt'=>'resource'],
'db2_pclose' => ['bool', 'resource'=>'resource'],
'db2_pconnect' => ['resource|false', 'database'=>'string', 'username'=>'string', 'password'=>'string', 'options='=>'array'],
'db2_prepare' => ['resource|false', 'connection'=>'resource', 'statement'=>'string', 'options='=>'array'],
'db2_primary_keys' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'table_name'=>'string'],
'db2_primarykeys' => [''],
'db2_procedure_columns' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'procedure'=>'string', 'parameter'=>'string'],
'db2_procedurecolumns' => [''],
'db2_procedures' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'procedure'=>'string'],
'db2_result' => ['mixed', 'stmt'=>'resource', 'column'=>'mixed'],
'db2_rollback' => ['bool', 'connection'=>'resource'],
'db2_server_info' => ['object|false', 'connection'=>'resource'],
'db2_set_option' => ['bool', 'resource'=>'resource', 'options'=>'array', 'type'=>'int'],
'db2_setoption' => [''],
'db2_special_columns' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'table_name'=>'string', 'scope'=>'int'],
'db2_specialcolumns' => [''],
'db2_statistics' => ['resource|false', 'connection'=>'resource', 'qualifier'=>'string', 'schema'=>'string', 'table_name'=>'string', 'unique'=>'bool'],
'db2_stmt_error' => ['string', 'stmt='=>'resource'],
'db2_stmt_errormsg' => ['string', 'stmt='=>'resource'],
'db2_table_privileges' => ['resource|false', 'connection'=>'resource', 'qualifier='=>'string', 'schema='=>'string', 'table_name='=>'string'],
'db2_tableprivileges' => [''],
'db2_tables' => ['resource|false', 'connection'=>'resource', 'qualifier='=>'string', 'schema='=>'string', 'table_name='=>'string', 'table_type='=>'string'],
'dba_close' => ['void', 'dba'=>'resource'],
'dba_delete' => ['bool', 'key'=>'string', 'dba'=>'resource'],
'dba_exists' => ['bool', 'key'=>'string', 'dba'=>'resource'],
'dba_fetch' => ['string|false', 'key'=>'string', 'skip'=>'int', 'dba'=>'resource'],
'dba_fetch\'1' => ['string|false', 'key'=>'string', 'skip'=>'resource'],
'dba_firstkey' => ['string', 'dba'=>'resource'],
'dba_handlers' => ['array', 'full_info='=>'bool'],
'dba_insert' => ['bool', 'key'=>'string', 'value'=>'string', 'dba'=>'resource'],
'dba_key_split' => ['array|false', 'key'=>'string'],
'dba_list' => ['array'],
'dba_nextkey' => ['string', 'dba'=>'resource'],
'dba_open' => ['resource', 'path'=>'string', 'mode'=>'string', 'handler='=>'string', '...handler_params='=>'string'],
'dba_optimize' => ['bool', 'dba'=>'resource'],
'dba_popen' => ['resource', 'path'=>'string', 'mode'=>'string', 'handler='=>'string', '...handler_params='=>'string'],
'dba_replace' => ['bool', 'key'=>'string', 'value'=>'string', 'dba'=>'resource'],
'dba_sync' => ['bool', 'dba'=>'resource'],
'dbase_add_record' => ['bool', 'dbase_identifier'=>'resource', 'record'=>'array'],
'dbase_close' => ['bool', 'dbase_identifier'=>'resource'],
'dbase_create' => ['resource|false', 'filename'=>'string', 'fields'=>'array'],
'dbase_delete_record' => ['bool', 'dbase_identifier'=>'resource', 'record_number'=>'int'],
'dbase_get_header_info' => ['array', 'dbase_identifier'=>'resource'],
'dbase_get_record' => ['array', 'dbase_identifier'=>'resource', 'record_number'=>'int'],
'dbase_get_record_with_names' => ['array', 'dbase_identifier'=>'resource', 'record_number'=>'int'],
'dbase_numfields' => ['int', 'dbase_identifier'=>'resource'],
'dbase_numrecords' => ['int', 'dbase_identifier'=>'resource'],
'dbase_open' => ['resource|false', 'filename'=>'string', 'mode'=>'int'],
'dbase_pack' => ['bool', 'dbase_identifier'=>'resource'],
'dbase_replace_record' => ['bool', 'dbase_identifier'=>'resource', 'record'=>'array', 'record_number'=>'int'],
'dbplus_add' => ['int', 'relation'=>'resource', 'tuple'=>'array'],
'dbplus_aql' => ['resource', 'query'=>'string', 'server='=>'string', 'dbpath='=>'string'],
'dbplus_chdir' => ['string', 'newdir='=>'string'],
'dbplus_close' => ['mixed', 'relation'=>'resource'],
'dbplus_curr' => ['int', 'relation'=>'resource', 'tuple'=>'array'],
'dbplus_errcode' => ['string', 'errno='=>'int'],
'dbplus_errno' => ['int'],
'dbplus_find' => ['int', 'relation'=>'resource', 'constraints'=>'array', 'tuple'=>'mixed'],
'dbplus_first' => ['int', 'relation'=>'resource', 'tuple'=>'array'],
'dbplus_flush' => ['int', 'relation'=>'resource'],
'dbplus_freealllocks' => ['int'],
'dbplus_freelock' => ['int', 'relation'=>'resource', 'tuple'=>'string'],
'dbplus_freerlocks' => ['int', 'relation'=>'resource'],
'dbplus_getlock' => ['int', 'relation'=>'resource', 'tuple'=>'string'],
'dbplus_getunique' => ['int', 'relation'=>'resource', 'uniqueid'=>'int'],
'dbplus_info' => ['int', 'relation'=>'resource', 'key'=>'string', 'result'=>'array'],
'dbplus_last' => ['int', 'relation'=>'resource', 'tuple'=>'array'],
'dbplus_lockrel' => ['int', 'relation'=>'resource'],
'dbplus_next' => ['int', 'relation'=>'resource', 'tuple'=>'array'],
'dbplus_open' => ['resource', 'name'=>'string'],
'dbplus_prev' => ['int', 'relation'=>'resource', 'tuple'=>'array'],
'dbplus_rchperm' => ['int', 'relation'=>'resource', 'mask'=>'int', 'user'=>'string', 'group'=>'string'],
'dbplus_rcreate' => ['resource', 'name'=>'string', 'domlist'=>'mixed', 'overwrite='=>'bool'],
'dbplus_rcrtexact' => ['mixed', 'name'=>'string', 'relation'=>'resource', 'overwrite='=>'bool'],
'dbplus_rcrtlike' => ['mixed', 'name'=>'string', 'relation'=>'resource', 'overwrite='=>'int'],
'dbplus_resolve' => ['array', 'relation_name'=>'string'],
'dbplus_restorepos' => ['int', 'relation'=>'resource', 'tuple'=>'array'],
'dbplus_rkeys' => ['mixed', 'relation'=>'resource', 'domlist'=>'mixed'],
'dbplus_ropen' => ['resource', 'name'=>'string'],
'dbplus_rquery' => ['resource', 'query'=>'string', 'dbpath='=>'string'],
'dbplus_rrename' => ['int', 'relation'=>'resource', 'name'=>'string'],
'dbplus_rsecindex' => ['mixed', 'relation'=>'resource', 'domlist'=>'mixed', 'type'=>'int'],
'dbplus_runlink' => ['int', 'relation'=>'resource'],
'dbplus_rzap' => ['int', 'relation'=>'resource'],
'dbplus_savepos' => ['int', 'relation'=>'resource'],
'dbplus_setindex' => ['int', 'relation'=>'resource', 'idx_name'=>'string'],
'dbplus_setindexbynumber' => ['int', 'relation'=>'resource', 'idx_number'=>'int'],
'dbplus_sql' => ['resource', 'query'=>'string', 'server='=>'string', 'dbpath='=>'string'],
'dbplus_tcl' => ['string', 'sid'=>'int', 'script'=>'string'],
'dbplus_tremove' => ['int', 'relation'=>'resource', 'tuple'=>'array', 'current='=>'array'],
'dbplus_undo' => ['int', 'relation'=>'resource'],
'dbplus_undoprepare' => ['int', 'relation'=>'resource'],
'dbplus_unlockrel' => ['int', 'relation'=>'resource'],
'dbplus_unselect' => ['int', 'relation'=>'resource'],
'dbplus_update' => ['int', 'relation'=>'resource', 'old'=>'array', 'new'=>'array'],
'dbplus_xlockrel' => ['int', 'relation'=>'resource'],
'dbplus_xunlockrel' => ['int', 'relation'=>'resource'],
'dbx_close' => ['int', 'link_identifier'=>'object'],
'dbx_compare' => ['int', 'row_a'=>'array', 'row_b'=>'array', 'column_key'=>'string', 'flags='=>'int'],
'dbx_connect' => ['object', 'module'=>'mixed', 'host'=>'string', 'database'=>'string', 'username'=>'string', 'password'=>'string', 'persistent='=>'int'],
'dbx_error' => ['string', 'link_identifier'=>'object'],
'dbx_escape_string' => ['string', 'link_identifier'=>'object', 'text'=>'string'],
'dbx_fetch_row' => ['mixed', 'result_identifier'=>'object'],
'dbx_query' => ['mixed', 'link_identifier'=>'object', 'sql_statement'=>'string', 'flags='=>'int'],
'dbx_sort' => ['bool', 'result'=>'object', 'user_compare_function'=>'string'],
'dcgettext' => ['string', 'domain'=>'string', 'message'=>'string', 'category'=>'int'],
'dcngettext' => ['string', 'domain'=>'string', 'singular'=>'string', 'plural'=>'string', 'count'=>'int', 'category'=>'int'],
'deaggregate' => ['', 'object'=>'object', 'class_name='=>'string'],
'debug_backtrace' => ['list<array{file:string,line:int,function:string,class?:class-string,object?:object,type?:string,args?:list}>', 'options='=>'int', 'limit='=>'int'],
'debug_print_backtrace' => ['void', 'options='=>'int', 'limit='=>'int'],
'debug_zval_dump' => ['void', '...value'=>'mixed'],
'debugger_connect' => [''],
'debugger_connector_pid' => [''],
'debugger_get_server_start_time' => [''],
'debugger_print' => [''],
'debugger_start_debug' => [''],
'decbin' => ['string', 'num'=>'int'],
'dechex' => ['string', 'num'=>'int'],
'decoct' => ['string', 'num'=>'int'],
'define' => ['bool', 'constant_name'=>'string', 'value'=>'mixed', 'case_insensitive='=>'bool'],
'define_syslog_variables' => ['void'],
'defined' => ['bool', 'constant_name'=>'string'],
'deflate_add' => ['string|false', 'context'=>'resource', 'data'=>'string', 'flush_mode='=>'int'],
'deflate_init' => ['resource|false', 'encoding'=>'int', 'options='=>'array'],
'deg2rad' => ['float', 'num'=>'float'],
'dgettext' => ['string', 'domain'=>'string', 'message'=>'string'],
'dio_close' => ['void', 'fd'=>'resource'],
'dio_fcntl' => ['mixed', 'fd'=>'resource', 'cmd'=>'int', 'args='=>'mixed'],
'dio_open' => ['resource|false', 'filename'=>'string', 'flags'=>'int', 'mode='=>'int'],
'dio_read' => ['string', 'fd'=>'resource', 'length='=>'int'],
'dio_seek' => ['int', 'fd'=>'resource', 'pos'=>'int', 'whence='=>'int'],
'dio_stat' => ['?array', 'fd'=>'resource'],
'dio_tcsetattr' => ['bool', 'fd'=>'resource', 'options'=>'array'],
'dio_truncate' => ['bool', 'fd'=>'resource', 'offset'=>'int'],
'dio_write' => ['int', 'fd'=>'resource', 'data'=>'string', 'length='=>'int'],
'dir' => ['Directory|false|null', 'directory'=>'string', 'context='=>'resource'],
'Directory::close' => ['void', 'dir_handle='=>'resource'],
'Directory::read' => ['string|false', 'dir_handle='=>'resource'],
'Directory::rewind' => ['void', 'dir_handle='=>'resource'],
'DirectoryIterator::__construct' => ['void', 'path'=>'string'],
'DirectoryIterator::__toString' => ['string'],
'DirectoryIterator::current' => ['DirectoryIterator'],
'DirectoryIterator::getATime' => ['int'],
'DirectoryIterator::getBasename' => ['string', 'suffix='=>'string'],
'DirectoryIterator::getCTime' => ['int'],
'DirectoryIterator::getExtension' => ['string'],
'DirectoryIterator::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'DirectoryIterator::getFilename' => ['string'],
'DirectoryIterator::getGroup' => ['int'],
'DirectoryIterator::getInode' => ['int'],
'DirectoryIterator::getLinkTarget' => ['string'],
'DirectoryIterator::getMTime' => ['int'],
'DirectoryIterator::getOwner' => ['int'],
'DirectoryIterator::getPath' => ['string'],
'DirectoryIterator::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'DirectoryIterator::getPathname' => ['string'],
'DirectoryIterator::getPerms' => ['int'],
'DirectoryIterator::getRealPath' => ['string'],
'DirectoryIterator::getSize' => ['int'],
'DirectoryIterator::getType' => ['string'],
'DirectoryIterator::isDir' => ['bool'],
'DirectoryIterator::isDot' => ['bool'],
'DirectoryIterator::isExecutable' => ['bool'],
'DirectoryIterator::isFile' => ['bool'],
'DirectoryIterator::isLink' => ['bool'],
'DirectoryIterator::isReadable' => ['bool'],
'DirectoryIterator::isWritable' => ['bool'],
'DirectoryIterator::key' => ['string'],
'DirectoryIterator::next' => ['void'],
'DirectoryIterator::openFile' => ['SplFileObject', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
'DirectoryIterator::rewind' => ['void'],
'DirectoryIterator::seek' => ['void', 'position'=>'int'],
'DirectoryIterator::setFileClass' => ['void', 'class_name='=>'string'],
'DirectoryIterator::setInfoClass' => ['void', 'class_name='=>'string'],
'DirectoryIterator::valid' => ['bool'],
'dirname' => ['string', 'path'=>'string', 'levels='=>'int'],
'disk_free_space' => ['float|false', 'directory'=>'string'],
'disk_total_space' => ['float|false', 'directory'=>'string'],
'diskfreespace' => ['float|false', 'directory'=>'string'],
'display_disabled_function' => [''],
'dl' => ['bool', 'extension_filename'=>'string'],
'dngettext' => ['string', 'domain'=>'string', 'singular'=>'string', 'plural'=>'string', 'count'=>'int'],
'dns_check_record' => ['bool', 'hostname'=>'string', 'type='=>'string'],
'dns_get_mx' => ['bool', 'hostname'=>'string', '&w_hosts'=>'array', '&w_weights'=>'array'],
'dns_get_record' => ['list<array>|false', 'hostname'=>'string', 'type='=>'int', '&w_authoritative_name_servers='=>'array', '&w_additional_records='=>'array', 'raw='=>'bool'],
'dom_document_relaxNG_validate_file' => ['bool', 'filename'=>'string'],
'dom_document_relaxNG_validate_xml' => ['bool', 'source'=>'string'],
'dom_document_schema_validate' => ['bool', 'source'=>'string', 'flags'=>'int'],
'dom_document_schema_validate_file' => ['bool', 'filename'=>'string', 'flags'=>'int'],
'dom_document_xinclude' => ['int', 'options'=>'int'],
'dom_import_simplexml' => ['DOMElement|false', 'node'=>'SimpleXMLElement'],
'dom_xpath_evaluate' => ['', 'expr'=>'string', 'context'=>'DOMNode', 'registernodens'=>'bool'],
'dom_xpath_query' => ['DOMNodeList', 'expr'=>'string', 'context'=>'DOMNode', 'registernodens'=>'bool'],
'dom_xpath_register_ns' => ['bool', 'prefix'=>'string', 'uri'=>'string'],
'dom_xpath_register_php_functions' => [''],
'DomainException::__clone' => ['void'],
'DomainException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?DomainException'],
'DomainException::__toString' => ['string'],
'DomainException::__wakeup' => ['void'],
'DomainException::getCode' => ['int'],
'DomainException::getFile' => ['string'],
'DomainException::getLine' => ['int'],
'DomainException::getMessage' => ['string'],
'DomainException::getPrevious' => ['Throwable|DomainException|null'],
'DomainException::getTrace' => ['list<array<string,mixed>>'],
'DomainException::getTraceAsString' => ['string'],
'DOMAttr::__construct' => ['void', 'name'=>'string', 'value='=>'string'],
'DOMAttr::getLineNo' => ['int'],
'DOMAttr::getNodePath' => ['?string'],
'DOMAttr::hasAttributes' => ['bool'],
'DOMAttr::hasChildNodes' => ['bool'],
'DOMAttr::insertBefore' => ['DOMNode', 'newnode'=>'DOMNode', 'refnode='=>'DOMNode'],
'DOMAttr::isDefaultNamespace' => ['bool', 'namespaceuri'=>'string'],
'DOMAttr::isId' => ['bool'],
'DOMAttr::isSameNode' => ['bool', 'node'=>'DOMNode'],
'DOMAttr::isSupported' => ['bool', 'feature'=>'string', 'version'=>'string'],
'DOMAttr::lookupNamespaceUri' => ['string', 'prefix'=>'string'],
'DOMAttr::lookupPrefix' => ['string', 'namespaceuri'=>'string'],
'DOMAttr::normalize' => ['void'],
'DOMAttr::removeChild' => ['DOMNode', 'oldnode'=>'DOMNode'],
'DOMAttr::replaceChild' => ['DOMNode', 'newnode'=>'DOMNode', 'oldnode'=>'DOMNode'],
'DomAttribute::name' => ['string'],
'DomAttribute::set_value' => ['bool', 'content'=>'string'],
'DomAttribute::specified' => ['bool'],
'DomAttribute::value' => ['string'],
'DOMCdataSection::__construct' => ['void', 'value'=>'string'],
'DOMCharacterData::appendData' => ['void', 'data'=>'string'],
'DOMCharacterData::deleteData' => ['void', 'offset'=>'int', 'count'=>'int'],
'DOMCharacterData::insertData' => ['void', 'offset'=>'int', 'data'=>'string'],
'DOMCharacterData::replaceData' => ['void', 'offset'=>'int', 'count'=>'int', 'data'=>'string'],
'DOMCharacterData::substringData' => ['string', 'offset'=>'int', 'count'=>'int'],
'DOMComment::__construct' => ['void', 'value='=>'string'],
'DOMDocument::__construct' => ['void', 'version='=>'string', 'encoding='=>'string'],
'DOMDocument::createAttribute' => ['DOMAttr|false', 'name'=>'string'],
'DOMDocument::createAttributeNS' => ['DOMAttr|false', 'namespaceuri'=>'string', 'qualifiedname'=>'string'],
'DOMDocument::createCDATASection' => ['DOMCDATASection|false', 'data'=>'string'],
'DOMDocument::createComment' => ['DOMComment|false', 'data'=>'string'],
'DOMDocument::createDocumentFragment' => ['DOMDocumentFragment|false'],
'DOMDocument::createElement' => ['DOMElement|false', 'name'=>'string', 'value='=>'string'],
'DOMDocument::createElementNS' => ['DOMElement|false', 'namespaceuri'=>'string', 'qualifiedname'=>'string', 'value='=>'string'],
'DOMDocument::createEntityReference' => ['DOMEntityReference|false', 'name'=>'string'],
'DOMDocument::createProcessingInstruction' => ['DOMProcessingInstruction|false', 'target'=>'string', 'data='=>'string'],
'DOMDocument::createTextNode' => ['DOMText|false', 'content'=>'string'],
'DOMDocument::getElementById' => ['?DOMElement', 'elementid'=>'string'],
'DOMDocument::getElementsByTagName' => ['DOMNodeList', 'name'=>'string'],
'DOMDocument::getElementsByTagNameNS' => ['DOMNodeList', 'namespaceuri'=>'string', 'localname'=>'string'],
'DOMDocument::importNode' => ['DOMNode|false', 'importednode'=>'DOMNode', 'deep='=>'bool'],
'DOMDocument::load' => ['DOMDocument|bool', 'filename'=>'string', 'options='=>'int'],
'DOMDocument::loadHTML' => ['bool', 'source'=>'string', 'options='=>'int'],
'DOMDocument::loadHTMLFile' => ['bool', 'filename'=>'string', 'options='=>'int'],
'DOMDocument::loadXML' => ['DOMDocument|bool', 'source'=>'string', 'options='=>'int'],
'DOMDocument::normalizeDocument' => ['void'],
'DOMDocument::registerNodeClass' => ['bool', 'baseclass'=>'string', 'extendedclass'=>'string'],
'DOMDocument::relaxNGValidate' => ['bool', 'filename'=>'string'],
'DOMDocument::relaxNGValidateSource' => ['bool', 'source'=>'string'],
'DOMDocument::save' => ['int|false', 'filename'=>'string', 'options='=>'int'],
'DOMDocument::saveHTML' => ['string|false', 'node='=>'?DOMNode'],
'DOMDocument::saveHTMLFile' => ['int|false', 'filename'=>'string'],
'DOMDocument::saveXML' => ['string|false', 'node='=>'?DOMNode', 'options='=>'int'],
'DOMDocument::schemaValidate' => ['bool', 'filename'=>'string', 'flags='=>'int'],
'DOMDocument::schemaValidateSource' => ['bool', 'source'=>'string', 'flags='=>'int'],
'DOMDocument::validate' => ['bool'],
'DOMDocument::xinclude' => ['int', 'options='=>'int'],
'DOMDocumentFragment::__construct' => ['void'],
'DOMDocumentFragment::appendXML' => ['bool', 'data'=>'string'],
'DomDocumentType::entities' => ['array'],
'DomDocumentType::internal_subset' => ['bool'],
'DomDocumentType::name' => ['string'],
'DomDocumentType::notations' => ['array'],
'DomDocumentType::public_id' => ['string'],
'DomDocumentType::system_id' => ['string'],
'DOMElement::__construct' => ['void', 'name'=>'string', 'value='=>'string', 'uri='=>'string'],
'DOMElement::get_attribute' => ['string', 'name'=>'string'],
'DOMElement::get_attribute_node' => ['DomAttribute', 'name'=>'string'],
'DOMElement::get_elements_by_tagname' => ['array', 'name'=>'string'],
'DOMElement::getAttribute' => ['string', 'name'=>'string'],
'DOMElement::getAttributeNode' => ['DOMAttr', 'name'=>'string'],
'DOMElement::getAttributeNodeNS' => ['DOMAttr', 'namespaceuri'=>'string', 'localname'=>'string'],
'DOMElement::getAttributeNS' => ['string', 'namespaceuri'=>'string', 'localname'=>'string'],
'DOMElement::getElementsByTagName' => ['DOMNodeList', 'name'=>'string'],
'DOMElement::getElementsByTagNameNS' => ['DOMNodeList', 'namespaceuri'=>'string', 'localname'=>'string'],
'DOMElement::has_attribute' => ['bool', 'name'=>'string'],
'DOMElement::hasAttribute' => ['bool', 'name'=>'string'],
'DOMElement::hasAttributeNS' => ['bool', 'namespaceuri'=>'string', 'localname'=>'string'],
'DOMElement::remove_attribute' => ['bool', 'name'=>'string'],
'DOMElement::removeAttribute' => ['bool', 'name'=>'string'],
'DOMElement::removeAttributeNode' => ['bool', 'oldnode'=>'DOMAttr'],
'DOMElement::removeAttributeNS' => ['bool', 'namespaceuri'=>'string', 'localname'=>'string'],
'DOMElement::set_attribute' => ['DomAttribute', 'name'=>'string', 'value'=>'string'],
'DOMElement::set_attribute_node' => ['DomNode', 'attr'=>'DOMNode'],
'DOMElement::setAttribute' => ['DOMAttr|false', 'name'=>'string', 'value'=>'string'],
'DOMElement::setAttributeNode' => ['?DOMAttr', 'attr'=>'DOMAttr'],
'DOMElement::setAttributeNodeNS' => ['DOMAttr', 'attr'=>'DOMAttr'],
'DOMElement::setAttributeNS' => ['void', 'namespaceuri'=>'string', 'qualifiedname'=>'string', 'value'=>'string'],
'DOMElement::setIdAttribute' => ['void', 'name'=>'string', 'isid'=>'bool'],
'DOMElement::setIdAttributeNode' => ['void', 'attr'=>'DOMAttr', 'isid'=>'bool'],
'DOMElement::setIdAttributeNS' => ['void', 'namespaceuri'=>'string', 'localname'=>'string', 'isid'=>'bool'],
'DOMElement::tagname' => ['string'],
'DOMEntityReference::__construct' => ['void', 'name'=>'string'],
'DOMImplementation::__construct' => ['void'],
'DOMImplementation::createDocument' => ['DOMDocument', 'namespaceuri='=>'string', 'qualifiedname='=>'string', 'doctype='=>'DOMDocumentType'],
'DOMImplementation::createDocumentType' => ['DOMDocumentType', 'qualifiedname='=>'string', 'publicid='=>'string', 'systemid='=>'string'],
'DOMImplementation::hasFeature' => ['bool', 'feature'=>'string', 'version'=>'string'],
'DOMNamedNodeMap::count' => ['int'],
'DOMNamedNodeMap::getNamedItem' => ['?DOMNode', 'name'=>'string'],
'DOMNamedNodeMap::getNamedItemNS' => ['?DOMNode', 'namespaceuri'=>'string', 'localname'=>'string'],
'DOMNamedNodeMap::item' => ['?DOMNode', 'index'=>'int'],
'DomNode::add_namespace' => ['bool', 'uri'=>'string', 'prefix'=>'string'],
'DomNode::append_child' => ['DOMNode', 'newnode'=>'DOMNode'],
'DOMNode::appendChild' => ['DOMNode', 'newnode'=>'DOMNode'],
'DOMNode::C14N' => ['string', 'exclusive='=>'bool', 'with_comments='=>'bool', 'xpath='=>'array', 'ns_prefixes='=>'array'],
'DOMNode::C14NFile' => ['int|false', 'uri='=>'string', 'exclusive='=>'bool', 'with_comments='=>'bool', 'xpath='=>'array', 'ns_prefixes='=>'array'],
'DOMNode::cloneNode' => ['DOMNode', 'deep='=>'bool'],
'DOMNode::getLineNo' => ['int'],
'DOMNode::getNodePath' => ['?string'],
'DOMNode::hasAttributes' => ['bool'],
'DOMNode::hasChildNodes' => ['bool'],
'DOMNode::insertBefore' => ['DOMNode', 'newnode'=>'DOMNode', 'refnode='=>'DOMNode|null'],
'DOMNode::isDefaultNamespace' => ['bool', 'namespaceuri'=>'string'],
'DOMNode::isSameNode' => ['bool', 'node'=>'DOMNode'],
'DOMNode::isSupported' => ['bool', 'feature'=>'string', 'version'=>'string'],
'DOMNode::lookupNamespaceURI' => ['string', 'prefix'=>'string'],
'DOMNode::lookupPrefix' => ['string', 'namespaceuri'=>'string'],
'DOMNode::normalize' => ['void'],
'DOMNode::removeChild' => ['DOMNode', 'oldnode'=>'DOMNode'],
'DOMNode::replaceChild' => ['DOMNode|false', 'newnode'=>'DOMNode', 'oldnode'=>'DOMNode'],
'DOMNodeList::count' => ['int'],
'DOMNodeList::item' => ['?DOMNode', 'index'=>'int'],
'DOMProcessingInstruction::__construct' => ['void', 'name'=>'string', 'value'=>'string'],
'DomProcessingInstruction::data' => ['string'],
'DomProcessingInstruction::target' => ['string'],
'DOMText::__construct' => ['void', 'value='=>'string'],
'DOMText::isElementContentWhitespace' => ['bool'],
'DOMText::isWhitespaceInElementContent' => ['bool'],
'DOMText::splitText' => ['DOMText', 'offset'=>'int'],
'domxml_new_doc' => ['DomDocument', 'version'=>'string'],
'domxml_open_file' => ['DomDocument', 'filename'=>'string', 'mode='=>'int', 'error='=>'array'],
'domxml_open_mem' => ['DomDocument', 'string'=>'string', 'mode='=>'int', 'error='=>'array'],
'domxml_version' => ['string'],
'domxml_xmltree' => ['DomDocument', 'string'=>'string'],
'domxml_xslt_stylesheet' => ['DomXsltStylesheet', 'xsl_buf'=>'string'],
'domxml_xslt_stylesheet_doc' => ['DomXsltStylesheet', 'xsl_doc'=>'DOMDocument'],
'domxml_xslt_stylesheet_file' => ['DomXsltStylesheet', 'xsl_file'=>'string'],
'domxml_xslt_version' => ['int'],
'DOMXPath::__construct' => ['void', 'doc'=>'DOMDocument'],
'DOMXPath::evaluate' => ['mixed', 'expression'=>'string', 'contextnode='=>'?DOMNode', 'registernodens='=>'bool'],
'DOMXPath::query' => ['DOMNodeList|false', 'expression'=>'string', 'contextnode='=>'DOMNode|null', 'registernodens='=>'bool'],
'DOMXPath::registerNamespace' => ['bool', 'prefix'=>'string', 'namespaceuri'=>'string'],
'DOMXPath::registerPhpFunctions' => ['void', 'restrict='=>'mixed'],
'DomXsltStylesheet::process' => ['DomDocument', 'xml_doc'=>'DOMDocument', 'xslt_params='=>'array', 'is_xpath_param='=>'bool', 'profile_filename='=>'string'],
'DomXsltStylesheet::result_dump_file' => ['string', 'xmldoc'=>'DOMDocument', 'filename'=>'string'],
'DomXsltStylesheet::result_dump_mem' => ['string', 'xmldoc'=>'DOMDocument'],
'DOTNET::__call' => ['mixed', 'name'=>'string', 'args'=>''],
'DOTNET::__construct' => ['void', 'assembly_name'=>'string', 'datatype_name'=>'string', 'codepage='=>'int'],
'DOTNET::__get' => ['mixed', 'name'=>'string'],
'DOTNET::__set' => ['void', 'name'=>'string', 'value'=>''],
'dotnet_load' => ['int', 'assembly_name'=>'string', 'datatype_name='=>'string', 'codepage='=>'int'],
'doubleval' => ['float', 'value'=>'mixed'],
'Ds\Collection::clear' => ['void'],
'Ds\Collection::copy' => ['Ds\Collection'],
'Ds\Collection::isEmpty' => ['bool'],
'Ds\Collection::toArray' => ['array'],
'Ds\Deque::__construct' => ['void', 'values='=>'mixed'],
'Ds\Deque::allocate' => ['void', 'capacity'=>'int'],
'Ds\Deque::apply' => ['void', 'callback'=>'callable'],
'Ds\Deque::capacity' => ['int'],
'Ds\Deque::clear' => ['void'],
'Ds\Deque::contains' => ['bool', '...values='=>'mixed'],
'Ds\Deque::copy' => ['Ds\Deque'],
'Ds\Deque::count' => ['int'],
'Ds\Deque::filter' => ['Ds\Deque', 'callback='=>'callable'],
'Ds\Deque::find' => ['mixed', 'value'=>'mixed'],
'Ds\Deque::first' => ['mixed'],
'Ds\Deque::get' => ['void', 'index'=>'int'],
'Ds\Deque::insert' => ['void', 'index'=>'int', '...values='=>'mixed'],
'Ds\Deque::isEmpty' => ['bool'],
'Ds\Deque::join' => ['string', 'glue='=>'string'],
'Ds\Deque::jsonSerialize' => ['array'],
'Ds\Deque::last' => ['mixed'],
'Ds\Deque::map' => ['Ds\Deque', 'callback'=>'callable'],
'Ds\Deque::merge' => ['Ds\Deque', 'values'=>'mixed'],
'Ds\Deque::pop' => ['mixed'],
'Ds\Deque::push' => ['void', '...values='=>'mixed'],
'Ds\Deque::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'],
'Ds\Deque::remove' => ['mixed', 'index'=>'int'],
'Ds\Deque::reverse' => ['void'],
'Ds\Deque::reversed' => ['Ds\Deque'],
'Ds\Deque::rotate' => ['void', 'rotations'=>'int'],
'Ds\Deque::set' => ['void', 'index'=>'int', 'value'=>'mixed'],
'Ds\Deque::shift' => ['mixed'],
'Ds\Deque::slice' => ['Ds\Deque', 'index'=>'int', 'length='=>'?int'],
'Ds\Deque::sort' => ['void', 'comparator='=>'callable'],
'Ds\Deque::sorted' => ['Ds\Deque', 'comparator='=>'callable'],
'Ds\Deque::sum' => ['int|float'],
'Ds\Deque::toArray' => ['array'],
'Ds\Deque::unshift' => ['void', '...values='=>'mixed'],
'Ds\Hashable::equals' => ['bool', 'object'=>'mixed'],
'Ds\Hashable::hash' => ['mixed'],
'Ds\Map::__construct' => ['void', 'values='=>'mixed'],
'Ds\Map::allocate' => ['void', 'capacity'=>'int'],
'Ds\Map::apply' => ['void', 'callback'=>'callable'],
'Ds\Map::capacity' => ['int'],
'Ds\Map::clear' => ['void'],
'Ds\Map::copy' => ['Ds\Map'],
'Ds\Map::count' => ['int'],
'Ds\Map::diff' => ['Ds\Map', 'map'=>'Ds\Map'],
'Ds\Map::filter' => ['Ds\Map', 'callback='=>'callable'],
'Ds\Map::first' => ['Ds\Pair'],
'Ds\Map::get' => ['mixed', 'key'=>'mixed', 'default='=>'mixed'],
'Ds\Map::hasKey' => ['bool', 'key'=>'mixed'],
'Ds\Map::hasValue' => ['bool', 'value'=>'mixed'],
'Ds\Map::intersect' => ['Ds\Map', 'map'=>'Ds\Map'],
'Ds\Map::isEmpty' => ['bool'],
'Ds\Map::jsonSerialize' => ['array'],
'Ds\Map::keys' => ['Ds\Set'],
'Ds\Map::ksort' => ['void', 'comparator='=>'callable'],
'Ds\Map::ksorted' => ['Ds\Map', 'comparator='=>'callable'],
'Ds\Map::last' => ['Ds\Pair'],
'Ds\Map::map' => ['Ds\Map', 'callback'=>'callable'],
'Ds\Map::merge' => ['Ds\Map', 'values'=>'mixed'],
'Ds\Map::pairs' => ['Ds\Sequence'],
'Ds\Map::put' => ['void', 'key'=>'mixed', 'value'=>'mixed'],
'Ds\Map::putAll' => ['void', 'values'=>'mixed'],
'Ds\Map::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'],
'Ds\Map::remove' => ['mixed', 'key'=>'mixed', 'default='=>'mixed'],
'Ds\Map::reverse' => ['void'],
'Ds\Map::reversed' => ['Ds\Map'],
'Ds\Map::skip' => ['Ds\Pair', 'position'=>'int'],
'Ds\Map::slice' => ['Ds\Map', 'index'=>'int', 'length='=>'?int'],
'Ds\Map::sort' => ['void', 'comparator='=>'callable'],
'Ds\Map::sorted' => ['Ds\Map', 'comparator='=>'callable'],
'Ds\Map::sum' => ['int|float'],
'Ds\Map::toArray' => ['array'],
'Ds\Map::union' => ['Ds\Map', 'map'=>'Ds\Map'],
'Ds\Map::values' => ['Ds\Sequence'],
'Ds\Map::xor' => ['Ds\Map', 'map'=>'Ds\Map'],
'Ds\Pair::__construct' => ['void', 'key='=>'mixed', 'value='=>'mixed'],
'Ds\Pair::clear' => ['void'],
'Ds\Pair::copy' => ['Ds\Pair'],
'Ds\Pair::isEmpty' => ['bool'],
'Ds\Pair::jsonSerialize' => ['array'],
'Ds\Pair::toArray' => ['array'],
'Ds\PriorityQueue::__construct' => ['void'],
'Ds\PriorityQueue::allocate' => ['void', 'capacity'=>'int'],
'Ds\PriorityQueue::capacity' => ['int'],
'Ds\PriorityQueue::clear' => ['void'],
'Ds\PriorityQueue::copy' => ['Ds\PriorityQueue'],
'Ds\PriorityQueue::count' => ['int'],
'Ds\PriorityQueue::isEmpty' => ['bool'],
'Ds\PriorityQueue::jsonSerialize' => ['array'],
'Ds\PriorityQueue::peek' => ['mixed'],
'Ds\PriorityQueue::pop' => ['mixed'],
'Ds\PriorityQueue::push' => ['void', 'value'=>'mixed', 'priority'=>'int'],
'Ds\PriorityQueue::toArray' => ['array'],
'Ds\Queue::__construct' => ['void', 'values='=>'mixed'],
'Ds\Queue::allocate' => ['void', 'capacity'=>'int'],
'Ds\Queue::capacity' => ['int'],
'Ds\Queue::clear' => ['void'],
'Ds\Queue::copy' => ['Ds\Queue'],
'Ds\Queue::count' => ['int'],
'Ds\Queue::isEmpty' => ['bool'],
'Ds\Queue::jsonSerialize' => ['array'],
'Ds\Queue::peek' => ['mixed'],
'Ds\Queue::pop' => ['mixed'],
'Ds\Queue::push' => ['void', '...values='=>'mixed'],
'Ds\Queue::toArray' => ['array'],
'Ds\Sequence::allocate' => ['void', 'capacity'=>'int'],
'Ds\Sequence::apply' => ['void', 'callback'=>'callable'],
'Ds\Sequence::capacity' => ['int'],
'Ds\Sequence::contains' => ['bool', '...values='=>'mixed'],
'Ds\Sequence::filter' => ['Ds\Sequence', 'callback='=>'callable'],
'Ds\Sequence::find' => ['mixed', 'value'=>'mixed'],
'Ds\Sequence::first' => ['mixed'],
'Ds\Sequence::get' => ['mixed', 'index'=>'int'],
'Ds\Sequence::insert' => ['void', 'index'=>'int', '...values='=>'mixed'],
'Ds\Sequence::join' => ['string', 'glue='=>'string'],
'Ds\Sequence::last' => ['void'],
'Ds\Sequence::map' => ['Ds\Sequence', 'callback'=>'callable'],
'Ds\Sequence::merge' => ['Ds\Sequence', 'values'=>'mixed'],
'Ds\Sequence::pop' => ['mixed'],
'Ds\Sequence::push' => ['void', '...values='=>'mixed'],
'Ds\Sequence::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'],
'Ds\Sequence::remove' => ['mixed', 'index'=>'int'],
'Ds\Sequence::reverse' => ['void'],
'Ds\Sequence::reversed' => ['Ds\Sequence'],
'Ds\Sequence::rotate' => ['void', 'rotations'=>'int'],
'Ds\Sequence::set' => ['void', 'index'=>'int', 'value'=>'mixed'],
'Ds\Sequence::shift' => ['mixed'],
'Ds\Sequence::slice' => ['Ds\Sequence', 'index'=>'int', 'length='=>'?int'],
'Ds\Sequence::sort' => ['void', 'comparator='=>'callable'],
'Ds\Sequence::sorted' => ['Ds\Sequence', 'comparator='=>'callable'],
'Ds\Sequence::sum' => ['int|float'],
'Ds\Sequence::unshift' => ['void', '...values='=>'mixed'],
'Ds\Set::__construct' => ['void', 'values='=>'mixed'],
'Ds\Set::add' => ['void', '...values='=>'mixed'],
'Ds\Set::allocate' => ['void', 'capacity'=>'int'],
'Ds\Set::capacity' => ['int'],
'Ds\Set::clear' => ['void'],
'Ds\Set::contains' => ['bool', '...values='=>'mixed'],
'Ds\Set::copy' => ['Ds\Set'],
'Ds\Set::count' => ['int'],
'Ds\Set::diff' => ['Ds\Set', 'set'=>'Ds\Set'],
'Ds\Set::filter' => ['Ds\Set', 'callback='=>'callable'],
'Ds\Set::first' => ['mixed'],
'Ds\Set::get' => ['mixed', 'index'=>'int'],
'Ds\Set::intersect' => ['Ds\Set', 'set'=>'Ds\Set'],
'Ds\Set::isEmpty' => ['bool'],
'Ds\Set::join' => ['string', 'glue='=>'string'],
'Ds\Set::jsonSerialize' => ['array'],
'Ds\Set::last' => ['mixed'],
'Ds\Set::merge' => ['Ds\Set', 'values'=>'mixed'],
'Ds\Set::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'],
'Ds\Set::remove' => ['void', '...values='=>'mixed'],
'Ds\Set::reverse' => ['void'],
'Ds\Set::reversed' => ['Ds\Set'],
'Ds\Set::slice' => ['Ds\Set', 'index'=>'int', 'length='=>'?int'],
'Ds\Set::sort' => ['void', 'comparator='=>'callable'],
'Ds\Set::sorted' => ['Ds\Set', 'comparator='=>'callable'],
'Ds\Set::sum' => ['int|float'],
'Ds\Set::toArray' => ['array'],
'Ds\Set::union' => ['Ds\Set', 'set'=>'Ds\Set'],
'Ds\Set::xor' => ['Ds\Set', 'set'=>'Ds\Set'],
'Ds\Stack::__construct' => ['void', 'values='=>'mixed'],
'Ds\Stack::allocate' => ['void', 'capacity'=>'int'],
'Ds\Stack::capacity' => ['int'],
'Ds\Stack::clear' => ['void'],
'Ds\Stack::copy' => ['Ds\Stack'],
'Ds\Stack::count' => ['int'],
'Ds\Stack::isEmpty' => ['bool'],
'Ds\Stack::jsonSerialize' => ['array'],
'Ds\Stack::peek' => ['mixed'],
'Ds\Stack::pop' => ['mixed'],
'Ds\Stack::push' => ['void', '...values='=>'mixed'],
'Ds\Stack::toArray' => ['array'],
'Ds\Vector::__construct' => ['void', 'values='=>'mixed'],
'Ds\Vector::allocate' => ['void', 'capacity'=>'int'],
'Ds\Vector::apply' => ['void', 'callback'=>'callable'],
'Ds\Vector::capacity' => ['int'],
'Ds\Vector::clear' => ['void'],
'Ds\Vector::contains' => ['bool', '...values='=>'mixed'],
'Ds\Vector::copy' => ['Ds\Vector'],
'Ds\Vector::count' => ['int'],
'Ds\Vector::filter' => ['Ds\Vector', 'callback='=>'callable'],
'Ds\Vector::find' => ['mixed', 'value'=>'mixed'],
'Ds\Vector::first' => ['mixed'],
'Ds\Vector::get' => ['mixed', 'index'=>'int'],
'Ds\Vector::insert' => ['void', 'index'=>'int', '...values='=>'mixed'],
'Ds\Vector::isEmpty' => ['bool'],
'Ds\Vector::join' => ['string', 'glue='=>'string'],
'Ds\Vector::jsonSerialize' => ['array'],
'Ds\Vector::last' => ['mixed'],
'Ds\Vector::map' => ['Ds\Vector', 'callback'=>'callable'],
'Ds\Vector::merge' => ['Ds\Vector', 'values'=>'mixed'],
'Ds\Vector::pop' => ['mixed'],
'Ds\Vector::push' => ['void', '...values='=>'mixed'],
'Ds\Vector::reduce' => ['mixed', 'callback'=>'callable', 'initial='=>'mixed'],
'Ds\Vector::remove' => ['mixed', 'index'=>'int'],
'Ds\Vector::reverse' => ['void'],
'Ds\Vector::reversed' => ['Ds\Vector'],
'Ds\Vector::rotate' => ['void', 'rotations'=>'int'],
'Ds\Vector::set' => ['void', 'index'=>'int', 'value'=>'mixed'],
'Ds\Vector::shift' => ['mixed'],
'Ds\Vector::slice' => ['Ds\Vector', 'index'=>'int', 'length='=>'?int'],
'Ds\Vector::sort' => ['void', 'comparator='=>'callable'],
'Ds\Vector::sorted' => ['Ds\Vector', 'comparator='=>'callable'],
'Ds\Vector::sum' => ['int|float'],
'Ds\Vector::toArray' => ['array'],
'Ds\Vector::unshift' => ['void', '...values='=>'mixed'],
'easter_date' => ['int', 'year='=>'int'],
'easter_days' => ['int', 'year='=>'int', 'mode='=>'int'],
'echo' => ['void', 'arg1'=>'string', '...args='=>'string'],
'eio_busy' => ['resource', 'delay'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_cancel' => ['void', 'req'=>'resource'],
'eio_chmod' => ['resource', 'path'=>'string', 'mode'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_chown' => ['resource', 'path'=>'string', 'uid'=>'int', 'gid='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_close' => ['resource', 'fd'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_custom' => ['resource', 'execute'=>'callable', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'],
'eio_dup2' => ['resource', 'fd'=>'mixed', 'fd2'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_event_loop' => ['bool'],
'eio_fallocate' => ['resource', 'fd'=>'mixed', 'mode'=>'int', 'offset'=>'int', 'length'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_fchmod' => ['resource', 'fd'=>'mixed', 'mode'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_fchown' => ['resource', 'fd'=>'mixed', 'uid'=>'int', 'gid='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_fdatasync' => ['resource', 'fd'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_fstat' => ['resource', 'fd'=>'mixed', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'],
'eio_fstatvfs' => ['resource', 'fd'=>'mixed', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'],
'eio_fsync' => ['resource', 'fd'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_ftruncate' => ['resource', 'fd'=>'mixed', 'offset='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_futime' => ['resource', 'fd'=>'mixed', 'atime'=>'float', 'mtime'=>'float', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_get_event_stream' => ['mixed'],
'eio_get_last_error' => ['string', 'req'=>'resource'],
'eio_grp' => ['resource', 'callback'=>'callable', 'data='=>'string'],
'eio_grp_add' => ['void', 'grp'=>'resource', 'req'=>'resource'],
'eio_grp_cancel' => ['void', 'grp'=>'resource'],
'eio_grp_limit' => ['void', 'grp'=>'resource', 'limit'=>'int'],
'eio_init' => ['void'],
'eio_link' => ['resource', 'path'=>'string', 'new_path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_lstat' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'],
'eio_mkdir' => ['resource', 'path'=>'string', 'mode'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_mknod' => ['resource', 'path'=>'string', 'mode'=>'int', 'dev'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_nop' => ['resource', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_npending' => ['int'],
'eio_nready' => ['int'],
'eio_nreqs' => ['int'],
'eio_nthreads' => ['int'],
'eio_open' => ['resource', 'path'=>'string', 'flags'=>'int', 'mode'=>'int', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'],
'eio_poll' => ['int'],
'eio_read' => ['resource', 'fd'=>'mixed', 'length'=>'int', 'offset'=>'int', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'],
'eio_readahead' => ['resource', 'fd'=>'mixed', 'offset'=>'int', 'length'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_readdir' => ['resource', 'path'=>'string', 'flags'=>'int', 'pri'=>'int', 'callback'=>'callable', 'data='=>'string'],
'eio_readlink' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'string'],
'eio_realpath' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'string'],
'eio_rename' => ['resource', 'path'=>'string', 'new_path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_rmdir' => ['resource', 'path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_seek' => ['resource', 'fd'=>'mixed', 'offset'=>'int', 'whence'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_sendfile' => ['resource', 'out_fd'=>'mixed', 'in_fd'=>'mixed', 'offset'=>'int', 'length'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'string'],
'eio_set_max_idle' => ['void', 'nthreads'=>'int'],
'eio_set_max_parallel' => ['void', 'nthreads'=>'int'],
'eio_set_max_poll_reqs' => ['void', 'nreqs'=>'int'],
'eio_set_max_poll_time' => ['void', 'nseconds'=>'float'],
'eio_set_min_parallel' => ['void', 'nthreads'=>'string'],
'eio_stat' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'],
'eio_statvfs' => ['resource', 'path'=>'string', 'pri'=>'int', 'callback'=>'callable', 'data='=>'mixed'],
'eio_symlink' => ['resource', 'path'=>'string', 'new_path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_sync' => ['resource', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_sync_file_range' => ['resource', 'fd'=>'mixed', 'offset'=>'int', 'nbytes'=>'int', 'flags'=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_syncfs' => ['resource', 'fd'=>'mixed', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_truncate' => ['resource', 'path'=>'string', 'offset='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_unlink' => ['resource', 'path'=>'string', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_utime' => ['resource', 'path'=>'string', 'atime'=>'float', 'mtime'=>'float', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'eio_write' => ['resource', 'fd'=>'mixed', 'string'=>'string', 'length='=>'int', 'offset='=>'int', 'pri='=>'int', 'callback='=>'callable', 'data='=>'mixed'],
'empty' => ['bool', 'value'=>'mixed'],
'EmptyIterator::current' => ['mixed'],
'EmptyIterator::key' => ['mixed'],
'EmptyIterator::next' => ['void'],
'EmptyIterator::rewind' => ['void'],
'EmptyIterator::valid' => ['bool'],
'enchant_broker_describe' => ['array', 'broker'=>'resource'],
'enchant_broker_dict_exists' => ['bool', 'broker'=>'resource', 'tag'=>'string'],
'enchant_broker_free' => ['bool', 'broker'=>'resource'],
'enchant_broker_free_dict' => ['bool', 'dictionary'=>'resource'],
'enchant_broker_get_dict_path' => ['string', 'broker'=>'resource', 'type'=>'int'],
'enchant_broker_get_error' => ['string|false', 'broker'=>'resource'],
'enchant_broker_init' => ['resource|false'],
'enchant_broker_list_dicts' => ['array<int,array{lang_tag:string,provider_name:string,provider_desc:string,provider_file:string}>|false', 'broker'=>'resource'],
'enchant_broker_request_dict' => ['resource|false', 'broker'=>'resource', 'tag'=>'string'],
'enchant_broker_request_pwl_dict' => ['resource|false', 'broker'=>'resource', 'filename'=>'string'],
'enchant_broker_set_dict_path' => ['bool', 'broker'=>'resource', 'type'=>'int', 'path'=>'string'],
'enchant_broker_set_ordering' => ['bool', 'broker'=>'resource', 'tag'=>'string', 'ordering'=>'string'],
'enchant_dict_add_to_personal' => ['void', 'dictionary'=>'resource', 'word'=>'string'],
'enchant_dict_add_to_session' => ['void', 'dictionary'=>'resource', 'word'=>'string'],
'enchant_dict_check' => ['bool', 'dictionary'=>'resource', 'word'=>'string'],
'enchant_dict_describe' => ['array', 'dictionary'=>'resource'],
'enchant_dict_get_error' => ['string', 'dictionary'=>'resource'],
'enchant_dict_is_in_session' => ['bool', 'dictionary'=>'resource', 'word'=>'string'],
'enchant_dict_quick_check' => ['bool', 'dictionary'=>'resource', 'word'=>'string', '&w_suggestions='=>'array<int,string>'],
'enchant_dict_store_replacement' => ['void', 'dictionary'=>'resource', 'misspelled'=>'string', 'correct'=>'string'],
'enchant_dict_suggest' => ['array', 'dictionary'=>'resource', 'word'=>'string'],
'end' => ['mixed|false', '&r_array'=>'array|object'],
'Error::__clone' => ['void'],
'Error::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?Error'],
'Error::__toString' => ['string'],
'Error::getCode' => ['int'],
'Error::getFile' => ['string'],
'Error::getLine' => ['int'],
'Error::getMessage' => ['string'],
'Error::getPrevious' => ['Throwable|Error|null'],
'Error::getTrace' => ['list<array<string,mixed>>'],
'Error::getTraceAsString' => ['string'],
'error_clear_last' => ['void'],
'error_get_last' => ['?array{type:int,message:string,file:string,line:int}'],
'error_log' => ['bool', 'message'=>'string', 'message_type='=>'int', 'destination='=>'string', 'additional_headers='=>'string'],
'error_reporting' => ['int', 'error_level='=>'int'],
'ErrorException::__clone' => ['void'],
'ErrorException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'severity='=>'int', 'filename='=>'string', 'lineno='=>'int', 'previous='=>'?Throwable|?ErrorException'],
'ErrorException::__toString' => ['string'],
'ErrorException::getCode' => ['int'],
'ErrorException::getFile' => ['string'],
'ErrorException::getLine' => ['int'],
'ErrorException::getMessage' => ['string'],
'ErrorException::getPrevious' => ['Throwable|ErrorException|null'],
'ErrorException::getSeverity' => ['int'],
'ErrorException::getTrace' => ['list<array<string,mixed>>'],
'ErrorException::getTraceAsString' => ['string'],
'escapeshellarg' => ['string', 'arg'=>'string'],
'escapeshellcmd' => ['string', 'command'=>'string'],
'Ev::backend' => ['int'],
'Ev::depth' => ['int'],
'Ev::embeddableBackends' => ['int'],
'Ev::feedSignal' => ['void', 'signum'=>'int'],
'Ev::feedSignalEvent' => ['void', 'signum'=>'int'],
'Ev::iteration' => ['int'],
'Ev::now' => ['float'],
'Ev::nowUpdate' => ['void'],
'Ev::recommendedBackends' => ['int'],
'Ev::resume' => ['void'],
'Ev::run' => ['void', 'flags='=>'int'],
'Ev::sleep' => ['void', 'seconds'=>'float'],
'Ev::stop' => ['void', 'how='=>'int'],
'Ev::supportedBackends' => ['int'],
'Ev::suspend' => ['void'],
'Ev::time' => ['float'],
'Ev::verify' => ['void'],
'eval' => ['mixed', 'code_str'=>'string'],
'EvCheck::__construct' => ['void', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvCheck::clear' => ['int'],
'EvCheck::createStopped' => ['EvCheck', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvCheck::feed' => ['void', 'events'=>'int'],
'EvCheck::getLoop' => ['EvLoop'],
'EvCheck::invoke' => ['void', 'events'=>'int'],
'EvCheck::keepAlive' => ['void', 'value'=>'bool'],
'EvCheck::setCallback' => ['void', 'callback'=>'callable'],
'EvCheck::start' => ['void'],
'EvCheck::stop' => ['void'],
'EvChild::__construct' => ['void', 'pid'=>'int', 'trace'=>'bool', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvChild::clear' => ['int'],
'EvChild::createStopped' => ['EvChild', 'pid'=>'int', 'trace'=>'bool', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvChild::feed' => ['void', 'events'=>'int'],
'EvChild::getLoop' => ['EvLoop'],
'EvChild::invoke' => ['void', 'events'=>'int'],
'EvChild::keepAlive' => ['void', 'value'=>'bool'],
'EvChild::set' => ['void', 'pid'=>'int', 'trace'=>'bool'],
'EvChild::setCallback' => ['void', 'callback'=>'callable'],
'EvChild::start' => ['void'],
'EvChild::stop' => ['void'],
'EvEmbed::__construct' => ['void', 'other'=>'object', 'callback='=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvEmbed::clear' => ['int'],
'EvEmbed::createStopped' => ['EvEmbed', 'other'=>'object', 'callback='=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvEmbed::feed' => ['void', 'events'=>'int'],
'EvEmbed::getLoop' => ['EvLoop'],
'EvEmbed::invoke' => ['void', 'events'=>'int'],
'EvEmbed::keepAlive' => ['void', 'value'=>'bool'],
'EvEmbed::set' => ['void', 'other'=>'object'],
'EvEmbed::setCallback' => ['void', 'callback'=>'callable'],
'EvEmbed::start' => ['void'],
'EvEmbed::stop' => ['void'],
'EvEmbed::sweep' => ['void'],
'Event::__construct' => ['void', 'base'=>'EventBase', 'fd'=>'mixed', 'what'=>'int', 'cb'=>'callable', 'arg='=>'mixed'],
'Event::add' => ['bool', 'timeout='=>'float'],
'Event::addSignal' => ['bool', 'timeout='=>'float'],
'Event::addTimer' => ['bool', 'timeout='=>'float'],
'Event::del' => ['bool'],
'Event::delSignal' => ['bool'],
'Event::delTimer' => ['bool'],
'Event::free' => ['void'],
'Event::getSupportedMethods' => ['array'],
'Event::pending' => ['bool', 'flags'=>'int'],
'Event::set' => ['bool', 'base'=>'EventBase', 'fd'=>'mixed', 'what='=>'int', 'cb='=>'callable', 'arg='=>'mixed'],
'Event::setPriority' => ['bool', 'priority'=>'int'],
'Event::setTimer' => ['bool', 'base'=>'EventBase', 'cb'=>'callable', 'arg='=>'mixed'],
'Event::signal' => ['Event', 'base'=>'EventBase', 'signum'=>'int', 'cb'=>'callable', 'arg='=>'mixed'],
'Event::timer' => ['Event', 'base'=>'EventBase', 'cb'=>'callable', 'arg='=>'mixed'],
'event_add' => ['bool', 'event'=>'resource', 'timeout='=>'int'],
'event_base_free' => ['void', 'event_base'=>'resource'],
'event_base_loop' => ['int', 'event_base'=>'resource', 'flags='=>'int'],
'event_base_loopbreak' => ['bool', 'event_base'=>'resource'],
'event_base_loopexit' => ['bool', 'event_base'=>'resource', 'timeout='=>'int'],
'event_base_new' => ['resource|false'],
'event_base_priority_init' => ['bool', 'event_base'=>'resource', 'npriorities'=>'int'],
'event_base_reinit' => ['bool', 'event_base'=>'resource'],
'event_base_set' => ['bool', 'event'=>'resource', 'event_base'=>'resource'],
'event_buffer_base_set' => ['bool', 'bevent'=>'resource', 'event_base'=>'resource'],
'event_buffer_disable' => ['bool', 'bevent'=>'resource', 'events'=>'int'],
'event_buffer_enable' => ['bool', 'bevent'=>'resource', 'events'=>'int'],
'event_buffer_fd_set' => ['void', 'bevent'=>'resource', 'fd'=>'resource'],
'event_buffer_free' => ['void', 'bevent'=>'resource'],
'event_buffer_new' => ['resource|false', 'stream'=>'resource', 'readcb'=>'callable|null', 'writecb'=>'callable|null', 'errorcb'=>'callable', 'arg='=>'mixed'],
'event_buffer_priority_set' => ['bool', 'bevent'=>'resource', 'priority'=>'int'],
'event_buffer_read' => ['string', 'bevent'=>'resource', 'data_size'=>'int'],
'event_buffer_set_callback' => ['bool', 'event'=>'resource', 'readcb'=>'mixed', 'writecb'=>'mixed', 'errorcb'=>'mixed', 'arg='=>'mixed'],
'event_buffer_timeout_set' => ['void', 'bevent'=>'resource', 'read_timeout'=>'int', 'write_timeout'=>'int'],
'event_buffer_watermark_set' => ['void', 'bevent'=>'resource', 'events'=>'int', 'lowmark'=>'int', 'highmark'=>'int'],
'event_buffer_write' => ['bool', 'bevent'=>'resource', 'data'=>'string', 'data_size='=>'int'],
'event_del' => ['bool', 'event'=>'resource'],
'event_free' => ['void', 'event'=>'resource'],
'event_new' => ['resource|false'],
'event_priority_set' => ['bool', 'event'=>'resource', 'priority'=>'int'],
'event_set' => ['bool', 'event'=>'resource', 'fd'=>'int|resource', 'events'=>'int', 'callback'=>'callable', 'arg='=>'mixed'],
'event_timer_add' => ['bool', 'event'=>'resource', 'timeout='=>'int'],
'event_timer_del' => ['bool', 'event'=>'resource'],
'event_timer_new' => ['resource|false'],
'event_timer_pending' => ['bool', 'event'=>'resource', 'timeout='=>'int'],
'event_timer_set' => ['bool', 'event'=>'resource', 'callback'=>'callable', 'arg='=>'mixed'],
'EventBase::__construct' => ['void', 'cfg='=>'EventConfig'],
'EventBase::dispatch' => ['void'],
'EventBase::exit' => ['bool', 'timeout='=>'float'],
'EventBase::free' => ['void'],
'EventBase::getFeatures' => ['int'],
'EventBase::getMethod' => ['string', 'cfg='=>'EventConfig'],
'EventBase::getTimeOfDayCached' => ['float'],
'EventBase::gotExit' => ['bool'],
'EventBase::gotStop' => ['bool'],
'EventBase::loop' => ['bool', 'flags='=>'int'],
'EventBase::priorityInit' => ['bool', 'n_priorities'=>'int'],
'EventBase::reInit' => ['bool'],
'EventBase::stop' => ['bool'],
'EventBuffer::__construct' => ['void'],
'EventBuffer::add' => ['bool', 'data'=>'string'],
'EventBuffer::addBuffer' => ['bool', 'buf'=>'EventBuffer'],
'EventBuffer::appendFrom' => ['int', 'buf'=>'EventBuffer', 'length'=>'int'],
'EventBuffer::copyout' => ['int', '&w_data'=>'string', 'max_bytes'=>'int'],
'EventBuffer::drain' => ['bool', 'length'=>'int'],
'EventBuffer::enableLocking' => ['void'],
'EventBuffer::expand' => ['bool', 'length'=>'int'],
'EventBuffer::freeze' => ['bool', 'at_front'=>'bool'],
'EventBuffer::lock' => ['void'],
'EventBuffer::prepend' => ['bool', 'data'=>'string'],
'EventBuffer::prependBuffer' => ['bool', 'buf'=>'EventBuffer'],
'EventBuffer::pullup' => ['string', 'size'=>'int'],
'EventBuffer::read' => ['string', 'max_bytes'=>'int'],
'EventBuffer::readFrom' => ['int', 'fd'=>'mixed', 'howmuch'=>'int'],
'EventBuffer::readLine' => ['string', 'eol_style'=>'int'],
'EventBuffer::search' => ['mixed', 'what'=>'string', 'start='=>'int', 'end='=>'int'],
'EventBuffer::searchEol' => ['mixed', 'start='=>'int', 'eol_style='=>'int'],
'EventBuffer::substr' => ['string', 'start'=>'int', 'length='=>'int'],
'EventBuffer::unfreeze' => ['bool', 'at_front'=>'bool'],
'EventBuffer::unlock' => ['bool'],
'EventBuffer::write' => ['int', 'fd'=>'mixed', 'howmuch='=>'int'],
'EventBufferEvent::__construct' => ['void', 'base'=>'EventBase', 'socket='=>'mixed', 'options='=>'int', 'readcb='=>'callable', 'writecb='=>'callable', 'eventcb='=>'callable'],
'EventBufferEvent::close' => ['void'],
'EventBufferEvent::connect' => ['bool', 'addr'=>'string'],
'EventBufferEvent::connectHost' => ['bool', 'dns_base'=>'EventDnsBase', 'hostname'=>'string', 'port'=>'int', 'family='=>'int'],
'EventBufferEvent::createPair' => ['array', 'base'=>'EventBase', 'options='=>'int'],
'EventBufferEvent::disable' => ['bool', 'events'=>'int'],
'EventBufferEvent::enable' => ['bool', 'events'=>'int'],
'EventBufferEvent::free' => ['void'],
'EventBufferEvent::getDnsErrorString' => ['string'],
'EventBufferEvent::getEnabled' => ['int'],
'EventBufferEvent::getInput' => ['EventBuffer'],
'EventBufferEvent::getOutput' => ['EventBuffer'],
'EventBufferEvent::read' => ['string', 'size'=>'int'],
'EventBufferEvent::readBuffer' => ['bool', 'buf'=>'EventBuffer'],
'EventBufferEvent::setCallbacks' => ['void', 'readcb'=>'callable', 'writecb'=>'callable', 'eventcb'=>'callable', 'arg='=>'string'],
'EventBufferEvent::setPriority' => ['bool', 'priority'=>'int'],
'EventBufferEvent::setTimeouts' => ['bool', 'timeout_read'=>'float', 'timeout_write'=>'float'],
'EventBufferEvent::setWatermark' => ['void', 'events'=>'int', 'lowmark'=>'int', 'highmark'=>'int'],
'EventBufferEvent::sslError' => ['string'],
'EventBufferEvent::sslFilter' => ['EventBufferEvent', 'base'=>'EventBase', 'underlying'=>'EventBufferEvent', 'ctx'=>'EventSslContext', 'state'=>'int', 'options='=>'int'],
'EventBufferEvent::sslGetCipherInfo' => ['string'],
'EventBufferEvent::sslGetCipherName' => ['string'],
'EventBufferEvent::sslGetCipherVersion' => ['string'],
'EventBufferEvent::sslGetProtocol' => ['string'],
'EventBufferEvent::sslRenegotiate' => ['void'],
'EventBufferEvent::sslSocket' => ['EventBufferEvent', 'base'=>'EventBase', 'socket'=>'mixed', 'ctx'=>'EventSslContext', 'state'=>'int', 'options='=>'int'],
'EventBufferEvent::write' => ['bool', 'data'=>'string'],
'EventBufferEvent::writeBuffer' => ['bool', 'buf'=>'EventBuffer'],
'EventConfig::__construct' => ['void'],
'EventConfig::avoidMethod' => ['bool', 'method'=>'string'],
'EventConfig::requireFeatures' => ['bool', 'feature'=>'int'],
'EventConfig::setMaxDispatchInterval' => ['void', 'max_interval'=>'int', 'max_callbacks'=>'int', 'min_priority'=>'int'],
'EventDnsBase::__construct' => ['void', 'base'=>'EventBase', 'initialize'=>'bool'],
'EventDnsBase::addNameserverIp' => ['bool', 'ip'=>'string'],
'EventDnsBase::addSearch' => ['void', 'domain'=>'string'],
'EventDnsBase::clearSearch' => ['void'],
'EventDnsBase::countNameservers' => ['int'],
'EventDnsBase::loadHosts' => ['bool', 'hosts'=>'string'],
'EventDnsBase::parseResolvConf' => ['bool', 'flags'=>'int', 'filename'=>'string'],
'EventDnsBase::setOption' => ['bool', 'option'=>'string', 'value'=>'string'],
'EventDnsBase::setSearchNdots' => ['bool', 'ndots'=>'int'],
'EventHttp::__construct' => ['void', 'base'=>'EventBase', 'ctx='=>'EventSslContext'],
'EventHttp::accept' => ['bool', 'socket'=>'mixed'],
'EventHttp::addServerAlias' => ['bool', 'alias'=>'string'],
'EventHttp::bind' => ['void', 'address'=>'string', 'port'=>'int'],
'EventHttp::removeServerAlias' => ['bool', 'alias'=>'string'],
'EventHttp::setAllowedMethods' => ['void', 'methods'=>'int'],
'EventHttp::setCallback' => ['void', 'path'=>'string', 'cb'=>'string', 'arg='=>'string'],
'EventHttp::setDefaultCallback' => ['void', 'cb'=>'string', 'arg='=>'string'],
'EventHttp::setMaxBodySize' => ['void', 'value'=>'int'],
'EventHttp::setMaxHeadersSize' => ['void', 'value'=>'int'],
'EventHttp::setTimeout' => ['void', 'value'=>'int'],
'EventHttpConnection::__construct' => ['void', 'base'=>'EventBase', 'dns_base'=>'EventDnsBase', 'address'=>'string', 'port'=>'int', 'ctx='=>'EventSslContext'],
'EventHttpConnection::getBase' => ['EventBase'],
'EventHttpConnection::getPeer' => ['void', '&w_address'=>'string', '&w_port'=>'int'],
'EventHttpConnection::makeRequest' => ['bool', 'req'=>'EventHttpRequest', 'type'=>'int', 'uri'=>'string'],
'EventHttpConnection::setCloseCallback' => ['void', 'callback'=>'callable', 'data='=>'mixed'],
'EventHttpConnection::setLocalAddress' => ['void', 'address'=>'string'],
'EventHttpConnection::setLocalPort' => ['void', 'port'=>'int'],
'EventHttpConnection::setMaxBodySize' => ['void', 'max_size'=>'string'],
'EventHttpConnection::setMaxHeadersSize' => ['void', 'max_size'=>'string'],
'EventHttpConnection::setRetries' => ['void', 'retries'=>'int'],
'EventHttpConnection::setTimeout' => ['void', 'timeout'=>'int'],
'EventHttpRequest::__construct' => ['void', 'callback'=>'callable', 'data='=>'mixed'],
'EventHttpRequest::addHeader' => ['bool', 'key'=>'string', 'value'=>'string', 'type'=>'int'],
'EventHttpRequest::cancel' => ['void'],
'EventHttpRequest::clearHeaders' => ['void'],
'EventHttpRequest::closeConnection' => ['void'],
'EventHttpRequest::findHeader' => ['void', 'key'=>'string', 'type'=>'string'],
'EventHttpRequest::free' => ['void'],
'EventHttpRequest::getBufferEvent' => ['EventBufferEvent'],
'EventHttpRequest::getCommand' => ['void'],
'EventHttpRequest::getConnection' => ['EventHttpConnection'],
'EventHttpRequest::getHost' => ['string'],
'EventHttpRequest::getInputBuffer' => ['EventBuffer'],
'EventHttpRequest::getInputHeaders' => ['array'],
'EventHttpRequest::getOutputBuffer' => ['EventBuffer'],
'EventHttpRequest::getOutputHeaders' => ['void'],
'EventHttpRequest::getResponseCode' => ['int'],
'EventHttpRequest::getUri' => ['string'],
'EventHttpRequest::removeHeader' => ['void', 'key'=>'string', 'type'=>'string'],
'EventHttpRequest::sendError' => ['void', 'error'=>'int', 'reason='=>'string'],
'EventHttpRequest::sendReply' => ['void', 'code'=>'int', 'reason'=>'string', 'buf='=>'EventBuffer'],
'EventHttpRequest::sendReplyChunk' => ['void', 'buf'=>'EventBuffer'],
'EventHttpRequest::sendReplyEnd' => ['void'],
'EventHttpRequest::sendReplyStart' => ['void', 'code'=>'int', 'reason'=>'string'],
'EventListener::__construct' => ['void', 'base'=>'EventBase', 'cb'=>'callable', 'data'=>'mixed', 'flags'=>'int', 'backlog'=>'int', 'target'=>'mixed'],
'EventListener::disable' => ['bool'],
'EventListener::enable' => ['bool'],
'EventListener::getBase' => ['void'],
'EventListener::getSocketName' => ['bool', '&w_address'=>'string', '&w_port='=>'mixed'],
'EventListener::setCallback' => ['void', 'cb'=>'callable', 'arg='=>'mixed'],
'EventListener::setErrorCallback' => ['void', 'cb'=>'string'],
'EventSslContext::__construct' => ['void', 'method'=>'string', 'options'=>'string'],
'EventUtil::__construct' => ['void'],
'EventUtil::getLastSocketErrno' => ['int', 'socket='=>'mixed'],
'EventUtil::getLastSocketError' => ['string', 'socket='=>'mixed'],
'EventUtil::getSocketFd' => ['int', 'socket'=>'mixed'],
'EventUtil::getSocketName' => ['bool', 'socket'=>'mixed', '&w_address'=>'string', '&w_port='=>'mixed'],
'EventUtil::setSocketOption' => ['bool', 'socket'=>'mixed', 'level'=>'int', 'optname'=>'int', 'optval'=>'mixed'],
'EventUtil::sslRandPoll' => ['void'],
'EvFork::__construct' => ['void', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvFork::clear' => ['int'],
'EvFork::createStopped' => ['EvFork', 'callback'=>'callable', 'data='=>'string', 'priority='=>'string'],
'EvFork::feed' => ['void', 'events'=>'int'],
'EvFork::getLoop' => ['EvLoop'],
'EvFork::invoke' => ['void', 'events'=>'int'],
'EvFork::keepAlive' => ['void', 'value'=>'bool'],
'EvFork::setCallback' => ['void', 'callback'=>'callable'],
'EvFork::start' => ['void'],
'EvFork::stop' => ['void'],
'EvIdle::__construct' => ['void', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvIdle::clear' => ['int'],
'EvIdle::createStopped' => ['EvIdle', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvIdle::feed' => ['void', 'events'=>'int'],
'EvIdle::getLoop' => ['EvLoop'],
'EvIdle::invoke' => ['void', 'events'=>'int'],
'EvIdle::keepAlive' => ['void', 'value'=>'bool'],
'EvIdle::setCallback' => ['void', 'callback'=>'callable'],
'EvIdle::start' => ['void'],
'EvIdle::stop' => ['void'],
'EvIo::__construct' => ['void', 'fd'=>'mixed', 'events'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvIo::clear' => ['int'],
'EvIo::createStopped' => ['EvIo', 'fd'=>'resource', 'events'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvIo::feed' => ['void', 'events'=>'int'],
'EvIo::getLoop' => ['EvLoop'],
'EvIo::invoke' => ['void', 'events'=>'int'],
'EvIo::keepAlive' => ['void', 'value'=>'bool'],
'EvIo::set' => ['void', 'fd'=>'resource', 'events'=>'int'],
'EvIo::setCallback' => ['void', 'callback'=>'callable'],
'EvIo::start' => ['void'],
'EvIo::stop' => ['void'],
'EvLoop::__construct' => ['void', 'flags='=>'int', 'data='=>'mixed', 'io_interval='=>'float', 'timeout_interval='=>'float'],
'EvLoop::backend' => ['int'],
'EvLoop::check' => ['EvCheck', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::child' => ['EvChild', 'pid'=>'int', 'trace'=>'bool', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::defaultLoop' => ['EvLoop', 'flags='=>'int', 'data='=>'mixed', 'io_interval='=>'float', 'timeout_interval='=>'float'],
'EvLoop::embed' => ['EvEmbed', 'other'=>'EvLoop', 'callback='=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::fork' => ['EvFork', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::idle' => ['EvIdle', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::invokePending' => ['void'],
'EvLoop::io' => ['EvIo', 'fd'=>'resource', 'events'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::loopFork' => ['void'],
'EvLoop::now' => ['float'],
'EvLoop::nowUpdate' => ['void'],
'EvLoop::periodic' => ['EvPeriodic', 'offset'=>'float', 'interval'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::prepare' => ['EvPrepare', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::resume' => ['void'],
'EvLoop::run' => ['void', 'flags='=>'int'],
'EvLoop::signal' => ['EvSignal', 'signum'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::stat' => ['EvStat', 'path'=>'string', 'interval'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::stop' => ['void', 'how='=>'int'],
'EvLoop::suspend' => ['void'],
'EvLoop::timer' => ['EvTimer', 'after'=>'float', 'repeat'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvLoop::verify' => ['void'],
'EvPeriodic::__construct' => ['void', 'offset'=>'float', 'interval'=>'string', 'reschedule_cb'=>'callable', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvPeriodic::again' => ['void'],
'EvPeriodic::at' => ['float'],
'EvPeriodic::clear' => ['int'],
'EvPeriodic::createStopped' => ['EvPeriodic', 'offset'=>'float', 'interval'=>'float', 'reschedule_cb'=>'callable', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvPeriodic::feed' => ['void', 'events'=>'int'],
'EvPeriodic::getLoop' => ['EvLoop'],
'EvPeriodic::invoke' => ['void', 'events'=>'int'],
'EvPeriodic::keepAlive' => ['void', 'value'=>'bool'],
'EvPeriodic::set' => ['void', 'offset'=>'float', 'interval'=>'float'],
'EvPeriodic::setCallback' => ['void', 'callback'=>'callable'],
'EvPeriodic::start' => ['void'],
'EvPeriodic::stop' => ['void'],
'EvPrepare::__construct' => ['void', 'callback'=>'string', 'data='=>'string', 'priority='=>'string'],
'EvPrepare::clear' => ['int'],
'EvPrepare::createStopped' => ['EvPrepare', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvPrepare::feed' => ['void', 'events'=>'int'],
'EvPrepare::getLoop' => ['EvLoop'],
'EvPrepare::invoke' => ['void', 'events'=>'int'],
'EvPrepare::keepAlive' => ['void', 'value'=>'bool'],
'EvPrepare::setCallback' => ['void', 'callback'=>'callable'],
'EvPrepare::start' => ['void'],
'EvPrepare::stop' => ['void'],
'EvSignal::__construct' => ['void', 'signum'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvSignal::clear' => ['int'],
'EvSignal::createStopped' => ['EvSignal', 'signum'=>'int', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvSignal::feed' => ['void', 'events'=>'int'],
'EvSignal::getLoop' => ['EvLoop'],
'EvSignal::invoke' => ['void', 'events'=>'int'],
'EvSignal::keepAlive' => ['void', 'value'=>'bool'],
'EvSignal::set' => ['void', 'signum'=>'int'],
'EvSignal::setCallback' => ['void', 'callback'=>'callable'],
'EvSignal::start' => ['void'],
'EvSignal::stop' => ['void'],
'EvStat::__construct' => ['void', 'path'=>'string', 'interval'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvStat::attr' => ['array'],
'EvStat::clear' => ['int'],
'EvStat::createStopped' => ['EvStat', 'path'=>'string', 'interval'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvStat::feed' => ['void', 'events'=>'int'],
'EvStat::getLoop' => ['EvLoop'],
'EvStat::invoke' => ['void', 'events'=>'int'],
'EvStat::keepAlive' => ['void', 'value'=>'bool'],
'EvStat::prev' => ['array'],
'EvStat::set' => ['void', 'path'=>'string', 'interval'=>'float'],
'EvStat::setCallback' => ['void', 'callback'=>'callable'],
'EvStat::start' => ['void'],
'EvStat::stat' => ['bool'],
'EvStat::stop' => ['void'],
'EvTimer::__construct' => ['void', 'after'=>'float', 'repeat'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvTimer::again' => ['void'],
'EvTimer::clear' => ['int'],
'EvTimer::createStopped' => ['EvTimer', 'after'=>'float', 'repeat'=>'float', 'callback'=>'callable', 'data='=>'mixed', 'priority='=>'int'],
'EvTimer::feed' => ['void', 'events'=>'int'],
'EvTimer::getLoop' => ['EvLoop'],
'EvTimer::invoke' => ['void', 'events'=>'int'],
'EvTimer::keepAlive' => ['void', 'value'=>'bool'],
'EvTimer::set' => ['void', 'after'=>'float', 'repeat'=>'float'],
'EvTimer::setCallback' => ['void', 'callback'=>'callable'],
'EvTimer::start' => ['void'],
'EvTimer::stop' => ['void'],
'EvWatcher::__construct' => ['void'],
'EvWatcher::clear' => ['int'],
'EvWatcher::feed' => ['void', 'revents'=>'int'],
'EvWatcher::getLoop' => ['EvLoop'],
'EvWatcher::invoke' => ['void', 'revents'=>'int'],
'EvWatcher::keepalive' => ['bool', 'value='=>'bool'],
'EvWatcher::setCallback' => ['void', 'callback'=>'callable'],
'EvWatcher::start' => ['void'],
'EvWatcher::stop' => ['void'],
'Exception::__clone' => ['void'],
'Exception::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?Exception'],
'Exception::__toString' => ['string'],
'Exception::getCode' => ['int|string'],
'Exception::getFile' => ['string'],
'Exception::getLine' => ['int'],
'Exception::getMessage' => ['string'],
'Exception::getPrevious' => ['?Throwable|?Exception'],
'Exception::getTrace' => ['list<array<string,mixed>>'],
'Exception::getTraceAsString' => ['string'],
'exec' => ['string|false', 'command'=>'string', '&w_output='=>'array', '&w_result_code='=>'int'],
'exif_imagetype' => ['int|false', 'filename'=>'string'],
'exif_read_data' => ['array|false', 'file'=>'string|resource', 'required_sections='=>'string', 'as_arrays='=>'bool', 'read_thumbnail='=>'bool'],
'exif_tagname' => ['string|false', 'index'=>'int'],
'exif_thumbnail' => ['string|false', 'file'=>'string', '&w_width='=>'int', '&w_height='=>'int', '&w_image_type='=>'int'],
'exit' => ['', 'status'=>'string|int'],
'exp' => ['float', 'num'=>'float'],
'expect_expectl' => ['int', 'expect'=>'resource', 'cases'=>'array', 'match='=>'array'],
'expect_popen' => ['resource|false', 'command'=>'string'],
'explode' => ['list<string>', 'separator'=>'string', 'string'=>'string', 'limit='=>'int'],
'expm1' => ['float', 'num'=>'float'],
'extension_loaded' => ['bool', 'extension'=>'string'],
'extract' => ['int', '&rw_array'=>'array', 'flags='=>'int', 'prefix='=>'?string'],
'ezmlm_hash' => ['int', 'addr'=>'string'],
'fam_cancel_monitor' => ['bool', 'fam'=>'resource', 'fam_monitor'=>'resource'],
'fam_close' => ['void', 'fam'=>'resource'],
'fam_monitor_collection' => ['resource', 'fam'=>'resource', 'dirname'=>'string', 'depth'=>'int', 'mask'=>'string'],
'fam_monitor_directory' => ['resource', 'fam'=>'resource', 'dirname'=>'string'],
'fam_monitor_file' => ['resource', 'fam'=>'resource', 'filename'=>'string'],
'fam_next_event' => ['array', 'fam'=>'resource'],
'fam_open' => ['resource|false', 'appname='=>'string'],
'fam_pending' => ['int', 'fam'=>'resource'],
'fam_resume_monitor' => ['bool', 'fam'=>'resource', 'fam_monitor'=>'resource'],
'fam_suspend_monitor' => ['bool', 'fam'=>'resource', 'fam_monitor'=>'resource'],
'fann_cascadetrain_on_data' => ['bool', 'ann'=>'resource', 'data'=>'resource', 'max_neurons'=>'int', 'neurons_between_reports'=>'int', 'desired_error'=>'float'],
'fann_cascadetrain_on_file' => ['bool', 'ann'=>'resource', 'filename'=>'string', 'max_neurons'=>'int', 'neurons_between_reports'=>'int', 'desired_error'=>'float'],
'fann_clear_scaling_params' => ['bool', 'ann'=>'resource'],
'fann_copy' => ['resource|false', 'ann'=>'resource'],
'fann_create_from_file' => ['resource', 'configuration_file'=>'string'],
'fann_create_shortcut' => ['resource|false', 'num_layers'=>'int', 'num_neurons1'=>'int', 'num_neurons2'=>'int', '...args='=>'int'],
'fann_create_shortcut_array' => ['resource|false', 'num_layers'=>'int', 'layers'=>'array'],
'fann_create_sparse' => ['resource|false', 'connection_rate'=>'float', 'num_layers'=>'int', 'num_neurons1'=>'int', 'num_neurons2'=>'int', '...args='=>'int'],
'fann_create_sparse_array' => ['resource|false', 'connection_rate'=>'float', 'num_layers'=>'int', 'layers'=>'array'],
'fann_create_standard' => ['resource|false', 'num_layers'=>'int', 'num_neurons1'=>'int', 'num_neurons2'=>'int', '...args='=>'int'],
'fann_create_standard_array' => ['resource|false', 'num_layers'=>'int', 'layers'=>'array'],
'fann_create_train' => ['resource', 'num_data'=>'int', 'num_input'=>'int', 'num_output'=>'int'],
'fann_create_train_from_callback' => ['resource', 'num_data'=>'int', 'num_input'=>'int', 'num_output'=>'int', 'user_function'=>'callable'],
'fann_descale_input' => ['bool', 'ann'=>'resource', 'input_vector'=>'array'],
'fann_descale_output' => ['bool', 'ann'=>'resource', 'output_vector'=>'array'],
'fann_descale_train' => ['bool', 'ann'=>'resource', 'train_data'=>'resource'],
'fann_destroy' => ['bool', 'ann'=>'resource'],
'fann_destroy_train' => ['bool', 'train_data'=>'resource'],
'fann_duplicate_train_data' => ['resource', 'data'=>'resource'],
'fann_get_activation_function' => ['int|false', 'ann'=>'resource', 'layer'=>'int', 'neuron'=>'int'],
'fann_get_activation_steepness' => ['float|false', 'ann'=>'resource', 'layer'=>'int', 'neuron'=>'int'],
'fann_get_bias_array' => ['array', 'ann'=>'resource'],
'fann_get_bit_fail' => ['int|false', 'ann'=>'resource'],
'fann_get_bit_fail_limit' => ['float|false', 'ann'=>'resource'],
'fann_get_cascade_activation_functions' => ['array|false', 'ann'=>'resource'],
'fann_get_cascade_activation_functions_count' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_activation_steepnesses' => ['array|false', 'ann'=>'resource'],
'fann_get_cascade_activation_steepnesses_count' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_candidate_change_fraction' => ['float|false', 'ann'=>'resource'],
'fann_get_cascade_candidate_limit' => ['float|false', 'ann'=>'resource'],
'fann_get_cascade_candidate_stagnation_epochs' => ['float|false', 'ann'=>'resource'],
'fann_get_cascade_max_cand_epochs' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_max_out_epochs' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_min_cand_epochs' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_min_out_epochs' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_num_candidate_groups' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_num_candidates' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_output_change_fraction' => ['float|false', 'ann'=>'resource'],
'fann_get_cascade_output_stagnation_epochs' => ['int|false', 'ann'=>'resource'],
'fann_get_cascade_weight_multiplier' => ['float|false', 'ann'=>'resource'],
'fann_get_connection_array' => ['array', 'ann'=>'resource'],
'fann_get_connection_rate' => ['float|false', 'ann'=>'resource'],
'fann_get_errno' => ['int|false', 'errdat'=>'resource'],
'fann_get_errstr' => ['string|false', 'errdat'=>'resource'],
'fann_get_layer_array' => ['array', 'ann'=>'resource'],
'fann_get_learning_momentum' => ['float|false', 'ann'=>'resource'],
'fann_get_learning_rate' => ['float|false', 'ann'=>'resource'],
'fann_get_MSE' => ['float|false', 'ann'=>'resource'],
'fann_get_network_type' => ['int|false', 'ann'=>'resource'],
'fann_get_num_input' => ['int|false', 'ann'=>'resource'],
'fann_get_num_layers' => ['int|false', 'ann'=>'resource'],
'fann_get_num_output' => ['int|false', 'ann'=>'resource'],
'fann_get_quickprop_decay' => ['float|false', 'ann'=>'resource'],
'fann_get_quickprop_mu' => ['float|false', 'ann'=>'resource'],
'fann_get_rprop_decrease_factor' => ['float|false', 'ann'=>'resource'],
'fann_get_rprop_delta_max' => ['float|false', 'ann'=>'resource'],
'fann_get_rprop_delta_min' => ['float|false', 'ann'=>'resource'],
'fann_get_rprop_delta_zero' => ['float|false', 'ann'=>'resource'],
'fann_get_rprop_increase_factor' => ['float|false', 'ann'=>'resource'],
'fann_get_sarprop_step_error_shift' => ['float|false', 'ann'=>'resource'],
'fann_get_sarprop_step_error_threshold_factor' => ['float|false', 'ann'=>'resource'],
'fann_get_sarprop_temperature' => ['float|false', 'ann'=>'resource'],
'fann_get_sarprop_weight_decay_shift' => ['float|false', 'ann'=>'resource'],
'fann_get_total_connections' => ['int|false', 'ann'=>'resource'],
'fann_get_total_neurons' => ['int|false', 'ann'=>'resource'],
'fann_get_train_error_function' => ['int|false', 'ann'=>'resource'],
'fann_get_train_stop_function' => ['int|false', 'ann'=>'resource'],
'fann_get_training_algorithm' => ['int|false', 'ann'=>'resource'],
'fann_init_weights' => ['bool', 'ann'=>'resource', 'train_data'=>'resource'],
'fann_length_train_data' => ['int|false', 'data'=>'resource'],
'fann_merge_train_data' => ['resource|false', 'data1'=>'resource', 'data2'=>'resource'],
'fann_num_input_train_data' => ['int|false', 'data'=>'resource'],
'fann_num_output_train_data' => ['int|false', 'data'=>'resource'],
'fann_print_error' => ['void', 'errdat'=>'string'],
'fann_randomize_weights' => ['bool', 'ann'=>'resource', 'min_weight'=>'float', 'max_weight'=>'float'],
'fann_read_train_from_file' => ['resource', 'filename'=>'string'],
'fann_reset_errno' => ['void', 'errdat'=>'resource'],
'fann_reset_errstr' => ['void', 'errdat'=>'resource'],
'fann_reset_MSE' => ['bool', 'ann'=>'string'],
'fann_run' => ['array|false', 'ann'=>'resource', 'input'=>'array'],
'fann_save' => ['bool', 'ann'=>'resource', 'configuration_file'=>'string'],
'fann_save_train' => ['bool', 'data'=>'resource', 'file_name'=>'string'],
'fann_scale_input' => ['bool', 'ann'=>'resource', 'input_vector'=>'array'],
'fann_scale_input_train_data' => ['bool', 'train_data'=>'resource', 'new_min'=>'float', 'new_max'=>'float'],
'fann_scale_output' => ['bool', 'ann'=>'resource', 'output_vector'=>'array'],
'fann_scale_output_train_data' => ['bool', 'train_data'=>'resource', 'new_min'=>'float', 'new_max'=>'float'],
'fann_scale_train' => ['bool', 'ann'=>'resource', 'train_data'=>'resource'],
'fann_scale_train_data' => ['bool', 'train_data'=>'resource', 'new_min'=>'float', 'new_max'=>'float'],
'fann_set_activation_function' => ['bool', 'ann'=>'resource', 'activation_function'=>'int', 'layer'=>'int', 'neuron'=>'int'],
'fann_set_activation_function_hidden' => ['bool', 'ann'=>'resource', 'activation_function'=>'int'],
'fann_set_activation_function_layer' => ['bool', 'ann'=>'resource', 'activation_function'=>'int', 'layer'=>'int'],
'fann_set_activation_function_output' => ['bool', 'ann'=>'resource', 'activation_function'=>'int'],
'fann_set_activation_steepness' => ['bool', 'ann'=>'resource', 'activation_steepness'=>'float', 'layer'=>'int', 'neuron'=>'int'],
'fann_set_activation_steepness_hidden' => ['bool', 'ann'=>'resource', 'activation_steepness'=>'float'],
'fann_set_activation_steepness_layer' => ['bool', 'ann'=>'resource', 'activation_steepness'=>'float', 'layer'=>'int'],
'fann_set_activation_steepness_output' => ['bool', 'ann'=>'resource', 'activation_steepness'=>'float'],
'fann_set_bit_fail_limit' => ['bool', 'ann'=>'resource', 'bit_fail_limit'=>'float'],
'fann_set_callback' => ['bool', 'ann'=>'resource', 'callback'=>'callable'],
'fann_set_cascade_activation_functions' => ['bool', 'ann'=>'resource', 'cascade_activation_functions'=>'array'],
'fann_set_cascade_activation_steepnesses' => ['bool', 'ann'=>'resource', 'cascade_activation_steepnesses_count'=>'array'],
'fann_set_cascade_candidate_change_fraction' => ['bool', 'ann'=>'resource', 'cascade_candidate_change_fraction'=>'float'],
'fann_set_cascade_candidate_limit' => ['bool', 'ann'=>'resource', 'cascade_candidate_limit'=>'float'],
'fann_set_cascade_candidate_stagnation_epochs' => ['bool', 'ann'=>'resource', 'cascade_candidate_stagnation_epochs'=>'int'],
'fann_set_cascade_max_cand_epochs' => ['bool', 'ann'=>'resource', 'cascade_max_cand_epochs'=>'int'],
'fann_set_cascade_max_out_epochs' => ['bool', 'ann'=>'resource', 'cascade_max_out_epochs'=>'int'],
'fann_set_cascade_min_cand_epochs' => ['bool', 'ann'=>'resource', 'cascade_min_cand_epochs'=>'int'],
'fann_set_cascade_min_out_epochs' => ['bool', 'ann'=>'resource', 'cascade_min_out_epochs'=>'int'],
'fann_set_cascade_num_candidate_groups' => ['bool', 'ann'=>'resource', 'cascade_num_candidate_groups'=>'int'],
'fann_set_cascade_output_change_fraction' => ['bool', 'ann'=>'resource', 'cascade_output_change_fraction'=>'float'],
'fann_set_cascade_output_stagnation_epochs' => ['bool', 'ann'=>'resource', 'cascade_output_stagnation_epochs'=>'int'],
'fann_set_cascade_weight_multiplier' => ['bool', 'ann'=>'resource', 'cascade_weight_multiplier'=>'float'],
'fann_set_error_log' => ['void', 'errdat'=>'resource', 'log_file'=>'string'],
'fann_set_input_scaling_params' => ['bool', 'ann'=>'resource', 'train_data'=>'resource', 'new_input_min'=>'float', 'new_input_max'=>'float'],
'fann_set_learning_momentum' => ['bool', 'ann'=>'resource', 'learning_momentum'=>'float'],
'fann_set_learning_rate' => ['bool', 'ann'=>'resource', 'learning_rate'=>'float'],
'fann_set_output_scaling_params' => ['bool', 'ann'=>'resource', 'train_data'=>'resource', 'new_output_min'=>'float', 'new_output_max'=>'float'],
'fann_set_quickprop_decay' => ['bool', 'ann'=>'resource', 'quickprop_decay'=>'float'],
'fann_set_quickprop_mu' => ['bool', 'ann'=>'resource', 'quickprop_mu'=>'float'],
'fann_set_rprop_decrease_factor' => ['bool', 'ann'=>'resource', 'rprop_decrease_factor'=>'float'],
'fann_set_rprop_delta_max' => ['bool', 'ann'=>'resource', 'rprop_delta_max'=>'float'],
'fann_set_rprop_delta_min' => ['bool', 'ann'=>'resource', 'rprop_delta_min'=>'float'],
'fann_set_rprop_delta_zero' => ['bool', 'ann'=>'resource', 'rprop_delta_zero'=>'float'],
'fann_set_rprop_increase_factor' => ['bool', 'ann'=>'resource', 'rprop_increase_factor'=>'float'],
'fann_set_sarprop_step_error_shift' => ['bool', 'ann'=>'resource', 'sarprop_step_error_shift'=>'float'],
'fann_set_sarprop_step_error_threshold_factor' => ['bool', 'ann'=>'resource', 'sarprop_step_error_threshold_factor'=>'float'],
'fann_set_sarprop_temperature' => ['bool', 'ann'=>'resource', 'sarprop_temperature'=>'float'],
'fann_set_sarprop_weight_decay_shift' => ['bool', 'ann'=>'resource', 'sarprop_weight_decay_shift'=>'float'],
'fann_set_scaling_params' => ['bool', 'ann'=>'resource', 'train_data'=>'resource', 'new_input_min'=>'float', 'new_input_max'=>'float', 'new_output_min'=>'float', 'new_output_max'=>'float'],
'fann_set_train_error_function' => ['bool', 'ann'=>'resource', 'error_function'=>'int'],
'fann_set_train_stop_function' => ['bool', 'ann'=>'resource', 'stop_function'=>'int'],
'fann_set_training_algorithm' => ['bool', 'ann'=>'resource', 'training_algorithm'=>'int'],
'fann_set_weight' => ['bool', 'ann'=>'resource', 'from_neuron'=>'int', 'to_neuron'=>'int', 'weight'=>'float'],
'fann_set_weight_array' => ['bool', 'ann'=>'resource', 'connections'=>'array'],
'fann_shuffle_train_data' => ['bool', 'train_data'=>'resource'],
'fann_subset_train_data' => ['resource', 'data'=>'resource', 'pos'=>'int', 'length'=>'int'],
'fann_test' => ['bool', 'ann'=>'resource', 'input'=>'array', 'desired_output'=>'array'],
'fann_test_data' => ['float|false', 'ann'=>'resource', 'data'=>'resource'],
'fann_train' => ['bool', 'ann'=>'resource', 'input'=>'array', 'desired_output'=>'array'],
'fann_train_epoch' => ['float|false', 'ann'=>'resource', 'data'=>'resource'],
'fann_train_on_data' => ['bool', 'ann'=>'resource', 'data'=>'resource', 'max_epochs'=>'int', 'epochs_between_reports'=>'int', 'desired_error'=>'float'],
'fann_train_on_file' => ['bool', 'ann'=>'resource', 'filename'=>'string', 'max_epochs'=>'int', 'epochs_between_reports'=>'int', 'desired_error'=>'float'],
'FANNConnection::__construct' => ['void', 'from_neuron'=>'int', 'to_neuron'=>'int', 'weight'=>'float'],
'FANNConnection::getFromNeuron' => ['int'],
'FANNConnection::getToNeuron' => ['int'],
'FANNConnection::getWeight' => ['void'],
'FANNConnection::setWeight' => ['bool', 'weight'=>'float'],
'fastcgi_finish_request' => ['bool'],
'fbsql_affected_rows' => ['int', 'link_identifier='=>'?resource'],
'fbsql_autocommit' => ['bool', 'link_identifier'=>'resource', 'onoff='=>'bool'],
'fbsql_blob_size' => ['int', 'blob_handle'=>'string', 'link_identifier='=>'?resource'],
'fbsql_change_user' => ['bool', 'user'=>'string', 'password'=>'string', 'database='=>'string', 'link_identifier='=>'?resource'],
'fbsql_clob_size' => ['int', 'clob_handle'=>'string', 'link_identifier='=>'?resource'],
'fbsql_close' => ['bool', 'link_identifier='=>'?resource'],
'fbsql_commit' => ['bool', 'link_identifier='=>'?resource'],
'fbsql_connect' => ['resource', 'hostname='=>'string', 'username='=>'string', 'password='=>'string'],
'fbsql_create_blob' => ['string', 'blob_data'=>'string', 'link_identifier='=>'?resource'],
'fbsql_create_clob' => ['string', 'clob_data'=>'string', 'link_identifier='=>'?resource'],
'fbsql_create_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource', 'database_options='=>'string'],
'fbsql_data_seek' => ['bool', 'result'=>'resource', 'row_number'=>'int'],
'fbsql_database' => ['string', 'link_identifier'=>'resource', 'database='=>'string'],
'fbsql_database_password' => ['string', 'link_identifier'=>'resource', 'database_password='=>'string'],
'fbsql_db_query' => ['resource', 'database'=>'string', 'query'=>'string', 'link_identifier='=>'?resource'],
'fbsql_db_status' => ['int', 'database_name'=>'string', 'link_identifier='=>'?resource'],
'fbsql_drop_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'],
'fbsql_errno' => ['int', 'link_identifier='=>'?resource'],
'fbsql_error' => ['string', 'link_identifier='=>'?resource'],
'fbsql_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'],
'fbsql_fetch_assoc' => ['array', 'result'=>'resource'],
'fbsql_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'],
'fbsql_fetch_lengths' => ['array', 'result'=>'resource'],
'fbsql_fetch_object' => ['object', 'result'=>'resource'],
'fbsql_fetch_row' => ['array', 'result'=>'resource'],
'fbsql_field_flags' => ['string', 'result'=>'resource', 'field_offset='=>'int'],
'fbsql_field_len' => ['int', 'result'=>'resource', 'field_offset='=>'int'],
'fbsql_field_name' => ['string', 'result'=>'resource', 'field_index='=>'int'],
'fbsql_field_seek' => ['bool', 'result'=>'resource', 'field_offset='=>'int'],
'fbsql_field_table' => ['string', 'result'=>'resource', 'field_offset='=>'int'],
'fbsql_field_type' => ['string', 'result'=>'resource', 'field_offset='=>'int'],
'fbsql_free_result' => ['bool', 'result'=>'resource'],
'fbsql_get_autostart_info' => ['array', 'link_identifier='=>'?resource'],
'fbsql_hostname' => ['string', 'link_identifier'=>'resource', 'host_name='=>'string'],
'fbsql_insert_id' => ['int', 'link_identifier='=>'?resource'],
'fbsql_list_dbs' => ['resource', 'link_identifier='=>'?resource'],
'fbsql_list_fields' => ['resource', 'database_name'=>'string', 'table_name'=>'string', 'link_identifier='=>'?resource'],
'fbsql_list_tables' => ['resource', 'database'=>'string', 'link_identifier='=>'?resource'],
'fbsql_next_result' => ['bool', 'result'=>'resource'],
'fbsql_num_fields' => ['int', 'result'=>'resource'],
'fbsql_num_rows' => ['int', 'result'=>'resource'],
'fbsql_password' => ['string', 'link_identifier'=>'resource', 'password='=>'string'],
'fbsql_pconnect' => ['resource', 'hostname='=>'string', 'username='=>'string', 'password='=>'string'],
'fbsql_query' => ['resource', 'query'=>'string', 'link_identifier='=>'?resource', 'batch_size='=>'int'],
'fbsql_read_blob' => ['string', 'blob_handle'=>'string', 'link_identifier='=>'?resource'],
'fbsql_read_clob' => ['string', 'clob_handle'=>'string', 'link_identifier='=>'?resource'],
'fbsql_result' => ['mixed', 'result'=>'resource', 'row='=>'int', 'field='=>'mixed'],
'fbsql_rollback' => ['bool', 'link_identifier='=>'?resource'],
'fbsql_rows_fetched' => ['int', 'result'=>'resource'],
'fbsql_select_db' => ['bool', 'database_name='=>'string', 'link_identifier='=>'?resource'],
'fbsql_set_characterset' => ['void', 'link_identifier'=>'resource', 'characterset'=>'int', 'in_out_both='=>'int'],
'fbsql_set_lob_mode' => ['bool', 'result'=>'resource', 'lob_mode'=>'int'],
'fbsql_set_password' => ['bool', 'link_identifier'=>'resource', 'user'=>'string', 'password'=>'string', 'old_password'=>'string'],
'fbsql_set_transaction' => ['void', 'link_identifier'=>'resource', 'locking'=>'int', 'isolation'=>'int'],
'fbsql_start_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource', 'database_options='=>'string'],
'fbsql_stop_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'],
'fbsql_table_name' => ['string', 'result'=>'resource', 'index'=>'int'],
'fbsql_username' => ['string', 'link_identifier'=>'resource', 'username='=>'string'],
'fbsql_warnings' => ['bool', 'onoff='=>'bool'],
'fclose' => ['bool', 'stream'=>'resource'],
'fdf_add_doc_javascript' => ['bool', 'fdf_document'=>'resource', 'script_name'=>'string', 'script_code'=>'string'],
'fdf_add_template' => ['bool', 'fdf_document'=>'resource', 'newpage'=>'int', 'filename'=>'string', 'template'=>'string', 'rename'=>'int'],
'fdf_close' => ['void', 'fdf_document'=>'resource'],
'fdf_create' => ['resource'],
'fdf_enum_values' => ['bool', 'fdf_document'=>'resource', 'function'=>'callable', 'userdata='=>'mixed'],
'fdf_errno' => ['int'],
'fdf_error' => ['string', 'error_code='=>'int'],
'fdf_get_ap' => ['bool', 'fdf_document'=>'resource', 'field'=>'string', 'face'=>'int', 'filename'=>'string'],
'fdf_get_attachment' => ['array', 'fdf_document'=>'resource', 'fieldname'=>'string', 'savepath'=>'string'],
'fdf_get_encoding' => ['string', 'fdf_document'=>'resource'],
'fdf_get_file' => ['string', 'fdf_document'=>'resource'],
'fdf_get_flags' => ['int', 'fdf_document'=>'resource', 'fieldname'=>'string', 'whichflags'=>'int'],
'fdf_get_opt' => ['mixed', 'fdf_document'=>'resource', 'fieldname'=>'string', 'element='=>'int'],
'fdf_get_status' => ['string', 'fdf_document'=>'resource'],
'fdf_get_value' => ['mixed', 'fdf_document'=>'resource', 'fieldname'=>'string', 'which='=>'int'],
'fdf_get_version' => ['string', 'fdf_document='=>'resource'],
'fdf_header' => ['void'],
'fdf_next_field_name' => ['string', 'fdf_document'=>'resource', 'fieldname='=>'string'],
'fdf_open' => ['resource|false', 'filename'=>'string'],
'fdf_open_string' => ['resource', 'fdf_data'=>'string'],
'fdf_remove_item' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'item'=>'int'],
'fdf_save' => ['bool', 'fdf_document'=>'resource', 'filename='=>'string'],
'fdf_save_string' => ['string', 'fdf_document'=>'resource'],
'fdf_set_ap' => ['bool', 'fdf_document'=>'resource', 'field_name'=>'string', 'face'=>'int', 'filename'=>'string', 'page_number'=>'int'],
'fdf_set_encoding' => ['bool', 'fdf_document'=>'resource', 'encoding'=>'string'],
'fdf_set_file' => ['bool', 'fdf_document'=>'resource', 'url'=>'string', 'target_frame='=>'string'],
'fdf_set_flags' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'whichflags'=>'int', 'newflags'=>'int'],
'fdf_set_javascript_action' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'trigger'=>'int', 'script'=>'string'],
'fdf_set_on_import_javascript' => ['bool', 'fdf_document'=>'resource', 'script'=>'string', 'before_data_import'=>'bool'],
'fdf_set_opt' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'element'=>'int', 'string1'=>'string', 'string2'=>'string'],
'fdf_set_status' => ['bool', 'fdf_document'=>'resource', 'status'=>'string'],
'fdf_set_submit_form_action' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'trigger'=>'int', 'script'=>'string', 'flags'=>'int'],
'fdf_set_target_frame' => ['bool', 'fdf_document'=>'resource', 'frame_name'=>'string'],
'fdf_set_value' => ['bool', 'fdf_document'=>'resource', 'fieldname'=>'string', 'value'=>'mixed', 'isname='=>'int'],
'fdf_set_version' => ['bool', 'fdf_document'=>'resource', 'version'=>'string'],
'fdiv' => ['float', 'num1'=>'float', 'num2'=>'float'],
'feof' => ['bool', 'stream'=>'resource'],
'fflush' => ['bool', 'stream'=>'resource'],
'fsync' => ['bool', 'stream'=>'resource'],
'fdatasync' => ['bool', 'stream'=>'resource'],
'ffmpeg_animated_gif::__construct' => ['void', 'output_file_path'=>'string', 'width'=>'int', 'height'=>'int', 'frame_rate'=>'int', 'loop_count='=>'int'],
'ffmpeg_animated_gif::addFrame' => ['', 'frame_to_add'=>'ffmpeg_frame'],
'ffmpeg_frame::__construct' => ['void', 'gd_image'=>'resource'],
'ffmpeg_frame::crop' => ['', 'crop_top'=>'int', 'crop_bottom='=>'int', 'crop_left='=>'int', 'crop_right='=>'int'],
'ffmpeg_frame::getHeight' => ['int'],
'ffmpeg_frame::getPresentationTimestamp' => ['int'],
'ffmpeg_frame::getPTS' => ['int'],
'ffmpeg_frame::getWidth' => ['int'],
'ffmpeg_frame::resize' => ['', 'width'=>'int', 'height'=>'int', 'crop_top='=>'int', 'crop_bottom='=>'int', 'crop_left='=>'int', 'crop_right='=>'int'],
'ffmpeg_frame::toGDImage' => ['resource'],
'ffmpeg_movie::__construct' => ['void', 'path_to_media'=>'string', 'persistent'=>'bool'],
'ffmpeg_movie::getArtist' => ['string'],
'ffmpeg_movie::getAudioBitRate' => ['int'],
'ffmpeg_movie::getAudioChannels' => ['int'],
'ffmpeg_movie::getAudioCodec' => ['string'],
'ffmpeg_movie::getAudioSampleRate' => ['int'],
'ffmpeg_movie::getAuthor' => ['string'],
'ffmpeg_movie::getBitRate' => ['int'],
'ffmpeg_movie::getComment' => ['string'],
'ffmpeg_movie::getCopyright' => ['string'],
'ffmpeg_movie::getDuration' => ['int'],
'ffmpeg_movie::getFilename' => ['string'],
'ffmpeg_movie::getFrame' => ['ffmpeg_frame|false', 'framenumber'=>'int'],
'ffmpeg_movie::getFrameCount' => ['int'],
'ffmpeg_movie::getFrameHeight' => ['int'],
'ffmpeg_movie::getFrameNumber' => ['int'],
'ffmpeg_movie::getFrameRate' => ['int'],
'ffmpeg_movie::getFrameWidth' => ['int'],
'ffmpeg_movie::getGenre' => ['string'],
'ffmpeg_movie::getNextKeyFrame' => ['ffmpeg_frame|false'],
'ffmpeg_movie::getPixelFormat' => [''],
'ffmpeg_movie::getTitle' => ['string'],
'ffmpeg_movie::getTrackNumber' => ['int|string'],
'ffmpeg_movie::getVideoBitRate' => ['int'],
'ffmpeg_movie::getVideoCodec' => ['string'],
'ffmpeg_movie::getYear' => ['int|string'],
'ffmpeg_movie::hasAudio' => ['bool'],
'ffmpeg_movie::hasVideo' => ['bool'],
'fgetc' => ['string|false', 'stream'=>'resource'],
'fgetcsv' => ['list<string>|array{0: null}|false|null', 'stream'=>'resource', 'length='=>'int', 'separator='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'fgets' => ['string|false', 'stream'=>'resource', 'length='=>'int'],
'fgetss' => ['string|false', 'fp'=>'resource', 'length='=>'int', 'allowable_tags='=>'string'],
'file' => ['list<string>|false', 'filename'=>'string', 'flags='=>'int', 'context='=>'resource'],
'file_exists' => ['bool', 'filename'=>'string'],
'file_get_contents' => ['string|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'?resource', 'offset='=>'int', 'length='=>'int'],
'file_put_contents' => ['int|false', 'filename'=>'string', 'data'=>'string|resource|array<string>', 'flags='=>'int', 'context='=>'resource'],
'fileatime' => ['int|false', 'filename'=>'string'],
'filectime' => ['int|false', 'filename'=>'string'],
'filegroup' => ['int|false', 'filename'=>'string'],
'fileinode' => ['int|false', 'filename'=>'string'],
'filemtime' => ['int|false', 'filename'=>'string'],
'fileowner' => ['int|false', 'filename'=>'string'],
'fileperms' => ['int|false', 'filename'=>'string'],
'filepro' => ['bool', 'directory'=>'string'],
'filepro_fieldcount' => ['int'],
'filepro_fieldname' => ['string', 'field_number'=>'int'],
'filepro_fieldtype' => ['string', 'field_number'=>'int'],
'filepro_fieldwidth' => ['int', 'field_number'=>'int'],
'filepro_retrieve' => ['string', 'row_number'=>'int', 'field_number'=>'int'],
'filepro_rowcount' => ['int'],
'filesize' => ['int|false', 'filename'=>'string'],
'FilesystemIterator::__construct' => ['void', 'path'=>'string', 'flags='=>'int'],
'FilesystemIterator::__toString' => ['string'],
'FilesystemIterator::_bad_state_ex' => [''],
'FilesystemIterator::current' => ['mixed'],
'FilesystemIterator::getATime' => ['int'],
'FilesystemIterator::getBasename' => ['string', 'suffix='=>'string'],
'FilesystemIterator::getCTime' => ['int'],
'FilesystemIterator::getExtension' => ['string'],
'FilesystemIterator::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'FilesystemIterator::getFilename' => ['string'],
'FilesystemIterator::getFlags' => ['int'],
'FilesystemIterator::getGroup' => ['int'],
'FilesystemIterator::getInode' => ['int'],
'FilesystemIterator::getLinkTarget' => ['string'],
'FilesystemIterator::getMTime' => ['int'],
'FilesystemIterator::getOwner' => ['int'],
'FilesystemIterator::getPath' => ['string'],
'FilesystemIterator::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'FilesystemIterator::getPathname' => ['string'],
'FilesystemIterator::getPerms' => ['int'],
'FilesystemIterator::getRealPath' => ['string'],
'FilesystemIterator::getSize' => ['int'],
'FilesystemIterator::getType' => ['string'],
'FilesystemIterator::isDir' => ['bool'],
'FilesystemIterator::isDot' => ['bool'],
'FilesystemIterator::isExecutable' => ['bool'],
'FilesystemIterator::isFile' => ['bool'],
'FilesystemIterator::isLink' => ['bool'],
'FilesystemIterator::isReadable' => ['bool'],
'FilesystemIterator::isWritable' => ['bool'],
'FilesystemIterator::key' => ['string'],
'FilesystemIterator::next' => ['void'],
'FilesystemIterator::openFile' => ['SplFileObject', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
'FilesystemIterator::rewind' => ['void'],
'FilesystemIterator::seek' => ['void', 'position'=>'int'],
'FilesystemIterator::setFileClass' => ['void', 'class_name='=>'string'],
'FilesystemIterator::setFlags' => ['void', 'flags='=>'int'],
'FilesystemIterator::setInfoClass' => ['void', 'class_name='=>'string'],
'FilesystemIterator::valid' => ['bool'],
'filetype' => ['string|false', 'filename'=>'string'],
'filter_has_var' => ['bool', 'input_type'=>'int', 'var_name'=>'string'],
'filter_id' => ['int|false', 'name'=>'string'],
'filter_input' => ['mixed|false', 'type'=>'int', 'var_name'=>'string', 'filter='=>'int', 'options='=>'array|int'],
'filter_input_array' => ['mixed|false', 'type'=>'int', 'options='=>'int|array', 'add_empty='=>'bool'],
'filter_list' => ['array'],
'filter_var' => ['mixed|false', 'value'=>'mixed', 'filter='=>'int', 'options='=>'mixed'],
'filter_var_array' => ['mixed|false', 'array'=>'array', 'options='=>'mixed', 'add_empty='=>'bool'],
'FilterIterator::__construct' => ['void', 'iterator'=>'Iterator'],
'FilterIterator::accept' => ['bool'],
'FilterIterator::current' => ['mixed'],
'FilterIterator::getInnerIterator' => ['Iterator'],
'FilterIterator::key' => ['mixed'],
'FilterIterator::next' => ['void'],
'FilterIterator::rewind' => ['void'],
'FilterIterator::valid' => ['bool'],
'finfo::__construct' => ['void', 'options='=>'int', 'magic_file='=>'string'],
'finfo::buffer' => ['string|false', 'string'=>'string', 'options='=>'int', 'context='=>'resource'],
'finfo::file' => ['string|false', 'file_name'=>'string', 'options='=>'int', 'context='=>'resource'],
'finfo::finfo' => ['void', 'options='=>'int', 'magic_file='=>'string'],
'finfo::set_flags' => ['bool', 'options'=>'int'],
'finfo_buffer' => ['string|false', 'finfo'=>'finfo', 'string'=>'string', 'flags='=>'int', 'context='=>'resource'],
'finfo_close' => ['bool', 'finfo'=>'finfo'],
'finfo_file' => ['string|false', 'finfo'=>'finfo', 'filename'=>'string', 'flags='=>'int', 'context='=>'resource'],
'finfo_open' => ['finfo|false', 'flags='=>'int', 'magic_database='=>'string'],
'finfo_set_flags' => ['bool', 'finfo'=>'finfo', 'flags'=>'int'],
'floatval' => ['float', 'value'=>'mixed'],
'flock' => ['bool', 'stream'=>'resource', 'operation'=>'int', '&w_would_block='=>'int'],
'floor' => ['float', 'num'=>'float'],
'flush' => ['void'],
'fmod' => ['float', 'num1'=>'float', 'num2'=>'float'],
'fnmatch' => ['bool', 'pattern'=>'string', 'filename'=>'string', 'flags='=>'int'],
'fopen' => ['resource|false', 'filename'=>'string', 'mode'=>'string', 'use_include_path='=>'bool', 'context='=>'resource|null'],
'forward_static_call' => ['mixed|false', 'callback'=>'callable', '...args='=>'mixed'],
'forward_static_call_array' => ['mixed|false', 'callback'=>'callable', 'args'=>'list<mixed>'],
'fpassthru' => ['int|false', 'stream'=>'resource'],
'fpm_get_status' => ['array|false'],
'fprintf' => ['int', 'stream'=>'resource', 'format'=>'string', '...values='=>'string|int|float'],
'fputcsv' => ['int|false', 'stream'=>'resource', 'fields'=>'array<array-key, null|scalar|Stringable>', 'separator='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'fputs' => ['int|false', 'stream'=>'resource', 'data'=>'string', 'length='=>'int'],
'fread' => ['string|false', 'stream'=>'resource', 'length'=>'int'],
'frenchtojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'],
'fribidi_log2vis' => ['string', 'string'=>'string', 'direction'=>'string', 'charset'=>'int'],
'fscanf' => ['list<mixed>', 'stream'=>'resource', 'format'=>'string'],
'fscanf\'1' => ['int', 'stream'=>'resource', 'format'=>'string', '&...w_vars='=>'string|int|float'],
'fseek' => ['int', 'stream'=>'resource', 'offset'=>'int', 'whence='=>'int'],
'fsockopen' => ['resource|false', 'hostname'=>'string', 'port='=>'int', '&w_error_code='=>'int', '&w_error_message='=>'string', 'timeout='=>'float'],
'fstat' => ['array|false', 'stream'=>'resource'],
'ftell' => ['int|false', 'stream'=>'resource'],
'ftok' => ['int', 'filename'=>'string', 'project_id'=>'string'],
'ftp_alloc' => ['bool', 'ftp'=>'FTP\Connection', 'size'=>'int', '&w_response='=>'string'],
'ftp_append' => ['bool', 'ftp'=>'FTP\Connection', 'remote_filename'=>'string', 'local_filename'=>'string', 'mode='=>'int'],
'ftp_cdup' => ['bool', 'ftp'=>'FTP\Connection'],
'ftp_chdir' => ['bool', 'ftp'=>'FTP\Connection', 'directory'=>'string'],
'ftp_chmod' => ['int|false', 'ftp'=>'FTP\Connection', 'permissions'=>'int', 'filename'=>'string'],
'ftp_close' => ['bool', 'ftp'=>'FTP\Connection'],
'ftp_connect' => ['FTP\Connection|false', 'hostname'=>'string', 'port='=>'int', 'timeout='=>'int'],
'ftp_delete' => ['bool', 'ftp'=>'FTP\Connection', 'filename'=>'string'],
'ftp_exec' => ['bool', 'ftp'=>'FTP\Connection', 'command'=>'string'],
'ftp_fget' => ['bool', 'ftp'=>'FTP\Connection', 'stream'=>'FTP\Connection', 'remote_filename'=>'string', 'mode='=>'int', 'offset='=>'int'],
'ftp_fput' => ['bool', 'ftp'=>'FTP\Connection', 'remote_filename'=>'string', 'stream'=>'FTP\Connection', 'mode='=>'int', 'offset='=>'int'],
'ftp_get' => ['bool', 'ftp'=>'FTP\Connection', 'local_filename'=>'string', 'remote_filename'=>'string', 'mode='=>'int', 'offset='=>'int'],
'ftp_get_option' => ['mixed|false', 'ftp'=>'FTP\Connection', 'option'=>'int'],
'ftp_login' => ['bool', 'ftp'=>'FTP\Connection', 'username'=>'string', 'password'=>'string'],
'ftp_mdtm' => ['int', 'ftp'=>'FTP\Connection', 'filename'=>'string'],
'ftp_mkdir' => ['string|false', 'ftp'=>'FTP\Connection', 'directory'=>'string'],
'ftp_mlsd' => ['array|false', 'ftp'=>'FTP\Connection', 'directory'=>'string'],
'ftp_nb_continue' => ['int', 'ftp'=>'FTP\Connection'],
'ftp_nb_fget' => ['int', 'ftp'=>'FTP\Connection', 'stream'=>'FTP\Connection', 'remote_filename'=>'string', 'mode='=>'int', 'offset='=>'int'],
'ftp_nb_fput' => ['int', 'ftp'=>'FTP\Connection', 'remote_filename'=>'string', 'stream'=>'FTP\Connection', 'mode='=>'int', 'offset='=>'int'],
'ftp_nb_get' => ['int', 'ftp'=>'FTP\Connection', 'local_filename'=>'string', 'remote_filename'=>'string', 'mode='=>'int', 'offset='=>'int'],
'ftp_nb_put' => ['int', 'ftp'=>'FTP\Connection', 'remote_filename'=>'string', 'local_filename'=>'string', 'mode='=>'int', 'offset='=>'int'],
'ftp_nlist' => ['array|false', 'ftp'=>'FTP\Connection', 'directory'=>'string'],
'ftp_pasv' => ['bool', 'ftp'=>'FTP\Connection', 'enable'=>'bool'],
'ftp_put' => ['bool', 'ftp'=>'FTP\Connection', 'remote_filename'=>'string', 'local_filename'=>'string', 'mode='=>'int', 'offset='=>'int'],
'ftp_pwd' => ['string|false', 'ftp'=>'FTP\Connection'],
'ftp_quit' => ['bool', 'ftp'=>'FTP\Connection'],
'ftp_raw' => ['array', 'ftp'=>'FTP\Connection', 'command'=>'string'],
'ftp_rawlist' => ['array|false', 'ftp'=>'FTP\Connection', 'directory'=>'string', 'recursive='=>'bool'],
'ftp_rename' => ['bool', 'ftp'=>'FTP\Connection', 'from'=>'string', 'to'=>'string'],
'ftp_rmdir' => ['bool', 'ftp'=>'FTP\Connection', 'directory'=>'string'],
'ftp_set_option' => ['bool', 'ftp'=>'FTP\Connection', 'option'=>'int', 'value'=>'mixed'],
'ftp_site' => ['bool', 'ftp'=>'FTP\Connection', 'command'=>'string'],
'ftp_size' => ['int', 'ftp'=>'FTP\Connection', 'filename'=>'string'],
'ftp_ssl_connect' => ['FTP\Connection|false', 'hostname'=>'string', 'port='=>'int', 'timeout='=>'int'],
'ftp_systype' => ['string|false', 'ftp'=>'FTP\Connection'],
'ftruncate' => ['bool', 'stream'=>'resource', 'size'=>'int'],
'func_get_arg' => ['mixed|false', 'position'=>'int'],
'func_get_args' => ['list<mixed>'],
'func_num_args' => ['int'],
'function_exists' => ['bool', 'function'=>'string'],
'fwrite' => ['int|false', 'stream'=>'resource', 'data'=>'string', 'length='=>'int'],
'Fiber::__construct' => ['void', 'callback'=>'callable'],
'Fiber::start' => ['mixed', '...args'=>'mixed'],
'Fiber::resume' => ['mixed', 'value='=>'null|mixed'],
'Fiber::throw' => ['mixed', 'exception'=>'Throwable'],
'Fiber::isStarted' => ['bool'],
'Fiber::isSuspended' => ['bool'],
'Fiber::isRunning' => ['bool'],
'Fiber::isTerminated' => ['bool'],
'Fiber::getReturn' => ['mixed'],
'Fiber::getCurrent' => ['?self'],
'Fiber::suspend' => ['mixed', 'value='=>'null|mixed'],
'FiberError::__construct' => ['void'],
'gc_collect_cycles' => ['int'],
'gc_disable' => ['void'],
'gc_enable' => ['void'],
'gc_enabled' => ['bool'],
'gc_mem_caches' => ['int'],
'gc_status' => ['array{runs:int,collected:int,threshold:int,roots:int}'],
'gd_info' => ['array'],
'gearman_bugreport' => [''],
'gearman_client_add_options' => ['', 'client_object'=>'', 'option'=>''],
'gearman_client_add_server' => ['', 'client_object'=>'', 'host'=>'', 'port'=>''],
'gearman_client_add_servers' => ['', 'client_object'=>'', 'servers'=>''],
'gearman_client_add_task' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''],
'gearman_client_add_task_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''],
'gearman_client_add_task_high' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''],
'gearman_client_add_task_high_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''],
'gearman_client_add_task_low' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''],
'gearman_client_add_task_low_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'context'=>'', 'unique'=>''],
'gearman_client_add_task_status' => ['', 'client_object'=>'', 'job_handle'=>'', 'context'=>''],
'gearman_client_clear_fn' => ['', 'client_object'=>''],
'gearman_client_clone' => ['', 'client_object'=>''],
'gearman_client_context' => ['', 'client_object'=>''],
'gearman_client_create' => ['', 'client_object'=>''],
'gearman_client_do' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''],
'gearman_client_do_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''],
'gearman_client_do_high' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''],
'gearman_client_do_high_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''],
'gearman_client_do_job_handle' => ['', 'client_object'=>''],
'gearman_client_do_low' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''],
'gearman_client_do_low_background' => ['', 'client_object'=>'', 'function_name'=>'', 'workload'=>'', 'unique'=>''],
'gearman_client_do_normal' => ['', 'client_object'=>'', 'function_name'=>'string', 'workload'=>'string', 'unique'=>'string'],
'gearman_client_do_status' => ['', 'client_object'=>''],
'gearman_client_echo' => ['', 'client_object'=>'', 'workload'=>''],
'gearman_client_errno' => ['', 'client_object'=>''],
'gearman_client_error' => ['', 'client_object'=>''],
'gearman_client_job_status' => ['', 'client_object'=>'', 'job_handle'=>''],
'gearman_client_options' => ['', 'client_object'=>''],
'gearman_client_remove_options' => ['', 'client_object'=>'', 'option'=>''],
'gearman_client_return_code' => ['', 'client_object'=>''],
'gearman_client_run_tasks' => ['', 'data'=>''],
'gearman_client_set_complete_fn' => ['', 'client_object'=>'', 'callback'=>''],
'gearman_client_set_context' => ['', 'client_object'=>'', 'context'=>''],
'gearman_client_set_created_fn' => ['', 'client_object'=>'', 'callback'=>''],
'gearman_client_set_data_fn' => ['', 'client_object'=>'', 'callback'=>''],
'gearman_client_set_exception_fn' => ['', 'client_object'=>'', 'callback'=>''],
'gearman_client_set_fail_fn' => ['', 'client_object'=>'', 'callback'=>''],
'gearman_client_set_options' => ['', 'client_object'=>'', 'option'=>''],
'gearman_client_set_status_fn' => ['', 'client_object'=>'', 'callback'=>''],
'gearman_client_set_timeout' => ['', 'client_object'=>'', 'timeout'=>''],
'gearman_client_set_warning_fn' => ['', 'client_object'=>'', 'callback'=>''],
'gearman_client_set_workload_fn' => ['', 'client_object'=>'', 'callback'=>''],
'gearman_client_timeout' => ['', 'client_object'=>''],
'gearman_client_wait' => ['', 'client_object'=>''],
'gearman_job_function_name' => ['', 'job_object'=>''],
'gearman_job_handle' => ['string'],
'gearman_job_return_code' => ['', 'job_object'=>''],
'gearman_job_send_complete' => ['', 'job_object'=>'', 'result'=>''],
'gearman_job_send_data' => ['', 'job_object'=>'', 'data'=>''],
'gearman_job_send_exception' => ['', 'job_object'=>'', 'exception'=>''],
'gearman_job_send_fail' => ['', 'job_object'=>''],
'gearman_job_send_status' => ['', 'job_object'=>'', 'numerator'=>'', 'denominator'=>''],
'gearman_job_send_warning' => ['', 'job_object'=>'', 'warning'=>''],
'gearman_job_status' => ['array', 'job_handle'=>'string'],
'gearman_job_unique' => ['', 'job_object'=>''],
'gearman_job_workload' => ['', 'job_object'=>''],
'gearman_job_workload_size' => ['', 'job_object'=>''],
'gearman_task_data' => ['', 'task_object'=>''],
'gearman_task_data_size' => ['', 'task_object'=>''],
'gearman_task_denominator' => ['', 'task_object'=>''],
'gearman_task_function_name' => ['', 'task_object'=>''],
'gearman_task_is_known' => ['', 'task_object'=>''],
'gearman_task_is_running' => ['', 'task_object'=>''],
'gearman_task_job_handle' => ['', 'task_object'=>''],
'gearman_task_numerator' => ['', 'task_object'=>''],
'gearman_task_recv_data' => ['', 'task_object'=>'', 'data_len'=>''],
'gearman_task_return_code' => ['', 'task_object'=>''],
'gearman_task_send_workload' => ['', 'task_object'=>'', 'data'=>''],
'gearman_task_unique' => ['', 'task_object'=>''],
'gearman_verbose_name' => ['', 'verbose'=>''],
'gearman_version' => [''],
'gearman_worker_add_function' => ['', 'worker_object'=>'', 'function_name'=>'', 'function'=>'', 'data'=>'', 'timeout'=>''],
'gearman_worker_add_options' => ['', 'worker_object'=>'', 'option'=>''],
'gearman_worker_add_server' => ['', 'worker_object'=>'', 'host'=>'', 'port'=>''],
'gearman_worker_add_servers' => ['', 'worker_object'=>'', 'servers'=>''],
'gearman_worker_clone' => ['', 'worker_object'=>''],
'gearman_worker_create' => [''],
'gearman_worker_echo' => ['', 'worker_object'=>'', 'workload'=>''],
'gearman_worker_errno' => ['', 'worker_object'=>''],
'gearman_worker_error' => ['', 'worker_object'=>''],
'gearman_worker_grab_job' => ['', 'worker_object'=>''],
'gearman_worker_options' => ['', 'worker_object'=>''],
'gearman_worker_register' => ['', 'worker_object'=>'', 'function_name'=>'', 'timeout'=>''],
'gearman_worker_remove_options' => ['', 'worker_object'=>'', 'option'=>''],
'gearman_worker_return_code' => ['', 'worker_object'=>''],
'gearman_worker_set_options' => ['', 'worker_object'=>'', 'option'=>''],
'gearman_worker_set_timeout' => ['', 'worker_object'=>'', 'timeout'=>''],
'gearman_worker_timeout' => ['', 'worker_object'=>''],
'gearman_worker_unregister' => ['', 'worker_object'=>'', 'function_name'=>''],
'gearman_worker_unregister_all' => ['', 'worker_object'=>''],
'gearman_worker_wait' => ['', 'worker_object'=>''],
'gearman_worker_work' => ['', 'worker_object'=>''],
'GearmanClient::__construct' => ['void'],
'GearmanClient::addOptions' => ['bool', 'options'=>'int'],
'GearmanClient::addServer' => ['bool', 'host='=>'string', 'port='=>'int'],
'GearmanClient::addServers' => ['bool', 'servers='=>'string'],
'GearmanClient::addTask' => ['GearmanTask|false', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'],
'GearmanClient::addTaskBackground' => ['GearmanTask|false', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'],
'GearmanClient::addTaskHigh' => ['GearmanTask|false', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'],
'GearmanClient::addTaskHighBackground' => ['GearmanTask|false', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'],
'GearmanClient::addTaskLow' => ['GearmanTask|false', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'],
'GearmanClient::addTaskLowBackground' => ['GearmanTask|false', 'function_name'=>'string', 'workload'=>'string', 'context='=>'mixed', 'unique='=>'string'],
'GearmanClient::addTaskStatus' => ['GearmanTask', 'job_handle'=>'string', 'context='=>'string'],
'GearmanClient::clearCallbacks' => ['bool'],
'GearmanClient::clone' => ['GearmanClient'],
'GearmanClient::context' => ['string'],
'GearmanClient::data' => ['string'],
'GearmanClient::do' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'],
'GearmanClient::doBackground' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'],
'GearmanClient::doHigh' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'],
'GearmanClient::doHighBackground' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'],
'GearmanClient::doJobHandle' => ['string'],
'GearmanClient::doLow' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'],
'GearmanClient::doLowBackground' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'],
'GearmanClient::doNormal' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'],
'GearmanClient::doStatus' => ['array'],
'GearmanClient::echo' => ['bool', 'workload'=>'string'],
'GearmanClient::error' => ['string'],
'GearmanClient::getErrno' => ['int'],
'GearmanClient::jobStatus' => ['array', 'job_handle'=>'string'],
'GearmanClient::options' => [''],
'GearmanClient::ping' => ['bool', 'workload'=>'string'],
'GearmanClient::removeOptions' => ['bool', 'options'=>'int'],
'GearmanClient::returnCode' => ['int'],
'GearmanClient::runTasks' => ['bool'],
'GearmanClient::setClientCallback' => ['void', 'callback'=>'callable'],
'GearmanClient::setCompleteCallback' => ['bool', 'callback'=>'callable'],
'GearmanClient::setContext' => ['bool', 'context'=>'string'],
'GearmanClient::setCreatedCallback' => ['bool', 'callback'=>'string'],
'GearmanClient::setData' => ['bool', 'data'=>'string'],
'GearmanClient::setDataCallback' => ['bool', 'callback'=>'callable'],
'GearmanClient::setExceptionCallback' => ['bool', 'callback'=>'callable'],
'GearmanClient::setFailCallback' => ['bool', 'callback'=>'callable'],
'GearmanClient::setOptions' => ['bool', 'options'=>'int'],
'GearmanClient::setStatusCallback' => ['bool', 'callback'=>'callable'],
'GearmanClient::setTimeout' => ['bool', 'timeout'=>'int'],
'GearmanClient::setWarningCallback' => ['bool', 'callback'=>'callable'],
'GearmanClient::setWorkloadCallback' => ['bool', 'callback'=>'callable'],
'GearmanClient::timeout' => ['int'],
'GearmanClient::wait' => [''],
'GearmanJob::__construct' => ['void'],
'GearmanJob::complete' => ['bool', 'result'=>'string'],
'GearmanJob::data' => ['bool', 'data'=>'string'],
'GearmanJob::exception' => ['bool', 'exception'=>'string'],
'GearmanJob::fail' => ['bool'],
'GearmanJob::functionName' => ['string'],
'GearmanJob::handle' => ['string'],
'GearmanJob::returnCode' => ['int'],
'GearmanJob::sendComplete' => ['bool', 'result'=>'string'],
'GearmanJob::sendData' => ['bool', 'data'=>'string'],
'GearmanJob::sendException' => ['bool', 'exception'=>'string'],
'GearmanJob::sendFail' => ['bool'],
'GearmanJob::sendStatus' => ['bool', 'numerator'=>'int', 'denominator'=>'int'],
'GearmanJob::sendWarning' => ['bool', 'warning'=>'string'],
'GearmanJob::setReturn' => ['bool', 'gearman_return_t'=>'string'],
'GearmanJob::status' => ['bool', 'numerator'=>'int', 'denominator'=>'int'],
'GearmanJob::unique' => ['string'],
'GearmanJob::warning' => ['bool', 'warning'=>'string'],
'GearmanJob::workload' => ['string'],
'GearmanJob::workloadSize' => ['int'],
'GearmanTask::__construct' => ['void'],
'GearmanTask::create' => ['GearmanTask'],
'GearmanTask::data' => ['string|false'],
'GearmanTask::dataSize' => ['int|false'],
'GearmanTask::function' => ['string'],
'GearmanTask::functionName' => ['string'],
'GearmanTask::isKnown' => ['bool'],
'GearmanTask::isRunning' => ['bool'],
'GearmanTask::jobHandle' => ['string'],
'GearmanTask::recvData' => ['array|false', 'data_len'=>'int'],
'GearmanTask::returnCode' => ['int'],
'GearmanTask::sendData' => ['int', 'data'=>'string'],
'GearmanTask::sendWorkload' => ['int|false', 'data'=>'string'],
'GearmanTask::taskDenominator' => ['int|false'],
'GearmanTask::taskNumerator' => ['int|false'],
'GearmanTask::unique' => ['string|false'],
'GearmanTask::uuid' => ['string'],
'GearmanWorker::__construct' => ['void'],
'GearmanWorker::addFunction' => ['bool', 'function_name'=>'string', 'function'=>'callable', 'context='=>'mixed', 'timeout='=>'int'],
'GearmanWorker::addOptions' => ['bool', 'option'=>'int'],
'GearmanWorker::addServer' => ['bool', 'host='=>'string', 'port='=>'int'],
'GearmanWorker::addServers' => ['bool', 'servers'=>'string'],
'GearmanWorker::clone' => ['void'],
'GearmanWorker::echo' => ['bool', 'workload'=>'string'],
'GearmanWorker::error' => ['string'],
'GearmanWorker::getErrno' => ['int'],
'GearmanWorker::grabJob' => [''],
'GearmanWorker::options' => ['int'],
'GearmanWorker::register' => ['bool', 'function_name'=>'string', 'timeout='=>'int'],
'GearmanWorker::removeOptions' => ['bool', 'option'=>'int'],
'GearmanWorker::returnCode' => ['int'],
'GearmanWorker::setId' => ['bool', 'id'=>'string'],
'GearmanWorker::setOptions' => ['bool', 'option'=>'int'],
'GearmanWorker::setTimeout' => ['bool', 'timeout'=>'int'],
'GearmanWorker::timeout' => ['int'],
'GearmanWorker::unregister' => ['bool', 'function_name'=>'string'],
'GearmanWorker::unregisterAll' => ['bool'],
'GearmanWorker::wait' => ['bool'],
'GearmanWorker::work' => ['bool'],
'Gender\Gender::__construct' => ['void', 'dsn='=>'string'],
'Gender\Gender::connect' => ['bool', 'dsn'=>'string'],
'Gender\Gender::country' => ['array', 'country'=>'int'],
'Gender\Gender::get' => ['int', 'name'=>'string', 'country='=>'int'],
'Gender\Gender::isNick' => ['array', 'name0'=>'string', 'name1'=>'string', 'country='=>'int'],
'Gender\Gender::similarNames' => ['array', 'name'=>'string', 'country='=>'int'],
'Generator::__wakeup' => ['void'],
'Generator::current' => ['mixed'],
'Generator::getReturn' => ['mixed'],
'Generator::key' => ['mixed'],
'Generator::next' => ['void'],
'Generator::rewind' => ['void'],
'Generator::send' => ['mixed', 'value'=>'mixed'],
'Generator::throw' => ['mixed', 'exception'=>'Exception|Throwable'],
'Generator::valid' => ['bool'],
'geoip_asnum_by_name' => ['string|false', 'hostname'=>'string'],
'geoip_continent_code_by_name' => ['string|false', 'hostname'=>'string'],
'geoip_country_code3_by_name' => ['string|false', 'hostname'=>'string'],
'geoip_country_code_by_name' => ['string|false', 'hostname'=>'string'],
'geoip_country_name_by_name' => ['string|false', 'hostname'=>'string'],
'geoip_database_info' => ['string', 'database='=>'int'],
'geoip_db_avail' => ['bool', 'database'=>'int'],
'geoip_db_filename' => ['string', 'database'=>'int'],
'geoip_db_get_all_info' => ['array'],
'geoip_domain_by_name' => ['string', 'hostname'=>'string'],
'geoip_id_by_name' => ['int', 'hostname'=>'string'],
'geoip_isp_by_name' => ['string|false', 'hostname'=>'string'],
'geoip_netspeedcell_by_name' => ['string|false', 'hostname'=>'string'],
'geoip_org_by_name' => ['string|false', 'hostname'=>'string'],
'geoip_record_by_name' => ['array|false', 'hostname'=>'string'],
'geoip_region_by_name' => ['array|false', 'hostname'=>'string'],
'geoip_region_name_by_code' => ['string|false', 'country_code'=>'string', 'region_code'=>'string'],
'geoip_setup_custom_directory' => ['void', 'path'=>'string'],
'geoip_time_zone_by_country_and_region' => ['string|false', 'country_code'=>'string', 'region_code='=>'string'],
'GEOSGeometry::__toString' => ['string'],
'GEOSGeometry::project' => ['float', 'other'=>'GEOSGeometry', 'normalized'=>'bool'],
'GEOSGeometry::interpolate' => ['GEOSGeometry', 'dist'=>'float', 'normalized'=>'bool'],
'GEOSGeometry::buffer' => ['GEOSGeometry', 'dist'=>'float', 'styleArray'=>'array'],
'GEOSGeometry::offsetCurve' => ['GEOSGeometry', 'dist'=>'float', 'styleArray'=>'array'],
'GEOSGeometry::envelope' => ['GEOSGeometry'],
'GEOSGeometry::intersection' => ['GEOSGeometry', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::convexHull' => ['GEOSGeometry'],
'GEOSGeometry::difference' => ['GEOSGeometry', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::symDifference' => ['GEOSGeometry', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::boundary' => ['GEOSGeometry'],
'GEOSGeometry::union' => ['GEOSGeometry', 'otherGeom='=>'GEOSGeometry'],
'GEOSGeometry::pointOnSurface' => ['GEOSGeometry'],
'GEOSGeometry::centroid' => ['GEOSGeometry'],
'GEOSGeometry::relate' => ['string|bool', 'otherGeom'=>'GEOSGeometry', 'pattern'=>'string'],
'GEOSGeometry::relateBoundaryNodeRule' => ['string', 'otherGeom'=>'GEOSGeometry', 'rule'=>'int'],
'GEOSGeometry::simplify' => ['GEOSGeometry', 'tolerance'=>'float', 'preserveTopology'=>'bool'],
'GEOSGeometry::normalize' => ['GEOSGeometry'],
'GEOSGeometry::extractUniquePoints' => ['GEOSGeometry'],
'GEOSGeometry::disjoint' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::touches' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::intersects' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::crosses' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::within' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::contains' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::overlaps' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::covers' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::coveredBy' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::equals' => ['bool', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::equalsExact' => ['bool', 'geom'=>'GEOSGeometry', 'tolerance'=>'float'],
'GEOSGeometry::isEmpty' => ['bool'],
'GEOSGeometry::checkValidity' => ['array{valid: bool, reason?: string, location?: GEOSGeometry}'],
'GEOSGeometry::isSimple' => ['bool'],
'GEOSGeometry::isRing' => ['bool'],
'GEOSGeometry::hasZ' => ['bool'],
'GEOSGeometry::isClosed' => ['bool'],
'GEOSGeometry::typeName' => ['string'],
'GEOSGeometry::typeId' => ['int'],
'GEOSGeometry::getSRID' => ['int'],
'GEOSGeometry::setSRID' => ['void', 'srid'=>'int'],
'GEOSGeometry::numGeometries' => ['int'],
'GEOSGeometry::geometryN' => ['GEOSGeometry', 'num'=>'int'],
'GEOSGeometry::numInteriorRings' => ['int'],
'GEOSGeometry::numPoints' => ['int'],
'GEOSGeometry::getX' => ['float'],
'GEOSGeometry::getY' => ['float'],
'GEOSGeometry::interiorRingN' => ['GEOSGeometry', 'num'=>'int'],
'GEOSGeometry::exteriorRing' => ['GEOSGeometry'],
'GEOSGeometry::numCoordinates' => ['int'],
'GEOSGeometry::dimension' => ['int'],
'GEOSGeometry::coordinateDimension' => ['int'],
'GEOSGeometry::pointN' => ['GEOSGeometry', 'num'=>'int'],
'GEOSGeometry::startPoint' => ['GEOSGeometry'],
'GEOSGeometry::endPoint' => ['GEOSGeometry'],
'GEOSGeometry::area' => ['float'],
'GEOSGeometry::length' => ['float'],
'GEOSGeometry::distance' => ['float', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::hausdorffDistance' => ['float', 'geom'=>'GEOSGeometry'],
'GEOSGeometry::snapTo' => ['GEOSGeometry', 'geom'=>'GEOSGeometry', 'tolerance'=>'float'],
'GEOSGeometry::node' => ['GEOSGeometry'],
'GEOSGeometry::delaunayTriangulation' => ['GEOSGeometry', 'tolerance'=>'float', 'onlyEdges'=>'bool'],
'GEOSGeometry::voronoiDiagram' => ['GEOSGeometry', 'tolerance'=>'float', 'onlyEdges'=>'bool', 'extent'=>'GEOSGeometry|null'],
'GEOSLineMerge' => ['array', 'geom'=>'GEOSGeometry'],
'GEOSPolygonize' => ['array{rings: GEOSGeometry[], cut_edges?: GEOSGeometry[], dangles: GEOSGeometry[], invalid_rings: GEOSGeometry[]}', 'geom'=>'GEOSGeometry'],
'GEOSRelateMatch' => ['bool', 'matrix'=>'string', 'pattern'=>'string'],
'GEOSSharedPaths' => ['GEOSGeometry', 'geom1'=>'GEOSGeometry', 'geom2'=>'GEOSGeometry'],
'GEOSVersion' => ['string'],
'GEOSWKBReader::__construct' => ['void'],
'GEOSWKBReader::read' => ['GEOSGeometry', 'wkb'=>'string'],
'GEOSWKBReader::readHEX' => ['GEOSGeometry', 'wkb'=>'string'],
'GEOSWKBWriter::__construct' => ['void'],
'GEOSWKBWriter::getOutputDimension' => ['int'],
'GEOSWKBWriter::setOutputDimension' => ['void', 'dim'=>'int'],
'GEOSWKBWriter::getByteOrder' => ['int'],
'GEOSWKBWriter::setByteOrder' => ['void', 'byteOrder'=>'int'],
'GEOSWKBWriter::getIncludeSRID' => ['bool'],
'GEOSWKBWriter::setIncludeSRID' => ['void', 'inc'=>'bool'],
'GEOSWKBWriter::write' => ['string', 'geom'=>'GEOSGeometry'],
'GEOSWKBWriter::writeHEX' => ['string', 'geom'=>'GEOSGeometry'],
'GEOSWKTReader::__construct' => ['void'],
'GEOSWKTReader::read' => ['GEOSGeometry', 'wkt'=>'string'],
'GEOSWKTWriter::__construct' => ['void'],
'GEOSWKTWriter::write' => ['string', 'geom'=>'GEOSGeometry'],
'GEOSWKTWriter::setTrim' => ['void', 'trim'=>'bool'],
'GEOSWKTWriter::setRoundingPrecision' => ['void', 'prec'=>'int'],
'GEOSWKTWriter::setOutputDimension' => ['void', 'dim'=>'int'],
'GEOSWKTWriter::getOutputDimension' => ['int'],
'GEOSWKTWriter::setOld3D' => ['void', 'val'=>'bool'],
'get_browser' => ['array|object|false', 'user_agent='=>'?string', 'return_array='=>'bool'],
'get_call_stack' => [''],
'get_called_class' => ['class-string'],
'get_cfg_var' => ['string|false', 'option'=>'string'],
'get_class' => ['class-string|false', 'object='=>'object'],
'get_class_methods' => ['list<string>|null', 'object_or_class'=>'mixed'],
'get_class_vars' => ['array<string,mixed>', 'class'=>'string'],
'get_current_user' => ['string'],
'get_debug_type' => ['string', 'value'=>'mixed'],
'get_declared_classes' => ['list<class-string>'],
'get_declared_interfaces' => ['list<class-string>'],
'get_declared_traits' => ['list<class-string>|null'],
'get_defined_constants' => ['array<string,int|string|float|bool|null|array|resource>', 'categorize='=>'bool'],
'get_defined_functions' => ['array<string,list<callable-string>>', 'exclude_disabled='=>'bool'],
'get_defined_vars' => ['array'],
'get_extension_funcs' => ['list<callable-string>|false', 'extension'=>'string'],
'get_headers' => ['array|false', 'url'=>'string', 'associative='=>'int', 'context='=>'resource'],
'get_html_translation_table' => ['array', 'table='=>'int', 'flags='=>'int', 'encoding='=>'string'],
'get_include_path' => ['string'],
'get_included_files' => ['list<string>'],
'get_loaded_extensions' => ['list<string>', 'zend_extensions='=>'bool'],
'get_magic_quotes_gpc' => ['int|false'],
'get_magic_quotes_runtime' => ['int|false'],
'get_meta_tags' => ['array', 'filename'=>'string', 'use_include_path='=>'bool'],
'get_object_vars' => ['array<string,mixed>', 'object'=>'object'],
'get_parent_class' => ['class-string|false', 'object_or_class='=>'mixed'],
'get_required_files' => ['list<string>'],
'get_resource_id' => ['int', 'resource'=>'resource'],
'get_resource_type' => ['string', 'resource'=>'resource'],
'get_resources' => ['array<int,resource>', 'type='=>'string'],
'getallheaders' => ['array|false'],
'getcwd' => ['string|false'],
'getdate' => ['array', 'timestamp='=>'int'],
'getenv' => ['string|false', 'name'=>'string', 'local_only='=>'bool'],
'getenv\'1' => ['array<string,string>'],
'gethostbyaddr' => ['string|false', 'ip'=>'string'],
'gethostbyname' => ['string', 'hostname'=>'string'],
'gethostbynamel' => ['list<string>|false', 'hostname'=>'string'],
'gethostname' => ['string|false'],
'getimagesize' => ['array|false', 'filename'=>'string', '&w_image_info='=>'array'],
'getimagesizefromstring' => ['array|false', 'string'=>'string', '&w_image_info='=>'array'],
'getlastmod' => ['int|false'],
'getmxrr' => ['bool', 'hostname'=>'string', '&w_hosts'=>'array', '&w_weights='=>'array'],
'getmygid' => ['int|false'],
'getmyinode' => ['int|false'],
'getmypid' => ['int|false'],
'getmyuid' => ['int|false'],
'getopt' => ['array<string,string>|array<string,false>|array<string,list<mixed>>|false', 'short_options'=>'string', 'long_options='=>'array', '&w_rest_index='=>'int'],
'getprotobyname' => ['int|false', 'protocol'=>'string'],
'getprotobynumber' => ['string', 'protocol'=>'int'],
'getrandmax' => ['int'],
'getrusage' => ['array', 'mode='=>'int'],
'getservbyname' => ['int|false', 'service'=>'string', 'protocol'=>'string'],
'getservbyport' => ['string|false', 'port'=>'int', 'protocol'=>'string'],
'gettext' => ['string', 'message'=>'string'],
'gettimeofday' => ['array<string, int>'],
'gettimeofday\'1' => ['float', 'as_float='=>'true'],
'gettype' => ['string', 'value'=>'mixed'],
'glob' => ['list<string>|false', 'pattern'=>'string', 'flags='=>'int'],
'GlobIterator::__construct' => ['void', 'path'=>'string', 'flags='=>'int'],
'GlobIterator::count' => ['int'],
'GlobIterator::current' => ['FilesystemIterator|SplFileInfo|string'],
'GlobIterator::getATime' => [''],
'GlobIterator::getBasename' => ['', 'suffix='=>'string'],
'GlobIterator::getCTime' => [''],
'GlobIterator::getExtension' => [''],
'GlobIterator::getFileInfo' => [''],
'GlobIterator::getFilename' => [''],
'GlobIterator::getFlags' => ['int'],
'GlobIterator::getGroup' => [''],
'GlobIterator::getInode' => [''],
'GlobIterator::getLinkTarget' => [''],
'GlobIterator::getMTime' => [''],
'GlobIterator::getOwner' => [''],
'GlobIterator::getPath' => [''],
'GlobIterator::getPathInfo' => [''],
'GlobIterator::getPathname' => [''],
'GlobIterator::getPerms' => [''],
'GlobIterator::getRealPath' => [''],
'GlobIterator::getSize' => [''],
'GlobIterator::getType' => [''],
'GlobIterator::isDir' => [''],
'GlobIterator::isDot' => [''],
'GlobIterator::isExecutable' => [''],
'GlobIterator::isFile' => [''],
'GlobIterator::isLink' => [''],
'GlobIterator::isReadable' => [''],
'GlobIterator::isWritable' => [''],
'GlobIterator::key' => ['string'],
'GlobIterator::next' => ['void'],
'GlobIterator::openFile' => [''],
'GlobIterator::rewind' => ['void'],
'GlobIterator::seek' => ['void', 'position'=>'int'],
'GlobIterator::setFileClass' => [''],
'GlobIterator::setFlags' => ['void', 'flags='=>'int'],
'GlobIterator::setInfoClass' => [''],
'GlobIterator::valid' => [''],
'Gmagick::__construct' => ['void', 'filename='=>'string'],
'Gmagick::addimage' => ['Gmagick', 'gmagick'=>'gmagick'],
'Gmagick::addnoiseimage' => ['Gmagick', 'noise'=>'int'],
'Gmagick::annotateimage' => ['Gmagick', 'gmagickdraw'=>'gmagickdraw', 'x'=>'float', 'y'=>'float', 'angle'=>'float', 'text'=>'string'],
'Gmagick::blurimage' => ['Gmagick', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'],
'Gmagick::borderimage' => ['Gmagick', 'color'=>'gmagickpixel', 'width'=>'int', 'height'=>'int'],
'Gmagick::charcoalimage' => ['Gmagick', 'radius'=>'float', 'sigma'=>'float'],
'Gmagick::chopimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Gmagick::clear' => ['Gmagick'],
'Gmagick::commentimage' => ['Gmagick', 'comment'=>'string'],
'Gmagick::compositeimage' => ['Gmagick', 'source'=>'gmagick', 'compose'=>'int', 'x'=>'int', 'y'=>'int'],
'Gmagick::cropimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Gmagick::cropthumbnailimage' => ['Gmagick', 'width'=>'int', 'height'=>'int'],
'Gmagick::current' => ['Gmagick'],
'Gmagick::cyclecolormapimage' => ['Gmagick', 'displace'=>'int'],
'Gmagick::deconstructimages' => ['Gmagick'],
'Gmagick::despeckleimage' => ['Gmagick'],
'Gmagick::destroy' => ['bool'],
'Gmagick::drawimage' => ['Gmagick', 'gmagickdraw'=>'gmagickdraw'],
'Gmagick::edgeimage' => ['Gmagick', 'radius'=>'float'],
'Gmagick::embossimage' => ['Gmagick', 'radius'=>'float', 'sigma'=>'float'],
'Gmagick::enhanceimage' => ['Gmagick'],
'Gmagick::equalizeimage' => ['Gmagick'],
'Gmagick::flipimage' => ['Gmagick'],
'Gmagick::flopimage' => ['Gmagick'],
'Gmagick::frameimage' => ['Gmagick', 'color'=>'gmagickpixel', 'width'=>'int', 'height'=>'int', 'inner_bevel'=>'int', 'outer_bevel'=>'int'],
'Gmagick::gammaimage' => ['Gmagick', 'gamma'=>'float'],
'Gmagick::getcopyright' => ['string'],
'Gmagick::getfilename' => ['string'],
'Gmagick::getimagebackgroundcolor' => ['GmagickPixel'],
'Gmagick::getimageblueprimary' => ['array'],
'Gmagick::getimagebordercolor' => ['GmagickPixel'],
'Gmagick::getimagechanneldepth' => ['int', 'channel_type'=>'int'],
'Gmagick::getimagecolors' => ['int'],
'Gmagick::getimagecolorspace' => ['int'],
'Gmagick::getimagecompose' => ['int'],
'Gmagick::getimagedelay' => ['int'],
'Gmagick::getimagedepth' => ['int'],
'Gmagick::getimagedispose' => ['int'],
'Gmagick::getimageextrema' => ['array'],
'Gmagick::getimagefilename' => ['string'],
'Gmagick::getimageformat' => ['string'],
'Gmagick::getimagegamma' => ['float'],
'Gmagick::getimagegreenprimary' => ['array'],
'Gmagick::getimageheight' => ['int'],
'Gmagick::getimagehistogram' => ['array'],
'Gmagick::getimageindex' => ['int'],
'Gmagick::getimageinterlacescheme' => ['int'],
'Gmagick::getimageiterations' => ['int'],
'Gmagick::getimagematte' => ['int'],
'Gmagick::getimagemattecolor' => ['GmagickPixel'],
'Gmagick::getimageprofile' => ['string', 'name'=>'string'],
'Gmagick::getimageredprimary' => ['array'],
'Gmagick::getimagerenderingintent' => ['int'],
'Gmagick::getimageresolution' => ['array'],
'Gmagick::getimagescene' => ['int'],
'Gmagick::getimagesignature' => ['string'],
'Gmagick::getimagetype' => ['int'],
'Gmagick::getimageunits' => ['int'],
'Gmagick::getimagewhitepoint' => ['array'],
'Gmagick::getimagewidth' => ['int'],
'Gmagick::getpackagename' => ['string'],
'Gmagick::getquantumdepth' => ['array'],
'Gmagick::getreleasedate' => ['string'],
'Gmagick::getsamplingfactors' => ['array'],
'Gmagick::getsize' => ['array'],
'Gmagick::getversion' => ['array'],
'Gmagick::hasnextimage' => ['bool'],
'Gmagick::haspreviousimage' => ['bool'],
'Gmagick::implodeimage' => ['mixed', 'radius'=>'float'],
'Gmagick::labelimage' => ['mixed', 'label'=>'string'],
'Gmagick::levelimage' => ['mixed', 'blackpoint'=>'float', 'gamma'=>'float', 'whitepoint'=>'float', 'channel='=>'int'],
'Gmagick::magnifyimage' => ['mixed'],
'Gmagick::mapimage' => ['Gmagick', 'gmagick'=>'gmagick', 'dither'=>'bool'],
'Gmagick::medianfilterimage' => ['void', 'radius'=>'float'],
'Gmagick::minifyimage' => ['Gmagick'],
'Gmagick::modulateimage' => ['Gmagick', 'brightness'=>'float', 'saturation'=>'float', 'hue'=>'float'],
'Gmagick::motionblurimage' => ['Gmagick', 'radius'=>'float', 'sigma'=>'float', 'angle'=>'float'],
'Gmagick::newimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'background'=>'string', 'format='=>'string'],
'Gmagick::nextimage' => ['bool'],
'Gmagick::normalizeimage' => ['Gmagick', 'channel='=>'int'],
'Gmagick::oilpaintimage' => ['Gmagick', 'radius'=>'float'],
'Gmagick::previousimage' => ['bool'],
'Gmagick::profileimage' => ['Gmagick', 'name'=>'string', 'profile'=>'string'],
'Gmagick::quantizeimage' => ['Gmagick', 'numcolors'=>'int', 'colorspace'=>'int', 'treedepth'=>'int', 'dither'=>'bool', 'measureerror'=>'bool'],
'Gmagick::quantizeimages' => ['Gmagick', 'numcolors'=>'int', 'colorspace'=>'int', 'treedepth'=>'int', 'dither'=>'bool', 'measureerror'=>'bool'],
'Gmagick::queryfontmetrics' => ['array', 'draw'=>'gmagickdraw', 'text'=>'string'],
'Gmagick::queryfonts' => ['array', 'pattern='=>'string'],
'Gmagick::queryformats' => ['array', 'pattern='=>'string'],
'Gmagick::radialblurimage' => ['Gmagick', 'angle'=>'float', 'channel='=>'int'],
'Gmagick::raiseimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int', 'raise'=>'bool'],
'Gmagick::read' => ['Gmagick', 'filename'=>'string'],
'Gmagick::readimage' => ['Gmagick', 'filename'=>'string'],
'Gmagick::readimageblob' => ['Gmagick', 'imagecontents'=>'string', 'filename='=>'string'],
'Gmagick::readimagefile' => ['Gmagick', 'fp'=>'resource', 'filename='=>'string'],
'Gmagick::reducenoiseimage' => ['Gmagick', 'radius'=>'float'],
'Gmagick::removeimage' => ['Gmagick'],
'Gmagick::removeimageprofile' => ['string', 'name'=>'string'],
'Gmagick::resampleimage' => ['Gmagick', 'xresolution'=>'float', 'yresolution'=>'float', 'filter'=>'int', 'blur'=>'float'],
'Gmagick::resizeimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'filter'=>'int', 'blur'=>'float', 'fit='=>'bool'],
'Gmagick::rollimage' => ['Gmagick', 'x'=>'int', 'y'=>'int'],
'Gmagick::rotateimage' => ['Gmagick', 'color'=>'mixed', 'degrees'=>'float'],
'Gmagick::scaleimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'fit='=>'bool'],
'Gmagick::separateimagechannel' => ['Gmagick', 'channel'=>'int'],
'Gmagick::setCompressionQuality' => ['Gmagick', 'quality'=>'int'],
'Gmagick::setfilename' => ['Gmagick', 'filename'=>'string'],
'Gmagick::setimagebackgroundcolor' => ['Gmagick', 'color'=>'gmagickpixel'],
'Gmagick::setimageblueprimary' => ['Gmagick', 'x'=>'float', 'y'=>'float'],
'Gmagick::setimagebordercolor' => ['Gmagick', 'color'=>'gmagickpixel'],
'Gmagick::setimagechanneldepth' => ['Gmagick', 'channel'=>'int', 'depth'=>'int'],
'Gmagick::setimagecolorspace' => ['Gmagick', 'colorspace'=>'int'],
'Gmagick::setimagecompose' => ['Gmagick', 'composite'=>'int'],
'Gmagick::setimagedelay' => ['Gmagick', 'delay'=>'int'],
'Gmagick::setimagedepth' => ['Gmagick', 'depth'=>'int'],
'Gmagick::setimagedispose' => ['Gmagick', 'disposetype'=>'int'],
'Gmagick::setimagefilename' => ['Gmagick', 'filename'=>'string'],
'Gmagick::setimageformat' => ['Gmagick', 'imageformat'=>'string'],
'Gmagick::setimagegamma' => ['Gmagick', 'gamma'=>'float'],
'Gmagick::setimagegreenprimary' => ['Gmagick', 'x'=>'float', 'y'=>'float'],
'Gmagick::setimageindex' => ['Gmagick', 'index'=>'int'],
'Gmagick::setimageinterlacescheme' => ['Gmagick', 'interlace'=>'int'],
'Gmagick::setimageiterations' => ['Gmagick', 'iterations'=>'int'],
'Gmagick::setimageprofile' => ['Gmagick', 'name'=>'string', 'profile'=>'string'],
'Gmagick::setimageredprimary' => ['Gmagick', 'x'=>'float', 'y'=>'float'],
'Gmagick::setimagerenderingintent' => ['Gmagick', 'rendering_intent'=>'int'],
'Gmagick::setimageresolution' => ['Gmagick', 'xresolution'=>'float', 'yresolution'=>'float'],
'Gmagick::setimagescene' => ['Gmagick', 'scene'=>'int'],
'Gmagick::setimagetype' => ['Gmagick', 'imgtype'=>'int'],
'Gmagick::setimageunits' => ['Gmagick', 'resolution'=>'int'],
'Gmagick::setimagewhitepoint' => ['Gmagick', 'x'=>'float', 'y'=>'float'],
'Gmagick::setsamplingfactors' => ['Gmagick', 'factors'=>'array'],
'Gmagick::setsize' => ['Gmagick', 'columns'=>'int', 'rows'=>'int'],
'Gmagick::shearimage' => ['Gmagick', 'color'=>'mixed', 'xshear'=>'float', 'yshear'=>'float'],
'Gmagick::solarizeimage' => ['Gmagick', 'threshold'=>'int'],
'Gmagick::spreadimage' => ['Gmagick', 'radius'=>'float'],
'Gmagick::stripimage' => ['Gmagick'],
'Gmagick::swirlimage' => ['Gmagick', 'degrees'=>'float'],
'Gmagick::thumbnailimage' => ['Gmagick', 'width'=>'int', 'height'=>'int', 'fit='=>'bool'],
'Gmagick::trimimage' => ['Gmagick', 'fuzz'=>'float'],
'Gmagick::write' => ['Gmagick', 'filename'=>'string'],
'Gmagick::writeimage' => ['Gmagick', 'filename'=>'string', 'all_frames='=>'bool'],
'GmagickDraw::annotate' => ['GmagickDraw', 'x'=>'float', 'y'=>'float', 'text'=>'string'],
'GmagickDraw::arc' => ['GmagickDraw', 'sx'=>'float', 'sy'=>'float', 'ex'=>'float', 'ey'=>'float', 'sd'=>'float', 'ed'=>'float'],
'GmagickDraw::bezier' => ['GmagickDraw', 'coordinate_array'=>'array'],
'GmagickDraw::ellipse' => ['GmagickDraw', 'ox'=>'float', 'oy'=>'float', 'rx'=>'float', 'ry'=>'float', 'start'=>'float', 'end'=>'float'],
'GmagickDraw::getfillcolor' => ['GmagickPixel'],
'GmagickDraw::getfillopacity' => ['float'],
'GmagickDraw::getfont' => ['string|false'],
'GmagickDraw::getfontsize' => ['float'],
'GmagickDraw::getfontstyle' => ['int'],
'GmagickDraw::getfontweight' => ['int'],
'GmagickDraw::getstrokecolor' => ['GmagickPixel'],
'GmagickDraw::getstrokeopacity' => ['float'],
'GmagickDraw::getstrokewidth' => ['float'],
'GmagickDraw::gettextdecoration' => ['int'],
'GmagickDraw::gettextencoding' => ['string|false'],
'GmagickDraw::line' => ['GmagickDraw', 'sx'=>'float', 'sy'=>'float', 'ex'=>'float', 'ey'=>'float'],
'GmagickDraw::point' => ['GmagickDraw', 'x'=>'float', 'y'=>'float'],
'GmagickDraw::polygon' => ['GmagickDraw', 'coordinates'=>'array'],
'GmagickDraw::polyline' => ['GmagickDraw', 'coordinate_array'=>'array'],
'GmagickDraw::rectangle' => ['GmagickDraw', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float'],
'GmagickDraw::rotate' => ['GmagickDraw', 'degrees'=>'float'],
'GmagickDraw::roundrectangle' => ['GmagickDraw', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'rx'=>'float', 'ry'=>'float'],
'GmagickDraw::scale' => ['GmagickDraw', 'x'=>'float', 'y'=>'float'],
'GmagickDraw::setfillcolor' => ['GmagickDraw', 'color'=>'string'],
'GmagickDraw::setfillopacity' => ['GmagickDraw', 'fill_opacity'=>'float'],
'GmagickDraw::setfont' => ['GmagickDraw', 'font'=>'string'],
'GmagickDraw::setfontsize' => ['GmagickDraw', 'pointsize'=>'float'],
'GmagickDraw::setfontstyle' => ['GmagickDraw', 'style'=>'int'],
'GmagickDraw::setfontweight' => ['GmagickDraw', 'weight'=>'int'],
'GmagickDraw::setstrokecolor' => ['GmagickDraw', 'color'=>'gmagickpixel'],
'GmagickDraw::setstrokeopacity' => ['GmagickDraw', 'stroke_opacity'=>'float'],
'GmagickDraw::setstrokewidth' => ['GmagickDraw', 'width'=>'float'],
'GmagickDraw::settextdecoration' => ['GmagickDraw', 'decoration'=>'int'],
'GmagickDraw::settextencoding' => ['GmagickDraw', 'encoding'=>'string'],
'GmagickPixel::__construct' => ['void', 'color='=>'string'],
'GmagickPixel::getcolor' => ['mixed', 'as_array='=>'bool', 'normalize_array='=>'bool'],
'GmagickPixel::getcolorcount' => ['int'],
'GmagickPixel::getcolorvalue' => ['float', 'color'=>'int'],
'GmagickPixel::setcolor' => ['GmagickPixel', 'color'=>'string'],
'GmagickPixel::setcolorvalue' => ['GmagickPixel', 'color'=>'int', 'value'=>'float'],
'gmdate' => ['string', 'format'=>'string', 'timestamp='=>'int|null'],
'gmmktime' => ['int|false', 'hour'=>'int', 'minute='=>'int|null', 'second='=>'int|null', 'month='=>'int|null', 'day='=>'int|null', 'year='=>'int|null'],
'GMP::__construct' => ['void'],
'GMP::__toString' => ['numeric-string'],
'GMP::serialize' => ['string'],
'GMP::unserialize' => ['void', 'serialized'=>'string'],
'gmp_abs' => ['GMP', 'num'=>'GMP|string|int'],
'gmp_add' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_and' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_binomial' => ['GMP', 'n'=>'GMP|string|int', 'k'=>'int'],
'gmp_clrbit' => ['void', 'num'=>'GMP|string|int', 'index'=>'int'],
'gmp_cmp' => ['int', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_com' => ['GMP', 'num'=>'GMP|string|int'],
'gmp_div' => ['GMP', 'num1'=>'GMP|resource|string', 'num2'=>'GMP|resource|string', 'rounding_mode='=>'int'],
'gmp_div_q' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int', 'rounding_mode='=>'int'],
'gmp_div_qr' => ['array{0: GMP, 1: GMP}', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int', 'rounding_mode='=>'int'],
'gmp_div_r' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int', 'rounding_mode='=>'int'],
'gmp_divexact' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_export' => ['string|false', 'num'=>'GMP|string|int', 'word_size='=>'int', 'flags='=>'int'],
'gmp_fact' => ['GMP', 'num'=>'int'],
'gmp_gcd' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_gcdext' => ['array<string,GMP>', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_hamdist' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_import' => ['GMP|false', 'data'=>'string', 'word_size='=>'int', 'flags='=>'int'],
'gmp_init' => ['GMP', 'num'=>'int|string', 'base='=>'int'],
'gmp_intval' => ['int', 'num'=>'GMP|string|int'],
'gmp_invert' => ['GMP|false', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_jacobi' => ['int', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_kronecker' => ['int', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_lcm' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_legendre' => ['int', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_mod' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_mul' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_neg' => ['GMP', 'num'=>'GMP|string|int'],
'gmp_nextprime' => ['GMP', 'num'=>'GMP|string|int'],
'gmp_or' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_perfect_power' => ['bool', 'num'=>'GMP|string|int'],
'gmp_perfect_square' => ['bool', 'num'=>'GMP|string|int'],
'gmp_popcount' => ['int', 'num'=>'GMP|string|int'],
'gmp_pow' => ['GMP', 'num'=>'GMP|string|int', 'exponent'=>'int'],
'gmp_powm' => ['GMP', 'num'=>'GMP|string|int', 'exponent'=>'GMP|string|int', 'modulus'=>'GMP|string|int'],
'gmp_prob_prime' => ['int', 'num'=>'GMP|string|int', 'repetitions='=>'int'],
'gmp_random_bits' => ['GMP', 'bits'=>'int'],
'gmp_random_range' => ['GMP', 'min'=>'GMP|string|int', 'max'=>'GMP|string|int'],
'gmp_random_seed' => ['void', 'seed'=>'GMP|string|int'],
'gmp_root' => ['GMP', 'num'=>'GMP|string|int', 'nth'=>'int'],
'gmp_rootrem' => ['array{0: GMP, 1: GMP}', 'num'=>'GMP|string|int', 'nth'=>'int'],
'gmp_scan0' => ['int', 'num1'=>'GMP|string|int', 'start'=>'int'],
'gmp_scan1' => ['int', 'num1'=>'GMP|string|int', 'start'=>'int'],
'gmp_setbit' => ['void', 'num'=>'GMP|string|int', 'index'=>'int', 'value='=>'bool'],
'gmp_sign' => ['int', 'num'=>'GMP|string|int'],
'gmp_sqrt' => ['GMP', 'num'=>'GMP|string|int'],
'gmp_sqrtrem' => ['array{0: GMP, 1: GMP}', 'num'=>'GMP|string|int'],
'gmp_strval' => ['numeric-string', 'num'=>'GMP|string|int', 'base='=>'int'],
'gmp_sub' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmp_testbit' => ['bool', 'num'=>'GMP|string|int', 'index'=>'int'],
'gmp_xor' => ['GMP', 'num1'=>'GMP|string|int', 'num2'=>'GMP|string|int'],
'gmstrftime' => ['string', 'format'=>'string', 'timestamp='=>'int'],
'gnupg::adddecryptkey' => ['bool', 'fingerprint'=>'string', 'passphrase'=>'string'],
'gnupg::addencryptkey' => ['bool', 'fingerprint'=>'string'],
'gnupg::addsignkey' => ['bool', 'fingerprint'=>'string', 'passphrase='=>'string'],
'gnupg::cleardecryptkeys' => ['bool'],
'gnupg::clearencryptkeys' => ['bool'],
'gnupg::clearsignkeys' => ['bool'],
'gnupg::decrypt' => ['string|false', 'text'=>'string'],
'gnupg::decryptverify' => ['array|false', 'text'=>'string', '&plaintext'=>'string'],
'gnupg::encrypt' => ['string|false', 'plaintext'=>'string'],
'gnupg::encryptsign' => ['string|false', 'plaintext'=>'string'],
'gnupg::export' => ['string|false', 'fingerprint'=>'string'],
'gnupg::geterror' => ['string|false'],
'gnupg::getprotocol' => ['int'],
'gnupg::import' => ['array|false', 'keydata'=>'string'],
'gnupg::init' => ['resource'],
'gnupg::keyinfo' => ['array', 'pattern'=>'string'],
'gnupg::setarmor' => ['bool', 'armor'=>'int'],
'gnupg::seterrormode' => ['void', 'errormode'=>'int'],
'gnupg::setsignmode' => ['bool', 'signmode'=>'int'],
'gnupg::sign' => ['string|false', 'plaintext'=>'string'],
'gnupg::verify' => ['array|false', 'signed_text'=>'string', 'signature'=>'string', '&plaintext='=>'string'],
'gnupg_adddecryptkey' => ['bool', 'identifier'=>'resource', 'fingerprint'=>'string', 'passphrase'=>'string'],
'gnupg_addencryptkey' => ['bool', 'identifier'=>'resource', 'fingerprint'=>'string'],
'gnupg_addsignkey' => ['bool', 'identifier'=>'resource', 'fingerprint'=>'string', 'passphrase='=>'string'],
'gnupg_cleardecryptkeys' => ['bool', 'identifier'=>'resource'],
'gnupg_clearencryptkeys' => ['bool', 'identifier'=>'resource'],
'gnupg_clearsignkeys' => ['bool', 'identifier'=>'resource'],
'gnupg_decrypt' => ['string', 'identifier'=>'resource', 'text'=>'string'],
'gnupg_decryptverify' => ['array', 'identifier'=>'resource', 'text'=>'string', 'plaintext'=>'string'],
'gnupg_encrypt' => ['string', 'identifier'=>'resource', 'plaintext'=>'string'],
'gnupg_encryptsign' => ['string', 'identifier'=>'resource', 'plaintext'=>'string'],
'gnupg_export' => ['string', 'identifier'=>'resource', 'fingerprint'=>'string'],
'gnupg_geterror' => ['string', 'identifier'=>'resource'],
'gnupg_getprotocol' => ['int', 'identifier'=>'resource'],
'gnupg_import' => ['array', 'identifier'=>'resource', 'keydata'=>'string'],
'gnupg_init' => ['resource'],
'gnupg_keyinfo' => ['array', 'identifier'=>'resource', 'pattern'=>'string'],
'gnupg_setarmor' => ['bool', 'identifier'=>'resource', 'armor'=>'int'],
'gnupg_seterrormode' => ['void', 'identifier'=>'resource', 'errormode'=>'int'],
'gnupg_setsignmode' => ['bool', 'identifier'=>'resource', 'signmode'=>'int'],
'gnupg_sign' => ['string', 'identifier'=>'resource', 'plaintext'=>'string'],
'gnupg_verify' => ['array', 'identifier'=>'resource', 'signed_text'=>'string', 'signature'=>'string', 'plaintext='=>'string'],
'gopher_parsedir' => ['array', 'dirent'=>'string'],
'grapheme_extract' => ['string|false', 'haystack'=>'string', 'size'=>'int', 'type='=>'int', 'offset='=>'int', '&w_next='=>'int'],
'grapheme_stripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'grapheme_stristr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'beforeNeedle='=>'bool'],
'grapheme_strlen' => ['int|false|null', 'string'=>'string'],
'grapheme_strpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'grapheme_strripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'grapheme_strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'grapheme_strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'beforeNeedle='=>'bool'],
'grapheme_substr' => ['string|false', 'string'=>'string', 'offset'=>'int', 'length='=>'int'],
'gregoriantojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'],
'gridObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'Grpc\Call::__construct' => ['void', 'channel'=>'Grpc\Channel', 'method'=>'string', 'absolute_deadline'=>'Grpc\Timeval', 'host_override='=>'mixed'],
'Grpc\Call::cancel' => [''],
'Grpc\Call::getPeer' => ['string'],
'Grpc\Call::setCredentials' => ['int', 'creds_obj'=>'Grpc\CallCredentials'],
'Grpc\Call::startBatch' => ['object', 'batch'=>'array'],
'Grpc\CallCredentials::createComposite' => ['Grpc\CallCredentials', 'cred1'=>'Grpc\CallCredentials', 'cred2'=>'Grpc\CallCredentials'],
'Grpc\CallCredentials::createFromPlugin' => ['Grpc\CallCredentials', 'callback'=>'Closure'],
'Grpc\Channel::__construct' => ['void', 'target'=>'string', 'args='=>'array'],
'Grpc\Channel::close' => [''],
'Grpc\Channel::getConnectivityState' => ['int', 'try_to_connect='=>'bool'],
'Grpc\Channel::getTarget' => ['string'],
'Grpc\Channel::watchConnectivityState' => ['bool', 'last_state'=>'int', 'deadline_obj'=>'Grpc\Timeval'],
'Grpc\ChannelCredentials::createComposite' => ['Grpc\ChannelCredentials', 'cred1'=>'Grpc\ChannelCredentials', 'cred2'=>'Grpc\CallCredentials'],
'Grpc\ChannelCredentials::createDefault' => ['Grpc\ChannelCredentials'],
'Grpc\ChannelCredentials::createInsecure' => ['null'],
'Grpc\ChannelCredentials::createSsl' => ['Grpc\ChannelCredentials', 'pem_root_certs'=>'string', 'pem_private_key='=>'string', 'pem_cert_chain='=>'string'],
'Grpc\ChannelCredentials::setDefaultRootsPem' => ['', 'pem_roots'=>'string'],
'Grpc\Server::__construct' => ['void', 'args'=>'array'],
'Grpc\Server::addHttp2Port' => ['bool', 'addr'=>'string'],
'Grpc\Server::addSecureHttp2Port' => ['bool', 'addr'=>'string', 'creds_obj'=>'Grpc\ServerCredentials'],
'Grpc\Server::requestCall' => ['', 'tag_new'=>'int', 'tag_cancel'=>'int'],
'Grpc\Server::start' => [''],
'Grpc\ServerCredentials::createSsl' => ['object', 'pem_root_certs'=>'string', 'pem_private_key'=>'string', 'pem_cert_chain'=>'string'],
'Grpc\Timeval::__construct' => ['void', 'usec'=>'int'],
'Grpc\Timeval::add' => ['Grpc\Timeval', 'other'=>'Grpc\Timeval'],
'Grpc\Timeval::compare' => ['int', 'a'=>'Grpc\Timeval', 'b'=>'Grpc\Timeval'],
'Grpc\Timeval::infFuture' => ['Grpc\Timeval'],
'Grpc\Timeval::infPast' => ['Grpc\Timeval'],
'Grpc\Timeval::now' => ['Grpc\Timeval'],
'Grpc\Timeval::similar' => ['bool', 'a'=>'Grpc\Timeval', 'b'=>'Grpc\Timeval', 'threshold'=>'Grpc\Timeval'],
'Grpc\Timeval::sleepUntil' => [''],
'Grpc\Timeval::subtract' => ['Grpc\Timeval', 'other'=>'Grpc\Timeval'],
'Grpc\Timeval::zero' => ['Grpc\Timeval'],
'gupnp_context_get_host_ip' => ['string', 'context'=>'resource'],
'gupnp_context_get_port' => ['int', 'context'=>'resource'],
'gupnp_context_get_subscription_timeout' => ['int', 'context'=>'resource'],
'gupnp_context_host_path' => ['bool', 'context'=>'resource', 'local_path'=>'string', 'server_path'=>'string'],
'gupnp_context_new' => ['resource', 'host_ip='=>'string', 'port='=>'int'],
'gupnp_context_set_subscription_timeout' => ['void', 'context'=>'resource', 'timeout'=>'int'],
'gupnp_context_timeout_add' => ['bool', 'context'=>'resource', 'timeout'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'],
'gupnp_context_unhost_path' => ['bool', 'context'=>'resource', 'server_path'=>'string'],
'gupnp_control_point_browse_start' => ['bool', 'cpoint'=>'resource'],
'gupnp_control_point_browse_stop' => ['bool', 'cpoint'=>'resource'],
'gupnp_control_point_callback_set' => ['bool', 'cpoint'=>'resource', 'signal'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'],
'gupnp_control_point_new' => ['resource', 'context'=>'resource', 'target'=>'string'],
'gupnp_device_action_callback_set' => ['bool', 'root_device'=>'resource', 'signal'=>'int', 'action_name'=>'string', 'callback'=>'mixed', 'arg='=>'mixed'],
'gupnp_device_info_get' => ['array', 'root_device'=>'resource'],
'gupnp_device_info_get_service' => ['resource', 'root_device'=>'resource', 'type'=>'string'],
'gupnp_root_device_get_available' => ['bool', 'root_device'=>'resource'],
'gupnp_root_device_get_relative_location' => ['string', 'root_device'=>'resource'],
'gupnp_root_device_new' => ['resource', 'context'=>'resource', 'location'=>'string', 'description_dir'=>'string'],
'gupnp_root_device_set_available' => ['bool', 'root_device'=>'resource', 'available'=>'bool'],
'gupnp_root_device_start' => ['bool', 'root_device'=>'resource'],
'gupnp_root_device_stop' => ['bool', 'root_device'=>'resource'],
'gupnp_service_action_get' => ['mixed', 'action'=>'resource', 'name'=>'string', 'type'=>'int'],
'gupnp_service_action_return' => ['bool', 'action'=>'resource'],
'gupnp_service_action_return_error' => ['bool', 'action'=>'resource', 'error_code'=>'int', 'error_description='=>'string'],
'gupnp_service_action_set' => ['bool', 'action'=>'resource', 'name'=>'string', 'type'=>'int', 'value'=>'mixed'],
'gupnp_service_freeze_notify' => ['bool', 'service'=>'resource'],
'gupnp_service_info_get' => ['array', 'proxy'=>'resource'],
'gupnp_service_info_get_introspection' => ['mixed', 'proxy'=>'resource', 'callback='=>'mixed', 'arg='=>'mixed'],
'gupnp_service_introspection_get_state_variable' => ['array', 'introspection'=>'resource', 'variable_name'=>'string'],
'gupnp_service_notify' => ['bool', 'service'=>'resource', 'name'=>'string', 'type'=>'int', 'value'=>'mixed'],
'gupnp_service_proxy_action_get' => ['mixed', 'proxy'=>'resource', 'action'=>'string', 'name'=>'string', 'type'=>'int'],
'gupnp_service_proxy_action_set' => ['bool', 'proxy'=>'resource', 'action'=>'string', 'name'=>'string', 'value'=>'mixed', 'type'=>'int'],
'gupnp_service_proxy_add_notify' => ['bool', 'proxy'=>'resource', 'value'=>'string', 'type'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'],
'gupnp_service_proxy_callback_set' => ['bool', 'proxy'=>'resource', 'signal'=>'int', 'callback'=>'mixed', 'arg='=>'mixed'],
'gupnp_service_proxy_get_subscribed' => ['bool', 'proxy'=>'resource'],
'gupnp_service_proxy_remove_notify' => ['bool', 'proxy'=>'resource', 'value'=>'string'],
'gupnp_service_proxy_send_action' => ['array', 'proxy'=>'resource', 'action'=>'string', 'in_params'=>'array', 'out_params'=>'array'],
'gupnp_service_proxy_set_subscribed' => ['bool', 'proxy'=>'resource', 'subscribed'=>'bool'],
'gupnp_service_thaw_notify' => ['bool', 'service'=>'resource'],
'gzclose' => ['bool', 'stream'=>'resource'],
'gzcompress' => ['string|false', 'data'=>'string', 'level='=>'int', 'encoding='=>'int'],
'gzdecode' => ['string|false', 'data'=>'string', 'max_length='=>'int'],
'gzdeflate' => ['string|false', 'data'=>'string', 'level='=>'int', 'encoding='=>'int'],
'gzencode' => ['string|false', 'data'=>'string', 'level='=>'int', 'encoding='=>'int'],
'gzeof' => ['bool|int', 'stream'=>'resource'],
'gzfile' => ['list<string>', 'filename'=>'string', 'use_include_path='=>'int'],
'gzgetc' => ['string|false', 'stream'=>'resource'],
'gzgets' => ['string|false', 'stream'=>'resource', 'length='=>'int'],
'gzinflate' => ['string|false', 'data'=>'string', 'max_length='=>'int'],
'gzopen' => ['resource|false', 'filename'=>'string', 'mode'=>'string', 'use_include_path='=>'int'],
'gzpassthru' => ['int|false', 'stream'=>'resource'],
'gzputs' => ['int', 'stream'=>'resource', 'data'=>'string', 'length='=>'int'],
'gzread' => ['string|false', 'stream'=>'resource', 'length'=>'int'],
'gzrewind' => ['bool', 'stream'=>'resource'],
'gzseek' => ['int', 'stream'=>'resource', 'offset'=>'int', 'whence='=>'int'],
'gztell' => ['int|false', 'stream'=>'resource'],
'gzuncompress' => ['string|false', 'data'=>'string', 'max_length='=>'int'],
'gzwrite' => ['int', 'stream'=>'resource', 'data'=>'string', 'length='=>'int'],
'HaruAnnotation::setBorderStyle' => ['bool', 'width'=>'float', 'dash_on'=>'int', 'dash_off'=>'int'],
'HaruAnnotation::setHighlightMode' => ['bool', 'mode'=>'int'],
'HaruAnnotation::setIcon' => ['bool', 'icon'=>'int'],
'HaruAnnotation::setOpened' => ['bool', 'opened'=>'bool'],
'HaruDestination::setFit' => ['bool'],
'HaruDestination::setFitB' => ['bool'],
'HaruDestination::setFitBH' => ['bool', 'top'=>'float'],
'HaruDestination::setFitBV' => ['bool', 'left'=>'float'],
'HaruDestination::setFitH' => ['bool', 'top'=>'float'],
'HaruDestination::setFitR' => ['bool', 'left'=>'float', 'bottom'=>'float', 'right'=>'float', 'top'=>'float'],
'HaruDestination::setFitV' => ['bool', 'left'=>'float'],
'HaruDestination::setXYZ' => ['bool', 'left'=>'float', 'top'=>'float', 'zoom'=>'float'],
'HaruDoc::__construct' => ['void'],
'HaruDoc::addPage' => ['object'],
'HaruDoc::addPageLabel' => ['bool', 'first_page'=>'int', 'style'=>'int', 'first_num'=>'int', 'prefix='=>'string'],
'HaruDoc::createOutline' => ['object', 'title'=>'string', 'parent_outline='=>'object', 'encoder='=>'object'],
'HaruDoc::getCurrentEncoder' => ['object'],
'HaruDoc::getCurrentPage' => ['object'],
'HaruDoc::getEncoder' => ['object', 'encoding'=>'string'],
'HaruDoc::getFont' => ['object', 'fontname'=>'string', 'encoding='=>'string'],
'HaruDoc::getInfoAttr' => ['string', 'type'=>'int'],
'HaruDoc::getPageLayout' => ['int'],
'HaruDoc::getPageMode' => ['int'],
'HaruDoc::getStreamSize' => ['int'],
'HaruDoc::insertPage' => ['object', 'page'=>'object'],
'HaruDoc::loadJPEG' => ['object', 'filename'=>'string'],
'HaruDoc::loadPNG' => ['object', 'filename'=>'string', 'deferred='=>'bool'],
'HaruDoc::loadRaw' => ['object', 'filename'=>'string', 'width'=>'int', 'height'=>'int', 'color_space'=>'int'],
'HaruDoc::loadTTC' => ['string', 'fontfile'=>'string', 'index'=>'int', 'embed='=>'bool'],
'HaruDoc::loadTTF' => ['string', 'fontfile'=>'string', 'embed='=>'bool'],
'HaruDoc::loadType1' => ['string', 'afmfile'=>'string', 'pfmfile='=>'string'],
'HaruDoc::output' => ['bool'],
'HaruDoc::readFromStream' => ['string', 'bytes'=>'int'],
'HaruDoc::resetError' => ['bool'],
'HaruDoc::resetStream' => ['bool'],
'HaruDoc::save' => ['bool', 'file'=>'string'],
'HaruDoc::saveToStream' => ['bool'],
'HaruDoc::setCompressionMode' => ['bool', 'mode'=>'int'],
'HaruDoc::setCurrentEncoder' => ['bool', 'encoding'=>'string'],
'HaruDoc::setEncryptionMode' => ['bool', 'mode'=>'int', 'key_len='=>'int'],
'HaruDoc::setInfoAttr' => ['bool', 'type'=>'int', 'info'=>'string'],
'HaruDoc::setInfoDateAttr' => ['bool', 'type'=>'int', 'year'=>'int', 'month'=>'int', 'day'=>'int', 'hour'=>'int', 'min'=>'int', 'sec'=>'int', 'ind'=>'string', 'off_hour'=>'int', 'off_min'=>'int'],
'HaruDoc::setOpenAction' => ['bool', 'destination'=>'object'],
'HaruDoc::setPageLayout' => ['bool', 'layout'=>'int'],
'HaruDoc::setPageMode' => ['bool', 'mode'=>'int'],
'HaruDoc::setPagesConfiguration' => ['bool', 'page_per_pages'=>'int'],
'HaruDoc::setPassword' => ['bool', 'owner_password'=>'string', 'user_password'=>'string'],
'HaruDoc::setPermission' => ['bool', 'permission'=>'int'],
'HaruDoc::useCNSEncodings' => ['bool'],
'HaruDoc::useCNSFonts' => ['bool'],
'HaruDoc::useCNTEncodings' => ['bool'],
'HaruDoc::useCNTFonts' => ['bool'],
'HaruDoc::useJPEncodings' => ['bool'],
'HaruDoc::useJPFonts' => ['bool'],
'HaruDoc::useKREncodings' => ['bool'],
'HaruDoc::useKRFonts' => ['bool'],
'HaruEncoder::getByteType' => ['int', 'text'=>'string', 'index'=>'int'],
'HaruEncoder::getType' => ['int'],
'HaruEncoder::getUnicode' => ['int', 'character'=>'int'],
'HaruEncoder::getWritingMode' => ['int'],
'HaruFont::getAscent' => ['int'],
'HaruFont::getCapHeight' => ['int'],
'HaruFont::getDescent' => ['int'],
'HaruFont::getEncodingName' => ['string'],
'HaruFont::getFontName' => ['string'],
'HaruFont::getTextWidth' => ['array', 'text'=>'string'],
'HaruFont::getUnicodeWidth' => ['int', 'character'=>'int'],
'HaruFont::getXHeight' => ['int'],
'HaruFont::measureText' => ['int', 'text'=>'string', 'width'=>'float', 'font_size'=>'float', 'char_space'=>'float', 'word_space'=>'float', 'word_wrap='=>'bool'],
'HaruImage::getBitsPerComponent' => ['int'],
'HaruImage::getColorSpace' => ['string'],
'HaruImage::getHeight' => ['int'],
'HaruImage::getSize' => ['array'],
'HaruImage::getWidth' => ['int'],
'HaruImage::setColorMask' => ['bool', 'rmin'=>'int', 'rmax'=>'int', 'gmin'=>'int', 'gmax'=>'int', 'bmin'=>'int', 'bmax'=>'int'],
'HaruImage::setMaskImage' => ['bool', 'mask_image'=>'object'],
'HaruOutline::setDestination' => ['bool', 'destination'=>'object'],
'HaruOutline::setOpened' => ['bool', 'opened'=>'bool'],
'HaruPage::arc' => ['bool', 'x'=>'float', 'y'=>'float', 'ray'=>'float', 'ang1'=>'float', 'ang2'=>'float'],
'HaruPage::beginText' => ['bool'],
'HaruPage::circle' => ['bool', 'x'=>'float', 'y'=>'float', 'ray'=>'float'],
'HaruPage::closePath' => ['bool'],
'HaruPage::concat' => ['bool', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'x'=>'float', 'y'=>'float'],
'HaruPage::createDestination' => ['object'],
'HaruPage::createLinkAnnotation' => ['object', 'rectangle'=>'array', 'destination'=>'object'],
'HaruPage::createTextAnnotation' => ['object', 'rectangle'=>'array', 'text'=>'string', 'encoder='=>'object'],
'HaruPage::createURLAnnotation' => ['object', 'rectangle'=>'array', 'url'=>'string'],
'HaruPage::curveTo' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'],
'HaruPage::curveTo2' => ['bool', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'],
'HaruPage::curveTo3' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x3'=>'float', 'y3'=>'float'],
'HaruPage::drawImage' => ['bool', 'image'=>'object', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'],
'HaruPage::ellipse' => ['bool', 'x'=>'float', 'y'=>'float', 'xray'=>'float', 'yray'=>'float'],
'HaruPage::endPath' => ['bool'],
'HaruPage::endText' => ['bool'],
'HaruPage::eofill' => ['bool'],
'HaruPage::eoFillStroke' => ['bool', 'close_path='=>'bool'],
'HaruPage::fill' => ['bool'],
'HaruPage::fillStroke' => ['bool', 'close_path='=>'bool'],
'HaruPage::getCharSpace' => ['float'],
'HaruPage::getCMYKFill' => ['array'],
'HaruPage::getCMYKStroke' => ['array'],
'HaruPage::getCurrentFont' => ['object'],
'HaruPage::getCurrentFontSize' => ['float'],
'HaruPage::getCurrentPos' => ['array'],
'HaruPage::getCurrentTextPos' => ['array'],
'HaruPage::getDash' => ['array'],
'HaruPage::getFillingColorSpace' => ['int'],
'HaruPage::getFlatness' => ['float'],
'HaruPage::getGMode' => ['int'],
'HaruPage::getGrayFill' => ['float'],
'HaruPage::getGrayStroke' => ['float'],
'HaruPage::getHeight' => ['float'],
'HaruPage::getHorizontalScaling' => ['float'],
'HaruPage::getLineCap' => ['int'],
'HaruPage::getLineJoin' => ['int'],
'HaruPage::getLineWidth' => ['float'],
'HaruPage::getMiterLimit' => ['float'],
'HaruPage::getRGBFill' => ['array'],
'HaruPage::getRGBStroke' => ['array'],
'HaruPage::getStrokingColorSpace' => ['int'],
'HaruPage::getTextLeading' => ['float'],
'HaruPage::getTextMatrix' => ['array'],
'HaruPage::getTextRenderingMode' => ['int'],
'HaruPage::getTextRise' => ['float'],
'HaruPage::getTextWidth' => ['float', 'text'=>'string'],
'HaruPage::getTransMatrix' => ['array'],
'HaruPage::getWidth' => ['float'],
'HaruPage::getWordSpace' => ['float'],
'HaruPage::lineTo' => ['bool', 'x'=>'float', 'y'=>'float'],
'HaruPage::measureText' => ['int', 'text'=>'string', 'width'=>'float', 'wordwrap='=>'bool'],
'HaruPage::moveTextPos' => ['bool', 'x'=>'float', 'y'=>'float', 'set_leading='=>'bool'],
'HaruPage::moveTo' => ['bool', 'x'=>'float', 'y'=>'float'],
'HaruPage::moveToNextLine' => ['bool'],
'HaruPage::rectangle' => ['bool', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'],
'HaruPage::setCharSpace' => ['bool', 'char_space'=>'float'],
'HaruPage::setCMYKFill' => ['bool', 'c'=>'float', 'm'=>'float', 'y'=>'float', 'k'=>'float'],
'HaruPage::setCMYKStroke' => ['bool', 'c'=>'float', 'm'=>'float', 'y'=>'float', 'k'=>'float'],
'HaruPage::setDash' => ['bool', 'pattern'=>'array', 'phase'=>'int'],
'HaruPage::setFlatness' => ['bool', 'flatness'=>'float'],
'HaruPage::setFontAndSize' => ['bool', 'font'=>'object', 'size'=>'float'],
'HaruPage::setGrayFill' => ['bool', 'value'=>'float'],
'HaruPage::setGrayStroke' => ['bool', 'value'=>'float'],
'HaruPage::setHeight' => ['bool', 'height'=>'float'],
'HaruPage::setHorizontalScaling' => ['bool', 'scaling'=>'float'],
'HaruPage::setLineCap' => ['bool', 'cap'=>'int'],
'HaruPage::setLineJoin' => ['bool', 'join'=>'int'],
'HaruPage::setLineWidth' => ['bool', 'width'=>'float'],
'HaruPage::setMiterLimit' => ['bool', 'limit'=>'float'],
'HaruPage::setRGBFill' => ['bool', 'r'=>'float', 'g'=>'float', 'b'=>'float'],
'HaruPage::setRGBStroke' => ['bool', 'r'=>'float', 'g'=>'float', 'b'=>'float'],
'HaruPage::setRotate' => ['bool', 'angle'=>'int'],
'HaruPage::setSize' => ['bool', 'size'=>'int', 'direction'=>'int'],
'HaruPage::setSlideShow' => ['bool', 'type'=>'int', 'disp_time'=>'float', 'trans_time'=>'float'],
'HaruPage::setTextLeading' => ['bool', 'text_leading'=>'float'],
'HaruPage::setTextMatrix' => ['bool', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'x'=>'float', 'y'=>'float'],
'HaruPage::setTextRenderingMode' => ['bool', 'mode'=>'int'],
'HaruPage::setTextRise' => ['bool', 'rise'=>'float'],
'HaruPage::setWidth' => ['bool', 'width'=>'float'],
'HaruPage::setWordSpace' => ['bool', 'word_space'=>'float'],
'HaruPage::showText' => ['bool', 'text'=>'string'],
'HaruPage::showTextNextLine' => ['bool', 'text'=>'string', 'word_space='=>'float', 'char_space='=>'float'],
'HaruPage::stroke' => ['bool', 'close_path='=>'bool'],
'HaruPage::textOut' => ['bool', 'x'=>'float', 'y'=>'float', 'text'=>'string'],
'HaruPage::textRect' => ['bool', 'left'=>'float', 'top'=>'float', 'right'=>'float', 'bottom'=>'float', 'text'=>'string', 'align='=>'int'],
'hash' => ['string|false', 'algo'=>'string', 'data'=>'string', 'binary='=>'bool', 'options='=>'array'],
'hash_algos' => ['list<string>'],
'hash_copy' => ['HashContext', 'context'=>'HashContext'],
'hash_equals' => ['bool', 'known_string'=>'string', 'user_string'=>'string'],
'hash_file' => ['string|false', 'algo'=>'string', 'filename'=>'string', 'binary='=>'bool', 'options='=>'array'],
'hash_final' => ['string', 'context'=>'HashContext', 'binary='=>'bool'],
'hash_hkdf' => ['string|false', 'algo'=>'string', 'key'=>'string', 'length='=>'int', 'info='=>'string', 'salt='=>'string'],
'hash_hmac' => ['string|false', 'algo'=>'string', 'data'=>'string', 'key'=>'string', 'binary='=>'bool'],
'hash_hmac_algos' => ['list<string>'],
'hash_hmac_file' => ['string|false', 'algo'=>'string', 'data'=>'string', 'key'=>'string', 'binary='=>'bool'],
'hash_init' => ['HashContext', 'algo'=>'string', 'flags='=>'int', 'key='=>'string', 'options='=>'array'],
'hash_pbkdf2' => ['string', 'algo'=>'string', 'password'=>'string', 'salt'=>'string', 'iterations'=>'int', 'length='=>'int', 'binary='=>'bool'],
'hash_update' => ['bool', 'context'=>'HashContext', 'data'=>'string'],
'hash_update_file' => ['bool', 'context'=>'HashContext', 'filename'=>'string', 'stream_context='=>'?resource'],
'hash_update_stream' => ['int', 'context'=>'HashContext', 'stream'=>'resource', 'length='=>'int'],
'hashTableObj::clear' => ['void'],
'hashTableObj::get' => ['string', 'key'=>'string'],
'hashTableObj::nextkey' => ['string', 'previousKey'=>'string'],
'hashTableObj::remove' => ['int', 'key'=>'string'],
'hashTableObj::set' => ['int', 'key'=>'string', 'value'=>'string'],
'header' => ['void', 'header'=>'string', 'replace='=>'bool', 'response_code='=>'int'],
'header_register_callback' => ['bool', 'callback'=>'callable():void'],
'header_remove' => ['void', 'name='=>'string'],
'headers_list' => ['list<string>'],
'headers_sent' => ['bool', '&w_filename='=>'string', '&w_line='=>'int'],
'hebrev' => ['string', 'string'=>'string', 'max_chars_per_line='=>'int'],
'hebrevc' => ['string', 'string'=>'string', 'max_chars_per_line='=>'int'],
'hex2bin' => ['string|false', 'string'=>'string'],
'hexdec' => ['int|float', 'hex_string'=>'string'],
'highlight_file' => ['string|bool', 'filename'=>'string', 'return='=>'bool'],
'highlight_string' => ['string|bool', 'string'=>'string', 'return='=>'bool'],
'hrtime' => ['array{0:int,1:int}|false', 'as_number='=>'false'],
'hrtime\'1' => ['int|float|false', 'as_number='=>'true'],
'HRTime\PerformanceCounter::getElapsedTicks' => ['int'],
'HRTime\PerformanceCounter::getFrequency' => ['int'],
'HRTime\PerformanceCounter::getLastElapsedTicks' => ['int'],
'HRTime\PerformanceCounter::getTicks' => ['int'],
'HRTime\PerformanceCounter::getTicksSince' => ['int', 'start'=>'int'],
'HRTime\PerformanceCounter::isRunning' => ['bool'],
'HRTime\PerformanceCounter::start' => ['void'],
'HRTime\PerformanceCounter::stop' => ['void'],
'HRTime\StopWatch::getElapsedTicks' => ['int'],
'HRTime\StopWatch::getElapsedTime' => ['float', 'unit='=>'int'],
'HRTime\StopWatch::getLastElapsedTicks' => ['int'],
'HRTime\StopWatch::getLastElapsedTime' => ['float', 'unit='=>'int'],
'HRTime\StopWatch::isRunning' => ['bool'],
'HRTime\StopWatch::start' => ['void'],
'HRTime\StopWatch::stop' => ['void'],
'html_entity_decode' => ['string', 'string'=>'string', 'flags='=>'int', 'encoding='=>'string'],
'htmlentities' => ['string', 'string'=>'string', 'flags='=>'int', 'encoding='=>'string', 'double_encode='=>'bool'],
'htmlspecialchars' => ['string', 'string'=>'string', 'flags='=>'int', 'encoding='=>'string|null', 'double_encode='=>'bool'],
'htmlspecialchars_decode' => ['string', 'string'=>'string', 'flags='=>'int'],
'http\Client::__construct' => ['void', 'driver='=>'string', 'persistent_handle_id='=>'string'],
'http\Client::addCookies' => ['http\Client', 'cookies='=>'?array'],
'http\Client::addSslOptions' => ['http\Client', 'ssl_options='=>'?array'],
'http\Client::attach' => ['void', 'observer'=>'SplObserver'],
'http\Client::configure' => ['http\Client', 'settings'=>'array'],
'http\Client::count' => ['int'],
'http\Client::dequeue' => ['http\Client', 'request'=>'http\Client\Request'],
'http\Client::detach' => ['void', 'observer'=>'SplObserver'],
'http\Client::enableEvents' => ['http\Client', 'enable='=>'mixed'],
'http\Client::enablePipelining' => ['http\Client', 'enable='=>'mixed'],
'http\Client::enqueue' => ['http\Client', 'request'=>'http\Client\Request', 'callable='=>'mixed'],
'http\Client::getAvailableConfiguration' => ['array'],
'http\Client::getAvailableDrivers' => ['array'],
'http\Client::getAvailableOptions' => ['array'],
'http\Client::getCookies' => ['array'],
'http\Client::getHistory' => ['http\Message'],
'http\Client::getObservers' => ['SplObjectStorage'],
'http\Client::getOptions' => ['array'],
'http\Client::getProgressInfo' => ['null|object', 'request'=>'http\Client\Request'],
'http\Client::getResponse' => ['http\Client\Response|null', 'request='=>'?http\Client\Request'],
'http\Client::getSslOptions' => ['array'],
'http\Client::getTransferInfo' => ['object', 'request'=>'http\Client\Request'],
'http\Client::notify' => ['void', 'request='=>'?http\Client\Request'],
'http\Client::once' => ['bool'],
'http\Client::requeue' => ['http\Client', 'request'=>'http\Client\Request', 'callable='=>'mixed'],
'http\Client::reset' => ['http\Client'],
'http\Client::send' => ['http\Client'],
'http\Client::setCookies' => ['http\Client', 'cookies='=>'?array'],
'http\Client::setDebug' => ['http\Client', 'callback'=>'callable'],
'http\Client::setOptions' => ['http\Client', 'options='=>'?array'],
'http\Client::setSslOptions' => ['http\Client', 'ssl_option='=>'?array'],
'http\Client::wait' => ['bool', 'timeout='=>'mixed'],
'http\Client\Curl\User::init' => ['', 'run'=>'callable'],
'http\Client\Curl\User::once' => [''],
'http\Client\Curl\User::send' => [''],
'http\Client\Curl\User::socket' => ['', 'socket'=>'resource', 'action'=>'int'],
'http\Client\Curl\User::timer' => ['', 'timeout_ms'=>'int'],
'http\Client\Curl\User::wait' => ['', 'timeout_ms='=>'mixed'],
'http\Client\Request::__construct' => ['void', 'method='=>'mixed', 'url='=>'mixed', 'headers='=>'?array', 'body='=>'?http\Message\Body'],
'http\Client\Request::__toString' => ['string'],
'http\Client\Request::addBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Client\Request::addHeader' => ['http\Message', 'header'=>'string', 'value'=>'mixed'],
'http\Client\Request::addHeaders' => ['http\Message', 'headers'=>'array', 'append='=>'mixed'],
'http\Client\Request::addQuery' => ['http\Client\Request', 'query_data'=>'mixed'],
'http\Client\Request::addSslOptions' => ['http\Client\Request', 'ssl_options='=>'?array'],
'http\Client\Request::count' => ['int'],
'http\Client\Request::current' => ['mixed'],
'http\Client\Request::detach' => ['http\Message'],
'http\Client\Request::getBody' => ['http\Message\Body'],
'http\Client\Request::getContentType' => ['null|string'],
'http\Client\Request::getHeader' => ['http\Header|mixed', 'header'=>'string', 'into_class='=>'mixed'],
'http\Client\Request::getHeaders' => ['array'],
'http\Client\Request::getHttpVersion' => ['string'],
'http\Client\Request::getInfo' => ['null|string'],
'http\Client\Request::getOptions' => ['array'],
'http\Client\Request::getParentMessage' => ['http\Message'],
'http\Client\Request::getQuery' => ['null|string'],
'http\Client\Request::getRequestMethod' => ['false|string'],
'http\Client\Request::getRequestUrl' => ['false|string'],
'http\Client\Request::getResponseCode' => ['false|int'],
'http\Client\Request::getResponseStatus' => ['false|string'],
'http\Client\Request::getSslOptions' => ['array'],
'http\Client\Request::getType' => ['int'],
'http\Client\Request::isMultipart' => ['bool', '&boundary='=>'mixed'],
'http\Client\Request::key' => ['int|string'],
'http\Client\Request::next' => ['void'],
'http\Client\Request::prepend' => ['http\Message', 'message'=>'http\Message', 'top='=>'mixed'],
'http\Client\Request::reverse' => ['http\Message'],
'http\Client\Request::rewind' => ['void'],
'http\Client\Request::serialize' => ['string'],
'http\Client\Request::setBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Client\Request::setContentType' => ['http\Client\Request', 'content_type'=>'string'],
'http\Client\Request::setHeader' => ['http\Message', 'header'=>'string', 'value='=>'mixed'],
'http\Client\Request::setHeaders' => ['http\Message', 'headers'=>'array'],
'http\Client\Request::setHttpVersion' => ['http\Message', 'http_version'=>'string'],
'http\Client\Request::setInfo' => ['http\Message', 'http_info'=>'string'],
'http\Client\Request::setOptions' => ['http\Client\Request', 'options='=>'?array'],
'http\Client\Request::setQuery' => ['http\Client\Request', 'query_data='=>'mixed'],
'http\Client\Request::setRequestMethod' => ['http\Message', 'request_method'=>'string'],
'http\Client\Request::setRequestUrl' => ['http\Message', 'url'=>'string'],
'http\Client\Request::setResponseCode' => ['http\Message', 'response_code'=>'int', 'strict='=>'mixed'],
'http\Client\Request::setResponseStatus' => ['http\Message', 'response_status'=>'string'],
'http\Client\Request::setSslOptions' => ['http\Client\Request', 'ssl_options='=>'?array'],
'http\Client\Request::setType' => ['http\Message', 'type'=>'int'],
'http\Client\Request::splitMultipartBody' => ['http\Message'],
'http\Client\Request::toCallback' => ['http\Message', 'callback'=>'callable'],
'http\Client\Request::toStream' => ['http\Message', 'stream'=>'resource'],
'http\Client\Request::toString' => ['string', 'include_parent='=>'mixed'],
'http\Client\Request::unserialize' => ['void', 'serialized'=>'string'],
'http\Client\Request::valid' => ['bool'],
'http\Client\Response::__construct' => ['Iterator'],
'http\Client\Response::__toString' => ['string'],
'http\Client\Response::addBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Client\Response::addHeader' => ['http\Message', 'header'=>'string', 'value'=>'mixed'],
'http\Client\Response::addHeaders' => ['http\Message', 'headers'=>'array', 'append='=>'mixed'],
'http\Client\Response::count' => ['int'],
'http\Client\Response::current' => ['mixed'],
'http\Client\Response::detach' => ['http\Message'],
'http\Client\Response::getBody' => ['http\Message\Body'],
'http\Client\Response::getCookies' => ['array', 'flags='=>'mixed', 'allowed_extras='=>'mixed'],
'http\Client\Response::getHeader' => ['http\Header|mixed', 'header'=>'string', 'into_class='=>'mixed'],
'http\Client\Response::getHeaders' => ['array'],
'http\Client\Response::getHttpVersion' => ['string'],
'http\Client\Response::getInfo' => ['null|string'],
'http\Client\Response::getParentMessage' => ['http\Message'],
'http\Client\Response::getRequestMethod' => ['false|string'],
'http\Client\Response::getRequestUrl' => ['false|string'],
'http\Client\Response::getResponseCode' => ['false|int'],
'http\Client\Response::getResponseStatus' => ['false|string'],
'http\Client\Response::getTransferInfo' => ['mixed|object', 'element='=>'mixed'],
'http\Client\Response::getType' => ['int'],
'http\Client\Response::isMultipart' => ['bool', '&boundary='=>'mixed'],
'http\Client\Response::key' => ['int|string'],
'http\Client\Response::next' => ['void'],
'http\Client\Response::prepend' => ['http\Message', 'message'=>'http\Message', 'top='=>'mixed'],
'http\Client\Response::reverse' => ['http\Message'],
'http\Client\Response::rewind' => ['void'],
'http\Client\Response::serialize' => ['string'],
'http\Client\Response::setBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Client\Response::setHeader' => ['http\Message', 'header'=>'string', 'value='=>'mixed'],
'http\Client\Response::setHeaders' => ['http\Message', 'headers'=>'array'],
'http\Client\Response::setHttpVersion' => ['http\Message', 'http_version'=>'string'],
'http\Client\Response::setInfo' => ['http\Message', 'http_info'=>'string'],
'http\Client\Response::setRequestMethod' => ['http\Message', 'request_method'=>'string'],
'http\Client\Response::setRequestUrl' => ['http\Message', 'url'=>'string'],
'http\Client\Response::setResponseCode' => ['http\Message', 'response_code'=>'int', 'strict='=>'mixed'],
'http\Client\Response::setResponseStatus' => ['http\Message', 'response_status'=>'string'],
'http\Client\Response::setType' => ['http\Message', 'type'=>'int'],
'http\Client\Response::splitMultipartBody' => ['http\Message'],
'http\Client\Response::toCallback' => ['http\Message', 'callback'=>'callable'],
'http\Client\Response::toStream' => ['http\Message', 'stream'=>'resource'],
'http\Client\Response::toString' => ['string', 'include_parent='=>'mixed'],
'http\Client\Response::unserialize' => ['void', 'serialized'=>'string'],
'http\Client\Response::valid' => ['bool'],
'http\Cookie::__construct' => ['void', 'cookie_string='=>'mixed', 'parser_flags='=>'int', 'allowed_extras='=>'array'],
'http\Cookie::__toString' => ['string'],
'http\Cookie::addCookie' => ['http\Cookie', 'cookie_name'=>'string', 'cookie_value'=>'string'],
'http\Cookie::addCookies' => ['http\Cookie', 'cookies'=>'array'],
'http\Cookie::addExtra' => ['http\Cookie', 'extra_name'=>'string', 'extra_value'=>'string'],
'http\Cookie::addExtras' => ['http\Cookie', 'extras'=>'array'],
'http\Cookie::getCookie' => ['null|string', 'name'=>'string'],
'http\Cookie::getCookies' => ['array'],
'http\Cookie::getDomain' => ['string'],
'http\Cookie::getExpires' => ['int'],
'http\Cookie::getExtra' => ['string', 'name'=>'string'],
'http\Cookie::getExtras' => ['array'],
'http\Cookie::getFlags' => ['int'],
'http\Cookie::getMaxAge' => ['int'],
'http\Cookie::getPath' => ['string'],
'http\Cookie::setCookie' => ['http\Cookie', 'cookie_name'=>'string', 'cookie_value='=>'mixed'],
'http\Cookie::setCookies' => ['http\Cookie', 'cookies='=>'mixed'],
'http\Cookie::setDomain' => ['http\Cookie', 'value='=>'mixed'],
'http\Cookie::setExpires' => ['http\Cookie', 'value='=>'mixed'],
'http\Cookie::setExtra' => ['http\Cookie', 'extra_name'=>'string', 'extra_value='=>'mixed'],
'http\Cookie::setExtras' => ['http\Cookie', 'extras='=>'mixed'],
'http\Cookie::setFlags' => ['http\Cookie', 'value='=>'mixed'],
'http\Cookie::setMaxAge' => ['http\Cookie', 'value='=>'mixed'],
'http\Cookie::setPath' => ['http\Cookie', 'value='=>'mixed'],
'http\Cookie::toArray' => ['array'],
'http\Cookie::toString' => ['string'],
'http\Encoding\Stream::__construct' => ['void', 'flags='=>'mixed'],
'http\Encoding\Stream::done' => ['bool'],
'http\Encoding\Stream::finish' => ['string'],
'http\Encoding\Stream::flush' => ['string'],
'http\Encoding\Stream::update' => ['string', 'data'=>'string'],
'http\Encoding\Stream\Debrotli::__construct' => ['void', 'flags='=>'int'],
'http\Encoding\Stream\Debrotli::decode' => ['string', 'data'=>'string'],
'http\Encoding\Stream\Debrotli::done' => ['bool'],
'http\Encoding\Stream\Debrotli::finish' => ['string'],
'http\Encoding\Stream\Debrotli::flush' => ['string'],
'http\Encoding\Stream\Debrotli::update' => ['string', 'data'=>'string'],
'http\Encoding\Stream\Dechunk::__construct' => ['void', 'flags='=>'mixed'],
'http\Encoding\Stream\Dechunk::decode' => ['false|string', 'data'=>'string', '&decoded_len='=>'mixed'],
'http\Encoding\Stream\Dechunk::done' => ['bool'],
'http\Encoding\Stream\Dechunk::finish' => ['string'],
'http\Encoding\Stream\Dechunk::flush' => ['string'],
'http\Encoding\Stream\Dechunk::update' => ['string', 'data'=>'string'],
'http\Encoding\Stream\Deflate::__construct' => ['void', 'flags='=>'mixed'],
'http\Encoding\Stream\Deflate::done' => ['bool'],
'http\Encoding\Stream\Deflate::encode' => ['string', 'data'=>'string', 'flags='=>'mixed'],
'http\Encoding\Stream\Deflate::finish' => ['string'],
'http\Encoding\Stream\Deflate::flush' => ['string'],
'http\Encoding\Stream\Deflate::update' => ['string', 'data'=>'string'],
'http\Encoding\Stream\Enbrotli::__construct' => ['void', 'flags='=>'int'],
'http\Encoding\Stream\Enbrotli::done' => ['bool'],
'http\Encoding\Stream\Enbrotli::encode' => ['string', 'data'=>'string', 'flags='=>'int'],
'http\Encoding\Stream\Enbrotli::finish' => ['string'],
'http\Encoding\Stream\Enbrotli::flush' => ['string'],
'http\Encoding\Stream\Enbrotli::update' => ['string', 'data'=>'string'],
'http\Encoding\Stream\Inflate::__construct' => ['void', 'flags='=>'mixed'],
'http\Encoding\Stream\Inflate::decode' => ['string', 'data'=>'string'],
'http\Encoding\Stream\Inflate::done' => ['bool'],
'http\Encoding\Stream\Inflate::finish' => ['string'],
'http\Encoding\Stream\Inflate::flush' => ['string'],
'http\Encoding\Stream\Inflate::update' => ['string', 'data'=>'string'],
'http\Env::getRequestBody' => ['http\Message\Body', 'body_class_name='=>'mixed'],
'http\Env::getRequestHeader' => ['array|null|string', 'header_name='=>'mixed'],
'http\Env::getResponseCode' => ['int'],
'http\Env::getResponseHeader' => ['array|null|string', 'header_name='=>'mixed'],
'http\Env::getResponseStatusForAllCodes' => ['array'],
'http\Env::getResponseStatusForCode' => ['string', 'code'=>'int'],
'http\Env::negotiate' => ['null|string', 'params'=>'string', 'supported'=>'array', 'primary_type_separator='=>'mixed', '&result_array='=>'mixed'],
'http\Env::negotiateCharset' => ['null|string', 'supported'=>'array', '&result_array='=>'mixed'],
'http\Env::negotiateContentType' => ['null|string', 'supported'=>'array', '&result_array='=>'mixed'],
'http\Env::negotiateEncoding' => ['null|string', 'supported'=>'array', '&result_array='=>'mixed'],
'http\Env::negotiateLanguage' => ['null|string', 'supported'=>'array', '&result_array='=>'mixed'],
'http\Env::setResponseCode' => ['bool', 'code'=>'int'],
'http\Env::setResponseHeader' => ['bool', 'header_name'=>'string', 'header_value='=>'mixed', 'response_code='=>'mixed', 'replace_header='=>'mixed'],
'http\Env\Request::__construct' => ['void'],
'http\Env\Request::__toString' => ['string'],
'http\Env\Request::addBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Env\Request::addHeader' => ['http\Message', 'header'=>'string', 'value'=>'mixed'],
'http\Env\Request::addHeaders' => ['http\Message', 'headers'=>'array', 'append='=>'mixed'],
'http\Env\Request::count' => ['int'],
'http\Env\Request::current' => ['mixed'],
'http\Env\Request::detach' => ['http\Message'],
'http\Env\Request::getBody' => ['http\Message\Body'],
'http\Env\Request::getCookie' => ['mixed', 'name='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool'],
'http\Env\Request::getFiles' => ['array'],
'http\Env\Request::getForm' => ['mixed', 'name='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool'],
'http\Env\Request::getHeader' => ['http\Header|mixed', 'header'=>'string', 'into_class='=>'mixed'],
'http\Env\Request::getHeaders' => ['array'],
'http\Env\Request::getHttpVersion' => ['string'],
'http\Env\Request::getInfo' => ['null|string'],
'http\Env\Request::getParentMessage' => ['http\Message'],
'http\Env\Request::getQuery' => ['mixed', 'name='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool'],
'http\Env\Request::getRequestMethod' => ['false|string'],
'http\Env\Request::getRequestUrl' => ['false|string'],
'http\Env\Request::getResponseCode' => ['false|int'],
'http\Env\Request::getResponseStatus' => ['false|string'],
'http\Env\Request::getType' => ['int'],
'http\Env\Request::isMultipart' => ['bool', '&boundary='=>'mixed'],
'http\Env\Request::key' => ['int|string'],
'http\Env\Request::next' => ['void'],
'http\Env\Request::prepend' => ['http\Message', 'message'=>'http\Message', 'top='=>'mixed'],
'http\Env\Request::reverse' => ['http\Message'],
'http\Env\Request::rewind' => ['void'],
'http\Env\Request::serialize' => ['string'],
'http\Env\Request::setBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Env\Request::setHeader' => ['http\Message', 'header'=>'string', 'value='=>'mixed'],
'http\Env\Request::setHeaders' => ['http\Message', 'headers'=>'array'],
'http\Env\Request::setHttpVersion' => ['http\Message', 'http_version'=>'string'],
'http\Env\Request::setInfo' => ['http\Message', 'http_info'=>'string'],
'http\Env\Request::setRequestMethod' => ['http\Message', 'request_method'=>'string'],
'http\Env\Request::setRequestUrl' => ['http\Message', 'url'=>'string'],
'http\Env\Request::setResponseCode' => ['http\Message', 'response_code'=>'int', 'strict='=>'mixed'],
'http\Env\Request::setResponseStatus' => ['http\Message', 'response_status'=>'string'],
'http\Env\Request::setType' => ['http\Message', 'type'=>'int'],
'http\Env\Request::splitMultipartBody' => ['http\Message'],
'http\Env\Request::toCallback' => ['http\Message', 'callback'=>'callable'],
'http\Env\Request::toStream' => ['http\Message', 'stream'=>'resource'],
'http\Env\Request::toString' => ['string', 'include_parent='=>'mixed'],
'http\Env\Request::unserialize' => ['void', 'serialized'=>'string'],
'http\Env\Request::valid' => ['bool'],
'http\Env\Response::__construct' => ['void'],
'http\Env\Response::__invoke' => ['bool', 'data'=>'string', 'ob_flags='=>'int'],
'http\Env\Response::__toString' => ['string'],
'http\Env\Response::addBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Env\Response::addHeader' => ['http\Message', 'header'=>'string', 'value'=>'mixed'],
'http\Env\Response::addHeaders' => ['http\Message', 'headers'=>'array', 'append='=>'mixed'],
'http\Env\Response::count' => ['int'],
'http\Env\Response::current' => ['mixed'],
'http\Env\Response::detach' => ['http\Message'],
'http\Env\Response::getBody' => ['http\Message\Body'],
'http\Env\Response::getHeader' => ['http\Header|mixed', 'header'=>'string', 'into_class='=>'mixed'],
'http\Env\Response::getHeaders' => ['array'],
'http\Env\Response::getHttpVersion' => ['string'],
'http\Env\Response::getInfo' => ['?string'],
'http\Env\Response::getParentMessage' => ['http\Message'],
'http\Env\Response::getRequestMethod' => ['false|string'],
'http\Env\Response::getRequestUrl' => ['false|string'],
'http\Env\Response::getResponseCode' => ['false|int'],
'http\Env\Response::getResponseStatus' => ['false|string'],
'http\Env\Response::getType' => ['int'],
'http\Env\Response::isCachedByETag' => ['int', 'header_name='=>'string'],
'http\Env\Response::isCachedByLastModified' => ['int', 'header_name='=>'string'],
'http\Env\Response::isMultipart' => ['bool', '&boundary='=>'mixed'],
'http\Env\Response::key' => ['int|string'],
'http\Env\Response::next' => ['void'],
'http\Env\Response::prepend' => ['http\Message', 'message'=>'http\Message', 'top='=>'mixed'],
'http\Env\Response::reverse' => ['http\Message'],
'http\Env\Response::rewind' => ['void'],
'http\Env\Response::send' => ['bool', 'stream='=>'resource'],
'http\Env\Response::serialize' => ['string'],
'http\Env\Response::setBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Env\Response::setCacheControl' => ['http\Env\Response', 'cache_control'=>'string'],
'http\Env\Response::setContentDisposition' => ['http\Env\Response', 'disposition_params'=>'array'],
'http\Env\Response::setContentEncoding' => ['http\Env\Response', 'content_encoding'=>'int'],
'http\Env\Response::setContentType' => ['http\Env\Response', 'content_type'=>'string'],
'http\Env\Response::setCookie' => ['http\Env\Response', 'cookie'=>'mixed'],
'http\Env\Response::setEnvRequest' => ['http\Env\Response', 'env_request'=>'http\Message'],
'http\Env\Response::setEtag' => ['http\Env\Response', 'etag'=>'string'],
'http\Env\Response::setHeader' => ['http\Message', 'header'=>'string', 'value='=>'mixed'],
'http\Env\Response::setHeaders' => ['http\Message', 'headers'=>'array'],
'http\Env\Response::setHttpVersion' => ['http\Message', 'http_version'=>'string'],
'http\Env\Response::setInfo' => ['http\Message', 'http_info'=>'string'],
'http\Env\Response::setLastModified' => ['http\Env\Response', 'last_modified'=>'int'],
'http\Env\Response::setRequestMethod' => ['http\Message', 'request_method'=>'string'],
'http\Env\Response::setRequestUrl' => ['http\Message', 'url'=>'string'],
'http\Env\Response::setResponseCode' => ['http\Message', 'response_code'=>'int', 'strict='=>'mixed'],
'http\Env\Response::setResponseStatus' => ['http\Message', 'response_status'=>'string'],
'http\Env\Response::setThrottleRate' => ['http\Env\Response', 'chunk_size'=>'int', 'delay='=>'float|int'],
'http\Env\Response::setType' => ['http\Message', 'type'=>'int'],
'http\Env\Response::splitMultipartBody' => ['http\Message'],
'http\Env\Response::toCallback' => ['http\Message', 'callback'=>'callable'],
'http\Env\Response::toStream' => ['http\Message', 'stream'=>'resource'],
'http\Env\Response::toString' => ['string', 'include_parent='=>'mixed'],
'http\Env\Response::unserialize' => ['void', 'serialized'=>'string'],
'http\Env\Response::valid' => ['bool'],
'http\Header::__construct' => ['void', 'name='=>'mixed', 'value='=>'mixed'],
'http\Header::__toString' => ['string'],
'http\Header::getParams' => ['http\Params', 'param_sep='=>'mixed', 'arg_sep='=>'mixed', 'val_sep='=>'mixed', 'flags='=>'mixed'],
'http\Header::match' => ['bool', 'value'=>'string', 'flags='=>'mixed'],
'http\Header::negotiate' => ['null|string', 'supported'=>'array', '&result='=>'mixed'],
'http\Header::parse' => ['array|false', 'string'=>'string', 'header_class='=>'mixed'],
'http\Header::serialize' => ['string'],
'http\Header::toString' => ['string'],
'http\Header::unserialize' => ['void', 'serialized'=>'string'],
'http\Header\Parser::getState' => ['int'],
'http\Header\Parser::parse' => ['int', 'data'=>'string', 'flags'=>'int', '&headers'=>'array'],
'http\Header\Parser::stream' => ['int', 'stream'=>'resource', 'flags'=>'int', '&headers'=>'array'],
'http\Message::__construct' => ['void', 'message='=>'mixed', 'greedy='=>'bool'],
'http\Message::__toString' => ['string'],
'http\Message::addBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Message::addHeader' => ['http\Message', 'header'=>'string', 'value'=>'mixed'],
'http\Message::addHeaders' => ['http\Message', 'headers'=>'array', 'append='=>'mixed'],
'http\Message::count' => ['int'],
'http\Message::current' => ['mixed'],
'http\Message::detach' => ['http\Message'],
'http\Message::getBody' => ['http\Message\Body'],
'http\Message::getHeader' => ['http\Header|mixed', 'header'=>'string', 'into_class='=>'mixed'],
'http\Message::getHeaders' => ['array'],
'http\Message::getHttpVersion' => ['string'],
'http\Message::getInfo' => ['null|string'],
'http\Message::getParentMessage' => ['http\Message'],
'http\Message::getRequestMethod' => ['false|string'],
'http\Message::getRequestUrl' => ['false|string'],
'http\Message::getResponseCode' => ['false|int'],
'http\Message::getResponseStatus' => ['false|string'],
'http\Message::getType' => ['int'],
'http\Message::isMultipart' => ['bool', '&boundary='=>'mixed'],
'http\Message::key' => ['int|string'],
'http\Message::next' => ['void'],
'http\Message::prepend' => ['http\Message', 'message'=>'http\Message', 'top='=>'mixed'],
'http\Message::reverse' => ['http\Message'],
'http\Message::rewind' => ['void'],
'http\Message::serialize' => ['string'],
'http\Message::setBody' => ['http\Message', 'body'=>'http\Message\Body'],
'http\Message::setHeader' => ['http\Message', 'header'=>'string', 'value='=>'mixed'],
'http\Message::setHeaders' => ['http\Message', 'headers'=>'array'],
'http\Message::setHttpVersion' => ['http\Message', 'http_version'=>'string'],
'http\Message::setInfo' => ['http\Message', 'http_info'=>'string'],
'http\Message::setRequestMethod' => ['http\Message', 'request_method'=>'string'],
'http\Message::setRequestUrl' => ['http\Message', 'url'=>'string'],
'http\Message::setResponseCode' => ['http\Message', 'response_code'=>'int', 'strict='=>'mixed'],
'http\Message::setResponseStatus' => ['http\Message', 'response_status'=>'string'],
'http\Message::setType' => ['http\Message', 'type'=>'int'],
'http\Message::splitMultipartBody' => ['http\Message'],
'http\Message::toCallback' => ['http\Message', 'callback'=>'callable'],
'http\Message::toStream' => ['http\Message', 'stream'=>'resource'],
'http\Message::toString' => ['string', 'include_parent='=>'mixed'],
'http\Message::unserialize' => ['void', 'serialized'=>'string'],
'http\Message::valid' => ['bool'],
'http\Message\Body::__construct' => ['void', 'stream='=>'resource'],
'http\Message\Body::__toString' => ['string'],
'http\Message\Body::addForm' => ['http\Message\Body', 'fields='=>'?array', 'files='=>'?array'],
'http\Message\Body::addPart' => ['http\Message\Body', 'message'=>'http\Message'],
'http\Message\Body::append' => ['http\Message\Body', 'string'=>'string'],
'http\Message\Body::etag' => ['false|string'],
'http\Message\Body::getBoundary' => ['null|string'],
'http\Message\Body::getResource' => ['resource'],
'http\Message\Body::serialize' => ['string'],
'http\Message\Body::stat' => ['int|object', 'field='=>'mixed'],
'http\Message\Body::toCallback' => ['http\Message\Body', 'callback'=>'callable', 'offset='=>'mixed', 'maxlen='=>'mixed'],
'http\Message\Body::toStream' => ['http\Message\Body', 'stream'=>'resource', 'offset='=>'mixed', 'maxlen='=>'mixed'],
'http\Message\Body::toString' => ['string'],
'http\Message\Body::unserialize' => ['void', 'serialized'=>'string'],
'http\Message\Parser::getState' => ['int'],
'http\Message\Parser::parse' => ['int', 'data'=>'string', 'flags'=>'int', '&message'=>'http\Message'],
'http\Message\Parser::stream' => ['int', 'stream'=>'resource', 'flags'=>'int', '&message'=>'http\Message'],
'http\Params::__construct' => ['void', 'params='=>'mixed', 'param_sep='=>'mixed', 'arg_sep='=>'mixed', 'val_sep='=>'mixed', 'flags='=>'mixed'],
'http\Params::__toString' => ['string'],
'http\Params::offsetExists' => ['bool', 'name'=>'mixed'],
'http\Params::offsetGet' => ['mixed', 'name'=>'mixed'],
'http\Params::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'],
'http\Params::offsetUnset' => ['void', 'name'=>'mixed'],
'http\Params::toArray' => ['array'],
'http\Params::toString' => ['string'],
'http\QueryString::__construct' => ['void', 'querystring'=>'string'],
'http\QueryString::__toString' => ['string'],
'http\QueryString::get' => ['http\QueryString|string|mixed', 'name='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool|false'],
'http\QueryString::getArray' => ['array|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'],
'http\QueryString::getBool' => ['bool|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'],
'http\QueryString::getFloat' => ['float|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'],
'http\QueryString::getGlobalInstance' => ['http\QueryString'],
'http\QueryString::getInt' => ['int|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'],
'http\QueryString::getIterator' => ['IteratorAggregate'],
'http\QueryString::getObject' => ['object|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'],
'http\QueryString::getString' => ['string|mixed', 'name'=>'string', 'defval='=>'mixed', 'delete='=>'bool|false'],
'http\QueryString::mod' => ['http\QueryString', 'params='=>'mixed'],
'http\QueryString::offsetExists' => ['bool', 'offset'=>'mixed'],
'http\QueryString::offsetGet' => ['mixed|null', 'offset'=>'mixed'],
'http\QueryString::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'],
'http\QueryString::offsetUnset' => ['void', 'offset'=>'mixed'],
'http\QueryString::serialize' => ['string'],
'http\QueryString::set' => ['http\QueryString', 'params'=>'mixed'],
'http\QueryString::toArray' => ['array'],
'http\QueryString::toString' => ['string'],
'http\QueryString::unserialize' => ['void', 'serialized'=>'string'],
'http\QueryString::xlate' => ['http\QueryString'],
'http\Url::__construct' => ['void', 'old_url='=>'mixed', 'new_url='=>'mixed', 'flags='=>'int'],
'http\Url::__toString' => ['string'],
'http\Url::mod' => ['http\Url', 'parts'=>'mixed', 'flags='=>'float|int|mixed'],
'http\Url::toArray' => ['string[]'],
'http\Url::toString' => ['string'],
'http_build_cookie' => ['string', 'cookie'=>'array'],
'http_build_query' => ['string', 'data'=>'array|object', 'numeric_prefix='=>'string', 'arg_separator='=>'string', 'encoding_type='=>'int'],
'http_build_str' => ['string', 'query'=>'array', 'prefix='=>'?string', 'arg_separator='=>'string'],
'http_build_url' => ['string', 'url='=>'string|array', 'parts='=>'string|array', 'flags='=>'int', 'new_url='=>'array'],
'http_cache_etag' => ['bool', 'etag='=>'string'],
'http_cache_last_modified' => ['bool', 'timestamp_or_expires='=>'int'],
'http_chunked_decode' => ['string|false', 'encoded'=>'string'],
'http_date' => ['string', 'timestamp='=>'int'],
'http_deflate' => ['?string', 'data'=>'string', 'flags='=>'int'],
'http_get' => ['string', 'url'=>'string', 'options='=>'array', 'info='=>'array'],
'http_get_request_body' => ['?string'],
'http_get_request_body_stream' => ['?resource'],
'http_get_request_headers' => ['array'],
'http_head' => ['string', 'url'=>'string', 'options='=>'array', 'info='=>'array'],
'http_inflate' => ['?string', 'data'=>'string'],
'http_match_etag' => ['bool', 'etag'=>'string', 'for_range='=>'bool'],
'http_match_modified' => ['bool', 'timestamp='=>'int', 'for_range='=>'bool'],
'http_match_request_header' => ['bool', 'header'=>'string', 'value'=>'string', 'match_case='=>'bool'],
'http_negotiate_charset' => ['string', 'supported'=>'array', 'result='=>'array'],
'http_negotiate_content_type' => ['string', 'supported'=>'array', 'result='=>'array'],
'http_negotiate_language' => ['string', 'supported'=>'array', 'result='=>'array'],
'http_parse_cookie' => ['stdClass|false', 'cookie'=>'string', 'flags='=>'int', 'allowed_extras='=>'array'],
'http_parse_headers' => ['array|false', 'header'=>'string'],
'http_parse_message' => ['object', 'message'=>'string'],
'http_parse_params' => ['stdClass', 'param'=>'string', 'flags='=>'int'],
'http_persistent_handles_clean' => ['string', 'ident='=>'string'],
'http_persistent_handles_count' => ['stdClass|false'],
'http_persistent_handles_ident' => ['string|false', 'ident='=>'string'],
'http_post_data' => ['string', 'url'=>'string', 'data'=>'string', 'options='=>'array', 'info='=>'array'],
'http_post_fields' => ['string', 'url'=>'string', 'data'=>'array', 'files='=>'array', 'options='=>'array', 'info='=>'array'],
'http_put_data' => ['string', 'url'=>'string', 'data'=>'string', 'options='=>'array', 'info='=>'array'],
'http_put_file' => ['string', 'url'=>'string', 'file'=>'string', 'options='=>'array', 'info='=>'array'],
'http_put_stream' => ['string', 'url'=>'string', 'stream'=>'resource', 'options='=>'array', 'info='=>'array'],
'http_redirect' => ['int|false', 'url='=>'string', 'params='=>'array', 'session='=>'bool', 'status='=>'int'],
'http_request' => ['string', 'method'=>'int', 'url'=>'string', 'body='=>'string', 'options='=>'array', 'info='=>'array'],
'http_request_body_encode' => ['string|false', 'fields'=>'array', 'files'=>'array'],
'http_request_method_exists' => ['bool', 'method'=>'mixed'],
'http_request_method_name' => ['string|false', 'method'=>'int'],
'http_request_method_register' => ['int|false', 'method'=>'string'],
'http_request_method_unregister' => ['bool', 'method'=>'mixed'],
'http_response_code' => ['int|bool', 'response_code='=>'int'],
'http_send_content_disposition' => ['bool', 'filename'=>'string', 'inline='=>'bool'],
'http_send_content_type' => ['bool', 'content_type='=>'string'],
'http_send_data' => ['bool', 'data'=>'string'],
'http_send_file' => ['bool', 'file'=>'string'],
'http_send_last_modified' => ['bool', 'timestamp='=>'int'],
'http_send_status' => ['bool', 'status'=>'int'],
'http_send_stream' => ['bool', 'stream'=>'resource'],
'http_support' => ['int', 'feature='=>'int'],
'http_throttle' => ['void', 'sec'=>'float', 'bytes='=>'int'],
'HttpDeflateStream::__construct' => ['void', 'flags='=>'int'],
'HttpDeflateStream::factory' => ['HttpDeflateStream', 'flags='=>'int', 'class_name='=>'string'],
'HttpDeflateStream::finish' => ['string', 'data='=>'string'],
'HttpDeflateStream::flush' => ['string|false', 'data='=>'string'],
'HttpDeflateStream::update' => ['string|false', 'data'=>'string'],
'HttpInflateStream::__construct' => ['void', 'flags='=>'int'],
'HttpInflateStream::factory' => ['HttpInflateStream', 'flags='=>'int', 'class_name='=>'string'],
'HttpInflateStream::finish' => ['string', 'data='=>'string'],
'HttpInflateStream::flush' => ['string|false', 'data='=>'string'],
'HttpInflateStream::update' => ['string|false', 'data'=>'string'],
'HttpMessage::__construct' => ['void', 'message='=>'string'],
'HttpMessage::__toString' => ['string'],
'HttpMessage::addHeaders' => ['void', 'headers'=>'array', 'append='=>'bool'],
'HttpMessage::count' => ['int'],
'HttpMessage::current' => ['mixed'],
'HttpMessage::detach' => ['HttpMessage'],
'HttpMessage::factory' => ['?HttpMessage', 'raw_message='=>'string', 'class_name='=>'string'],
'HttpMessage::fromEnv' => ['?HttpMessage', 'message_type'=>'int', 'class_name='=>'string'],
'HttpMessage::fromString' => ['?HttpMessage', 'raw_message='=>'string', 'class_name='=>'string'],
'HttpMessage::getBody' => ['string'],
'HttpMessage::getHeader' => ['?string', 'header'=>'string'],
'HttpMessage::getHeaders' => ['array'],
'HttpMessage::getHttpVersion' => ['string'],
'HttpMessage::getInfo' => [''],
'HttpMessage::getParentMessage' => ['HttpMessage'],
'HttpMessage::getRequestMethod' => ['string|false'],
'HttpMessage::getRequestUrl' => ['string|false'],
'HttpMessage::getResponseCode' => ['int'],
'HttpMessage::getResponseStatus' => ['string'],
'HttpMessage::getType' => ['int'],
'HttpMessage::guessContentType' => ['string|false', 'magic_file'=>'string', 'magic_mode='=>'int'],
'HttpMessage::key' => ['int|string'],
'HttpMessage::next' => ['void'],
'HttpMessage::prepend' => ['void', 'message'=>'HttpMessage', 'top='=>'bool'],
'HttpMessage::reverse' => ['HttpMessage'],
'HttpMessage::rewind' => ['void'],
'HttpMessage::send' => ['bool'],
'HttpMessage::serialize' => ['string'],
'HttpMessage::setBody' => ['void', 'body'=>'string'],
'HttpMessage::setHeaders' => ['void', 'headers'=>'array'],
'HttpMessage::setHttpVersion' => ['bool', 'version'=>'string'],
'HttpMessage::setInfo' => ['', 'http_info'=>''],
'HttpMessage::setRequestMethod' => ['bool', 'method'=>'string'],
'HttpMessage::setRequestUrl' => ['bool', 'url'=>'string'],
'HttpMessage::setResponseCode' => ['bool', 'code'=>'int'],
'HttpMessage::setResponseStatus' => ['bool', 'status'=>'string'],
'HttpMessage::setType' => ['void', 'type'=>'int'],
'HttpMessage::toMessageTypeObject' => ['HttpRequest|HttpResponse|null'],
'HttpMessage::toString' => ['string', 'include_parent='=>'bool'],
'HttpMessage::unserialize' => ['void', 'serialized'=>'string'],
'HttpMessage::valid' => ['bool'],
'HttpQueryString::__construct' => ['void', 'global='=>'bool', 'add='=>'mixed'],
'HttpQueryString::__toString' => ['string'],
'HttpQueryString::factory' => ['', 'global'=>'', 'params'=>'', 'class_name'=>''],
'HttpQueryString::get' => ['mixed', 'key='=>'string', 'type='=>'mixed', 'defval='=>'mixed', 'delete='=>'bool'],
'HttpQueryString::getArray' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''],
'HttpQueryString::getBool' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''],
'HttpQueryString::getFloat' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''],
'HttpQueryString::getInt' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''],
'HttpQueryString::getObject' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''],
'HttpQueryString::getString' => ['', 'name'=>'', 'defval'=>'', 'delete'=>''],
'HttpQueryString::mod' => ['HttpQueryString', 'params'=>'mixed'],
'HttpQueryString::offsetExists' => ['bool', 'offset'=>'mixed'],
'HttpQueryString::offsetGet' => ['mixed', 'offset'=>'mixed'],
'HttpQueryString::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'],
'HttpQueryString::offsetUnset' => ['void', 'offset'=>'mixed'],
'HttpQueryString::serialize' => ['string'],
'HttpQueryString::set' => ['string', 'params'=>'mixed'],
'HttpQueryString::singleton' => ['HttpQueryString', 'global='=>'bool'],
'HttpQueryString::toArray' => ['array'],
'HttpQueryString::toString' => ['string'],
'HttpQueryString::unserialize' => ['void', 'serialized'=>'string'],
'HttpQueryString::xlate' => ['bool', 'ie'=>'string', 'oe'=>'string'],
'HttpRequest::__construct' => ['void', 'url='=>'string', 'request_method='=>'int', 'options='=>'array'],
'HttpRequest::addBody' => ['', 'request_body_data'=>''],
'HttpRequest::addCookies' => ['bool', 'cookies'=>'array'],
'HttpRequest::addHeaders' => ['bool', 'headers'=>'array'],
'HttpRequest::addPostFields' => ['bool', 'post_data'=>'array'],
'HttpRequest::addPostFile' => ['bool', 'name'=>'string', 'file'=>'string', 'content_type='=>'string'],
'HttpRequest::addPutData' => ['bool', 'put_data'=>'string'],
'HttpRequest::addQueryData' => ['bool', 'query_params'=>'array'],
'HttpRequest::addRawPostData' => ['bool', 'raw_post_data'=>'string'],
'HttpRequest::addSslOptions' => ['bool', 'options'=>'array'],
'HttpRequest::clearHistory' => ['void'],
'HttpRequest::enableCookies' => ['bool'],
'HttpRequest::encodeBody' => ['', 'fields'=>'', 'files'=>''],
'HttpRequest::factory' => ['', 'url'=>'', 'method'=>'', 'options'=>'', 'class_name'=>''],
'HttpRequest::flushCookies' => [''],
'HttpRequest::get' => ['', 'url'=>'', 'options'=>'', '&info'=>''],
'HttpRequest::getBody' => [''],
'HttpRequest::getContentType' => ['string'],
'HttpRequest::getCookies' => ['array'],
'HttpRequest::getHeaders' => ['array'],
'HttpRequest::getHistory' => ['HttpMessage'],
'HttpRequest::getMethod' => ['int'],
'HttpRequest::getOptions' => ['array'],
'HttpRequest::getPostFields' => ['array'],
'HttpRequest::getPostFiles' => ['array'],
'HttpRequest::getPutData' => ['string'],
'HttpRequest::getPutFile' => ['string'],
'HttpRequest::getQueryData' => ['string'],
'HttpRequest::getRawPostData' => ['string'],
'HttpRequest::getRawRequestMessage' => ['string'],
'HttpRequest::getRawResponseMessage' => ['string'],
'HttpRequest::getRequestMessage' => ['HttpMessage'],
'HttpRequest::getResponseBody' => ['string'],
'HttpRequest::getResponseCode' => ['int'],
'HttpRequest::getResponseCookies' => ['stdClass[]', 'flags='=>'int', 'allowed_extras='=>'array'],
'HttpRequest::getResponseData' => ['array'],
'HttpRequest::getResponseHeader' => ['mixed', 'name='=>'string'],
'HttpRequest::getResponseInfo' => ['mixed', 'name='=>'string'],
'HttpRequest::getResponseMessage' => ['HttpMessage'],
'HttpRequest::getResponseStatus' => ['string'],
'HttpRequest::getSslOptions' => ['array'],
'HttpRequest::getUrl' => ['string'],
'HttpRequest::head' => ['', 'url'=>'', 'options'=>'', '&info'=>''],
'HttpRequest::methodExists' => ['', 'method'=>''],
'HttpRequest::methodName' => ['', 'method_id'=>''],
'HttpRequest::methodRegister' => ['', 'method_name'=>''],
'HttpRequest::methodUnregister' => ['', 'method'=>''],
'HttpRequest::postData' => ['', 'url'=>'', 'data'=>'', 'options'=>'', '&info'=>''],
'HttpRequest::postFields' => ['', 'url'=>'', 'data'=>'', 'options'=>'', '&info'=>''],
'HttpRequest::putData' => ['', 'url'=>'', 'data'=>'', 'options'=>'', '&info'=>''],
'HttpRequest::putFile' => ['', 'url'=>'', 'file'=>'', 'options'=>'', '&info'=>''],
'HttpRequest::putStream' => ['', 'url'=>'', 'stream'=>'', 'options'=>'', '&info'=>''],
'HttpRequest::resetCookies' => ['bool', 'session_only='=>'bool'],
'HttpRequest::send' => ['HttpMessage'],
'HttpRequest::setBody' => ['bool', 'request_body_data='=>'string'],
'HttpRequest::setContentType' => ['bool', 'content_type'=>'string'],
'HttpRequest::setCookies' => ['bool', 'cookies='=>'array'],
'HttpRequest::setHeaders' => ['bool', 'headers='=>'array'],
'HttpRequest::setMethod' => ['bool', 'request_method'=>'int'],
'HttpRequest::setOptions' => ['bool', 'options='=>'array'],
'HttpRequest::setPostFields' => ['bool', 'post_data'=>'array'],
'HttpRequest::setPostFiles' => ['bool', 'post_files'=>'array'],
'HttpRequest::setPutData' => ['bool', 'put_data='=>'string'],
'HttpRequest::setPutFile' => ['bool', 'file='=>'string'],
'HttpRequest::setQueryData' => ['bool', 'query_data'=>'mixed'],
'HttpRequest::setRawPostData' => ['bool', 'raw_post_data='=>'string'],
'HttpRequest::setSslOptions' => ['bool', 'options='=>'array'],
'HttpRequest::setUrl' => ['bool', 'url'=>'string'],
'HttpRequestDataShare::__construct' => ['void'],
'HttpRequestDataShare::__destruct' => ['void'],
'HttpRequestDataShare::attach' => ['', 'request'=>'HttpRequest'],
'HttpRequestDataShare::count' => ['int'],
'HttpRequestDataShare::detach' => ['', 'request'=>'HttpRequest'],
'HttpRequestDataShare::factory' => ['', 'global'=>'', 'class_name'=>''],
'HttpRequestDataShare::reset' => [''],
'HttpRequestDataShare::singleton' => ['', 'global'=>''],
'HttpRequestPool::__construct' => ['void', 'request='=>'HttpRequest'],
'HttpRequestPool::__destruct' => ['void'],
'HttpRequestPool::attach' => ['bool', 'request'=>'HttpRequest'],
'HttpRequestPool::count' => ['int'],
'HttpRequestPool::current' => ['mixed'],
'HttpRequestPool::detach' => ['bool', 'request'=>'HttpRequest'],
'HttpRequestPool::enableEvents' => ['', 'enable'=>''],
'HttpRequestPool::enablePipelining' => ['', 'enable'=>''],
'HttpRequestPool::getAttachedRequests' => ['array'],
'HttpRequestPool::getFinishedRequests' => ['array'],
'HttpRequestPool::key' => ['int|string'],
'HttpRequestPool::next' => ['void'],
'HttpRequestPool::reset' => ['void'],
'HttpRequestPool::rewind' => ['void'],
'HttpRequestPool::send' => ['bool'],
'HttpRequestPool::socketPerform' => ['bool'],
'HttpRequestPool::socketSelect' => ['bool', 'timeout='=>'float'],
'HttpRequestPool::valid' => ['bool'],
'HttpResponse::capture' => ['void'],
'HttpResponse::getBufferSize' => ['int'],
'HttpResponse::getCache' => ['bool'],
'HttpResponse::getCacheControl' => ['string'],
'HttpResponse::getContentDisposition' => ['string'],
'HttpResponse::getContentType' => ['string'],
'HttpResponse::getData' => ['string'],
'HttpResponse::getETag' => ['string'],
'HttpResponse::getFile' => ['string'],
'HttpResponse::getGzip' => ['bool'],
'HttpResponse::getHeader' => ['mixed', 'name='=>'string'],
'HttpResponse::getLastModified' => ['int'],
'HttpResponse::getRequestBody' => ['string'],
'HttpResponse::getRequestBodyStream' => ['resource'],
'HttpResponse::getRequestHeaders' => ['array'],
'HttpResponse::getStream' => ['resource'],
'HttpResponse::getThrottleDelay' => ['float'],
'HttpResponse::guessContentType' => ['string|false', 'magic_file'=>'string', 'magic_mode='=>'int'],
'HttpResponse::redirect' => ['void', 'url='=>'string', 'params='=>'array', 'session='=>'bool', 'status='=>'int'],
'HttpResponse::send' => ['bool', 'clean_ob='=>'bool'],
'HttpResponse::setBufferSize' => ['bool', 'bytes'=>'int'],
'HttpResponse::setCache' => ['bool', 'cache'=>'bool'],
'HttpResponse::setCacheControl' => ['bool', 'control'=>'string', 'max_age='=>'int', 'must_revalidate='=>'bool'],
'HttpResponse::setContentDisposition' => ['bool', 'filename'=>'string', 'inline='=>'bool'],
'HttpResponse::setContentType' => ['bool', 'content_type'=>'string'],
'HttpResponse::setData' => ['bool', 'data'=>'mixed'],
'HttpResponse::setETag' => ['bool', 'etag'=>'string'],
'HttpResponse::setFile' => ['bool', 'file'=>'string'],
'HttpResponse::setGzip' => ['bool', 'gzip'=>'bool'],
'HttpResponse::setHeader' => ['bool', 'name'=>'string', 'value='=>'mixed', 'replace='=>'bool'],
'HttpResponse::setLastModified' => ['bool', 'timestamp'=>'int'],
'HttpResponse::setStream' => ['bool', 'stream'=>'resource'],
'HttpResponse::setThrottleDelay' => ['bool', 'seconds'=>'float'],
'HttpResponse::status' => ['bool', 'status'=>'int'],
'HttpUtil::buildCookie' => ['', 'cookie_array'=>''],
'HttpUtil::buildStr' => ['', 'query'=>'', 'prefix'=>'', 'arg_sep'=>''],
'HttpUtil::buildUrl' => ['', 'url'=>'', 'parts'=>'', 'flags'=>'', '&composed'=>''],
'HttpUtil::chunkedDecode' => ['', 'encoded_string'=>''],
'HttpUtil::date' => ['', 'timestamp'=>''],
'HttpUtil::deflate' => ['', 'plain'=>'', 'flags'=>''],
'HttpUtil::inflate' => ['', 'encoded'=>''],
'HttpUtil::matchEtag' => ['', 'plain_etag'=>'', 'for_range'=>''],
'HttpUtil::matchModified' => ['', 'last_modified'=>'', 'for_range'=>''],
'HttpUtil::matchRequestHeader' => ['', 'header_name'=>'', 'header_value'=>'', 'case_sensitive'=>''],
'HttpUtil::negotiateCharset' => ['', 'supported'=>'', '&result'=>''],
'HttpUtil::negotiateContentType' => ['', 'supported'=>'', '&result'=>''],
'HttpUtil::negotiateLanguage' => ['', 'supported'=>'', '&result'=>''],
'HttpUtil::parseCookie' => ['', 'cookie_string'=>''],
'HttpUtil::parseHeaders' => ['', 'headers_string'=>''],
'HttpUtil::parseMessage' => ['', 'message_string'=>''],
'HttpUtil::parseParams' => ['', 'param_string'=>'', 'flags'=>''],
'HttpUtil::support' => ['', 'feature'=>''],
'hw_api::checkin' => ['bool', 'parameter'=>'array'],
'hw_api::checkout' => ['bool', 'parameter'=>'array'],
'hw_api::children' => ['array', 'parameter'=>'array'],
'hw_api::content' => ['HW_API_Content', 'parameter'=>'array'],
'hw_api::copy' => ['hw_api_content', 'parameter'=>'array'],
'hw_api::dbstat' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::dcstat' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::dstanchors' => ['array', 'parameter'=>'array'],
'hw_api::dstofsrcanchor' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::find' => ['array', 'parameter'=>'array'],
'hw_api::ftstat' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::hwstat' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::identify' => ['bool', 'parameter'=>'array'],
'hw_api::info' => ['array', 'parameter'=>'array'],
'hw_api::insert' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::insertanchor' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::insertcollection' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::insertdocument' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::link' => ['bool', 'parameter'=>'array'],
'hw_api::lock' => ['bool', 'parameter'=>'array'],
'hw_api::move' => ['bool', 'parameter'=>'array'],
'hw_api::object' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::objectbyanchor' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::parents' => ['array', 'parameter'=>'array'],
'hw_api::remove' => ['bool', 'parameter'=>'array'],
'hw_api::replace' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::setcommittedversion' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::srcanchors' => ['array', 'parameter'=>'array'],
'hw_api::srcsofdst' => ['array', 'parameter'=>'array'],
'hw_api::unlock' => ['bool', 'parameter'=>'array'],
'hw_api::user' => ['hw_api_object', 'parameter'=>'array'],
'hw_api::userlist' => ['array', 'parameter'=>'array'],
'hw_api_attribute' => ['HW_API_Attribute', 'name='=>'string', 'value='=>'string'],
'hw_api_attribute::key' => ['string'],
'hw_api_attribute::langdepvalue' => ['string', 'language'=>'string'],
'hw_api_attribute::value' => ['string'],
'hw_api_attribute::values' => ['array'],
'hw_api_content' => ['HW_API_Content', 'content'=>'string', 'mimetype'=>'string'],
'hw_api_content::mimetype' => ['string'],
'hw_api_content::read' => ['string', 'buffer'=>'string', 'length'=>'int'],
'hw_api_error::count' => ['int'],
'hw_api_error::reason' => ['HW_API_Reason'],
'hw_api_object' => ['hw_api_object', 'parameter'=>'array'],
'hw_api_object::assign' => ['bool', 'parameter'=>'array'],
'hw_api_object::attreditable' => ['bool', 'parameter'=>'array'],
'hw_api_object::count' => ['int', 'parameter'=>'array'],
'hw_api_object::insert' => ['bool', 'attribute'=>'hw_api_attribute'],
'hw_api_object::remove' => ['bool', 'name'=>'string'],
'hw_api_object::title' => ['string', 'parameter'=>'array'],
'hw_api_object::value' => ['string', 'name'=>'string'],
'hw_api_reason::description' => ['string'],
'hw_api_reason::type' => ['HW_API_Reason'],
'hw_Array2Objrec' => ['string', 'object_array'=>'array'],
'hw_changeobject' => ['bool', 'link'=>'int', 'objid'=>'int', 'attributes'=>'array'],
'hw_Children' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_ChildrenObj' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_Close' => ['bool', 'connection'=>'int'],
'hw_Connect' => ['int', 'host'=>'string', 'port'=>'int', 'username='=>'string', 'password='=>'string'],
'hw_connection_info' => ['', 'link'=>'int'],
'hw_cp' => ['int', 'connection'=>'int', 'object_id_array'=>'array', 'destination_id'=>'int'],
'hw_Deleteobject' => ['bool', 'connection'=>'int', 'object_to_delete'=>'int'],
'hw_DocByAnchor' => ['int', 'connection'=>'int', 'anchorid'=>'int'],
'hw_DocByAnchorObj' => ['string', 'connection'=>'int', 'anchorid'=>'int'],
'hw_Document_Attributes' => ['string', 'hw_document'=>'int'],
'hw_Document_BodyTag' => ['string', 'hw_document'=>'int', 'prefix='=>'string'],
'hw_Document_Content' => ['string', 'hw_document'=>'int'],
'hw_Document_SetContent' => ['bool', 'hw_document'=>'int', 'content'=>'string'],
'hw_Document_Size' => ['int', 'hw_document'=>'int'],
'hw_dummy' => ['string', 'link'=>'int', 'id'=>'int', 'msgid'=>'int'],
'hw_EditText' => ['bool', 'connection'=>'int', 'hw_document'=>'int'],
'hw_Error' => ['int', 'connection'=>'int'],
'hw_ErrorMsg' => ['string', 'connection'=>'int'],
'hw_Free_Document' => ['bool', 'hw_document'=>'int'],
'hw_GetAnchors' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetAnchorsObj' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetAndLock' => ['string', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetChildColl' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetChildCollObj' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetChildDocColl' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetChildDocCollObj' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetObject' => ['', 'connection'=>'int', 'objectid'=>'', 'query='=>'string'],
'hw_GetObjectByQuery' => ['array', 'connection'=>'int', 'query'=>'string', 'max_hits'=>'int'],
'hw_GetObjectByQueryColl' => ['array', 'connection'=>'int', 'objectid'=>'int', 'query'=>'string', 'max_hits'=>'int'],
'hw_GetObjectByQueryCollObj' => ['array', 'connection'=>'int', 'objectid'=>'int', 'query'=>'string', 'max_hits'=>'int'],
'hw_GetObjectByQueryObj' => ['array', 'connection'=>'int', 'query'=>'string', 'max_hits'=>'int'],
'hw_GetParents' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetParentsObj' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_getrellink' => ['string', 'link'=>'int', 'rootid'=>'int', 'sourceid'=>'int', 'destid'=>'int'],
'hw_GetRemote' => ['int', 'connection'=>'int', 'objectid'=>'int'],
'hw_getremotechildren' => ['', 'connection'=>'int', 'object_record'=>'string'],
'hw_GetSrcByDestObj' => ['array', 'connection'=>'int', 'objectid'=>'int'],
'hw_GetText' => ['int', 'connection'=>'int', 'objectid'=>'int', 'prefix='=>''],
'hw_getusername' => ['string', 'connection'=>'int'],
'hw_Identify' => ['string', 'link'=>'int', 'username'=>'string', 'password'=>'string'],
'hw_InCollections' => ['array', 'connection'=>'int', 'object_id_array'=>'array', 'collection_id_array'=>'array', 'return_collections'=>'int'],
'hw_Info' => ['string', 'connection'=>'int'],
'hw_InsColl' => ['int', 'connection'=>'int', 'objectid'=>'int', 'object_array'=>'array'],
'hw_InsDoc' => ['int', 'connection'=>'', 'parentid'=>'int', 'object_record'=>'string', 'text='=>'string'],
'hw_insertanchors' => ['bool', 'hwdoc'=>'int', 'anchorecs'=>'array', 'dest'=>'array', 'urlprefixes='=>'array'],
'hw_InsertDocument' => ['int', 'connection'=>'int', 'parent_id'=>'int', 'hw_document'=>'int'],
'hw_InsertObject' => ['int', 'connection'=>'int', 'object_rec'=>'string', 'parameter'=>'string'],
'hw_mapid' => ['int', 'connection'=>'int', 'server_id'=>'int', 'object_id'=>'int'],
'hw_Modifyobject' => ['bool', 'connection'=>'int', 'object_to_change'=>'int', 'remove'=>'array', 'add'=>'array', 'mode='=>'int'],
'hw_mv' => ['int', 'connection'=>'int', 'object_id_array'=>'array', 'source_id'=>'int', 'destination_id'=>'int'],
'hw_New_Document' => ['int', 'object_record'=>'string', 'document_data'=>'string', 'document_size'=>'int'],
'hw_objrec2array' => ['array', 'object_record'=>'string', 'format='=>'array'],
'hw_Output_Document' => ['bool', 'hw_document'=>'int'],
'hw_pConnect' => ['int', 'host'=>'string', 'port'=>'int', 'username='=>'string', 'password='=>'string'],
'hw_PipeDocument' => ['int', 'connection'=>'int', 'objectid'=>'int', 'url_prefixes='=>'array'],
'hw_Root' => ['int'],
'hw_setlinkroot' => ['int', 'link'=>'int', 'rootid'=>'int'],
'hw_stat' => ['string', 'link'=>'int'],
'hw_Unlock' => ['bool', 'connection'=>'int', 'objectid'=>'int'],
'hw_Who' => ['array', 'connection'=>'int'],
'hwapi_attribute_new' => ['HW_API_Attribute', 'name='=>'string', 'value='=>'string'],
'hwapi_content_new' => ['HW_API_Content', 'content'=>'string', 'mimetype'=>'string'],
'hwapi_hgcsp' => ['HW_API', 'hostname'=>'string', 'port='=>'int'],
'hwapi_object_new' => ['hw_api_object', 'parameter'=>'array'],
'hypot' => ['float', 'x'=>'float', 'y'=>'float'],
'ibase_add_user' => ['bool', 'service_handle'=>'resource', 'user_name'=>'string', 'password'=>'string', 'first_name='=>'string', 'middle_name='=>'string', 'last_name='=>'string'],
'ibase_affected_rows' => ['int', 'link_identifier='=>'resource'],
'ibase_backup' => ['mixed', 'service_handle'=>'resource', 'source_db'=>'string', 'dest_file'=>'string', 'options='=>'int', 'verbose='=>'bool'],
'ibase_blob_add' => ['void', 'blob_handle'=>'resource', 'data'=>'string'],
'ibase_blob_cancel' => ['bool', 'blob_handle'=>'resource'],
'ibase_blob_close' => ['string|bool', 'blob_handle'=>'resource'],
'ibase_blob_create' => ['resource', 'link_identifier='=>'resource'],
'ibase_blob_echo' => ['bool', 'link_identifier'=>'', 'blob_id'=>'string'],
'ibase_blob_echo\'1' => ['bool', 'blob_id'=>'string'],
'ibase_blob_get' => ['string|false', 'blob_handle'=>'resource', 'length'=>'int'],
'ibase_blob_import' => ['string|false', 'link_identifier'=>'resource', 'file_handle'=>'resource'],
'ibase_blob_info' => ['array', 'link_identifier'=>'resource', 'blob_id'=>'string'],
'ibase_blob_info\'1' => ['array', 'blob_id'=>'string'],
'ibase_blob_open' => ['resource|false', 'link_identifier'=>'', 'blob_id'=>'string'],
'ibase_blob_open\'1' => ['resource', 'blob_id'=>'string'],
'ibase_close' => ['bool', 'link_identifier='=>'resource'],
'ibase_commit' => ['bool', 'link_identifier='=>'resource'],
'ibase_commit_ret' => ['bool', 'link_identifier='=>'resource'],
'ibase_connect' => ['resource|false', 'database='=>'string', 'username='=>'string', 'password='=>'string', 'charset='=>'string', 'buffers='=>'int', 'dialect='=>'int', 'role='=>'string'],
'ibase_db_info' => ['string', 'service_handle'=>'resource', 'db'=>'string', 'action'=>'int', 'argument='=>'int'],
'ibase_delete_user' => ['bool', 'service_handle'=>'resource', 'user_name'=>'string', 'password='=>'string', 'first_name='=>'string', 'middle_name='=>'string', 'last_name='=>'string'],
'ibase_drop_db' => ['bool', 'link_identifier='=>'resource'],
'ibase_errcode' => ['int|false'],
'ibase_errmsg' => ['string|false'],
'ibase_execute' => ['resource|false', 'query'=>'resource', 'bind_arg='=>'mixed', '...args='=>'mixed'],
'ibase_fetch_assoc' => ['array|false', 'result'=>'resource', 'fetch_flags='=>'int'],
'ibase_fetch_object' => ['object|false', 'result'=>'resource', 'fetch_flags='=>'int'],
'ibase_fetch_row' => ['array|false', 'result'=>'resource', 'fetch_flags='=>'int'],
'ibase_field_info' => ['array', 'query_result'=>'resource', 'field_number'=>'int'],
'ibase_free_event_handler' => ['bool', 'event'=>'resource'],
'ibase_free_query' => ['bool', 'query'=>'resource'],
'ibase_free_result' => ['bool', 'result'=>'resource'],
'ibase_gen_id' => ['int|string', 'generator'=>'string', 'increment='=>'int', 'link_identifier='=>'resource'],
'ibase_maintain_db' => ['bool', 'service_handle'=>'resource', 'db'=>'string', 'action'=>'int', 'argument='=>'int'],
'ibase_modify_user' => ['bool', 'service_handle'=>'resource', 'user_name'=>'string', 'password'=>'string', 'first_name='=>'string', 'middle_name='=>'string', 'last_name='=>'string'],
'ibase_name_result' => ['bool', 'result'=>'resource', 'name'=>'string'],
'ibase_num_fields' => ['int', 'query_result'=>'resource'],
'ibase_num_params' => ['int', 'query'=>'resource'],
'ibase_num_rows' => ['int', 'result_identifier'=>''],
'ibase_param_info' => ['array', 'query'=>'resource', 'field_number'=>'int'],
'ibase_pconnect' => ['resource|false', 'database='=>'string', 'username='=>'string', 'password='=>'string', 'charset='=>'string', 'buffers='=>'int', 'dialect='=>'int', 'role='=>'string'],
'ibase_prepare' => ['resource|false', 'link_identifier'=>'', 'query'=>'string', 'trans_identifier'=>''],
'ibase_query' => ['resource|false', 'link_identifier='=>'resource', 'string='=>'string', 'bind_arg='=>'int', '...args='=>''],
'ibase_restore' => ['mixed', 'service_handle'=>'resource', 'source_file'=>'string', 'dest_db'=>'string', 'options='=>'int', 'verbose='=>'bool'],
'ibase_rollback' => ['bool', 'link_identifier='=>'resource'],
'ibase_rollback_ret' => ['bool', 'link_identifier='=>'resource'],
'ibase_server_info' => ['string', 'service_handle'=>'resource', 'action'=>'int'],
'ibase_service_attach' => ['resource', 'host'=>'string', 'dba_username'=>'string', 'dba_password'=>'string'],
'ibase_service_detach' => ['bool', 'service_handle'=>'resource'],
'ibase_set_event_handler' => ['resource', 'link_identifier'=>'', 'callback'=>'callable', 'event='=>'string', '...args='=>''],
'ibase_set_event_handler\'1' => ['resource', 'callback'=>'callable', 'event'=>'string', '...args'=>''],
'ibase_timefmt' => ['bool', 'format'=>'string', 'columntype='=>'int'],
'ibase_trans' => ['resource|false', 'trans_args='=>'int', 'link_identifier='=>'', '...args='=>''],
'ibase_wait_event' => ['string', 'link_identifier'=>'', 'event='=>'string', '...args='=>''],
'ibase_wait_event\'1' => ['string', 'event'=>'string', '...args'=>''],
'iconv' => ['string|false', 'from_encoding'=>'string', 'to_encoding'=>'string', 'string'=>'string'],
'iconv_get_encoding' => ['mixed', 'type='=>'string'],
'iconv_mime_decode' => ['string|false', 'string'=>'string', 'mode='=>'int', 'encoding='=>'string'],
'iconv_mime_decode_headers' => ['array|false', 'headers'=>'string', 'mode='=>'int', 'encoding='=>'string'],
'iconv_mime_encode' => ['string|false', 'field_name'=>'string', 'field_value'=>'string', 'options='=>'array'],
'iconv_set_encoding' => ['bool', 'type'=>'string', 'encoding'=>'string'],
'iconv_strlen' => ['int|false', 'string'=>'string', 'encoding='=>'string'],
'iconv_strpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string'],
'iconv_strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'encoding='=>'string'],
'iconv_substr' => ['string|false', 'string'=>'string', 'offset'=>'int', 'length='=>'int', 'encoding='=>'string'],
'id3_get_frame_long_name' => ['string', 'frameid'=>'string'],
'id3_get_frame_short_name' => ['string', 'frameid'=>'string'],
'id3_get_genre_id' => ['int', 'genre'=>'string'],
'id3_get_genre_list' => ['array'],
'id3_get_genre_name' => ['string', 'genre_id'=>'int'],
'id3_get_tag' => ['array', 'filename'=>'string', 'version='=>'int'],
'id3_get_version' => ['int', 'filename'=>'string'],
'id3_remove_tag' => ['bool', 'filename'=>'string', 'version='=>'int'],
'id3_set_tag' => ['bool', 'filename'=>'string', 'tag'=>'array', 'version='=>'int'],
'idate' => ['int', 'format'=>'string', 'timestamp='=>'int'],
'idn_strerror' => ['string', 'errorcode'=>'int'],
'idn_to_ascii' => ['string|false', 'domain'=>'string', 'flags='=>'int', 'variant='=>'int', '&w_idna_info='=>'array'],
'idn_to_utf8' => ['string|false', 'domain'=>'string', 'flags='=>'int', 'variant='=>'int', '&w_idna_info='=>'array'],
'ifx_affected_rows' => ['int', 'result_id'=>'resource'],
'ifx_blobinfile_mode' => ['bool', 'mode'=>'int'],
'ifx_byteasvarchar' => ['bool', 'mode'=>'int'],
'ifx_close' => ['bool', 'link_identifier='=>'resource'],
'ifx_connect' => ['resource', 'database='=>'string', 'userid='=>'string', 'password='=>'string'],
'ifx_copy_blob' => ['int', 'bid'=>'int'],
'ifx_create_blob' => ['int', 'type'=>'int', 'mode'=>'int', 'param'=>'string'],
'ifx_create_char' => ['int', 'param'=>'string'],
'ifx_do' => ['bool', 'result_id'=>'resource'],
'ifx_error' => ['string', 'link_identifier='=>'resource'],
'ifx_errormsg' => ['string', 'errorcode='=>'int'],
'ifx_fetch_row' => ['array', 'result_id'=>'resource', 'position='=>'mixed'],
'ifx_fieldproperties' => ['array', 'result_id'=>'resource'],
'ifx_fieldtypes' => ['array', 'result_id'=>'resource'],
'ifx_free_blob' => ['bool', 'bid'=>'int'],
'ifx_free_char' => ['bool', 'bid'=>'int'],
'ifx_free_result' => ['bool', 'result_id'=>'resource'],
'ifx_get_blob' => ['string', 'bid'=>'int'],
'ifx_get_char' => ['string', 'bid'=>'int'],
'ifx_getsqlca' => ['array', 'result_id'=>'resource'],
'ifx_htmltbl_result' => ['int', 'result_id'=>'resource', 'html_table_options='=>'string'],
'ifx_nullformat' => ['bool', 'mode'=>'int'],
'ifx_num_fields' => ['int', 'result_id'=>'resource'],
'ifx_num_rows' => ['int', 'result_id'=>'resource'],
'ifx_pconnect' => ['resource', 'database='=>'string', 'userid='=>'string', 'password='=>'string'],
'ifx_prepare' => ['resource', 'query'=>'string', 'link_identifier'=>'resource', 'cursor_def='=>'int', 'blobidarray='=>'mixed'],
'ifx_query' => ['resource', 'query'=>'string', 'link_identifier'=>'resource', 'cursor_type='=>'int', 'blobidarray='=>'mixed'],
'ifx_textasvarchar' => ['bool', 'mode'=>'int'],
'ifx_update_blob' => ['bool', 'bid'=>'int', 'content'=>'string'],
'ifx_update_char' => ['bool', 'bid'=>'int', 'content'=>'string'],
'ifxus_close_slob' => ['bool', 'bid'=>'int'],
'ifxus_create_slob' => ['int', 'mode'=>'int'],
'ifxus_free_slob' => ['bool', 'bid'=>'int'],
'ifxus_open_slob' => ['int', 'bid'=>'int', 'mode'=>'int'],
'ifxus_read_slob' => ['string', 'bid'=>'int', 'nbytes'=>'int'],
'ifxus_seek_slob' => ['int', 'bid'=>'int', 'mode'=>'int', 'offset'=>'int'],
'ifxus_tell_slob' => ['int', 'bid'=>'int'],
'ifxus_write_slob' => ['int', 'bid'=>'int', 'content'=>'string'],
'igbinary_serialize' => ['string|false', 'value'=>'mixed'],
'igbinary_unserialize' => ['mixed', 'string'=>'string'],
'ignore_user_abort' => ['int', 'enable='=>'bool'],
'iis_add_server' => ['int', 'path'=>'string', 'comment'=>'string', 'server_ip'=>'string', 'port'=>'int', 'host_name'=>'string', 'rights'=>'int', 'start_server'=>'int'],
'iis_get_dir_security' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string'],
'iis_get_script_map' => ['string', 'server_instance'=>'int', 'virtual_path'=>'string', 'script_extension'=>'string'],
'iis_get_server_by_comment' => ['int', 'comment'=>'string'],
'iis_get_server_by_path' => ['int', 'path'=>'string'],
'iis_get_server_rights' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string'],
'iis_get_service_state' => ['int', 'service_id'=>'string'],
'iis_remove_server' => ['int', 'server_instance'=>'int'],
'iis_set_app_settings' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string', 'application_scope'=>'string'],
'iis_set_dir_security' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string', 'directory_flags'=>'int'],
'iis_set_script_map' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string', 'script_extension'=>'string', 'engine_path'=>'string', 'allow_scripting'=>'int'],
'iis_set_server_rights' => ['int', 'server_instance'=>'int', 'virtual_path'=>'string', 'directory_flags'=>'int'],
'iis_start_server' => ['int', 'server_instance'=>'int'],
'iis_start_service' => ['int', 'service_id'=>'string'],
'iis_stop_server' => ['int', 'server_instance'=>'int'],
'iis_stop_service' => ['int', 'service_id'=>'string'],
'image_type_to_extension' => ['string', 'image_type'=>'int', 'include_dot='=>'bool'],
'image_type_to_mime_type' => ['string', 'image_type'=>'int'],
'imageaffine' => ['false|GdImage', 'image'=>'GdImage', 'affine'=>'array', 'clip='=>'?array'],
'imageaffinematrixconcat' => ['array{0:float,1:float,2:float,3:float,4:float,5:float}|false', 'matrix1'=>'array', 'matrix2'=>'array'],
'imageaffinematrixget' => ['array{0:float,1:float,2:float,3:float,4:float,5:float}|false', 'type'=>'int', 'options'=>'array|float'],
'imagealphablending' => ['bool', 'image'=>'GdImage', 'enable'=>'bool'],
'imageantialias' => ['bool', 'image'=>'GdImage', 'enable'=>'bool'],
'imagearc' => ['bool', 'image'=>'GdImage', 'center_x'=>'int', 'center_y'=>'int', 'width'=>'int', 'height'=>'int', 'start_angle'=>'int', 'end_angle'=>'int', 'color'=>'int'],
'imageavif' => ['bool', 'image'=>'GdImage', 'file='=>'resource|string|null', 'quality='=>'int', 'speed='=>'int'],
'imagebmp' => ['bool', 'image'=>'GdImage', 'file='=>'resource|string|null', 'compressed='=>'bool'],
'imagechar' => ['bool', 'image'=>'GdImage', 'font'=>'int', 'x'=>'int', 'y'=>'int', 'char'=>'string', 'color'=>'int'],
'imagecharup' => ['bool', 'image'=>'GdImage', 'font'=>'int', 'x'=>'int', 'y'=>'int', 'char'=>'string', 'color'=>'int'],
'imagecolorallocate' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int'],
'imagecolorallocatealpha' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha'=>'int'],
'imagecolorat' => ['int|false', 'image'=>'GdImage', 'x'=>'int', 'y'=>'int'],
'imagecolorclosest' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int'],
'imagecolorclosestalpha' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha'=>'int'],
'imagecolorclosesthwb' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int'],
'imagecolordeallocate' => ['bool', 'image'=>'GdImage', 'color'=>'int'],
'imagecolorexact' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int'],
'imagecolorexactalpha' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha'=>'int'],
'imagecolormatch' => ['bool', 'image1'=>'GdImage', 'image2'=>'GdImage'],
'imagecolorresolve' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int'],
'imagecolorresolvealpha' => ['int|false', 'image'=>'GdImage', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha'=>'int'],
'imagecolorset' => ['void', 'image'=>'GdImage', 'color'=>'int', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha='=>'int'],
'imagecolorsforindex' => ['array|false', 'image'=>'GdImage', 'color'=>'int'],
'imagecolorstotal' => ['int|false', 'image'=>'GdImage'],
'imagecolortransparent' => ['int|false', 'image'=>'GdImage', 'color='=>'int'],
'imageconvolution' => ['bool', 'image'=>'GdImage', 'matrix'=>'array', 'divisor'=>'float', 'offset'=>'float'],
'imagecopy' => ['bool', 'dst_image'=>'GdImage', 'src_image'=>'GdImage', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'src_width'=>'int', 'src_height'=>'int'],
'imagecopymerge' => ['bool', 'dst_image'=>'GdImage', 'src_image'=>'GdImage', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'src_width'=>'int', 'src_height'=>'int', 'pct'=>'int'],
'imagecopymergegray' => ['bool', 'dst_image'=>'GdImage', 'src_image'=>'GdImage', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'src_width'=>'int', 'src_height'=>'int', 'pct'=>'int'],
'imagecopyresampled' => ['bool', 'dst_image'=>'GdImage', 'src_image'=>'GdImage', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'dst_width'=>'int', 'dst_height'=>'int', 'src_width'=>'int', 'src_height'=>'int'],
'imagecopyresized' => ['bool', 'dst_image'=>'GdImage', 'src_image'=>'GdImage', 'dst_x'=>'int', 'dst_y'=>'int', 'src_x'=>'int', 'src_y'=>'int', 'dst_width'=>'int', 'dst_height'=>'int', 'src_width'=>'int', 'src_height'=>'int'],
'imagecreate' => ['false|GdImage', 'width'=>'int', 'height'=>'int'],
'imagecreatefromavif' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefrombmp' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefromgd' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefromgd2' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefromgd2part' => ['false|GdImage', 'filename'=>'string', 'x'=>'int', 'y'=>'int', 'width'=>'int', 'height'=>'int'],
'imagecreatefromgif' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefromjpeg' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefrompng' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefromstring' => ['false|GdImage', 'data'=>'string'],
'imagecreatefromwbmp' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefromwebp' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefromxbm' => ['false|GdImage', 'filename'=>'string'],
'imagecreatefromxpm' => ['false|GdImage', 'filename'=>'string'],
'imagecreatetruecolor' => ['false|GdImage', 'width'=>'int', 'height'=>'int'],
'imagecrop' => ['false|GdImage', 'image'=>'GdImage', 'rectangle'=>'array'],
'imagecropauto' => ['false|GdImage', 'image'=>'GdImage', 'mode='=>'int', 'threshold='=>'float', 'color='=>'int'],
'imagedashedline' => ['bool', 'image'=>'GdImage', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int', 'color'=>'int'],
'imagedestroy' => ['bool', 'image'=>'GdImage'],
'imageellipse' => ['bool', 'image'=>'GdImage', 'center_x'=>'int', 'center_y'=>'int', 'width'=>'int', 'height'=>'int', 'color'=>'int'],
'imagefill' => ['bool', 'image'=>'GdImage', 'x'=>'int', 'y'=>'int', 'color'=>'int'],
'imagefilledarc' => ['bool', 'image'=>'GdImage', 'center_x'=>'int', 'center_y'=>'int', 'width'=>'int', 'height'=>'int', 'start_angle'=>'int', 'end_angle'=>'int', 'color'=>'int', 'style'=>'int'],
'imagefilledellipse' => ['bool', 'image'=>'GdImage', 'center_x'=>'int', 'center_y'=>'int', 'width'=>'int', 'height'=>'int', 'color'=>'int'],
'imagefilledpolygon' => ['bool', 'image'=>'GdImage', 'points'=>'array', 'num_points_or_color'=>'int', 'color'=>'int'],
'imagefilledrectangle' => ['bool', 'image'=>'GdImage', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int', 'color'=>'int'],
'imagefilltoborder' => ['bool', 'image'=>'GdImage', 'x'=>'int', 'y'=>'int', 'border_color'=>'int', 'color'=>'int'],
'imagefilter' => ['bool', 'image'=>'GdImage', 'filter'=>'int', 'args='=>'int', 'arg2='=>'int', 'arg3='=>'int', 'arg4='=>'int'],
'imageflip' => ['bool', 'image'=>'GdImage', 'mode'=>'int'],
'imagefontheight' => ['int', 'font'=>'int'],
'imagefontwidth' => ['int', 'font'=>'int'],
'imageftbbox' => ['array|false', 'size'=>'float', 'angle'=>'float', 'font_filename'=>'string', 'string'=>'string', 'options='=>'array'],
'imagefttext' => ['array|false', 'image'=>'GdImage', 'size'=>'float', 'angle'=>'float', 'x'=>'int', 'y'=>'int', 'color'=>'int', 'font_filename'=>'string', 'text'=>'string', 'options='=>'array'],
'imagegammacorrect' => ['bool', 'image'=>'GdImage', 'input_gamma'=>'float', 'output_gamma'=>'float'],
'imagegd' => ['bool', 'image'=>'GdImage', 'file='=>'string|resource|null'],
'imagegd2' => ['bool', 'image'=>'GdImage', 'file='=>'string|resource|null', 'chunk_size='=>'int', 'mode='=>'int'],
'imagegetclip' => ['array<int,int>', 'image'=>'GdImage'],
'imagegetinterpolation' => ['int', 'image'=>'GdImage'],
'imagegif' => ['bool', 'image'=>'GdImage', 'file='=>'string|resource|null'],
'imagegrabscreen' => ['false|GdImage'],
'imagegrabwindow' => ['false|GdImage', 'handle'=>'int', 'client_area='=>'int'],
'imageinterlace' => ['int|false', 'image'=>'GdImage', 'enable='=>'int'],
'imageistruecolor' => ['bool', 'image'=>'GdImage'],
'imagejpeg' => ['bool', 'image'=>'GdImage', 'file='=>'string|resource|null', 'quality='=>'int'],
'imagelayereffect' => ['bool', 'image'=>'GdImage', 'effect'=>'int'],
'imageline' => ['bool', 'image'=>'GdImage', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int', 'color'=>'int'],
'imageloadfont' => ['int|false', 'filename'=>'string'],
'imageObj::pasteImage' => ['void', 'srcImg'=>'imageObj', 'transparentColorHex'=>'int', 'dstX'=>'int', 'dstY'=>'int', 'angle'=>'int'],
'imageObj::saveImage' => ['int', 'filename'=>'string', 'oMap'=>'mapObj'],
'imageObj::saveWebImage' => ['string'],
'imageopenpolygon' => ['bool', 'image'=>'GdImage', 'points'=>'array', 'num_points'=>'int', 'color'=>'int'],
'imagepalettecopy' => ['void', 'dst'=>'GdImage', 'src'=>'GdImage'],
'imagepalettetotruecolor' => ['bool', 'image'=>'GdImage'],
'imagepng' => ['bool', 'image'=>'GdImage', 'file='=>'string|resource|null', 'quality='=>'int', 'filters='=>'int'],
'imagepolygon' => ['bool', 'image'=>'GdImage', 'points'=>'array', 'num_points_or_color'=>'int', 'color'=>'int'],
'imagerectangle' => ['bool', 'image'=>'GdImage', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int', 'color'=>'int'],
'imageresolution' => ['array|bool', 'image'=>'GdImage', 'resolution_x='=>'int', 'resolution_y='=>'int'],
'imagerotate' => ['false|GdImage', 'image'=>'GdImage', 'angle'=>'float', 'background_color'=>'int', 'ignore_transparent='=>'int'],
'imagesavealpha' => ['bool', 'image'=>'GdImage', 'enable'=>'bool'],
'imagescale' => ['false|GdImage', 'image'=>'GdImage', 'width'=>'int', 'height='=>'int', 'mode='=>'int'],
'imagesetbrush' => ['bool', 'image'=>'GdImage', 'brush'=>'GdImage'],
'imagesetclip' => ['bool', 'image'=>'GdImage', 'x1'=>'int', 'x2'=>'int', 'y1'=>'int', 'y2'=>'int'],
'imagesetinterpolation' => ['bool', 'image'=>'GdImage', 'method'=>'int'],
'imagesetpixel' => ['bool', 'image'=>'GdImage', 'x'=>'int', 'y'=>'int', 'color'=>'int'],
'imagesetstyle' => ['bool', 'image'=>'GdImage', 'style'=>'non-empty-array'],
'imagesetthickness' => ['bool', 'image'=>'GdImage', 'thickness'=>'int'],
'imagesettile' => ['bool', 'image'=>'GdImage', 'tile'=>'GdImage'],
'imagestring' => ['bool', 'image'=>'GdImage', 'font'=>'int', 'x'=>'int', 'y'=>'int', 'string'=>'string', 'color'=>'int'],
'imagestringup' => ['bool', 'image'=>'GdImage', 'font'=>'int', 'x'=>'int', 'y'=>'int', 'string'=>'string', 'color'=>'int'],
'imagesx' => ['int|false', 'image'=>'GdImage'],
'imagesy' => ['int|false', 'image'=>'GdImage'],
'imagetruecolortopalette' => ['bool', 'image'=>'GdImage', 'dither'=>'bool', 'num_colors'=>'int'],
'imagettfbbox' => ['false|array', 'size'=>'float', 'angle'=>'float', 'font_filename'=>'string', 'string'=>'string'],
'imagettftext' => ['false|array', 'image'=>'GdImage', 'size'=>'float', 'angle'=>'float', 'x'=>'int', 'y'=>'int', 'color'=>'int', 'font_filename'=>'string', 'text'=>'string'],
'imagetypes' => ['int'],
'imagewbmp' => ['bool', 'image'=>'GdImage', 'file='=>'string|resource|null', 'foreground_color='=>'int'],
'imagewebp' => ['bool', 'image'=>'GdImage', 'file='=>'string|resource|null', 'quality='=>'int'],
'imagexbm' => ['bool', 'image'=>'GdImage', 'filename='=>'?string', 'foreground_color='=>'int'],
'Imagick::__construct' => ['void', 'files='=>'string|string[]'],
'Imagick::__toString' => ['string'],
'Imagick::adaptiveBlurImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'],
'Imagick::adaptiveResizeImage' => ['bool', 'columns'=>'int', 'rows'=>'int', 'bestfit='=>'bool'],
'Imagick::adaptiveSharpenImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'],
'Imagick::adaptiveThresholdImage' => ['bool', 'width'=>'int', 'height'=>'int', 'offset'=>'int'],
'Imagick::addImage' => ['bool', 'source'=>'Imagick'],
'Imagick::addNoiseImage' => ['bool', 'noise_type'=>'int', 'channel='=>'int'],
'Imagick::affineTransformImage' => ['bool', 'matrix'=>'ImagickDraw'],
'Imagick::animateImages' => ['bool', 'x_server'=>'string'],
'Imagick::annotateImage' => ['bool', 'draw_settings'=>'ImagickDraw', 'x'=>'float', 'y'=>'float', 'angle'=>'float', 'text'=>'string'],
'Imagick::appendImages' => ['Imagick', 'stack'=>'bool'],
'Imagick::autoGammaImage' => ['bool', 'channel='=>'int'],
'Imagick::autoLevelImage' => ['void', 'CHANNEL='=>'string'],
'Imagick::autoOrient' => ['bool'],
'Imagick::averageImages' => ['Imagick'],
'Imagick::blackThresholdImage' => ['bool', 'threshold'=>'mixed'],
'Imagick::blueShiftImage' => ['void', 'factor='=>'float'],
'Imagick::blurImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'],
'Imagick::borderImage' => ['bool', 'bordercolor'=>'mixed', 'width'=>'int', 'height'=>'int'],
'Imagick::brightnessContrastImage' => ['void', 'brightness'=>'string', 'contrast'=>'string', 'CHANNEL='=>'string'],
'Imagick::charcoalImage' => ['bool', 'radius'=>'float', 'sigma'=>'float'],
'Imagick::chopImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Imagick::clampImage' => ['void', 'CHANNEL='=>'string'],
'Imagick::clear' => ['bool'],
'Imagick::clipImage' => ['bool'],
'Imagick::clipImagePath' => ['void', 'pathname'=>'string', 'inside'=>'string'],
'Imagick::clipPathImage' => ['bool', 'pathname'=>'string', 'inside'=>'bool'],
'Imagick::clone' => ['Imagick'],
'Imagick::clutImage' => ['bool', 'lookup_table'=>'Imagick', 'channel='=>'float'],
'Imagick::coalesceImages' => ['Imagick'],
'Imagick::colorFloodfillImage' => ['bool', 'fill'=>'mixed', 'fuzz'=>'float', 'bordercolor'=>'mixed', 'x'=>'int', 'y'=>'int'],
'Imagick::colorizeImage' => ['bool', 'colorize'=>'mixed', 'opacity'=>'mixed'],
'Imagick::colorMatrixImage' => ['void', 'color_matrix'=>'string'],
'Imagick::combineImages' => ['Imagick', 'channeltype'=>'int'],
'Imagick::commentImage' => ['bool', 'comment'=>'string'],
'Imagick::compareImageChannels' => ['array{Imagick, float}', 'image'=>'Imagick', 'channeltype'=>'int', 'metrictype'=>'int'],
'Imagick::compareImageLayers' => ['Imagick', 'method'=>'int'],
'Imagick::compareImages' => ['array{Imagick, float}', 'compare'=>'Imagick', 'metric'=>'int'],
'Imagick::compositeImage' => ['bool', 'composite_object'=>'Imagick', 'composite'=>'int', 'x'=>'int', 'y'=>'int', 'channel='=>'int'],
'Imagick::compositeImageGravity' => ['bool', 'Imagick'=>'Imagick', 'COMPOSITE_CONSTANT'=>'int', 'GRAVITY_CONSTANT'=>'int'],
'Imagick::contrastImage' => ['bool', 'sharpen'=>'bool'],
'Imagick::contrastStretchImage' => ['bool', 'black_point'=>'float', 'white_point'=>'float', 'channel='=>'int'],
'Imagick::convolveImage' => ['bool', 'kernel'=>'array', 'channel='=>'int'],
'Imagick::count' => ['void', 'mode='=>'string'],
'Imagick::cropImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Imagick::cropThumbnailImage' => ['bool', 'width'=>'int', 'height'=>'int', 'legacy='=>'bool'],
'Imagick::current' => ['Imagick'],
'Imagick::cycleColormapImage' => ['bool', 'displace'=>'int'],
'Imagick::decipherImage' => ['bool', 'passphrase'=>'string'],
'Imagick::deconstructImages' => ['Imagick'],
'Imagick::deleteImageArtifact' => ['bool', 'artifact'=>'string'],
'Imagick::deleteImageProperty' => ['void', 'name'=>'string'],
'Imagick::deskewImage' => ['bool', 'threshold'=>'float'],
'Imagick::despeckleImage' => ['bool'],
'Imagick::destroy' => ['bool'],
'Imagick::displayImage' => ['bool', 'servername'=>'string'],
'Imagick::displayImages' => ['bool', 'servername'=>'string'],
'Imagick::distortImage' => ['bool', 'method'=>'int', 'arguments'=>'array', 'bestfit'=>'bool'],
'Imagick::drawImage' => ['bool', 'draw'=>'ImagickDraw'],
'Imagick::edgeImage' => ['bool', 'radius'=>'float'],
'Imagick::embossImage' => ['bool', 'radius'=>'float', 'sigma'=>'float'],
'Imagick::encipherImage' => ['bool', 'passphrase'=>'string'],
'Imagick::enhanceImage' => ['bool'],
'Imagick::equalizeImage' => ['bool'],
'Imagick::evaluateImage' => ['bool', 'op'=>'int', 'constant'=>'float', 'channel='=>'int'],
'Imagick::evaluateImages' => ['bool', 'EVALUATE_CONSTANT'=>'int'],
'Imagick::exportImagePixels' => ['list<int>', 'x'=>'int', 'y'=>'int', 'width'=>'int', 'height'=>'int', 'map'=>'string', 'storage'=>'int'],
'Imagick::extentImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Imagick::filter' => ['void', 'ImagickKernel'=>'ImagickKernel', 'CHANNEL='=>'int'],
'Imagick::flattenImages' => ['Imagick'],
'Imagick::flipImage' => ['bool'],
'Imagick::floodFillPaintImage' => ['bool', 'fill'=>'mixed', 'fuzz'=>'float', 'target'=>'mixed', 'x'=>'int', 'y'=>'int', 'invert'=>'bool', 'channel='=>'int'],
'Imagick::flopImage' => ['bool'],
'Imagick::forwardFourierTransformimage' => ['void', 'magnitude'=>'bool'],
'Imagick::frameImage' => ['bool', 'matte_color'=>'mixed', 'width'=>'int', 'height'=>'int', 'inner_bevel'=>'int', 'outer_bevel'=>'int'],
'Imagick::functionImage' => ['bool', 'function'=>'int', 'arguments'=>'array', 'channel='=>'int'],
'Imagick::fxImage' => ['Imagick', 'expression'=>'string', 'channel='=>'int'],
'Imagick::gammaImage' => ['bool', 'gamma'=>'float', 'channel='=>'int'],
'Imagick::gaussianBlurImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'],
'Imagick::getColorspace' => ['int'],
'Imagick::getCompression' => ['int'],
'Imagick::getCompressionQuality' => ['int'],
'Imagick::getConfigureOptions' => ['string'],
'Imagick::getCopyright' => ['string'],
'Imagick::getFeatures' => ['string'],
'Imagick::getFilename' => ['string'],
'Imagick::getFont' => ['string|false'],
'Imagick::getFormat' => ['string'],
'Imagick::getGravity' => ['int'],
'Imagick::getHDRIEnabled' => ['int'],
'Imagick::getHomeURL' => ['string'],
'Imagick::getImage' => ['Imagick'],
'Imagick::getImageAlphaChannel' => ['int'],
'Imagick::getImageArtifact' => ['string', 'artifact'=>'string'],
'Imagick::getImageAttribute' => ['string', 'key'=>'string'],
'Imagick::getImageBackgroundColor' => ['ImagickPixel'],
'Imagick::getImageBlob' => ['string'],
'Imagick::getImageBluePrimary' => ['array{x:float, y:float}'],
'Imagick::getImageBorderColor' => ['ImagickPixel'],
'Imagick::getImageChannelDepth' => ['int', 'channel'=>'int'],
'Imagick::getImageChannelDistortion' => ['float', 'reference'=>'Imagick', 'channel'=>'int', 'metric'=>'int'],
'Imagick::getImageChannelDistortions' => ['float', 'reference'=>'Imagick', 'metric'=>'int', 'channel='=>'int'],
'Imagick::getImageChannelExtrema' => ['array{minima:int, maxima:int}', 'channel'=>'int'],
'Imagick::getImageChannelKurtosis' => ['array{kurtosis:float, skewness:float}', 'channel='=>'int'],
'Imagick::getImageChannelMean' => ['array{mean:float, standardDeviation:float}', 'channel'=>'int'],
'Imagick::getImageChannelRange' => ['array{minima:float, maxima:float}', 'channel'=>'int'],
'Imagick::getImageChannelStatistics' => ['array<int, array{mean:float, minima:float, maxima:float, standardDeviation:float, depth:int}>'],
'Imagick::getImageClipMask' => ['Imagick'],
'Imagick::getImageColormapColor' => ['ImagickPixel', 'index'=>'int'],
'Imagick::getImageColors' => ['int'],
'Imagick::getImageColorspace' => ['int'],
'Imagick::getImageCompose' => ['int'],
'Imagick::getImageCompression' => ['int'],
'Imagick::getImageCompressionQuality' => ['int'],
'Imagick::getImageDelay' => ['int'],
'Imagick::getImageDepth' => ['int'],
'Imagick::getImageDispose' => ['int'],
'Imagick::getImageDistortion' => ['float', 'reference'=>'magickwand', 'metric'=>'int'],
'Imagick::getImageExtrema' => ['array{min:int, max:int}'],
'Imagick::getImageFilename' => ['string'],
'Imagick::getImageFormat' => ['string'],
'Imagick::getImageGamma' => ['float'],
'Imagick::getImageGeometry' => ['array{width:int, height:int}'],
'Imagick::getImageGravity' => ['int'],
'Imagick::getImageGreenPrimary' => ['array{x:float, y:float}'],
'Imagick::getImageHeight' => ['int'],
'Imagick::getImageHistogram' => ['list<ImagickPixel>'],
'Imagick::getImageIndex' => ['int'],
'Imagick::getImageInterlaceScheme' => ['int'],
'Imagick::getImageInterpolateMethod' => ['int'],
'Imagick::getImageIterations' => ['int'],
'Imagick::getImageLength' => ['int'],
'Imagick::getImageMagickLicense' => ['string'],
'Imagick::getImageMatte' => ['bool'],
'Imagick::getImageMatteColor' => ['ImagickPixel'],
'Imagick::getImageMimeType' => ['string'],
'Imagick::getImageOrientation' => ['int'],
'Imagick::getImagePage' => ['array{width:int, height:int, x:int, y:int}'],
'Imagick::getImagePixelColor' => ['ImagickPixel', 'x'=>'int', 'y'=>'int'],
'Imagick::getImageProfile' => ['string', 'name'=>'string'],
'Imagick::getImageProfiles' => ['array', 'pattern='=>'string', 'only_names='=>'bool'],
'Imagick::getImageProperties' => ['array<int|string, string>', 'pattern='=>'string', 'only_names='=>'bool'],
'Imagick::getImageProperty' => ['string|false', 'name'=>'string'],
'Imagick::getImageRedPrimary' => ['array{x:float, y:float}'],
'Imagick::getImageRegion' => ['Imagick', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Imagick::getImageRenderingIntent' => ['int'],
'Imagick::getImageResolution' => ['array{x:float, y:float}'],
'Imagick::getImagesBlob' => ['string'],
'Imagick::getImageScene' => ['int'],
'Imagick::getImageSignature' => ['string'],
'Imagick::getImageSize' => ['int'],
'Imagick::getImageTicksPerSecond' => ['int'],
'Imagick::getImageTotalInkDensity' => ['float'],
'Imagick::getImageType' => ['int'],
'Imagick::getImageUnits' => ['int'],
'Imagick::getImageVirtualPixelMethod' => ['int'],
'Imagick::getImageWhitePoint' => ['array{x:float, y:float}'],
'Imagick::getImageWidth' => ['int'],
'Imagick::getInterlaceScheme' => ['int'],
'Imagick::getIteratorIndex' => ['int'],
'Imagick::getNumberImages' => ['int'],
'Imagick::getOption' => ['string', 'key'=>'string'],
'Imagick::getPackageName' => ['string'],
'Imagick::getPage' => ['array{width:int, height:int, x:int, y:int}'],
'Imagick::getPixelIterator' => ['ImagickPixelIterator'],
'Imagick::getPixelRegionIterator' => ['ImagickPixelIterator', 'x'=>'int', 'y'=>'int', 'columns'=>'int', 'rows'=>'int'],
'Imagick::getPointSize' => ['float'],
'Imagick::getQuantum' => ['int'],
'Imagick::getQuantumDepth' => ['array{quantumDepthLong:int, quantumDepthString:string}'],
'Imagick::getQuantumRange' => ['array{quantumRangeLong:int, quantumRangeString:string}'],
'Imagick::getRegistry' => ['string|false', 'key'=>'string'],
'Imagick::getReleaseDate' => ['string'],
'Imagick::getResource' => ['int', 'type'=>'int'],
'Imagick::getResourceLimit' => ['int', 'type'=>'int'],
'Imagick::getSamplingFactors' => ['array'],
'Imagick::getSize' => ['array{columns:int, rows: int}'],
'Imagick::getSizeOffset' => ['int'],
'Imagick::getVersion' => ['array{versionNumber: int, versionString:string}'],
'Imagick::haldClutImage' => ['bool', 'clut'=>'Imagick', 'channel='=>'int'],
'Imagick::hasNextImage' => ['bool'],
'Imagick::hasPreviousImage' => ['bool'],
'Imagick::identifyFormat' => ['string|false', 'embedText'=>'string'],
'Imagick::identifyImage' => ['array<string, mixed>', 'appendrawoutput='=>'bool'],
'Imagick::identifyImageType' => ['int'],
'Imagick::implodeImage' => ['bool', 'radius'=>'float'],
'Imagick::importImagePixels' => ['bool', 'x'=>'int', 'y'=>'int', 'width'=>'int', 'height'=>'int', 'map'=>'string', 'storage'=>'int', 'pixels'=>'list<int>'],
'Imagick::inverseFourierTransformImage' => ['void', 'complement'=>'string', 'magnitude'=>'string'],
'Imagick::key' => ['int|string'],
'Imagick::labelImage' => ['bool', 'label'=>'string'],
'Imagick::levelImage' => ['bool', 'blackpoint'=>'float', 'gamma'=>'float', 'whitepoint'=>'float', 'channel='=>'int'],
'Imagick::linearStretchImage' => ['bool', 'blackpoint'=>'float', 'whitepoint'=>'float'],
'Imagick::liquidRescaleImage' => ['bool', 'width'=>'int', 'height'=>'int', 'delta_x'=>'float', 'rigidity'=>'float'],
'Imagick::listRegistry' => ['array'],
'Imagick::localContrastImage' => ['bool', 'radius'=>'float', 'strength'=>'float'],
'Imagick::magnifyImage' => ['bool'],
'Imagick::mapImage' => ['bool', 'map'=>'Imagick', 'dither'=>'bool'],
'Imagick::matteFloodfillImage' => ['bool', 'alpha'=>'float', 'fuzz'=>'float', 'bordercolor'=>'mixed', 'x'=>'int', 'y'=>'int'],
'Imagick::medianFilterImage' => ['bool', 'radius'=>'float'],
'Imagick::mergeImageLayers' => ['Imagick', 'layer_method'=>'int'],
'Imagick::minifyImage' => ['bool'],
'Imagick::modulateImage' => ['bool', 'brightness'=>'float', 'saturation'=>'float', 'hue'=>'float'],
'Imagick::montageImage' => ['Imagick', 'draw'=>'ImagickDraw', 'tile_geometry'=>'string', 'thumbnail_geometry'=>'string', 'mode'=>'int', 'frame'=>'string'],
'Imagick::morphImages' => ['Imagick', 'number_frames'=>'int'],
'Imagick::morphology' => ['void', 'morphologyMethod'=>'int', 'iterations'=>'int', 'ImagickKernel'=>'ImagickKernel', 'CHANNEL='=>'string'],
'Imagick::mosaicImages' => ['Imagick'],
'Imagick::motionBlurImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'angle'=>'float', 'channel='=>'int'],
'Imagick::negateImage' => ['bool', 'gray'=>'bool', 'channel='=>'int'],
'Imagick::newImage' => ['bool', 'cols'=>'int', 'rows'=>'int', 'background'=>'mixed', 'format='=>'string'],
'Imagick::newPseudoImage' => ['bool', 'columns'=>'int', 'rows'=>'int', 'pseudostring'=>'string'],
'Imagick::next' => ['void'],
'Imagick::nextImage' => ['bool'],
'Imagick::normalizeImage' => ['bool', 'channel='=>'int'],
'Imagick::oilPaintImage' => ['bool', 'radius'=>'float'],
'Imagick::opaquePaintImage' => ['bool', 'target'=>'mixed', 'fill'=>'mixed', 'fuzz'=>'float', 'invert'=>'bool', 'channel='=>'int'],
'Imagick::optimizeImageLayers' => ['bool'],
'Imagick::orderedPosterizeImage' => ['bool', 'threshold_map'=>'string', 'channel='=>'int'],
'Imagick::paintFloodfillImage' => ['bool', 'fill'=>'mixed', 'fuzz'=>'float', 'bordercolor'=>'mixed', 'x'=>'int', 'y'=>'int', 'channel='=>'int'],
'Imagick::paintOpaqueImage' => ['bool', 'target'=>'mixed', 'fill'=>'mixed', 'fuzz'=>'float', 'channel='=>'int'],
'Imagick::paintTransparentImage' => ['bool', 'target'=>'mixed', 'alpha'=>'float', 'fuzz'=>'float'],
'Imagick::pingImage' => ['bool', 'filename'=>'string'],
'Imagick::pingImageBlob' => ['bool', 'image'=>'string'],
'Imagick::pingImageFile' => ['bool', 'filehandle'=>'resource', 'filename='=>'string'],
'Imagick::polaroidImage' => ['bool', 'properties'=>'ImagickDraw', 'angle'=>'float'],
'Imagick::posterizeImage' => ['bool', 'levels'=>'int', 'dither'=>'bool'],
'Imagick::previewImages' => ['bool', 'preview'=>'int'],
'Imagick::previousImage' => ['bool'],
'Imagick::profileImage' => ['bool', 'name'=>'string', 'profile'=>'string'],
'Imagick::quantizeImage' => ['bool', 'numbercolors'=>'int', 'colorspace'=>'int', 'treedepth'=>'int', 'dither'=>'bool', 'measureerror'=>'bool'],
'Imagick::quantizeImages' => ['bool', 'numbercolors'=>'int', 'colorspace'=>'int', 'treedepth'=>'int', 'dither'=>'bool', 'measureerror'=>'bool'],
'Imagick::queryFontMetrics' => ['array', 'properties'=>'ImagickDraw', 'text'=>'string', 'multiline='=>'bool'],
'Imagick::queryFonts' => ['array', 'pattern='=>'string'],
'Imagick::queryFormats' => ['list<string>', 'pattern='=>'string'],
'Imagick::radialBlurImage' => ['bool', 'angle'=>'float', 'channel='=>'int'],
'Imagick::raiseImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int', 'raise'=>'bool'],
'Imagick::randomThresholdImage' => ['bool', 'low'=>'float', 'high'=>'float', 'channel='=>'int'],
'Imagick::readImage' => ['bool', 'filename'=>'string'],
'Imagick::readImageBlob' => ['bool', 'image'=>'string', 'filename='=>'string'],
'Imagick::readImageFile' => ['bool', 'filehandle'=>'resource', 'filename='=>'string'],
'Imagick::readImages' => ['Imagick', 'filenames'=>'string'],
'Imagick::recolorImage' => ['bool', 'matrix'=>'list<float>'],
'Imagick::reduceNoiseImage' => ['bool', 'radius'=>'float'],
'Imagick::remapImage' => ['bool', 'replacement'=>'Imagick', 'dither'=>'int'],
'Imagick::removeImage' => ['bool'],
'Imagick::removeImageProfile' => ['string', 'name'=>'string'],
'Imagick::render' => ['bool'],
'Imagick::resampleImage' => ['bool', 'x_resolution'=>'float', 'y_resolution'=>'float', 'filter'=>'int', 'blur'=>'float'],
'Imagick::resetImagePage' => ['bool', 'page'=>'string'],
'Imagick::resetIterator' => [''],
'Imagick::resizeImage' => ['bool', 'columns'=>'int', 'rows'=>'int', 'filter'=>'int', 'blur'=>'float', 'bestfit='=>'bool'],
'Imagick::rewind' => ['void'],
'Imagick::rollImage' => ['bool', 'x'=>'int', 'y'=>'int'],
'Imagick::rotateImage' => ['bool', 'background'=>'mixed', 'degrees'=>'float'],
'Imagick::rotationalBlurImage' => ['void', 'angle'=>'string', 'CHANNEL='=>'string'],
'Imagick::roundCorners' => ['bool', 'x_rounding'=>'float', 'y_rounding'=>'float', 'stroke_width='=>'float', 'displace='=>'float', 'size_correction='=>'float'],
'Imagick::roundCornersImage' => ['', 'xRounding'=>'', 'yRounding'=>'', 'strokeWidth'=>'', 'displace'=>'', 'sizeCorrection'=>''],
'Imagick::sampleImage' => ['bool', 'columns'=>'int', 'rows'=>'int'],
'Imagick::scaleImage' => ['bool', 'cols'=>'int', 'rows'=>'int', 'bestfit='=>'bool'],
'Imagick::segmentImage' => ['bool', 'colorspace'=>'int', 'cluster_threshold'=>'float', 'smooth_threshold'=>'float', 'verbose='=>'bool'],
'Imagick::selectiveBlurImage' => ['void', 'radius'=>'float', 'sigma'=>'float', 'threshold'=>'float', 'CHANNEL'=>'int'],
'Imagick::separateImageChannel' => ['bool', 'channel'=>'int'],
'Imagick::sepiaToneImage' => ['bool', 'threshold'=>'float'],
'Imagick::setAntiAlias' => ['int', 'antialias'=>'bool'],
'Imagick::setBackgroundColor' => ['bool', 'background'=>'mixed'],
'Imagick::setColorspace' => ['bool', 'colorspace'=>'int'],
'Imagick::setCompression' => ['bool', 'compression'=>'int'],
'Imagick::setCompressionQuality' => ['bool', 'quality'=>'int'],
'Imagick::setFilename' => ['bool', 'filename'=>'string'],
'Imagick::setFirstIterator' => ['bool'],
'Imagick::setFont' => ['bool', 'font'=>'string'],
'Imagick::setFormat' => ['bool', 'format'=>'string'],
'Imagick::setGravity' => ['bool', 'gravity'=>'int'],
'Imagick::setImage' => ['bool', 'replace'=>'Imagick'],
'Imagick::setImageAlpha' => ['bool', 'alpha'=>'float'],
'Imagick::setImageAlphaChannel' => ['bool', 'mode'=>'int'],
'Imagick::setImageArtifact' => ['bool', 'artifact'=>'string', 'value'=>'string'],
'Imagick::setImageAttribute' => ['void', 'key'=>'string', 'value'=>'string'],
'Imagick::setImageBackgroundColor' => ['bool', 'background'=>'mixed'],
'Imagick::setImageBias' => ['bool', 'bias'=>'float'],
'Imagick::setImageBiasQuantum' => ['void', 'bias'=>'string'],
'Imagick::setImageBluePrimary' => ['bool', 'x'=>'float', 'y'=>'float'],
'Imagick::setImageBorderColor' => ['bool', 'border'=>'mixed'],
'Imagick::setImageChannelDepth' => ['bool', 'channel'=>'int', 'depth'=>'int'],
'Imagick::setImageChannelMask' => ['', 'channel'=>'int'],
'Imagick::setImageClipMask' => ['bool', 'clip_mask'=>'Imagick'],
'Imagick::setImageColormapColor' => ['bool', 'index'=>'int', 'color'=>'ImagickPixel'],
'Imagick::setImageColorspace' => ['bool', 'colorspace'=>'int'],
'Imagick::setImageCompose' => ['bool', 'compose'=>'int'],
'Imagick::setImageCompression' => ['bool', 'compression'=>'int'],
'Imagick::setImageCompressionQuality' => ['bool', 'quality'=>'int'],
'Imagick::setImageDelay' => ['bool', 'delay'=>'int'],
'Imagick::setImageDepth' => ['bool', 'depth'=>'int'],
'Imagick::setImageDispose' => ['bool', 'dispose'=>'int'],
'Imagick::setImageExtent' => ['bool', 'columns'=>'int', 'rows'=>'int'],
'Imagick::setImageFilename' => ['bool', 'filename'=>'string'],
'Imagick::setImageFormat' => ['bool', 'format'=>'string'],
'Imagick::setImageGamma' => ['bool', 'gamma'=>'float'],
'Imagick::setImageGravity' => ['bool', 'gravity'=>'int'],
'Imagick::setImageGreenPrimary' => ['bool', 'x'=>'float', 'y'=>'float'],
'Imagick::setImageIndex' => ['bool', 'index'=>'int'],
'Imagick::setImageInterlaceScheme' => ['bool', 'interlace_scheme'=>'int'],
'Imagick::setImageInterpolateMethod' => ['bool', 'method'=>'int'],
'Imagick::setImageIterations' => ['bool', 'iterations'=>'int'],
'Imagick::setImageMatte' => ['bool', 'matte'=>'bool'],
'Imagick::setImageMatteColor' => ['bool', 'matte'=>'mixed'],
'Imagick::setImageOpacity' => ['bool', 'opacity'=>'float'],
'Imagick::setImageOrientation' => ['bool', 'orientation'=>'int'],
'Imagick::setImagePage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Imagick::setImageProfile' => ['bool', 'name'=>'string', 'profile'=>'string'],
'Imagick::setImageProgressMonitor' => ['', 'filename'=>''],
'Imagick::setImageProperty' => ['bool', 'name'=>'string', 'value'=>'string'],
'Imagick::setImageRedPrimary' => ['bool', 'x'=>'float', 'y'=>'float'],
'Imagick::setImageRenderingIntent' => ['bool', 'rendering_intent'=>'int'],
'Imagick::setImageResolution' => ['bool', 'x_resolution'=>'float', 'y_resolution'=>'float'],
'Imagick::setImageScene' => ['bool', 'scene'=>'int'],
'Imagick::setImageTicksPerSecond' => ['bool', 'ticks_per_second'=>'int'],
'Imagick::setImageType' => ['bool', 'image_type'=>'int'],
'Imagick::setImageUnits' => ['bool', 'units'=>'int'],
'Imagick::setImageVirtualPixelMethod' => ['bool', 'method'=>'int'],
'Imagick::setImageWhitePoint' => ['bool', 'x'=>'float', 'y'=>'float'],
'Imagick::setInterlaceScheme' => ['bool', 'interlace_scheme'=>'int'],
'Imagick::setIteratorIndex' => ['bool', 'index'=>'int'],
'Imagick::setLastIterator' => ['bool'],
'Imagick::setOption' => ['bool', 'key'=>'string', 'value'=>'string'],
'Imagick::setPage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Imagick::setPointSize' => ['bool', 'point_size'=>'float'],
'Imagick::setProgressMonitor' => ['void', 'callback'=>'callable'],
'Imagick::setRegistry' => ['void', 'key'=>'string', 'value'=>'string'],
'Imagick::setResolution' => ['bool', 'x_resolution'=>'float', 'y_resolution'=>'float'],
'Imagick::setResourceLimit' => ['bool', 'type'=>'int', 'limit'=>'int'],
'Imagick::setSamplingFactors' => ['bool', 'factors'=>'list<string>'],
'Imagick::setSize' => ['bool', 'columns'=>'int', 'rows'=>'int'],
'Imagick::setSizeOffset' => ['bool', 'columns'=>'int', 'rows'=>'int', 'offset'=>'int'],
'Imagick::setType' => ['bool', 'image_type'=>'int'],
'Imagick::shadeImage' => ['bool', 'gray'=>'bool', 'azimuth'=>'float', 'elevation'=>'float'],
'Imagick::shadowImage' => ['bool', 'opacity'=>'float', 'sigma'=>'float', 'x'=>'int', 'y'=>'int'],
'Imagick::sharpenImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'channel='=>'int'],
'Imagick::shaveImage' => ['bool', 'columns'=>'int', 'rows'=>'int'],
'Imagick::shearImage' => ['bool', 'background'=>'mixed', 'x_shear'=>'float', 'y_shear'=>'float'],
'Imagick::sigmoidalContrastImage' => ['bool', 'sharpen'=>'bool', 'alpha'=>'float', 'beta'=>'float', 'channel='=>'int'],
'Imagick::similarityImage' => ['Imagick', 'Imagick'=>'Imagick', '&bestMatch'=>'array', '&similarity'=>'float', 'similarity_threshold'=>'float', 'metric'=>'int'],
'Imagick::sketchImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'angle'=>'float'],
'Imagick::smushImages' => ['Imagick', 'stack'=>'string', 'offset'=>'string'],
'Imagick::solarizeImage' => ['bool', 'threshold'=>'int'],
'Imagick::sparseColorImage' => ['bool', 'sparse_method'=>'int', 'arguments'=>'array', 'channel='=>'int'],
'Imagick::spliceImage' => ['bool', 'width'=>'int', 'height'=>'int', 'x'=>'int', 'y'=>'int'],
'Imagick::spreadImage' => ['bool', 'radius'=>'float'],
'Imagick::statisticImage' => ['void', 'type'=>'int', 'width'=>'int', 'height'=>'int', 'CHANNEL='=>'string'],
'Imagick::steganoImage' => ['Imagick', 'watermark_wand'=>'Imagick', 'offset'=>'int'],
'Imagick::stereoImage' => ['bool', 'offset_wand'=>'Imagick'],
'Imagick::stripImage' => ['bool'],
'Imagick::subImageMatch' => ['Imagick', 'Imagick'=>'Imagick', '&w_offset='=>'array', '&w_similarity='=>'float'],
'Imagick::swirlImage' => ['bool', 'degrees'=>'float'],
'Imagick::textureImage' => ['bool', 'texture_wand'=>'Imagick'],
'Imagick::thresholdImage' => ['bool', 'threshold'=>'float', 'channel='=>'int'],
'Imagick::thumbnailImage' => ['bool', 'columns'=>'int', 'rows'=>'int', 'bestfit='=>'bool', 'fill='=>'bool', 'legacy='=>'bool'],
'Imagick::tintImage' => ['bool', 'tint'=>'mixed', 'opacity'=>'mixed'],
'Imagick::transformImage' => ['Imagick', 'crop'=>'string', 'geometry'=>'string'],
'Imagick::transformImageColorspace' => ['bool', 'colorspace'=>'int'],
'Imagick::transparentPaintImage' => ['bool', 'target'=>'mixed', 'alpha'=>'float', 'fuzz'=>'float', 'invert'=>'bool'],
'Imagick::transposeImage' => ['bool'],
'Imagick::transverseImage' => ['bool'],
'Imagick::trimImage' => ['bool', 'fuzz'=>'float'],
'Imagick::uniqueImageColors' => ['bool'],
'Imagick::unsharpMaskImage' => ['bool', 'radius'=>'float', 'sigma'=>'float', 'amount'=>'float', 'threshold'=>'float', 'channel='=>'int'],
'Imagick::valid' => ['bool'],
'Imagick::vignetteImage' => ['bool', 'blackpoint'=>'float', 'whitepoint'=>'float', 'x'=>'int', 'y'=>'int'],
'Imagick::waveImage' => ['bool', 'amplitude'=>'float', 'length'=>'float'],
'Imagick::whiteThresholdImage' => ['bool', 'threshold'=>'mixed'],
'Imagick::writeImage' => ['bool', 'filename='=>'string'],
'Imagick::writeImageFile' => ['bool', 'filehandle'=>'resource'],
'Imagick::writeImages' => ['bool', 'filename'=>'string', 'adjoin'=>'bool'],
'Imagick::writeImagesFile' => ['bool', 'filehandle'=>'resource'],
'ImagickDraw::__construct' => ['void'],
'ImagickDraw::affine' => ['bool', 'affine'=>'array<string, float>'],
'ImagickDraw::annotation' => ['bool', 'x'=>'float', 'y'=>'float', 'text'=>'string'],
'ImagickDraw::arc' => ['bool', 'sx'=>'float', 'sy'=>'float', 'ex'=>'float', 'ey'=>'float', 'sd'=>'float', 'ed'=>'float'],
'ImagickDraw::bezier' => ['bool', 'coordinates'=>'list<array{x:float, y:float}>'],
'ImagickDraw::circle' => ['bool', 'ox'=>'float', 'oy'=>'float', 'px'=>'float', 'py'=>'float'],
'ImagickDraw::clear' => ['bool'],
'ImagickDraw::clone' => ['ImagickDraw'],
'ImagickDraw::color' => ['bool', 'x'=>'float', 'y'=>'float', 'paintmethod'=>'int'],
'ImagickDraw::comment' => ['bool', 'comment'=>'string'],
'ImagickDraw::composite' => ['bool', 'compose'=>'int', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float', 'compositewand'=>'Imagick'],
'ImagickDraw::destroy' => ['bool'],
'ImagickDraw::ellipse' => ['bool', 'ox'=>'float', 'oy'=>'float', 'rx'=>'float', 'ry'=>'float', 'start'=>'float', 'end'=>'float'],
'ImagickDraw::getBorderColor' => ['ImagickPixel'],
'ImagickDraw::getClipPath' => ['string|false'],
'ImagickDraw::getClipRule' => ['int'],
'ImagickDraw::getClipUnits' => ['int'],
'ImagickDraw::getDensity' => ['?string'],
'ImagickDraw::getFillColor' => ['ImagickPixel'],
'ImagickDraw::getFillOpacity' => ['float'],
'ImagickDraw::getFillRule' => ['int'],
'ImagickDraw::getFont' => ['string|false'],
'ImagickDraw::getFontFamily' => ['string|false'],
'ImagickDraw::getFontResolution' => ['array'],
'ImagickDraw::getFontSize' => ['float'],
'ImagickDraw::getFontStretch' => ['int'],
'ImagickDraw::getFontStyle' => ['int'],
'ImagickDraw::getFontWeight' => ['int'],
'ImagickDraw::getGravity' => ['int'],
'ImagickDraw::getOpacity' => ['float'],
'ImagickDraw::getStrokeAntialias' => ['bool'],
'ImagickDraw::getStrokeColor' => ['ImagickPixel'],
'ImagickDraw::getStrokeDashArray' => ['array'],
'ImagickDraw::getStrokeDashOffset' => ['float'],
'ImagickDraw::getStrokeLineCap' => ['int'],
'ImagickDraw::getStrokeLineJoin' => ['int'],
'ImagickDraw::getStrokeMiterLimit' => ['int'],
'ImagickDraw::getStrokeOpacity' => ['float'],
'ImagickDraw::getStrokeWidth' => ['float'],
'ImagickDraw::getTextAlignment' => ['int'],
'ImagickDraw::getTextAntialias' => ['bool'],
'ImagickDraw::getTextDecoration' => ['int'],
'ImagickDraw::getTextDirection' => ['bool'],
'ImagickDraw::getTextEncoding' => ['string'],
'ImagickDraw::getTextInterlineSpacing' => ['float'],
'ImagickDraw::getTextInterwordSpacing' => ['float'],
'ImagickDraw::getTextKerning' => ['float'],
'ImagickDraw::getTextUnderColor' => ['ImagickPixel'],
'ImagickDraw::getVectorGraphics' => ['string'],
'ImagickDraw::line' => ['bool', 'sx'=>'float', 'sy'=>'float', 'ex'=>'float', 'ey'=>'float'],
'ImagickDraw::matte' => ['bool', 'x'=>'float', 'y'=>'float', 'paintmethod'=>'int'],
'ImagickDraw::pathClose' => ['bool'],
'ImagickDraw::pathCurveToAbsolute' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathCurveToQuadraticBezierAbsolute' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathCurveToQuadraticBezierRelative' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathCurveToQuadraticBezierSmoothAbsolute' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathCurveToQuadraticBezierSmoothRelative' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathCurveToRelative' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathCurveToSmoothAbsolute' => ['bool', 'x2'=>'float', 'y2'=>'float', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathCurveToSmoothRelative' => ['bool', 'x2'=>'float', 'y2'=>'float', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathEllipticArcAbsolute' => ['bool', 'rx'=>'float', 'ry'=>'float', 'x_axis_rotation'=>'float', 'large_arc_flag'=>'bool', 'sweep_flag'=>'bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathEllipticArcRelative' => ['bool', 'rx'=>'float', 'ry'=>'float', 'x_axis_rotation'=>'float', 'large_arc_flag'=>'bool', 'sweep_flag'=>'bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathFinish' => ['bool'],
'ImagickDraw::pathLineToAbsolute' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathLineToHorizontalAbsolute' => ['bool', 'x'=>'float'],
'ImagickDraw::pathLineToHorizontalRelative' => ['bool', 'x'=>'float'],
'ImagickDraw::pathLineToRelative' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathLineToVerticalAbsolute' => ['bool', 'y'=>'float'],
'ImagickDraw::pathLineToVerticalRelative' => ['bool', 'y'=>'float'],
'ImagickDraw::pathMoveToAbsolute' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathMoveToRelative' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::pathStart' => ['bool'],
'ImagickDraw::point' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::polygon' => ['bool', 'coordinates'=>'list<array{x:float, y:float}>'],
'ImagickDraw::polyline' => ['bool', 'coordinates'=>'list<array{x:float, y:float}>'],
'ImagickDraw::pop' => ['bool'],
'ImagickDraw::popClipPath' => ['bool'],
'ImagickDraw::popDefs' => ['bool'],
'ImagickDraw::popPattern' => ['bool'],
'ImagickDraw::push' => ['bool'],
'ImagickDraw::pushClipPath' => ['bool', 'clip_mask_id'=>'string'],
'ImagickDraw::pushDefs' => ['bool'],
'ImagickDraw::pushPattern' => ['bool', 'pattern_id'=>'string', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'],
'ImagickDraw::rectangle' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float'],
'ImagickDraw::render' => ['bool'],
'ImagickDraw::resetVectorGraphics' => ['void'],
'ImagickDraw::rotate' => ['bool', 'degrees'=>'float'],
'ImagickDraw::roundRectangle' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'rx'=>'float', 'ry'=>'float'],
'ImagickDraw::scale' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::setBorderColor' => ['bool', 'color'=>'ImagickPixel|string'],
'ImagickDraw::setClipPath' => ['bool', 'clip_mask'=>'string'],
'ImagickDraw::setClipRule' => ['bool', 'fill_rule'=>'int'],
'ImagickDraw::setClipUnits' => ['bool', 'clip_units'=>'int'],
'ImagickDraw::setDensity' => ['bool', 'density_string'=>'string'],
'ImagickDraw::setFillAlpha' => ['bool', 'opacity'=>'float'],
'ImagickDraw::setFillColor' => ['bool', 'fill_pixel'=>'ImagickPixel|string'],
'ImagickDraw::setFillOpacity' => ['bool', 'fillopacity'=>'float'],
'ImagickDraw::setFillPatternURL' => ['bool', 'fill_url'=>'string'],
'ImagickDraw::setFillRule' => ['bool', 'fill_rule'=>'int'],
'ImagickDraw::setFont' => ['bool', 'font_name'=>'string'],
'ImagickDraw::setFontFamily' => ['bool', 'font_family'=>'string'],
'ImagickDraw::setFontResolution' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickDraw::setFontSize' => ['bool', 'pointsize'=>'float'],
'ImagickDraw::setFontStretch' => ['bool', 'fontstretch'=>'int'],
'ImagickDraw::setFontStyle' => ['bool', 'style'=>'int'],
'ImagickDraw::setFontWeight' => ['bool', 'font_weight'=>'int'],
'ImagickDraw::setGravity' => ['bool', 'gravity'=>'int'],
'ImagickDraw::setOpacity' => ['void', 'opacity'=>'float'],
'ImagickDraw::setResolution' => ['void', 'x_resolution'=>'float', 'y_resolution'=>'float'],
'ImagickDraw::setStrokeAlpha' => ['bool', 'opacity'=>'float'],
'ImagickDraw::setStrokeAntialias' => ['bool', 'stroke_antialias'=>'bool'],
'ImagickDraw::setStrokeColor' => ['bool', 'stroke_pixel'=>'ImagickPixel|string'],
'ImagickDraw::setStrokeDashArray' => ['bool', 'dasharray'=>'list<int|float>'],
'ImagickDraw::setStrokeDashOffset' => ['bool', 'dash_offset'=>'float'],
'ImagickDraw::setStrokeLineCap' => ['bool', 'linecap'=>'int'],
'ImagickDraw::setStrokeLineJoin' => ['bool', 'linejoin'=>'int'],
'ImagickDraw::setStrokeMiterLimit' => ['bool', 'miterlimit'=>'int'],
'ImagickDraw::setStrokeOpacity' => ['bool', 'stroke_opacity'=>'float'],
'ImagickDraw::setStrokePatternURL' => ['bool', 'stroke_url'=>'string'],
'ImagickDraw::setStrokeWidth' => ['bool', 'stroke_width'=>'float'],
'ImagickDraw::setTextAlignment' => ['bool', 'alignment'=>'int'],
'ImagickDraw::setTextAntialias' => ['bool', 'antialias'=>'bool'],
'ImagickDraw::setTextDecoration' => ['bool', 'decoration'=>'int'],
'ImagickDraw::setTextDirection' => ['bool', 'direction'=>'int'],
'ImagickDraw::setTextEncoding' => ['bool', 'encoding'=>'string'],
'ImagickDraw::setTextInterlineSpacing' => ['void', 'spacing'=>'float'],
'ImagickDraw::setTextInterwordSpacing' => ['void', 'spacing'=>'float'],
'ImagickDraw::setTextKerning' => ['void', 'kerning'=>'float'],
'ImagickDraw::setTextUnderColor' => ['bool', 'under_color'=>'ImagickPixel|string'],
'ImagickDraw::setVectorGraphics' => ['bool', 'xml'=>'string'],
'ImagickDraw::setViewbox' => ['bool', 'x1'=>'int', 'y1'=>'int', 'x2'=>'int', 'y2'=>'int'],
'ImagickDraw::skewX' => ['bool', 'degrees'=>'float'],
'ImagickDraw::skewY' => ['bool', 'degrees'=>'float'],
'ImagickDraw::translate' => ['bool', 'x'=>'float', 'y'=>'float'],
'ImagickKernel::addKernel' => ['void', 'ImagickKernel'=>'ImagickKernel'],
'ImagickKernel::addUnityKernel' => ['void'],
'ImagickKernel::fromBuiltin' => ['ImagickKernel', 'kernelType'=>'string', 'kernelString'=>'string'],
'ImagickKernel::fromMatrix' => ['ImagickKernel', 'matrix'=>'list<list<float>>', 'origin='=>'array'],
'ImagickKernel::getMatrix' => ['list<list<float|false>>'],
'ImagickKernel::scale' => ['void'],
'ImagickKernel::separate' => ['ImagickKernel[]'],
'ImagickKernel::seperate' => ['void'],
'ImagickPixel::__construct' => ['void', 'color='=>'string'],
'ImagickPixel::clear' => ['bool'],
'ImagickPixel::clone' => ['void'],
'ImagickPixel::destroy' => ['bool'],
'ImagickPixel::getColor' => ['array{r: int|float, g: int|float, b: int|float, a: int|float}', 'normalized='=>'0|1|2'],
'ImagickPixel::getColorAsString' => ['string'],
'ImagickPixel::getColorCount' => ['int'],
'ImagickPixel::getColorQuantum' => ['mixed'],
'ImagickPixel::getColorValue' => ['float', 'color'=>'int'],
'ImagickPixel::getColorValueQuantum' => ['mixed'],
'ImagickPixel::getHSL' => ['array{hue: float, saturation: float, luminosity: float}'],
'ImagickPixel::getIndex' => ['int'],
'ImagickPixel::isPixelSimilar' => ['bool', 'color'=>'ImagickPixel', 'fuzz'=>'float'],
'ImagickPixel::isPixelSimilarQuantum' => ['bool', 'color'=>'string', 'fuzz='=>'string'],
'ImagickPixel::isSimilar' => ['bool', 'color'=>'ImagickPixel', 'fuzz'=>'float'],
'ImagickPixel::setColor' => ['bool', 'color'=>'string'],
'ImagickPixel::setcolorcount' => ['void', 'colorCount'=>'string'],
'ImagickPixel::setColorFromPixel' => ['bool', 'srcPixel'=>'ImagickPixel'],
'ImagickPixel::setColorValue' => ['bool', 'color'=>'int', 'value'=>'float'],
'ImagickPixel::setColorValueQuantum' => ['void', 'color'=>'int', 'value'=>'mixed'],
'ImagickPixel::setHSL' => ['bool', 'hue'=>'float', 'saturation'=>'float', 'luminosity'=>'float'],
'ImagickPixel::setIndex' => ['void', 'index'=>'int'],
'ImagickPixelIterator::__construct' => ['void', 'wand'=>'Imagick'],
'ImagickPixelIterator::clear' => ['bool'],
'ImagickPixelIterator::current' => ['mixed'],
'ImagickPixelIterator::destroy' => ['bool'],
'ImagickPixelIterator::getCurrentIteratorRow' => ['array'],
'ImagickPixelIterator::getIteratorRow' => ['int'],
'ImagickPixelIterator::getNextIteratorRow' => ['array'],
'ImagickPixelIterator::getpixeliterator' => ['', 'Imagick'=>'Imagick'],
'ImagickPixelIterator::getpixelregioniterator' => ['', 'Imagick'=>'Imagick', 'x'=>'', 'y'=>'', 'columns'=>'', 'rows'=>''],
'ImagickPixelIterator::getPreviousIteratorRow' => ['array'],
'ImagickPixelIterator::key' => ['int|string'],
'ImagickPixelIterator::newPixelIterator' => ['bool', 'wand'=>'Imagick'],
'ImagickPixelIterator::newPixelRegionIterator' => ['bool', 'wand'=>'Imagick', 'x'=>'int', 'y'=>'int', 'columns'=>'int', 'rows'=>'int'],
'ImagickPixelIterator::next' => ['void'],
'ImagickPixelIterator::resetIterator' => ['bool'],
'ImagickPixelIterator::rewind' => ['void'],
'ImagickPixelIterator::setIteratorFirstRow' => ['bool'],
'ImagickPixelIterator::setIteratorLastRow' => ['bool'],
'ImagickPixelIterator::setIteratorRow' => ['bool', 'row'=>'int'],
'ImagickPixelIterator::syncIterator' => ['bool'],
'ImagickPixelIterator::valid' => ['bool'],
'imap_8bit' => ['string|false', 'string'=>'string'],
'imap_alerts' => ['array|false'],
'imap_append' => ['bool', 'imap'=>'IMAP\Connection', 'folder'=>'string', 'message'=>'string', 'options='=>'string', 'internal_date='=>'string'],
'imap_base64' => ['string|false', 'string'=>'string'],
'imap_binary' => ['string|false', 'string'=>'string'],
'imap_body' => ['string|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'flags='=>'int'],
'imap_bodystruct' => ['stdClass|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'section'=>'string'],
'imap_check' => ['stdClass|false', 'imap'=>'IMAP\Connection'],
'imap_clearflag_full' => ['bool', 'imap'=>'IMAP\Connection', 'sequence'=>'string', 'flag'=>'string', 'options='=>'int'],
'imap_close' => ['bool', 'imap'=>'IMAP\Connection', 'flags='=>'int'],
'imap_create' => ['bool', 'imap'=>'IMAP\Connection', 'mailbox'=>'string'],
'imap_createmailbox' => ['bool', 'imap'=>'IMAP\Connection', 'mailbox'=>'string'],
'imap_delete' => ['bool', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'flags='=>'int'],
'imap_deletemailbox' => ['bool', 'imap'=>'IMAP\Connection', 'mailbox'=>'string'],
'imap_errors' => ['array|false'],
'imap_expunge' => ['bool', 'imap'=>'IMAP\Connection'],
'imap_fetch_overview' => ['array|false', 'imap'=>'IMAP\Connection', 'sequence'=>'string', 'flags='=>'int'],
'imap_fetchbody' => ['string|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'section'=>'string', 'flags='=>'int'],
'imap_fetchheader' => ['string|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'flags='=>'int'],
'imap_fetchmime' => ['string|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'section'=>'string', 'flags='=>'int'],
'imap_fetchstructure' => ['stdClass|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'flags='=>'int'],
'imap_fetchtext' => ['string|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'flags='=>'int'],
'imap_gc' => ['bool', 'imap'=>'IMAP\Connection', 'flags'=>'int'],
'imap_get_quota' => ['array|false', 'imap'=>'IMAP\Connection', 'quota_root'=>'string'],
'imap_get_quotaroot' => ['array|false', 'imap'=>'IMAP\Connection', 'mailbox'=>'string'],
'imap_getacl' => ['array|false', 'imap'=>'IMAP\Connection', 'mailbox'=>'string'],
'imap_getmailboxes' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string'],
'imap_getsubscribed' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string'],
'imap_header' => ['stdClass|false', 'stream_id'=>'resource', 'msg_no'=>'int', 'from_length='=>'int', 'subject_length='=>'int', 'default_host='=>'string'],
'imap_headerinfo' => ['stdClass|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'from_length='=>'int', 'subject_length='=>'int', 'default_host='=>'string|null'],
'imap_headers' => ['array|false', 'imap'=>'IMAP\Connection'],
'imap_last_error' => ['string|false'],
'imap_list' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string'],
'imap_listmailbox' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string'],
'imap_listscan' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string', 'content'=>'string'],
'imap_listsubscribed' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string'],
'imap_lsub' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string'],
'imap_mail' => ['bool', 'to'=>'string', 'subject'=>'string', 'message'=>'string', 'additional_headers='=>'string', 'cc='=>'string', 'bcc='=>'string', 'return_path='=>'string'],
'imap_mail_compose' => ['string|false', 'envelope'=>'array', 'bodies'=>'array'],
'imap_mail_copy' => ['bool', 'imap'=>'IMAP\Connection', 'message_nums'=>'string', 'mailbox'=>'string', 'flags='=>'int'],
'imap_mail_move' => ['bool', 'imap'=>'IMAP\Connection', 'message_nums'=>'string', 'mailbox'=>'string', 'flags='=>'int'],
'imap_mailboxmsginfo' => ['stdClass|false', 'imap'=>'IMAP\Connection'],
'imap_mime_header_decode' => ['array|false', 'string'=>'string'],
'imap_msgno' => ['int|false', 'imap'=>'IMAP\Connection', 'message_uid'=>'int'],
'imap_mutf7_to_utf8' => ['string|false', 'string'=>'string'],
'imap_num_msg' => ['int|false', 'imap'=>'IMAP\Connection'],
'imap_num_recent' => ['int|false', 'imap'=>'IMAP\Connection'],
'imap_open' => ['IMAP\Connection|false', 'mailbox'=>'string', 'user'=>'string', 'password'=>'string', 'flags='=>'int', 'retries='=>'int', 'options='=>'?array'],
'imap_ping' => ['bool', 'imap'=>'IMAP\Connection'],
'imap_qprint' => ['string|false', 'string'=>'string'],
'imap_rename' => ['bool', 'imap'=>'IMAP\Connection', 'from'=>'string', 'to'=>'string'],
'imap_renamemailbox' => ['bool', 'imap'=>'IMAP\Connection', 'from'=>'string', 'to'=>'string'],
'imap_reopen' => ['bool', 'imap'=>'IMAP\Connection', 'mailbox'=>'string', 'flags='=>'int', 'retries='=>'int'],
'imap_rfc822_parse_adrlist' => ['array', 'string'=>'string', 'default_hostname'=>'string'],
'imap_rfc822_parse_headers' => ['stdClass', 'headers'=>'string', 'default_hostname='=>'string'],
'imap_rfc822_write_address' => ['string|false', 'mailbox'=>'?string', 'hostname'=>'?string', 'personal'=>'?string'],
'imap_savebody' => ['bool', 'imap'=>'IMAP\Connection', 'file'=>'string|resource', 'message_num'=>'int', 'section='=>'string', 'flags='=>'int'],
'imap_scan' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string', 'content'=>'string'],
'imap_scanmailbox' => ['array|false', 'imap'=>'IMAP\Connection', 'reference'=>'string', 'pattern'=>'string', 'content'=>'string'],
'imap_search' => ['array|false', 'imap'=>'IMAP\Connection', 'criteria'=>'string', 'flags='=>'int', 'charset='=>'string'],
'imap_set_quota' => ['bool', 'imap'=>'IMAP\Connection', 'quota_root'=>'string', 'mailbox_size'=>'int'],
'imap_setacl' => ['bool', 'imap'=>'IMAP\Connection', 'mailbox'=>'string', 'user_id'=>'string', 'rights'=>'string'],
'imap_setflag_full' => ['bool', 'imap'=>'IMAP\Connection', 'sequence'=>'string', 'flag'=>'string', 'options='=>'int'],
'imap_sort' => ['array|false', 'imap'=>'IMAP\Connection', 'criteria'=>'int', 'reverse'=>'int', 'flags='=>'int', 'search_criteria='=>'string', 'charset='=>'string'],
'imap_status' => ['stdClass|false', 'imap'=>'IMAP\Connection', 'mailbox'=>'string', 'flags'=>'int'],
'imap_subscribe' => ['bool', 'imap'=>'IMAP\Connection', 'mailbox'=>'string'],
'imap_thread' => ['array|false', 'imap'=>'IMAP\Connection', 'flags='=>'int'],
'imap_timeout' => ['int|bool', 'timeout_type'=>'int', 'timeout='=>'int'],
'imap_uid' => ['int|false', 'imap'=>'IMAP\Connection', 'message_num'=>'int'],
'imap_undelete' => ['bool', 'imap'=>'IMAP\Connection', 'message_num'=>'int', 'flags='=>'int'],
'imap_unsubscribe' => ['bool', 'imap'=>'IMAP\Connection', 'mailbox'=>'string'],
'imap_utf7_decode' => ['string|false', 'string'=>'string'],
'imap_utf7_encode' => ['string', 'string'=>'string'],
'imap_utf8' => ['string', 'mime_encoded_text'=>'string'],
'imap_utf8_to_mutf7' => ['string|false', 'string'=>'string'],
'implode' => ['string', 'separator'=>'string', 'array'=>'array'],
'implode\'1' => ['string', 'separator'=>'array'],
'import_request_variables' => ['bool', 'types'=>'string', 'prefix='=>'string'],
'in_array' => ['bool', 'needle'=>'mixed', 'haystack'=>'array', 'strict='=>'bool'],
'inclued_get_data' => ['array'],
'inet_ntop' => ['string|false', 'ip'=>'string'],
'inet_pton' => ['string|false', 'ip'=>'string'],
'InfiniteIterator::__construct' => ['void', 'iterator'=>'Iterator'],
'InfiniteIterator::current' => ['mixed'],
'InfiniteIterator::getInnerIterator' => ['Iterator'],
'InfiniteIterator::key' => ['bool|float|int|string'],
'InfiniteIterator::next' => ['void'],
'InfiniteIterator::rewind' => ['void'],
'InfiniteIterator::valid' => ['bool'],
'inflate_add' => ['string|false', 'context'=>'resource', 'data'=>'string', 'flush_mode='=>'int'],
'inflate_get_read_len' => ['int|false', 'context'=>'resource'],
'inflate_get_status' => ['int|false', 'context'=>'resource'],
'inflate_init' => ['resource|false', 'encoding'=>'int', 'options='=>'array'],
'ingres_autocommit' => ['bool', 'link'=>'resource'],
'ingres_autocommit_state' => ['bool', 'link'=>'resource'],
'ingres_charset' => ['string', 'link'=>'resource'],
'ingres_close' => ['bool', 'link'=>'resource'],
'ingres_commit' => ['bool', 'link'=>'resource'],
'ingres_connect' => ['resource', 'database='=>'string', 'username='=>'string', 'password='=>'string', 'options='=>'array'],
'ingres_cursor' => ['string', 'result'=>'resource'],
'ingres_errno' => ['int', 'link='=>'resource'],
'ingres_error' => ['string', 'link='=>'resource'],
'ingres_errsqlstate' => ['string', 'link='=>'resource'],
'ingres_escape_string' => ['string', 'link'=>'resource', 'source_string'=>'string'],
'ingres_execute' => ['bool', 'result'=>'resource', 'params='=>'array', 'types='=>'string'],
'ingres_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'],
'ingres_fetch_assoc' => ['array', 'result'=>'resource'],
'ingres_fetch_object' => ['object', 'result'=>'resource', 'result_type='=>'int'],
'ingres_fetch_proc_return' => ['int', 'result'=>'resource'],
'ingres_fetch_row' => ['array', 'result'=>'resource'],
'ingres_field_length' => ['int', 'result'=>'resource', 'index'=>'int'],
'ingres_field_name' => ['string', 'result'=>'resource', 'index'=>'int'],
'ingres_field_nullable' => ['bool', 'result'=>'resource', 'index'=>'int'],
'ingres_field_precision' => ['int', 'result'=>'resource', 'index'=>'int'],
'ingres_field_scale' => ['int', 'result'=>'resource', 'index'=>'int'],
'ingres_field_type' => ['string', 'result'=>'resource', 'index'=>'int'],
'ingres_free_result' => ['bool', 'result'=>'resource'],
'ingres_next_error' => ['bool', 'link='=>'resource'],
'ingres_num_fields' => ['int', 'result'=>'resource'],
'ingres_num_rows' => ['int', 'result'=>'resource'],
'ingres_pconnect' => ['resource', 'database='=>'string', 'username='=>'string', 'password='=>'string', 'options='=>'array'],
'ingres_prepare' => ['mixed', 'link'=>'resource', 'query'=>'string'],
'ingres_query' => ['mixed', 'link'=>'resource', 'query'=>'string', 'params='=>'array', 'types='=>'string'],
'ingres_result_seek' => ['bool', 'result'=>'resource', 'position'=>'int'],
'ingres_rollback' => ['bool', 'link'=>'resource'],
'ingres_set_environment' => ['bool', 'link'=>'resource', 'options'=>'array'],
'ingres_unbuffered_query' => ['mixed', 'link'=>'resource', 'query'=>'string', 'params='=>'array', 'types='=>'string'],
'ini_alter' => ['string|false', 'option'=>'string', 'value'=>'string'],
'ini_get' => ['string|false', 'option'=>'string'],
'ini_get_all' => ['array|false', 'extension='=>'?string', 'details='=>'bool'],
'ini_restore' => ['void', 'option'=>'string'],
'ini_set' => ['string|false', 'option'=>'string', 'value'=>'string'],
'inotify_add_watch' => ['int', 'inotify_instance'=>'resource', 'pathname'=>'string', 'mask'=>'int'],
'inotify_init' => ['resource|false'],
'inotify_queue_len' => ['int', 'inotify_instance'=>'resource'],
'inotify_read' => ['array|false', 'inotify_instance'=>'resource'],
'inotify_rm_watch' => ['bool', 'inotify_instance'=>'resource', 'watch_descriptor'=>'int'],
'intdiv' => ['int', 'num1'=>'int', 'num2'=>'int'],
'interface_exists' => ['bool', 'interface'=>'string', 'autoload='=>'bool'],
'intl_error_name' => ['string', 'errorCode'=>'int'],
'intl_get_error_code' => ['int'],
'intl_get_error_message' => ['string'],
'intl_is_failure' => ['bool', 'errorCode'=>'int'],
'IntlBreakIterator::__construct' => ['void'],
'IntlBreakIterator::createCharacterInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlBreakIterator::createCodePointInstance' => ['IntlCodePointBreakIterator'],
'IntlBreakIterator::createLineInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlBreakIterator::createSentenceInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlBreakIterator::createTitleInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlBreakIterator::createWordInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlBreakIterator::current' => ['int'],
'IntlBreakIterator::first' => ['int'],
'IntlBreakIterator::following' => ['int', 'offset'=>'int'],
'IntlBreakIterator::getErrorCode' => ['int'],
'IntlBreakIterator::getErrorMessage' => ['string'],
'IntlBreakIterator::getLocale' => ['string', 'locale_type'=>'string'],
'IntlBreakIterator::getPartsIterator' => ['IntlPartsIterator', 'key_type='=>'int'],
'IntlBreakIterator::getText' => ['string'],
'IntlBreakIterator::isBoundary' => ['bool', 'offset'=>'int'],
'IntlBreakIterator::last' => ['int'],
'IntlBreakIterator::next' => ['int', 'offset='=>'int'],
'IntlBreakIterator::preceding' => ['int', 'offset'=>'int'],
'IntlBreakIterator::previous' => ['int'],
'IntlBreakIterator::setText' => ['bool', 'text'=>'string'],
'intlcal_add' => ['bool', 'calendar'=>'IntlCalendar', 'field'=>'int', 'value'=>'int'],
'intlcal_after' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
'intlcal_before' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
'intlcal_clear' => ['bool', 'calendar'=>'IntlCalendar', 'field='=>'int'],
'intlcal_create_instance' => ['IntlCalendar', 'timezone='=>'mixed', 'locale='=>'string'],
'intlcal_equals' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
'intlcal_field_difference' => ['int', 'calendar'=>'IntlCalendar', 'timestamp'=>'float', 'field'=>'int'],
'intlcal_from_date_time' => ['IntlCalendar', 'datetime'=>'DateTime|string'],
'intlcal_get' => ['mixed', 'calendar'=>'IntlCalendar', 'field'=>'int'],
'intlcal_get_actual_maximum' => ['int', 'calendar'=>'IntlCalendar', 'field'=>'int'],
'intlcal_get_actual_minimum' => ['int', 'calendar'=>'IntlCalendar', 'field'=>'int'],
'intlcal_get_available_locales' => ['array'],
'intlcal_get_day_of_week_type' => ['int', 'calendar'=>'IntlCalendar', 'dayOfWeek'=>'int'],
'intlcal_get_first_day_of_week' => ['int', 'calendar'=>'IntlCalendar'],
'intlcal_get_greatest_minimum' => ['int', 'calendar'=>'IntlCalendar', 'field'=>'int'],
'intlcal_get_keyword_values_for_locale' => ['Iterator|false', 'keyword'=>'string', 'locale'=>'string', 'onlyCommon'=>'bool'],
'intlcal_get_least_maximum' => ['int', 'calendar'=>'IntlCalendar', 'field'=>'int'],
'intlcal_get_locale' => ['string', 'calendar'=>'IntlCalendar', 'type'=>'int'],
'intlcal_get_maximum' => ['int|false', 'calendar'=>'IntlCalendar', 'field'=>'int'],
'intlcal_get_minimal_days_in_first_week' => ['int', 'calendar'=>'IntlCalendar'],
'intlcal_get_minimum' => ['int', 'calendar'=>'IntlCalendar', 'field'=>'int'],
'intlcal_get_now' => ['float'],
'intlcal_get_repeated_wall_time_option' => ['int', 'calendar'=>'IntlCalendar'],
'intlcal_get_skipped_wall_time_option' => ['int', 'calendar'=>'IntlCalendar'],
'intlcal_get_time' => ['float', 'calendar'=>'IntlCalendar'],
'intlcal_get_time_zone' => ['IntlTimeZone', 'calendar'=>'IntlCalendar'],
'intlcal_get_type' => ['string', 'calendar'=>'IntlCalendar'],
'intlcal_get_weekend_transition' => ['int', 'calendar'=>'IntlCalendar', 'dayOfWeek'=>'string'],
'intlcal_in_daylight_time' => ['bool', 'calendar'=>'IntlCalendar'],
'intlcal_is_equivalent_to' => ['bool', 'calendar'=>'IntlCalendar', 'other'=>'IntlCalendar'],
'intlcal_is_lenient' => ['bool', 'calendar'=>'IntlCalendar'],
'intlcal_is_set' => ['bool', 'calendar'=>'IntlCalendar', 'field'=>'int'],
'intlcal_is_weekend' => ['bool', 'calendar'=>'IntlCalendar', 'timestamp='=>'float'],
'intlcal_roll' => ['bool', 'calendar'=>'IntlCalendar', 'field'=>'int', 'value'=>'mixed'],
'intlcal_set' => ['bool', 'calendar'=>'IntlCalendar', 'year'=>'int', 'month'=>'int'],
'intlcal_set\'1' => ['bool', 'calendar'=>'IntlCalendar', 'year'=>'int', 'month'=>'int', 'dayOfMonth='=>'int', 'hour='=>'int', 'minute='=>'int', 'second='=>'int'],
'intlcal_set_first_day_of_week' => ['bool', 'calendar'=>'IntlCalendar', 'dayOfWeek'=>'int'],
'intlcal_set_lenient' => ['bool', 'calendar'=>'IntlCalendar', 'lenient'=>'bool'],
'intlcal_set_repeated_wall_time_option' => ['bool', 'calendar'=>'IntlCalendar', 'option'=>'int'],
'intlcal_set_skipped_wall_time_option' => ['bool', 'calendar'=>'IntlCalendar', 'option'=>'int'],
'intlcal_set_time' => ['bool', 'calendar'=>'IntlCalendar', 'timestamp'=>'float'],
'intlcal_set_time_zone' => ['bool', 'calendar'=>'IntlCalendar', 'timezone'=>'mixed'],
'intlcal_to_date_time' => ['DateTime|false', 'calendar'=>'IntlCalendar'],
'IntlCalendar::__construct' => ['void'],
'IntlCalendar::add' => ['bool', 'field'=>'int', 'amount'=>'int'],
'IntlCalendar::after' => ['bool', 'other'=>'IntlCalendar'],
'IntlCalendar::before' => ['bool', 'other'=>'IntlCalendar'],
'IntlCalendar::clear' => ['bool', 'field='=>'int'],
'IntlCalendar::createInstance' => ['IntlCalendar', 'timeZone='=>'mixed', 'locale='=>'string'],
'IntlCalendar::equals' => ['bool', 'other'=>'IntlCalendar'],
'IntlCalendar::fieldDifference' => ['int', 'when'=>'float', 'field'=>'int'],
'IntlCalendar::fromDateTime' => ['IntlCalendar', 'dateTime'=>'DateTime|string'],
'IntlCalendar::get' => ['int', 'field'=>'int'],
'IntlCalendar::getActualMaximum' => ['int', 'field'=>'int'],
'IntlCalendar::getActualMinimum' => ['int', 'field'=>'int'],
'IntlCalendar::getAvailableLocales' => ['array'],
'IntlCalendar::getDayOfWeekType' => ['int', 'dayOfWeek'=>'int'],
'IntlCalendar::getErrorCode' => ['int'],
'IntlCalendar::getErrorMessage' => ['string'],
'IntlCalendar::getFirstDayOfWeek' => ['int'],
'IntlCalendar::getGreatestMinimum' => ['int', 'field'=>'int'],
'IntlCalendar::getKeywordValuesForLocale' => ['Iterator|false', 'key'=>'string', 'locale'=>'string', 'commonlyUsed'=>'bool'],
'IntlCalendar::getLeastMaximum' => ['int', 'field'=>'int'],
'IntlCalendar::getLocale' => ['string', 'localeType'=>'int'],
'IntlCalendar::getMaximum' => ['int|false', 'field'=>'int'],
'IntlCalendar::getMinimalDaysInFirstWeek' => ['int'],
'IntlCalendar::getMinimum' => ['int', 'field'=>'int'],
'IntlCalendar::getNow' => ['float'],
'IntlCalendar::getRepeatedWallTimeOption' => ['int'],
'IntlCalendar::getSkippedWallTimeOption' => ['int'],
'IntlCalendar::getTime' => ['float'],
'IntlCalendar::getTimeZone' => ['IntlTimeZone'],
'IntlCalendar::getType' => ['string'],
'IntlCalendar::getWeekendTransition' => ['int', 'dayOfWeek'=>'string'],
'IntlCalendar::inDaylightTime' => ['bool'],
'IntlCalendar::isEquivalentTo' => ['bool', 'other'=>'IntlCalendar'],
'IntlCalendar::isLenient' => ['bool'],
'IntlCalendar::isSet' => ['bool', 'field'=>'int'],
'IntlCalendar::isWeekend' => ['bool', 'date='=>'float'],
'IntlCalendar::roll' => ['bool', 'field'=>'int', 'amountOrUpOrDown'=>'mixed'],
'IntlCalendar::set' => ['bool', 'field'=>'int', 'value'=>'int'],
'IntlCalendar::set\'1' => ['bool', 'year'=>'int', 'month'=>'int', 'dayOfMonth='=>'int', 'hour='=>'int', 'minute='=>'int', 'second='=>'int'],
'IntlCalendar::setFirstDayOfWeek' => ['bool', 'dayOfWeek'=>'int'],
'IntlCalendar::setLenient' => ['bool', 'isLenient'=>'string'],
'IntlCalendar::setMinimalDaysInFirstWeek' => ['bool', 'minimalDays'=>'int'],
'IntlCalendar::setRepeatedWallTimeOption' => ['bool', 'wallTimeOption'=>'int'],
'IntlCalendar::setSkippedWallTimeOption' => ['bool', 'wallTimeOption'=>'int'],
'IntlCalendar::setTime' => ['bool', 'date'=>'float'],
'IntlCalendar::setTimeZone' => ['bool', 'timeZone'=>'mixed'],
'IntlCalendar::toDateTime' => ['DateTime|false'],
'IntlChar::charAge' => ['array', 'char'=>'int|string'],
'IntlChar::charDigitValue' => ['int', 'codepoint'=>'mixed'],
'IntlChar::charDirection' => ['int', 'codepoint'=>'mixed'],
'IntlChar::charFromName' => ['?int', 'name'=>'string', 'namechoice='=>'int'],
'IntlChar::charMirror' => ['mixed', 'codepoint'=>'mixed'],
'IntlChar::charName' => ['string', 'char'=>'int|string', 'namechoice='=>'int'],
'IntlChar::charType' => ['int', 'codepoint'=>'mixed'],
'IntlChar::chr' => ['string', 'codepoint'=>'mixed'],
'IntlChar::digit' => ['int|false', 'char'=>'int|string', 'radix='=>'int'],
'IntlChar::enumCharNames' => ['void', 'start'=>'mixed', 'limit'=>'mixed', 'callback'=>'callable', 'nameChoice='=>'int'],
'IntlChar::enumCharTypes' => ['void', 'cb='=>'callable'],
'IntlChar::foldCase' => ['int|string', 'char'=>'int|string', 'options='=>'int'],
'IntlChar::forDigit' => ['int', 'digit'=>'int', 'radix'=>'int'],
'IntlChar::getBidiPairedBracket' => ['mixed', 'codepoint'=>'mixed'],
'IntlChar::getBlockCode' => ['int', 'char'=>'int|string'],
'IntlChar::getCombiningClass' => ['int', 'codepoint'=>'mixed'],
'IntlChar::getFC_NFKC_Closure' => ['string', 'char'=>'int|string'],
'IntlChar::getIntPropertyMaxValue' => ['int', 'property'=>'int'],
'IntlChar::getIntPropertyMinValue' => ['int', 'property'=>'int'],
'IntlChar::getIntPropertyMxValue' => ['int', 'property'=>'int'],
'IntlChar::getIntPropertyValue' => ['int', 'char'=>'int|string', 'property'=>'int'],
'IntlChar::getNumericValue' => ['float', 'char'=>'int|string'],
'IntlChar::getPropertyEnum' => ['int', 'alias'=>'string'],
'IntlChar::getPropertyName' => ['string|false', 'property'=>'int', 'namechoice='=>'int'],
'IntlChar::getPropertyValueEnum' => ['int', 'property'=>'int', 'name'=>'string'],
'IntlChar::getPropertyValueName' => ['string|false', 'prop'=>'int', 'value'=>'int', 'namechoice='=>'int'],
'IntlChar::getUnicodeVersion' => ['array'],
'IntlChar::hasBinaryProperty' => ['bool', 'char'=>'int|string', 'property'=>'int'],
'IntlChar::isalnum' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isalpha' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isbase' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isblank' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::iscntrl' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isdefined' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isdigit' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isgraph' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isIDIgnorable' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isIDPart' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isIDStart' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isISOControl' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isJavaIDPart' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isJavaIDStart' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isJavaSpaceChar' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::islower' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isMirrored' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isprint' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::ispunct' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isspace' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::istitle' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isUAlphabetic' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isULowercase' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isupper' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isUUppercase' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isUWhiteSpace' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isWhitespace' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::isxdigit' => ['bool', 'codepoint'=>'mixed'],
'IntlChar::ord' => ['int', 'character'=>'mixed'],
'IntlChar::tolower' => ['mixed', 'codepoint'=>'mixed'],
'IntlChar::totitle' => ['mixed', 'codepoint'=>'mixed'],
'IntlChar::toupper' => ['mixed', 'codepoint'=>'mixed'],
'IntlCodePointBreakIterator::__construct' => ['void'],
'IntlCodePointBreakIterator::createCharacterInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlCodePointBreakIterator::createCodePointInstance' => ['IntlCodePointBreakIterator'],
'IntlCodePointBreakIterator::createLineInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlCodePointBreakIterator::createSentenceInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlCodePointBreakIterator::createTitleInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlCodePointBreakIterator::createWordInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlCodePointBreakIterator::current' => ['int'],
'IntlCodePointBreakIterator::first' => ['int'],
'IntlCodePointBreakIterator::following' => ['int', 'offset'=>'string'],
'IntlCodePointBreakIterator::getErrorCode' => ['int'],
'IntlCodePointBreakIterator::getErrorMessage' => ['string'],
'IntlCodePointBreakIterator::getLastCodePoint' => ['int'],
'IntlCodePointBreakIterator::getLocale' => ['string', 'locale_type'=>'string'],
'IntlCodePointBreakIterator::getPartsIterator' => ['IntlPartsIterator', 'key_type='=>'string'],
'IntlCodePointBreakIterator::getText' => ['string'],
'IntlCodePointBreakIterator::isBoundary' => ['bool', 'offset'=>'string'],
'IntlCodePointBreakIterator::last' => ['int'],
'IntlCodePointBreakIterator::next' => ['int', 'offset='=>'string'],
'IntlCodePointBreakIterator::preceding' => ['int', 'offset'=>'string'],
'IntlCodePointBreakIterator::previous' => ['int'],
'IntlCodePointBreakIterator::setText' => ['bool', 'text'=>'string'],
'IntlDateFormatter::__construct' => ['void', 'locale'=>'?string', 'datetype'=>'?int', 'timetype'=>'?int', 'timezone='=>'null|string|IntlTimeZone|DateTimeZone', 'calendar='=>'null|int|IntlCalendar', 'pattern='=>'string'],
'IntlDateFormatter::create' => ['IntlDateFormatter|false', 'locale'=>'?string', 'datetype'=>'?int', 'timetype'=>'?int', 'timezone='=>'null|string|IntlTimeZone|DateTimeZone', 'calendar='=>'int|IntlCalendar', 'pattern='=>'string'],
'IntlDateFormatter::format' => ['string|false', 'args'=>''],
'IntlDateFormatter::formatObject' => ['string|false', 'object'=>'object', 'format='=>'mixed', 'locale='=>'string'],
'IntlDateFormatter::getCalendar' => ['int'],
'IntlDateFormatter::getCalendarObject' => ['IntlCalendar'],
'IntlDateFormatter::getDateType' => ['int'],
'IntlDateFormatter::getErrorCode' => ['int'],
'IntlDateFormatter::getErrorMessage' => ['string'],
'IntlDateFormatter::getLocale' => ['string|false'],
'IntlDateFormatter::getPattern' => ['string'],
'IntlDateFormatter::getTimeType' => ['int'],
'IntlDateFormatter::getTimeZone' => ['IntlTimeZone|false'],
'IntlDateFormatter::getTimeZoneId' => ['string'],
'IntlDateFormatter::isLenient' => ['bool'],
'IntlDateFormatter::localtime' => ['array', 'text_to_parse'=>'string', '&w_parse_pos='=>'int'],
'IntlDateFormatter::parse' => ['int|false', 'text_to_parse'=>'string', '&rw_parse_pos='=>'int'],
'IntlDateFormatter::setCalendar' => ['bool', 'calendar'=>''],
'IntlDateFormatter::setLenient' => ['bool', 'lenient'=>'bool'],
'IntlDateFormatter::setPattern' => ['bool', 'pattern'=>'string'],
'IntlDateFormatter::setTimeZone' => ['bool', 'timezone'=>''],
'IntlDateFormatter::setTimeZoneId' => ['bool', 'zone'=>'string', 'fmt='=>'IntlDateFormatter'],
'IntlException::__clone' => ['void'],
'IntlException::__construct' => ['void'],
'IntlException::__toString' => ['string'],
'IntlException::__wakeup' => ['void'],
'IntlException::getCode' => ['int'],
'IntlException::getFile' => ['string'],
'IntlException::getLine' => ['int'],
'IntlException::getMessage' => ['string'],
'IntlException::getPrevious' => ['?Throwable'],
'IntlException::getTrace' => ['list<array<string,mixed>>'],
'IntlException::getTraceAsString' => ['string'],
'intlgregcal_create_instance' => ['IntlGregorianCalendar', 'timezoneOrYear='=>'mixed', 'localeOrMonth='=>'string'],
'intlgregcal_get_gregorian_change' => ['float', 'calendar'=>'IntlGregorianCalendar'],
'intlgregcal_is_leap_year' => ['bool', 'calendar'=>'int'],
'intlgregcal_set_gregorian_change' => ['void', 'calendar'=>'IntlGregorianCalendar', 'timestamp'=>'float'],
'IntlGregorianCalendar::__construct' => ['void'],
'IntlGregorianCalendar::add' => ['bool', 'field'=>'int', 'amount'=>'int'],
'IntlGregorianCalendar::after' => ['bool', 'other'=>'IntlCalendar'],
'IntlGregorianCalendar::before' => ['bool', 'other'=>'IntlCalendar'],
'IntlGregorianCalendar::clear' => ['bool', 'field='=>'int'],
'IntlGregorianCalendar::createInstance' => ['IntlGregorianCalendar', 'timeZone='=>'mixed', 'locale='=>'string'],
'IntlGregorianCalendar::equals' => ['bool', 'other'=>'IntlCalendar'],
'IntlGregorianCalendar::fieldDifference' => ['int', 'when'=>'float', 'field'=>'int'],
'IntlGregorianCalendar::fromDateTime' => ['IntlCalendar', 'dateTime'=>'DateTime|string'],
'IntlGregorianCalendar::get' => ['int', 'field'=>'int'],
'IntlGregorianCalendar::getActualMaximum' => ['int', 'field'=>'int'],
'IntlGregorianCalendar::getActualMinimum' => ['int', 'field'=>'int'],
'IntlGregorianCalendar::getAvailableLocales' => ['array'],
'IntlGregorianCalendar::getDayOfWeekType' => ['int', 'dayOfWeek'=>'int'],
'IntlGregorianCalendar::getErrorCode' => ['int'],
'IntlGregorianCalendar::getErrorMessage' => ['string'],
'IntlGregorianCalendar::getFirstDayOfWeek' => ['int'],
'IntlGregorianCalendar::getGreatestMinimum' => ['int', 'field'=>'int'],
'IntlGregorianCalendar::getGregorianChange' => ['float'],
'IntlGregorianCalendar::getKeywordValuesForLocale' => ['Iterator', 'key'=>'string', 'locale'=>'string', 'commonlyUsed'=>'bool'],
'IntlGregorianCalendar::getLeastMaximum' => ['int', 'field'=>'int'],
'IntlGregorianCalendar::getLocale' => ['string', 'localeType'=>'int'],
'IntlGregorianCalendar::getMaximum' => ['int', 'field'=>'int'],
'IntlGregorianCalendar::getMinimalDaysInFirstWeek' => ['int'],
'IntlGregorianCalendar::getMinimum' => ['int', 'field'=>'int'],
'IntlGregorianCalendar::getNow' => ['float'],
'IntlGregorianCalendar::getRepeatedWallTimeOption' => ['int'],
'IntlGregorianCalendar::getSkippedWallTimeOption' => ['int'],
'IntlGregorianCalendar::getTime' => ['float'],
'IntlGregorianCalendar::getTimeZone' => ['IntlTimeZone'],
'IntlGregorianCalendar::getType' => ['string'],
'IntlGregorianCalendar::getWeekendTransition' => ['int', 'dayOfWeek'=>'string'],
'IntlGregorianCalendar::inDaylightTime' => ['bool'],
'IntlGregorianCalendar::isEquivalentTo' => ['bool', 'other'=>'IntlCalendar'],
'IntlGregorianCalendar::isLeapYear' => ['bool', 'year'=>'int'],
'IntlGregorianCalendar::isLenient' => ['bool'],
'IntlGregorianCalendar::isSet' => ['bool', 'field'=>'int'],
'IntlGregorianCalendar::isWeekend' => ['bool', 'date='=>'float'],
'IntlGregorianCalendar::roll' => ['bool', 'field'=>'int', 'amountOrUpOrDown'=>'mixed'],
'IntlGregorianCalendar::set' => ['bool', 'field'=>'int', 'value'=>'int'],
'IntlGregorianCalendar::set\'1' => ['bool', 'year'=>'int', 'month'=>'int', 'dayOfMonth='=>'int', 'hour='=>'int', 'minute='=>'int', 'second='=>'int'],
'IntlGregorianCalendar::setFirstDayOfWeek' => ['bool', 'dayOfWeek'=>'int'],
'IntlGregorianCalendar::setGregorianChange' => ['bool', 'date'=>'float'],
'IntlGregorianCalendar::setLenient' => ['bool', 'isLenient'=>'string'],
'IntlGregorianCalendar::setMinimalDaysInFirstWeek' => ['bool', 'minimalDays'=>'int'],
'IntlGregorianCalendar::setRepeatedWallTimeOption' => ['bool', 'wallTimeOption'=>'int'],
'IntlGregorianCalendar::setSkippedWallTimeOption' => ['bool', 'wallTimeOption'=>'int'],
'IntlGregorianCalendar::setTime' => ['bool', 'date'=>'float'],
'IntlGregorianCalendar::setTimeZone' => ['bool', 'timeZone'=>'mixed'],
'IntlGregorianCalendar::toDateTime' => ['DateTime'],
'IntlIterator::__construct' => ['void'],
'IntlIterator::current' => ['mixed'],
'IntlIterator::key' => ['string'],
'IntlIterator::next' => ['void'],
'IntlIterator::rewind' => ['void'],
'IntlIterator::valid' => ['bool'],
'IntlPartsIterator::getBreakIterator' => ['IntlBreakIterator'],
'IntlRuleBasedBreakIterator::__construct' => ['void', 'rules'=>'string', 'areCompiled='=>'string'],
'IntlRuleBasedBreakIterator::createCharacterInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlRuleBasedBreakIterator::createCodePointInstance' => ['IntlCodePointBreakIterator'],
'IntlRuleBasedBreakIterator::createLineInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlRuleBasedBreakIterator::createSentenceInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlRuleBasedBreakIterator::createTitleInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlRuleBasedBreakIterator::createWordInstance' => ['IntlRuleBasedBreakIterator', 'locale='=>'string'],
'IntlRuleBasedBreakIterator::current' => ['int'],
'IntlRuleBasedBreakIterator::first' => ['int'],
'IntlRuleBasedBreakIterator::following' => ['int', 'offset'=>'int'],
'IntlRuleBasedBreakIterator::getBinaryRules' => ['string'],
'IntlRuleBasedBreakIterator::getErrorCode' => ['int'],
'IntlRuleBasedBreakIterator::getErrorMessage' => ['string'],
'IntlRuleBasedBreakIterator::getLocale' => ['string', 'locale_type'=>'string'],
'IntlRuleBasedBreakIterator::getPartsIterator' => ['IntlPartsIterator', 'key_type='=>'int'],
'IntlRuleBasedBreakIterator::getRules' => ['string'],
'IntlRuleBasedBreakIterator::getRuleStatus' => ['int'],
'IntlRuleBasedBreakIterator::getRuleStatusVec' => ['array'],
'IntlRuleBasedBreakIterator::getText' => ['string'],
'IntlRuleBasedBreakIterator::isBoundary' => ['bool', 'offset'=>'int'],
'IntlRuleBasedBreakIterator::last' => ['int'],
'IntlRuleBasedBreakIterator::next' => ['int', 'offset='=>'int'],
'IntlRuleBasedBreakIterator::preceding' => ['int', 'offset'=>'int'],
'IntlRuleBasedBreakIterator::previous' => ['int'],
'IntlRuleBasedBreakIterator::setText' => ['bool', 'text'=>'string'],
'IntlTimeZone::countEquivalentIDs' => ['int|false', 'zoneId'=>'string'],
'IntlTimeZone::createDefault' => ['IntlTimeZone'],
'IntlTimeZone::createEnumeration' => ['IntlIterator|false', 'countryOrRawOffset='=>'mixed'],
'IntlTimeZone::createTimeZone' => ['IntlTimeZone|false', 'zoneId'=>'string'],
'IntlTimeZone::createTimeZoneIDEnumeration' => ['IntlIterator|false', 'zoneType'=>'int', 'region='=>'string', 'rawOffset='=>'int'],
'IntlTimeZone::fromDateTimeZone' => ['?IntlTimeZone', 'zoneId'=>'DateTimeZone'],
'IntlTimeZone::getCanonicalID' => ['string|false', 'zoneId'=>'string', '&w_isSystemID='=>'bool'],
'IntlTimeZone::getDisplayName' => ['string|false', 'isDaylight='=>'bool', 'style='=>'int', 'locale='=>'string'],
'IntlTimeZone::getDSTSavings' => ['int'],
'IntlTimeZone::getEquivalentID' => ['string|false', 'zoneId'=>'string', 'index'=>'int'],
'IntlTimeZone::getErrorCode' => ['int'],
'IntlTimeZone::getErrorMessage' => ['string'],
'IntlTimeZone::getGMT' => ['IntlTimeZone'],
'IntlTimeZone::getID' => ['string'],
'IntlTimeZone::getIDForWindowsID' => ['string', 'timezone'=>'string', 'region='=>'string'],
'IntlTimeZone::getOffset' => ['int', 'date'=>'float', 'local'=>'bool', '&w_rawOffset'=>'int', '&w_dstOffset'=>'int'],
'IntlTimeZone::getRawOffset' => ['int'],
'IntlTimeZone::getRegion' => ['string|false', 'zoneId'=>'string'],
'IntlTimeZone::getTZDataVersion' => ['string'],
'IntlTimeZone::getUnknown' => ['IntlTimeZone'],
'IntlTimeZone::getWindowsID' => ['string|false', 'timezone'=>'string'],
'IntlTimeZone::hasSameRules' => ['bool', 'otherTimeZone'=>'IntlTimeZone'],
'IntlTimeZone::toDateTimeZone' => ['DateTimeZone|false'],
'IntlTimeZone::useDaylightTime' => ['bool'],
'intltz_count_equivalent_ids' => ['int', 'timezoneId'=>'string'],
'intltz_create_enumeration' => ['IntlIterator', 'countryOrRawOffset'=>'mixed'],
'intltz_create_time_zone' => ['IntlTimeZone', 'timezoneId'=>'string'],
'intltz_from_date_time_zone' => ['IntlTimeZone', 'timezone'=>'DateTimeZone'],
'intltz_get_canonical_id' => ['string', 'timezoneId'=>'string', '&isSystemId'=>'bool'],
'intltz_get_display_name' => ['string', 'timezone'=>'IntlTimeZone', 'dst'=>'bool', 'style'=>'int', 'locale'=>'string'],
'intltz_get_dst_savings' => ['int', 'timezone'=>'IntlTimeZone'],
'intltz_get_equivalent_id' => ['string', 'timezoneId'=>'string', 'offset'=>'int'],
'intltz_get_error_code' => ['int', 'timezone'=>'IntlTimeZone'],
'intltz_get_error_message' => ['string', 'timezone'=>'IntlTimeZone'],
'intltz_get_id' => ['string', 'timezone'=>'IntlTimeZone'],
'intltz_get_offset' => ['int', 'timezone'=>'IntlTimeZone', 'timestamp'=>'float', 'local'=>'bool', '&rawOffset'=>'int', '&dstOffset'=>'int'],
'intltz_get_raw_offset' => ['int', 'timezone'=>'IntlTimeZone'],
'intltz_get_tz_data_version' => ['string', 'object'=>'IntlTimeZone'],
'intltz_getGMT' => ['IntlTimeZone'],
'intltz_has_same_rules' => ['bool', 'timezone'=>'IntlTimeZone', 'other'=>'IntlTimeZone'],
'intltz_to_date_time_zone' => ['DateTimeZone', 'timezone'=>'IntlTimeZone'],
'intltz_use_daylight_time' => ['bool', 'timezone'=>'IntlTimeZone'],
'intlz_create_default' => ['IntlTimeZone'],
'intval' => ['int', 'value'=>'mixed', 'base='=>'int'],
'InvalidArgumentException::__clone' => ['void'],
'InvalidArgumentException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?InvalidArgumentException'],
'InvalidArgumentException::__toString' => ['string'],
'InvalidArgumentException::getCode' => ['int'],
'InvalidArgumentException::getFile' => ['string'],
'InvalidArgumentException::getLine' => ['int'],
'InvalidArgumentException::getMessage' => ['string'],
'InvalidArgumentException::getPrevious' => ['Throwable|InvalidArgumentException|null'],
'InvalidArgumentException::getTrace' => ['list<array<string,mixed>>'],
'InvalidArgumentException::getTraceAsString' => ['string'],
'ip2long' => ['int|false', 'ip'=>'string'],
'iptcembed' => ['string|bool', 'iptc_data'=>'string', 'filename'=>'string', 'spool='=>'int'],
'iptcparse' => ['array|false', 'iptc_block'=>'string'],
'is_a' => ['bool', 'object_or_class'=>'mixed', 'class'=>'string', 'allow_string='=>'bool'],
'is_array' => ['bool', 'value'=>'mixed'],
'is_bool' => ['bool', 'value'=>'mixed'],
'is_callable' => ['bool', 'value'=>'callable|mixed', 'syntax_only='=>'bool', '&w_callable_name='=>'string'],
'is_countable' => ['bool', 'value'=>'mixed'],
'is_dir' => ['bool', 'filename'=>'string'],
'is_double' => ['bool', 'value'=>'mixed'],
'is_executable' => ['bool', 'filename'=>'string'],
'is_file' => ['bool', 'filename'=>'string'],
'is_finite' => ['bool', 'num'=>'float'],
'is_float' => ['bool', 'value'=>'mixed'],
'is_infinite' => ['bool', 'num'=>'float'],
'is_int' => ['bool', 'value'=>'mixed'],
'is_integer' => ['bool', 'value'=>'mixed'],
'is_iterable' => ['bool', 'value'=>'mixed'],
'is_link' => ['bool', 'filename'=>'string'],
'is_long' => ['bool', 'value'=>'mixed'],
'is_nan' => ['bool', 'num'=>'float'],
'is_null' => ['bool', 'value'=>'mixed'],
'is_numeric' => ['bool', 'value'=>'mixed'],
'is_object' => ['bool', 'value'=>'mixed'],
'is_readable' => ['bool', 'filename'=>'string'],
'is_real' => ['bool', 'value'=>'mixed'],
'is_resource' => ['bool', 'value'=>'mixed'],
'is_scalar' => ['bool', 'value'=>'mixed'],
'is_soap_fault' => ['bool', 'object'=>'mixed'],
'is_string' => ['bool', 'value'=>'mixed'],
'is_subclass_of' => ['bool', 'object_or_class'=>'object|string', 'class'=>'class-string', 'allow_string='=>'bool'],
'is_tainted' => ['bool', 'string'=>'string'],
'is_uploaded_file' => ['bool', 'filename'=>'string'],
'is_writable' => ['bool', 'filename'=>'string'],
'is_writeable' => ['bool', 'filename'=>'string'],
'isset' => ['bool', 'value'=>'mixed', '...rest='=>'mixed'],
'Iterator::current' => ['mixed'],
'Iterator::key' => ['mixed'],
'Iterator::next' => ['void'],
'Iterator::rewind' => ['void'],
'Iterator::valid' => ['bool'],
'iterator_apply' => ['int', 'iterator'=>'Traversable', 'callback'=>'callable(mixed):bool', 'args='=>'array'],
'iterator_count' => ['int', 'iterator'=>'Traversable'],
'iterator_to_array' => ['array', 'iterator'=>'Traversable', 'preserve_keys='=>'bool'],
'IteratorAggregate::getIterator' => ['Traversable'],
'IteratorIterator::__construct' => ['void', 'it'=>'Traversable'],
'IteratorIterator::current' => ['mixed'],
'IteratorIterator::getInnerIterator' => ['Iterator'],
'IteratorIterator::key' => ['mixed'],
'IteratorIterator::next' => ['void'],
'IteratorIterator::rewind' => ['void'],
'IteratorIterator::valid' => ['bool'],
'java_last_exception_clear' => ['void'],
'java_last_exception_get' => ['object'],
'java_reload' => ['array', 'new_jarpath'=>'string'],
'java_require' => ['array', 'new_classpath'=>'string'],
'java_set_encoding' => ['array', 'encoding'=>'string'],
'java_set_ignore_case' => ['void', 'ignore'=>'bool'],
'java_throw_exceptions' => ['void', 'throw'=>'bool'],
'JavaException::getCause' => ['object'],
'jddayofweek' => ['mixed', 'julian_day'=>'int', 'mode='=>'int'],
'jdmonthname' => ['string', 'julian_day'=>'int', 'mode'=>'int'],
'jdtofrench' => ['string', 'julian_day'=>'int'],
'jdtogregorian' => ['string', 'julian_day'=>'int'],
'jdtojewish' => ['string', 'julian_day'=>'int', 'hebrew='=>'bool', 'flags='=>'int'],
'jdtojulian' => ['string', 'julian_day'=>'int'],
'jdtounix' => ['int|false', 'julian_day'=>'int'],
'jewishtojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'],
'jobqueue_license_info' => ['array'],
'join' => ['string', 'separator'=>'string', 'array'=>'array'],
'join\'1' => ['string', 'separator'=>'array'],
'json_decode' => ['mixed', 'json'=>'string', 'associative='=>'bool', 'depth='=>'int', 'flags='=>'int'],
'json_encode' => ['string|false', 'value'=>'mixed', 'flags='=>'int', 'depth='=>'int'],
'json_last_error' => ['int'],
'json_last_error_msg' => ['string'],
'JsonException::__clone' => ['void'],
'JsonException::__construct' => ['void'],
'JsonException::__toString' => ['string'],
'JsonException::__wakeup' => ['void'],
'JsonException::getCode' => ['int'],
'JsonException::getFile' => ['string'],
'JsonException::getLine' => ['int'],
'JsonException::getMessage' => ['string'],
'JsonException::getPrevious' => ['?Throwable'],
'JsonException::getTrace' => ['list<array<string,mixed>>'],
'JsonException::getTraceAsString' => ['string'],
'JsonIncrementalParser::__construct' => ['void', 'depth'=>'', 'options'=>''],
'JsonIncrementalParser::get' => ['', 'options'=>''],
'JsonIncrementalParser::getError' => [''],
'JsonIncrementalParser::parse' => ['', 'json'=>''],
'JsonIncrementalParser::parseFile' => ['', 'filename'=>''],
'JsonIncrementalParser::reset' => [''],
'JsonSerializable::jsonSerialize' => ['mixed'],
'Judy::__construct' => ['void', 'judy_type'=>'int'],
'Judy::__destruct' => ['void'],
'Judy::byCount' => ['int', 'nth_index'=>'int'],
'Judy::count' => ['int', 'index_start='=>'int', 'index_end='=>'int'],
'Judy::first' => ['mixed', 'index='=>'mixed'],
'Judy::firstEmpty' => ['mixed', 'index='=>'mixed'],
'Judy::free' => ['int'],
'Judy::getType' => ['int'],
'Judy::last' => ['mixed', 'index='=>'string'],
'Judy::lastEmpty' => ['mixed', 'index='=>'int'],
'Judy::memoryUsage' => ['int'],
'Judy::next' => ['mixed', 'index'=>'mixed'],
'Judy::nextEmpty' => ['mixed', 'index'=>'mixed'],
'Judy::offsetExists' => ['bool', 'offset'=>'mixed'],
'Judy::offsetGet' => ['mixed', 'offset'=>'mixed'],
'Judy::offsetSet' => ['bool', 'offset'=>'mixed', 'value'=>'mixed'],
'Judy::offsetUnset' => ['bool', 'offset'=>'mixed'],
'Judy::prev' => ['mixed', 'index'=>'mixed'],
'Judy::prevEmpty' => ['mixed', 'index'=>'mixed'],
'Judy::size' => ['int'],
'judy_type' => ['int', 'array'=>'judy'],
'judy_version' => ['string'],
'juliantojd' => ['int', 'month'=>'int', 'day'=>'int', 'year'=>'int'],
'kadm5_chpass_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string', 'password'=>'string'],
'kadm5_create_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string', 'password='=>'string', 'options='=>'array'],
'kadm5_delete_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string'],
'kadm5_destroy' => ['bool', 'handle'=>'resource'],
'kadm5_flush' => ['bool', 'handle'=>'resource'],
'kadm5_get_policies' => ['array', 'handle'=>'resource'],
'kadm5_get_principal' => ['array', 'handle'=>'resource', 'principal'=>'string'],
'kadm5_get_principals' => ['array', 'handle'=>'resource'],
'kadm5_init_with_password' => ['resource', 'admin_server'=>'string', 'realm'=>'string', 'principal'=>'string', 'password'=>'string'],
'kadm5_modify_principal' => ['bool', 'handle'=>'resource', 'principal'=>'string', 'options'=>'array'],
'key' => ['int|string|null', 'array'=>'array|object'],
'key_exists' => ['bool', 'key'=>'string|int', 'array'=>'array'],
'krsort' => ['bool', '&rw_array'=>'array', 'flags='=>'int'],
'ksort' => ['bool', '&rw_array'=>'array', 'flags='=>'int'],
'KTaglib_ID3v2_AttachedPictureFrame::getDescription' => ['string'],
'KTaglib_ID3v2_AttachedPictureFrame::getMimeType' => ['string'],
'KTaglib_ID3v2_AttachedPictureFrame::getType' => ['int'],
'KTaglib_ID3v2_AttachedPictureFrame::savePicture' => ['bool', 'filename'=>'string'],
'KTaglib_ID3v2_AttachedPictureFrame::setMimeType' => ['string', 'type'=>'string'],
'KTaglib_ID3v2_AttachedPictureFrame::setPicture' => ['', 'filename'=>'string'],
'KTaglib_ID3v2_AttachedPictureFrame::setType' => ['', 'type'=>'int'],
'KTaglib_ID3v2_Frame::__toString' => ['string'],
'KTaglib_ID3v2_Frame::getDescription' => ['string'],
'KTaglib_ID3v2_Frame::getMimeType' => ['string'],
'KTaglib_ID3v2_Frame::getSize' => ['int'],
'KTaglib_ID3v2_Frame::getType' => ['int'],
'KTaglib_ID3v2_Frame::savePicture' => ['bool', 'filename'=>'string'],
'KTaglib_ID3v2_Frame::setMimeType' => ['string', 'type'=>'string'],
'KTaglib_ID3v2_Frame::setPicture' => ['void', 'filename'=>'string'],
'KTaglib_ID3v2_Frame::setType' => ['void', 'type'=>'int'],
'KTaglib_ID3v2_Tag::addFrame' => ['bool', 'frame'=>'KTaglib_ID3v2_Frame'],
'KTaglib_ID3v2_Tag::getFrameList' => ['array'],
'KTaglib_MPEG_AudioProperties::getBitrate' => ['int'],
'KTaglib_MPEG_AudioProperties::getChannels' => ['int'],
'KTaglib_MPEG_AudioProperties::getLayer' => ['int'],
'KTaglib_MPEG_AudioProperties::getLength' => ['int'],
'KTaglib_MPEG_AudioProperties::getSampleBitrate' => ['int'],
'KTaglib_MPEG_AudioProperties::getVersion' => ['int'],
'KTaglib_MPEG_AudioProperties::isCopyrighted' => ['bool'],
'KTaglib_MPEG_AudioProperties::isOriginal' => ['bool'],
'KTaglib_MPEG_AudioProperties::isProtectionEnabled' => ['bool'],
'KTaglib_MPEG_File::getAudioProperties' => ['KTaglib_MPEG_File'],
'KTaglib_MPEG_File::getID3v1Tag' => ['KTaglib_ID3v1_Tag', 'create='=>'bool'],
'KTaglib_MPEG_File::getID3v2Tag' => ['KTaglib_ID3v2_Tag', 'create='=>'bool'],
'KTaglib_Tag::getAlbum' => ['string'],
'KTaglib_Tag::getArtist' => ['string'],
'KTaglib_Tag::getComment' => ['string'],
'KTaglib_Tag::getGenre' => ['string'],
'KTaglib_Tag::getTitle' => ['string'],
'KTaglib_Tag::getTrack' => ['int'],
'KTaglib_Tag::getYear' => ['int'],
'KTaglib_Tag::isEmpty' => ['bool'],
'labelcacheObj::freeCache' => ['bool'],
'labelObj::__construct' => ['void'],
'labelObj::convertToString' => ['string'],
'labelObj::deleteStyle' => ['int', 'index'=>'int'],
'labelObj::free' => ['void'],
'labelObj::getBinding' => ['string', 'labelbinding'=>'mixed'],
'labelObj::getExpressionString' => ['string'],
'labelObj::getStyle' => ['styleObj', 'index'=>'int'],
'labelObj::getTextString' => ['string'],
'labelObj::moveStyleDown' => ['int', 'index'=>'int'],
'labelObj::moveStyleUp' => ['int', 'index'=>'int'],
'labelObj::removeBinding' => ['int', 'labelbinding'=>'mixed'],
'labelObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'labelObj::setBinding' => ['int', 'labelbinding'=>'mixed', 'value'=>'string'],
'labelObj::setExpression' => ['int', 'expression'=>'string'],
'labelObj::setText' => ['int', 'text'=>'string'],
'labelObj::updateFromString' => ['int', 'snippet'=>'string'],
'Lapack::eigenValues' => ['array', 'a'=>'array', 'left='=>'array', 'right='=>'array'],
'Lapack::identity' => ['array', 'n'=>'int'],
'Lapack::leastSquaresByFactorisation' => ['array', 'a'=>'array', 'b'=>'array'],
'Lapack::leastSquaresBySVD' => ['array', 'a'=>'array', 'b'=>'array'],
'Lapack::pseudoInverse' => ['array', 'a'=>'array'],
'Lapack::singularValues' => ['array', 'a'=>'array'],
'Lapack::solveLinearEquation' => ['array', 'a'=>'array', 'b'=>'array'],
'layerObj::addFeature' => ['int', 'shape'=>'shapeObj'],
'layerObj::applySLD' => ['int', 'sldxml'=>'string', 'namedlayer'=>'string'],
'layerObj::applySLDURL' => ['int', 'sldurl'=>'string', 'namedlayer'=>'string'],
'layerObj::clearProcessing' => ['void'],
'layerObj::close' => ['void'],
'layerObj::convertToString' => ['string'],
'layerObj::draw' => ['int', 'image'=>'imageObj'],
'layerObj::drawQuery' => ['int', 'image'=>'imageObj'],
'layerObj::free' => ['void'],
'layerObj::generateSLD' => ['string'],
'layerObj::getClass' => ['classObj', 'classIndex'=>'int'],
'layerObj::getClassIndex' => ['int', 'shape'=>'', 'classgroup'=>'', 'numclasses'=>''],
'layerObj::getExtent' => ['rectObj'],
'layerObj::getFilterString' => ['?string'],
'layerObj::getGridIntersectionCoordinates' => ['array'],
'layerObj::getItems' => ['array'],
'layerObj::getMetaData' => ['int', 'name'=>'string'],
'layerObj::getNumResults' => ['int'],
'layerObj::getProcessing' => ['array'],
'layerObj::getProjection' => ['string'],
'layerObj::getResult' => ['resultObj', 'index'=>'int'],
'layerObj::getResultsBounds' => ['rectObj'],
'layerObj::getShape' => ['shapeObj', 'result'=>'resultObj'],
'layerObj::getWMSFeatureInfoURL' => ['string', 'clickX'=>'int', 'clickY'=>'int', 'featureCount'=>'int', 'infoFormat'=>'string'],
'layerObj::isVisible' => ['bool'],
'layerObj::moveclassdown' => ['int', 'index'=>'int'],
'layerObj::moveclassup' => ['int', 'index'=>'int'],
'layerObj::ms_newLayerObj' => ['layerObj', 'map'=>'mapObj', 'layer'=>'layerObj'],
'layerObj::nextShape' => ['shapeObj'],
'layerObj::open' => ['int'],
'layerObj::queryByAttributes' => ['int', 'qitem'=>'string', 'qstring'=>'string', 'mode'=>'int'],
'layerObj::queryByFeatures' => ['int', 'slayer'=>'int'],
'layerObj::queryByPoint' => ['int', 'point'=>'pointObj', 'mode'=>'int', 'buffer'=>'float'],
'layerObj::queryByRect' => ['int', 'rect'=>'rectObj'],
'layerObj::queryByShape' => ['int', 'shape'=>'shapeObj'],
'layerObj::removeClass' => ['?classObj', 'index'=>'int'],
'layerObj::removeMetaData' => ['int', 'name'=>'string'],
'layerObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'layerObj::setConnectionType' => ['int', 'connectiontype'=>'int', 'plugin_library'=>'string'],
'layerObj::setFilter' => ['int', 'expression'=>'string'],
'layerObj::setMetaData' => ['int', 'name'=>'string', 'value'=>'string'],
'layerObj::setProjection' => ['int', 'proj_params'=>'string'],
'layerObj::setWKTProjection' => ['int', 'proj_params'=>'string'],
'layerObj::updateFromString' => ['int', 'snippet'=>'string'],
'lcfirst' => ['string', 'string'=>'string'],
'lcg_value' => ['float'],
'lchgrp' => ['bool', 'filename'=>'string', 'group'=>'string|int'],
'lchown' => ['bool', 'filename'=>'string', 'user'=>'string|int'],
'ldap_8859_to_t61' => ['string', 'value'=>'string'],
'ldap_add' => ['bool', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array', 'controls='=>'array'],
'ldap_add_ext' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array', 'controls='=>'array'],
'ldap_bind' => ['bool', 'ldap'=>'LDAP\Connection', 'dn='=>'string|null', 'password='=>'string|null'],
'ldap_bind_ext' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'dn='=>'string|null', 'password='=>'string|null', 'controls='=>'array'],
'ldap_close' => ['bool', 'ldap'=>'LDAP\Connection'],
'ldap_compare' => ['bool|int', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'attribute'=>'string', 'value'=>'string'],
'ldap_connect' => ['LDAP\Connection|false', 'uri='=>'string', 'port='=>'int', 'wallet='=>'string', 'password='=>'string', 'auth_mode='=>'int'],
'ldap_control_paged_result' => ['bool', 'link_identifier'=>'resource', 'pagesize'=>'int', 'iscritical='=>'bool', 'cookie='=>'string'],
'ldap_control_paged_result_response' => ['bool', 'link_identifier'=>'resource', 'result_identifier'=>'resource', '&w_cookie'=>'string', '&w_estimated'=>'int'],
'ldap_count_entries' => ['int|false', 'ldap'=>'LDAP\Connection', 'result'=>'LDAP\Result'],
'ldap_delete' => ['bool', 'ldap'=>'LDAP\Connection', 'dn'=>'string'],
'ldap_delete_ext' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'controls='=>'array'],
'ldap_dn2ufn' => ['string', 'dn'=>'string'],
'ldap_err2str' => ['string', 'errno'=>'int'],
'ldap_errno' => ['int', 'ldap'=>'LDAP\Connection'],
'ldap_error' => ['string', 'ldap'=>'LDAP\Connection'],
'ldap_escape' => ['string', 'value'=>'string', 'ignore='=>'string', 'flags='=>'int'],
'ldap_exop' => ['mixed', 'ldap'=>'LDAP\Connection', 'reqoid'=>'string', 'reqdata='=>'string', 'serverctrls='=>'array|null', '&w_response_data='=>'string', '&w_response_oid='=>'string'],
'ldap_exop_passwd' => ['bool|string', 'ldap'=>'LDAP\Connection', 'user='=>'string', 'old_password='=>'string', 'new_password='=>'string', '&w_controls='=>'array|null'],
'ldap_exop_refresh' => ['int|false', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'ttl'=>'int'],
'ldap_exop_whoami' => ['string|false', 'ldap'=>'LDAP\Connection'],
'ldap_explode_dn' => ['array|false', 'dn'=>'string', 'with_attrib'=>'int'],
'ldap_first_attribute' => ['string|false', 'ldap'=>'LDAP\Connection', 'entry'=>'LDAP\ResultEntry'],
'ldap_first_entry' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'result'=>'LDAP\Result'],
'ldap_first_reference' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'result'=>'LDAP\Result'],
'ldap_free_result' => ['bool', 'ldap'=>'LDAP\Connection'],
'ldap_get_attributes' => ['array|false', 'ldap'=>'LDAP\Connection', 'entry'=>'LDAP\ResultEntry'],
'ldap_get_dn' => ['string|false', 'ldap'=>'LDAP\Connection', 'entry'=>'LDAP\ResultEntry'],
'ldap_get_entries' => ['array|false', 'ldap'=>'LDAP\Connection', 'result'=>'LDAP\Result'],
'ldap_get_option' => ['bool', 'ldap'=>'LDAP\Connection', 'option'=>'int', '&w_value'=>'mixed'],
'ldap_get_values' => ['array|false', 'ldap'=>'LDAP\Connection', 'entry'=>'LDAP\ResultEntry', 'attribute'=>'string'],
'ldap_get_values_len' => ['array|false', 'ldap'=>'LDAP\Connection', 'entry'=>'LDAP\ResultEntry', 'attribute'=>'string'],
'ldap_list' => ['LDAP\Connection|false', 'ldap'=>'resource|array', 'base'=>'string', 'filter'=>'string', 'attributes='=>'array', 'attributes_only='=>'int', 'sizelimit='=>'int', 'timelimit='=>'int', 'deref='=>'int'],
'ldap_mod_add' => ['bool', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array'],
'ldap_mod_add_ext' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array', 'controls='=>'array'],
'ldap_mod_del' => ['bool', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array'],
'ldap_mod_del_ext' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array', 'controls='=>'array'],
'ldap_mod_replace' => ['bool', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array'],
'ldap_mod_replace_ext' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array', 'controls='=>'array'],
'ldap_modify' => ['bool', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'entry'=>'array'],
'ldap_modify_batch' => ['bool', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'modifications_info'=>'array'],
'ldap_next_attribute' => ['string|false', 'ldap'=>'LDAP\Connection', 'entry'=>'LDAP\ResultEntry'],
'ldap_next_entry' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'result'=>'LDAP\Result'],
'ldap_next_reference' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'entry'=>'LDAP\ResultEntry'],
'ldap_parse_exop' => ['bool', 'ldap'=>'LDAP\Connection', 'result'=>'LDAP\Result', '&w_response_data='=>'string', '&w_response_oid='=>'string'],
'ldap_parse_reference' => ['bool', 'ldap'=>'LDAP\Connection', 'entry'=>'LDAP\ResultEntry', 'referrals'=>'array'],
'ldap_parse_result' => ['bool', 'ldap'=>'LDAP\Connection', 'result'=>'LDAP\Result', '&w_error_code'=>'int', '&w_matched_dn='=>'string', '&w_error_message='=>'string', '&w_referrals='=>'array', '&w_controls='=>'array'],
'ldap_read' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection|array', 'base'=>'string', 'filter'=>'string', 'attributes='=>'array', 'attributes_only='=>'int', 'sizelimit='=>'int', 'timelimit='=>'int', 'deref='=>'int'],
'ldap_rename' => ['bool', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'new_rdn'=>'string', 'new_parent'=>'string', 'delete_old_rdn'=>'bool'],
'ldap_rename_ext' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection', 'dn'=>'string', 'new_rdn'=>'string', 'new_parent'=>'string', 'delete_old_rdn'=>'bool', 'controls='=>'array'],
'ldap_sasl_bind' => ['bool', 'ldap'=>'LDAP\Connection', 'dn='=>'string', 'password='=>'string', 'mech='=>'string', 'realm='=>'string', 'authc_id='=>'string', 'authz_id='=>'string', 'props='=>'string'],
'ldap_search' => ['LDAP\Connection|false', 'ldap'=>'LDAP\Connection|LDAP\Connection[]', 'base'=>'string', 'filter'=>'string', 'attributes='=>'array', 'attributes_only='=>'int', 'sizelimit='=>'int', 'timelimit='=>'int', 'deref='=>'int'],
'ldap_set_option' => ['bool', 'ldap'=>'LDAP\Connection|null', 'option'=>'int', 'value'=>'mixed'],
'ldap_set_rebind_proc' => ['bool', 'ldap'=>'LDAP\Connection', 'callback'=>'string'],
'ldap_start_tls' => ['bool', 'ldap'=>'resource'],
'ldap_t61_to_8859' => ['string', 'value'=>'string'],
'ldap_unbind' => ['bool', 'ldap'=>'resource'],
'leak' => ['', 'num_bytes'=>'int'],
'leak_variable' => ['', 'variable'=>'', 'leak_data'=>'bool'],
'legendObj::convertToString' => ['string'],
'legendObj::free' => ['void'],
'legendObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'legendObj::updateFromString' => ['int', 'snippet'=>'string'],
'LengthException::__clone' => ['void'],
'LengthException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?LengthException'],
'LengthException::__toString' => ['string'],
'LengthException::getCode' => ['int'],
'LengthException::getFile' => ['string'],
'LengthException::getLine' => ['int'],
'LengthException::getMessage' => ['string'],
'LengthException::getPrevious' => ['Throwable|LengthException|null'],
'LengthException::getTrace' => ['list<array<string,mixed>>'],
'LengthException::getTraceAsString' => ['string'],
'LevelDB::__construct' => ['void', 'name'=>'string', 'options='=>'array', 'read_options='=>'array', 'write_options='=>'array'],
'LevelDB::close' => [''],
'LevelDB::compactRange' => ['', 'start'=>'', 'limit'=>''],
'LevelDB::delete' => ['bool', 'key'=>'string', 'write_options='=>'array'],
'LevelDB::destroy' => ['', 'name'=>'', 'options='=>'array'],
'LevelDB::get' => ['bool|string', 'key'=>'string', 'read_options='=>'array'],
'LevelDB::getApproximateSizes' => ['', 'start'=>'', 'limit'=>''],
'LevelDB::getIterator' => ['LevelDBIterator', 'options='=>'array'],
'LevelDB::getProperty' => ['mixed', 'name'=>'string'],
'LevelDB::getSnapshot' => ['LevelDBSnapshot'],
'LevelDB::put' => ['', 'key'=>'string', 'value'=>'string', 'write_options='=>'array'],
'LevelDB::repair' => ['', 'name'=>'', 'options='=>'array'],
'LevelDB::set' => ['', 'key'=>'string', 'value'=>'string', 'write_options='=>'array'],
'LevelDB::write' => ['', 'batch'=>'LevelDBWriteBatch', 'write_options='=>'array'],
'LevelDBIterator::__construct' => ['void', 'db'=>'LevelDB', 'read_options='=>'array'],
'LevelDBIterator::current' => ['mixed'],
'LevelDBIterator::destroy' => [''],
'LevelDBIterator::getError' => [''],
'LevelDBIterator::key' => ['int|string'],
'LevelDBIterator::last' => [''],
'LevelDBIterator::next' => ['void'],
'LevelDBIterator::prev' => [''],
'LevelDBIterator::rewind' => ['void'],
'LevelDBIterator::seek' => ['', 'key'=>''],
'LevelDBIterator::valid' => ['bool'],
'LevelDBSnapshot::__construct' => ['void', 'db'=>'LevelDB'],
'LevelDBSnapshot::release' => [''],
'LevelDBWriteBatch::__construct' => ['void', 'name'=>'', 'options='=>'array', 'read_options='=>'array', 'write_options='=>'array'],
'LevelDBWriteBatch::clear' => [''],
'LevelDBWriteBatch::delete' => ['', 'key'=>'', 'write_options='=>'array'],
'LevelDBWriteBatch::put' => ['', 'key'=>'', 'value'=>'', 'write_options='=>'array'],
'LevelDBWriteBatch::set' => ['', 'key'=>'', 'value'=>'', 'write_options='=>'array'],
'levenshtein' => ['int', 'string1'=>'string', 'string2'=>'string'],
'levenshtein\'1' => ['int', 'string1'=>'string', 'string2'=>'string', 'insertion_cost'=>'int', 'repetition_cost'=>'int', 'deletion_cost'=>'int'],
'libxml_clear_errors' => ['void'],
'libxml_disable_entity_loader' => ['bool', 'disable='=>'bool'],
'libxml_get_errors' => ['array<int,LibXMLError>'],
'libxml_get_last_error' => ['LibXMLError|false'],
'libxml_set_external_entity_loader' => ['bool', 'resolver_function'=>'callable'],
'libxml_set_streams_context' => ['void', 'context'=>'resource'],
'libxml_use_internal_errors' => ['bool', 'use_errors='=>'bool'],
'LimitIterator::__construct' => ['void', 'iterator'=>'Iterator', 'offset='=>'int', 'count='=>'int'],
'LimitIterator::current' => ['mixed'],
'LimitIterator::getInnerIterator' => ['Iterator'],
'LimitIterator::getPosition' => ['int'],
'LimitIterator::key' => ['mixed'],
'LimitIterator::next' => ['void'],
'LimitIterator::rewind' => ['void'],
'LimitIterator::seek' => ['int', 'position'=>'int'],
'LimitIterator::valid' => ['bool'],
'lineObj::__construct' => ['void'],
'lineObj::add' => ['int', 'point'=>'pointObj'],
'lineObj::addXY' => ['int', 'x'=>'float', 'y'=>'float', 'm'=>'float'],
'lineObj::addXYZ' => ['int', 'x'=>'float', 'y'=>'float', 'z'=>'float', 'm'=>'float'],
'lineObj::ms_newLineObj' => ['lineObj'],
'lineObj::point' => ['pointObj', 'i'=>'int'],
'lineObj::project' => ['int', 'in'=>'projectionObj', 'out'=>'projectionObj'],
'link' => ['bool', 'target'=>'string', 'link'=>'string'],
'linkinfo' => ['int|false', 'path'=>'string'],
'litespeed_request_headers' => ['array'],
'litespeed_response_headers' => ['array'],
'Locale::acceptFromHttp' => ['string|false', 'header'=>'string'],
'Locale::canonicalize' => ['string', 'locale'=>'string'],
'Locale::composeLocale' => ['string', 'subtags'=>'array'],
'Locale::filterMatches' => ['bool', 'langtag'=>'string', 'locale'=>'string', 'canonicalize='=>'bool'],
'Locale::getAllVariants' => ['array', 'locale'=>'string'],
'Locale::getDefault' => ['string'],
'Locale::getDisplayLanguage' => ['string', 'locale'=>'string', 'in_locale='=>'string'],
'Locale::getDisplayName' => ['string', 'locale'=>'string', 'in_locale='=>'string'],
'Locale::getDisplayRegion' => ['string', 'locale'=>'string', 'in_locale='=>'string'],
'Locale::getDisplayScript' => ['string', 'locale'=>'string', 'in_locale='=>'string'],
'Locale::getDisplayVariant' => ['string', 'locale'=>'string', 'in_locale='=>'string'],
'Locale::getKeywords' => ['array|false', 'locale'=>'string'],
'Locale::getPrimaryLanguage' => ['string', 'locale'=>'string'],
'Locale::getRegion' => ['string', 'locale'=>'string'],
'Locale::getScript' => ['string', 'locale'=>'string'],
'Locale::lookup' => ['string', 'langtag'=>'array', 'locale'=>'string', 'canonicalize='=>'bool', 'default='=>'string'],
'Locale::parseLocale' => ['array', 'locale'=>'string'],
'Locale::setDefault' => ['bool', 'locale'=>'string'],
'locale_accept_from_http' => ['string|false', 'header'=>'string'],
'locale_canonicalize' => ['string', 'locale'=>'string'],
'locale_compose' => ['string|false', 'subtags'=>'array'],
'locale_filter_matches' => ['bool', 'languageTag'=>'string', 'locale'=>'string', 'canonicalize='=>'bool'],
'locale_get_all_variants' => ['array', 'locale'=>'string'],
'locale_get_default' => ['string'],
'locale_get_display_language' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
'locale_get_display_name' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
'locale_get_display_region' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
'locale_get_display_script' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
'locale_get_display_variant' => ['string', 'locale'=>'string', 'displayLocale='=>'string'],
'locale_get_keywords' => ['array|false', 'locale'=>'string'],
'locale_get_primary_language' => ['string', 'locale'=>'string'],
'locale_get_region' => ['string', 'locale'=>'string'],
'locale_get_script' => ['string', 'locale'=>'string'],
'locale_lookup' => ['string', 'languageTag'=>'array', 'locale'=>'string', 'canonicalize='=>'bool', 'defaultLocale='=>'string'],
'locale_parse' => ['array', 'locale'=>'string'],
'locale_set_default' => ['bool', 'locale'=>'string'],
'localeconv' => ['array'],
'localtime' => ['array', 'timestamp='=>'int', 'associative='=>'bool'],
'log' => ['float', 'num'=>'float', 'base='=>'float'],
'log10' => ['float', 'num'=>'float'],
'log1p' => ['float', 'num'=>'float'],
'LogicException::__clone' => ['void'],
'LogicException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?LogicException'],
'LogicException::__toString' => ['string'],
'LogicException::getCode' => ['int'],
'LogicException::getFile' => ['string'],
'LogicException::getLine' => ['int'],
'LogicException::getMessage' => ['string'],
'LogicException::getPrevious' => ['Throwable|LogicException|null'],
'LogicException::getTrace' => ['list<array<string,mixed>>'],
'LogicException::getTraceAsString' => ['string'],
'long2ip' => ['string', 'ip'=>'string|int'],
'lstat' => ['array|false', 'filename'=>'string'],
'ltrim' => ['string', 'string'=>'string', 'characters='=>'string'],
'Lua::__call' => ['mixed', 'lua_func'=>'callable', 'args='=>'array', 'use_self='=>'int'],
'Lua::__construct' => ['void', 'lua_script_file'=>'string'],
'Lua::assign' => ['?Lua', 'name'=>'string', 'value'=>'mixed'],
'Lua::call' => ['mixed', 'lua_func'=>'callable', 'args='=>'array', 'use_self='=>'int'],
'Lua::eval' => ['mixed', 'statements'=>'string'],
'Lua::getVersion' => ['string'],
'Lua::include' => ['mixed', 'file'=>'string'],
'Lua::registerCallback' => ['Lua|null|false', 'name'=>'string', 'function'=>'callable'],
'LuaClosure::__invoke' => ['void', 'arg'=>'mixed', '...args='=>'mixed'],
'lzf_compress' => ['string', 'data'=>'string'],
'lzf_decompress' => ['string', 'data'=>'string'],
'lzf_optimized_for' => ['int'],
'm_checkstatus' => ['int', 'conn'=>'resource', 'identifier'=>'int'],
'm_completeauthorizations' => ['int', 'conn'=>'resource', 'array'=>'int'],
'm_connect' => ['int', 'conn'=>'resource'],
'm_connectionerror' => ['string', 'conn'=>'resource'],
'm_deletetrans' => ['bool', 'conn'=>'resource', 'identifier'=>'int'],
'm_destroyconn' => ['bool', 'conn'=>'resource'],
'm_destroyengine' => ['void'],
'm_getcell' => ['string', 'conn'=>'resource', 'identifier'=>'int', 'column'=>'string', 'row'=>'int'],
'm_getcellbynum' => ['string', 'conn'=>'resource', 'identifier'=>'int', 'column'=>'int', 'row'=>'int'],
'm_getcommadelimited' => ['string', 'conn'=>'resource', 'identifier'=>'int'],
'm_getheader' => ['string', 'conn'=>'resource', 'identifier'=>'int', 'column_num'=>'int'],
'm_initconn' => ['resource'],
'm_initengine' => ['int', 'location'=>'string'],
'm_iscommadelimited' => ['int', 'conn'=>'resource', 'identifier'=>'int'],
'm_maxconntimeout' => ['bool', 'conn'=>'resource', 'secs'=>'int'],
'm_monitor' => ['int', 'conn'=>'resource'],
'm_numcolumns' => ['int', 'conn'=>'resource', 'identifier'=>'int'],
'm_numrows' => ['int', 'conn'=>'resource', 'identifier'=>'int'],
'm_parsecommadelimited' => ['int', 'conn'=>'resource', 'identifier'=>'int'],
'm_responsekeys' => ['array', 'conn'=>'resource', 'identifier'=>'int'],
'm_responseparam' => ['string', 'conn'=>'resource', 'identifier'=>'int', 'key'=>'string'],
'm_returnstatus' => ['int', 'conn'=>'resource', 'identifier'=>'int'],
'm_setblocking' => ['int', 'conn'=>'resource', 'tf'=>'int'],
'm_setdropfile' => ['int', 'conn'=>'resource', 'directory'=>'string'],
'm_setip' => ['int', 'conn'=>'resource', 'host'=>'string', 'port'=>'int'],
'm_setssl' => ['int', 'conn'=>'resource', 'host'=>'string', 'port'=>'int'],
'm_setssl_cafile' => ['int', 'conn'=>'resource', 'cafile'=>'string'],
'm_setssl_files' => ['int', 'conn'=>'resource', 'sslkeyfile'=>'string', 'sslcertfile'=>'string'],
'm_settimeout' => ['int', 'conn'=>'resource', 'seconds'=>'int'],
'm_sslcert_gen_hash' => ['string', 'filename'=>'string'],
'm_transactionssent' => ['int', 'conn'=>'resource'],
'm_transinqueue' => ['int', 'conn'=>'resource'],
'm_transkeyval' => ['int', 'conn'=>'resource', 'identifier'=>'int', 'key'=>'string', 'value'=>'string'],
'm_transnew' => ['int', 'conn'=>'resource'],
'm_transsend' => ['int', 'conn'=>'resource', 'identifier'=>'int'],
'm_uwait' => ['int', 'microsecs'=>'int'],
'm_validateidentifier' => ['int', 'conn'=>'resource', 'tf'=>'int'],
'm_verifyconnection' => ['bool', 'conn'=>'resource', 'tf'=>'int'],
'm_verifysslcert' => ['bool', 'conn'=>'resource', 'tf'=>'int'],
'magic_quotes_runtime' => ['bool', 'new_setting'=>'bool'],
'mail' => ['bool', 'to'=>'string', 'subject'=>'string', 'message'=>'string', 'additional_headers='=>'string|array|null', 'additional_params='=>'string'],
'mailparse_determine_best_xfer_encoding' => ['string', 'fp'=>'resource'],
'mailparse_msg_create' => ['resource'],
'mailparse_msg_extract_part' => ['void', 'mimemail'=>'resource', 'msgbody'=>'string', 'callbackfunc='=>'callable'],
'mailparse_msg_extract_part_file' => ['string', 'mimemail'=>'resource', 'filename'=>'mixed', 'callbackfunc='=>'callable'],
'mailparse_msg_extract_whole_part_file' => ['string', 'mimemail'=>'resource', 'filename'=>'string', 'callbackfunc='=>'callable'],
'mailparse_msg_free' => ['bool', 'mimemail'=>'resource'],
'mailparse_msg_get_part' => ['resource', 'mimemail'=>'resource', 'mimesection'=>'string'],
'mailparse_msg_get_part_data' => ['array', 'mimemail'=>'resource'],
'mailparse_msg_get_structure' => ['array', 'mimemail'=>'resource'],
'mailparse_msg_parse' => ['bool', 'mimemail'=>'resource', 'data'=>'string'],
'mailparse_msg_parse_file' => ['resource|false', 'filename'=>'string'],
'mailparse_rfc822_parse_addresses' => ['array', 'addresses'=>'string'],
'mailparse_stream_encode' => ['bool', 'sourcefp'=>'resource', 'destfp'=>'resource', 'encoding'=>'string'],
'mailparse_uudecode_all' => ['array', 'fp'=>'resource'],
'mapObj::__construct' => ['void', 'map_file_name'=>'string', 'new_map_path'=>'string'],
'mapObj::appendOutputFormat' => ['int', 'outputFormat'=>'outputformatObj'],
'mapObj::applyconfigoptions' => ['int'],
'mapObj::applySLD' => ['int', 'sldxml'=>'string'],
'mapObj::applySLDURL' => ['int', 'sldurl'=>'string'],
'mapObj::convertToString' => ['string'],
'mapObj::draw' => ['?imageObj'],
'mapObj::drawLabelCache' => ['int', 'image'=>'imageObj'],
'mapObj::drawLegend' => ['imageObj'],
'mapObj::drawQuery' => ['?imageObj'],
'mapObj::drawReferenceMap' => ['imageObj'],
'mapObj::drawScaleBar' => ['imageObj'],
'mapObj::embedLegend' => ['int', 'image'=>'imageObj'],
'mapObj::embedScalebar' => ['int', 'image'=>'imageObj'],
'mapObj::free' => ['void'],
'mapObj::generateSLD' => ['string'],
'mapObj::getAllGroupNames' => ['array'],
'mapObj::getAllLayerNames' => ['array'],
'mapObj::getColorbyIndex' => ['colorObj', 'iCloIndex'=>'int'],
'mapObj::getConfigOption' => ['string', 'key'=>'string'],
'mapObj::getLabel' => ['labelcacheMemberObj', 'index'=>'int'],
'mapObj::getLayer' => ['layerObj', 'index'=>'int'],
'mapObj::getLayerByName' => ['layerObj', 'layer_name'=>'string'],
'mapObj::getLayersDrawingOrder' => ['array'],
'mapObj::getLayersIndexByGroup' => ['array', 'groupname'=>'string'],
'mapObj::getMetaData' => ['int', 'name'=>'string'],
'mapObj::getNumSymbols' => ['int'],
'mapObj::getOutputFormat' => ['?outputformatObj', 'index'=>'int'],
'mapObj::getProjection' => ['string'],
'mapObj::getSymbolByName' => ['int', 'symbol_name'=>'string'],
'mapObj::getSymbolObjectById' => ['symbolObj', 'symbolid'=>'int'],
'mapObj::loadMapContext' => ['int', 'filename'=>'string', 'unique_layer_name'=>'bool'],
'mapObj::loadOWSParameters' => ['int', 'request'=>'OwsrequestObj', 'version'=>'string'],
'mapObj::moveLayerDown' => ['int', 'layerindex'=>'int'],
'mapObj::moveLayerUp' => ['int', 'layerindex'=>'int'],
'mapObj::ms_newMapObjFromString' => ['mapObj', 'map_file_string'=>'string', 'new_map_path'=>'string'],
'mapObj::offsetExtent' => ['int', 'x'=>'float', 'y'=>'float'],
'mapObj::owsDispatch' => ['int', 'request'=>'OwsrequestObj'],
'mapObj::prepareImage' => ['imageObj'],
'mapObj::prepareQuery' => ['void'],
'mapObj::processLegendTemplate' => ['string', 'params'=>'array'],
'mapObj::processQueryTemplate' => ['string', 'params'=>'array', 'generateimages'=>'bool'],
'mapObj::processTemplate' => ['string', 'params'=>'array', 'generateimages'=>'bool'],
'mapObj::queryByFeatures' => ['int', 'slayer'=>'int'],
'mapObj::queryByIndex' => ['int', 'layerindex'=>'', 'tileindex'=>'', 'shapeindex'=>'', 'addtoquery'=>''],
'mapObj::queryByPoint' => ['int', 'point'=>'pointObj', 'mode'=>'int', 'buffer'=>'float'],
'mapObj::queryByRect' => ['int', 'rect'=>'rectObj'],
'mapObj::queryByShape' => ['int', 'shape'=>'shapeObj'],
'mapObj::removeLayer' => ['layerObj', 'nIndex'=>'int'],
'mapObj::removeMetaData' => ['int', 'name'=>'string'],
'mapObj::removeOutputFormat' => ['int', 'name'=>'string'],
'mapObj::save' => ['int', 'filename'=>'string'],
'mapObj::saveMapContext' => ['int', 'filename'=>'string'],
'mapObj::saveQuery' => ['int', 'filename'=>'string', 'results'=>'int'],
'mapObj::scaleExtent' => ['int', 'zoomfactor'=>'float', 'minscaledenom'=>'float', 'maxscaledenom'=>'float'],
'mapObj::selectOutputFormat' => ['int', 'type'=>'string'],
'mapObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'mapObj::setCenter' => ['int', 'center'=>'pointObj'],
'mapObj::setConfigOption' => ['int', 'key'=>'string', 'value'=>'string'],
'mapObj::setExtent' => ['void', 'minx'=>'float', 'miny'=>'float', 'maxx'=>'float', 'maxy'=>'float'],
'mapObj::setFontSet' => ['int', 'fileName'=>'string'],
'mapObj::setMetaData' => ['int', 'name'=>'string', 'value'=>'string'],
'mapObj::setProjection' => ['int', 'proj_params'=>'string', 'bSetUnitsAndExtents'=>'bool'],
'mapObj::setRotation' => ['int', 'rotation_angle'=>'float'],
'mapObj::setSize' => ['int', 'width'=>'int', 'height'=>'int'],
'mapObj::setSymbolSet' => ['int', 'fileName'=>'string'],
'mapObj::setWKTProjection' => ['int', 'proj_params'=>'string', 'bSetUnitsAndExtents'=>'bool'],
'mapObj::zoomPoint' => ['int', 'nZoomFactor'=>'int', 'oPixelPos'=>'pointObj', 'nImageWidth'=>'int', 'nImageHeight'=>'int', 'oGeorefExt'=>'rectObj'],
'mapObj::zoomRectangle' => ['int', 'oPixelExt'=>'rectObj', 'nImageWidth'=>'int', 'nImageHeight'=>'int', 'oGeorefExt'=>'rectObj'],
'mapObj::zoomScale' => ['int', 'nScaleDenom'=>'float', 'oPixelPos'=>'pointObj', 'nImageWidth'=>'int', 'nImageHeight'=>'int', 'oGeorefExt'=>'rectObj', 'oMaxGeorefExt'=>'rectObj'],
'max' => ['mixed', 'value'=>'non-empty-array'],
'max\'1' => ['mixed', 'value'=>'', 'values'=>'', '...args='=>''],
'maxdb::__construct' => ['void', 'host='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'],
'maxdb::affected_rows' => ['int', 'link'=>''],
'maxdb::auto_commit' => ['bool', 'link'=>'', 'mode'=>'bool'],
'maxdb::change_user' => ['bool', 'link'=>'', 'user'=>'string', 'password'=>'string', 'database'=>'string'],
'maxdb::character_set_name' => ['string', 'link'=>''],
'maxdb::close' => ['bool', 'link'=>''],
'maxdb::commit' => ['bool', 'link'=>''],
'maxdb::disable_reads_from_master' => ['', 'link'=>''],
'maxdb::errno' => ['int', 'link'=>''],
'maxdb::error' => ['string', 'link'=>''],
'maxdb::field_count' => ['int', 'link'=>''],
'maxdb::get_host_info' => ['string', 'link'=>''],
'maxdb::info' => ['string', 'link'=>''],
'maxdb::insert_id' => ['', 'link'=>''],
'maxdb::kill' => ['bool', 'link'=>'', 'processid'=>'int'],
'maxdb::more_results' => ['bool', 'link'=>''],
'maxdb::multi_query' => ['bool', 'link'=>'', 'query'=>'string'],
'maxdb::next_result' => ['bool', 'link'=>''],
'maxdb::num_rows' => ['int', 'result'=>''],
'maxdb::options' => ['bool', 'link'=>'', 'option'=>'int', 'value'=>''],
'maxdb::ping' => ['bool', 'link'=>''],
'maxdb::prepare' => ['maxdb_stmt', 'link'=>'', 'query'=>'string'],
'maxdb::protocol_version' => ['string', 'link'=>''],
'maxdb::query' => ['', 'link'=>'', 'query'=>'string', 'resultmode='=>'int'],
'maxdb::real_connect' => ['bool', 'link'=>'', 'hostname='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'],
'maxdb::real_escape_string' => ['string', 'link'=>'', 'escapestr'=>'string'],
'maxdb::real_query' => ['bool', 'link'=>'', 'query'=>'string'],
'maxdb::rollback' => ['bool', 'link'=>''],
'maxdb::rpl_query_type' => ['int', 'link'=>''],
'maxdb::select_db' => ['bool', 'link'=>'', 'dbname'=>'string'],
'maxdb::send_query' => ['bool', 'link'=>'', 'query'=>'string'],
'maxdb::server_info' => ['string', 'link'=>''],
'maxdb::server_version' => ['int', 'link'=>''],
'maxdb::sqlstate' => ['string', 'link'=>''],
'maxdb::ssl_set' => ['bool', 'link'=>'', 'key'=>'string', 'cert'=>'string', 'ca'=>'string', 'capath'=>'string', 'cipher'=>'string'],
'maxdb::stat' => ['string', 'link'=>''],
'maxdb::stmt_init' => ['object', 'link'=>''],
'maxdb::store_result' => ['bool', 'link'=>''],
'maxdb::thread_id' => ['int', 'link'=>''],
'maxdb::use_result' => ['resource', 'link'=>''],
'maxdb::warning_count' => ['int', 'link'=>''],
'maxdb_affected_rows' => ['int', 'link'=>'resource'],
'maxdb_autocommit' => ['bool', 'link'=>'', 'mode'=>'bool'],
'maxdb_change_user' => ['bool', 'link'=>'', 'user'=>'string', 'password'=>'string', 'database'=>'string'],
'maxdb_character_set_name' => ['string', 'link'=>''],
'maxdb_close' => ['bool', 'link'=>''],
'maxdb_commit' => ['bool', 'link'=>''],
'maxdb_connect' => ['resource', 'host='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'],
'maxdb_connect_errno' => ['int'],
'maxdb_connect_error' => ['string'],
'maxdb_data_seek' => ['bool', 'result'=>'', 'offset'=>'int'],
'maxdb_debug' => ['void', 'debug'=>'string'],
'maxdb_disable_reads_from_master' => ['', 'link'=>''],
'maxdb_disable_rpl_parse' => ['bool', 'link'=>'resource'],
'maxdb_dump_debug_info' => ['bool', 'link'=>'resource'],
'maxdb_embedded_connect' => ['resource', 'dbname='=>'string'],
'maxdb_enable_reads_from_master' => ['bool', 'link'=>'resource'],
'maxdb_enable_rpl_parse' => ['bool', 'link'=>'resource'],
'maxdb_errno' => ['int', 'link'=>'resource'],
'maxdb_error' => ['string', 'link'=>'resource'],
'maxdb_fetch_array' => ['', 'result'=>'', 'resulttype='=>'int'],
'maxdb_fetch_assoc' => ['array', 'result'=>''],
'maxdb_fetch_field' => ['', 'result'=>''],
'maxdb_fetch_field_direct' => ['', 'result'=>'', 'fieldnr'=>'int'],
'maxdb_fetch_fields' => ['', 'result'=>''],
'maxdb_fetch_lengths' => ['array', 'result'=>'resource'],
'maxdb_fetch_object' => ['object', 'result'=>'object'],
'maxdb_fetch_row' => ['', 'result'=>''],
'maxdb_field_count' => ['int', 'link'=>''],
'maxdb_field_seek' => ['bool', 'result'=>'', 'fieldnr'=>'int'],
'maxdb_field_tell' => ['int', 'result'=>'resource'],
'maxdb_free_result' => ['', 'result'=>''],
'maxdb_get_client_info' => ['string'],
'maxdb_get_client_version' => ['int'],
'maxdb_get_host_info' => ['string', 'link'=>'resource'],
'maxdb_get_proto_info' => ['string', 'link'=>'resource'],
'maxdb_get_server_info' => ['string', 'link'=>'resource'],
'maxdb_get_server_version' => ['int', 'link'=>'resource'],
'maxdb_info' => ['string', 'link'=>'resource'],
'maxdb_init' => ['resource'],
'maxdb_insert_id' => ['mixed', 'link'=>'resource'],
'maxdb_kill' => ['bool', 'link'=>'', 'processid'=>'int'],
'maxdb_master_query' => ['bool', 'link'=>'resource', 'query'=>'string'],
'maxdb_more_results' => ['bool', 'link'=>'resource'],
'maxdb_multi_query' => ['bool', 'link'=>'', 'query'=>'string'],
'maxdb_next_result' => ['bool', 'link'=>'resource'],
'maxdb_num_fields' => ['int', 'result'=>'resource'],
'maxdb_num_rows' => ['int', 'result'=>'resource'],
'maxdb_options' => ['bool', 'link'=>'', 'option'=>'int', 'value'=>''],
'maxdb_ping' => ['bool', 'link'=>''],
'maxdb_prepare' => ['maxdb_stmt', 'link'=>'', 'query'=>'string'],
'maxdb_query' => ['', 'link'=>'', 'query'=>'string', 'resultmode='=>'int'],
'maxdb_real_connect' => ['bool', 'link'=>'', 'hostname='=>'string', 'username='=>'string', 'passwd='=>'string', 'dbname='=>'string', 'port='=>'int', 'socket='=>'string'],
'maxdb_real_escape_string' => ['string', 'link'=>'', 'escapestr'=>'string'],
'maxdb_real_query' => ['bool', 'link'=>'', 'query'=>'string'],
'maxdb_report' => ['bool', 'flags'=>'int'],
'maxdb_result::current_field' => ['int', 'result'=>''],
'maxdb_result::data_seek' => ['bool', 'result'=>'', 'offset'=>'int'],
'maxdb_result::fetch_array' => ['', 'result'=>'', 'resulttype='=>'int'],
'maxdb_result::fetch_assoc' => ['array', 'result'=>''],
'maxdb_result::fetch_field' => ['', 'result'=>''],
'maxdb_result::fetch_field_direct' => ['', 'result'=>'', 'fieldnr'=>'int'],
'maxdb_result::fetch_fields' => ['', 'result'=>''],
'maxdb_result::fetch_object' => ['object', 'result'=>'object'],
'maxdb_result::fetch_row' => ['', 'result'=>''],
'maxdb_result::field_count' => ['int', 'result'=>''],
'maxdb_result::field_seek' => ['bool', 'result'=>'', 'fieldnr'=>'int'],
'maxdb_result::free' => ['', 'result'=>''],
'maxdb_result::lengths' => ['array', 'result'=>''],
'maxdb_rollback' => ['bool', 'link'=>''],
'maxdb_rpl_parse_enabled' => ['int', 'link'=>'resource'],
'maxdb_rpl_probe' => ['bool', 'link'=>'resource'],
'maxdb_rpl_query_type' => ['int', 'link'=>''],
'maxdb_select_db' => ['bool', 'link'=>'resource', 'dbname'=>'string'],
'maxdb_send_query' => ['bool', 'link'=>'', 'query'=>'string'],
'maxdb_server_end' => ['void'],
'maxdb_server_init' => ['bool', 'server='=>'array', 'groups='=>'array'],
'maxdb_sqlstate' => ['string', 'link'=>'resource'],
'maxdb_ssl_set' => ['bool', 'link'=>'', 'key'=>'string', 'cert'=>'string', 'ca'=>'string', 'capath'=>'string', 'cipher'=>'string'],
'maxdb_stat' => ['string', 'link'=>''],
'maxdb_stmt::affected_rows' => ['int', 'stmt'=>''],
'maxdb_stmt::bind_param' => ['bool', 'stmt'=>'', 'types'=>'string', '&...rw_var'=>''],
'maxdb_stmt::bind_param\'1' => ['bool', 'stmt'=>'', 'types'=>'string', '&rw_var'=>'array'],
'maxdb_stmt::bind_result' => ['bool', 'stmt'=>'', '&w_var1'=>'', '&...w_vars='=>''],
'maxdb_stmt::close' => ['bool', 'stmt'=>''],
'maxdb_stmt::close_long_data' => ['bool', 'stmt'=>'', 'param_nr'=>'int'],
'maxdb_stmt::data_seek' => ['bool', 'statement'=>'', 'offset'=>'int'],
'maxdb_stmt::errno' => ['int', 'stmt'=>''],
'maxdb_stmt::error' => ['string', 'stmt'=>''],
'maxdb_stmt::execute' => ['bool', 'stmt'=>''],
'maxdb_stmt::fetch' => ['bool', 'stmt'=>''],
'maxdb_stmt::free_result' => ['', 'stmt'=>''],
'maxdb_stmt::num_rows' => ['int', 'stmt'=>''],
'maxdb_stmt::param_count' => ['int', 'stmt'=>''],
'maxdb_stmt::prepare' => ['', 'stmt'=>'', 'query'=>'string'],
'maxdb_stmt::reset' => ['bool', 'stmt'=>''],
'maxdb_stmt::result_metadata' => ['resource', 'stmt'=>''],
'maxdb_stmt::send_long_data' => ['bool', 'stmt'=>'', 'param_nr'=>'int', 'data'=>'string'],
'maxdb_stmt::stmt_send_long_data' => ['bool', 'param_nr'=>'int', 'data'=>'string'],
'maxdb_stmt::store_result' => ['bool'],
'maxdb_stmt_affected_rows' => ['int', 'stmt'=>'resource'],
'maxdb_stmt_bind_param' => ['bool', 'stmt'=>'', 'types'=>'string', 'var1'=>'', '...args='=>'', 'var='=>'array'],
'maxdb_stmt_bind_result' => ['bool', 'stmt'=>'', '&w_var1'=>'', '&...w_vars='=>''],
'maxdb_stmt_close' => ['bool', 'stmt'=>''],
'maxdb_stmt_close_long_data' => ['bool', 'stmt'=>'', 'param_nr'=>'int'],
'maxdb_stmt_data_seek' => ['bool', 'statement'=>'', 'offset'=>'int'],
'maxdb_stmt_errno' => ['int', 'stmt'=>'resource'],
'maxdb_stmt_error' => ['string', 'stmt'=>'resource'],
'maxdb_stmt_execute' => ['bool', 'stmt'=>''],
'maxdb_stmt_fetch' => ['bool', 'stmt'=>''],
'maxdb_stmt_free_result' => ['', 'stmt'=>''],
'maxdb_stmt_init' => ['object', 'link'=>''],
'maxdb_stmt_num_rows' => ['int', 'stmt'=>'resource'],
'maxdb_stmt_param_count' => ['int', 'stmt'=>'resource'],
'maxdb_stmt_prepare' => ['', 'stmt'=>'', 'query'=>'string'],
'maxdb_stmt_reset' => ['bool', 'stmt'=>''],
'maxdb_stmt_result_metadata' => ['resource', 'stmt'=>''],
'maxdb_stmt_send_long_data' => ['bool', 'stmt'=>'', 'param_nr'=>'int', 'data'=>'string'],
'maxdb_stmt_sqlstate' => ['string', 'stmt'=>'resource'],
'maxdb_stmt_store_result' => ['bool', 'stmt'=>''],
'maxdb_store_result' => ['bool', 'link'=>''],
'maxdb_thread_id' => ['int', 'link'=>'resource'],
'maxdb_thread_safe' => ['bool'],
'maxdb_use_result' => ['resource', 'link'=>''],
'maxdb_warning_count' => ['int', 'link'=>'resource'],
'mb_check_encoding' => ['bool', 'value='=>'array|string|null', 'encoding='=>'string|null'],
'mb_chr' => ['string|false', 'codepoint'=>'int', 'encoding='=>'string|null'],
'mb_convert_case' => ['string', 'string'=>'string', 'mode'=>'int', 'encoding='=>'string|null'],
'mb_convert_encoding' => ['string|false', 'string'=>'string', 'to_encoding'=>'string', 'from_encoding='=>'array|string|null'],
'mb_convert_encoding\'1' => ['array', 'string'=>'array', 'to_encoding'=>'string', 'from_encoding='=>'array|string|null'],
'mb_convert_kana' => ['string', 'string'=>'string', 'mode='=>'string', 'encoding='=>'string|null'],
'mb_convert_variables' => ['string|false', 'to_encoding'=>'string', 'from_encoding'=>'array|string', '&rw_var'=>'string|array|object', '&...rw_vars='=>'string|array|object'],
'mb_decode_mimeheader' => ['string', 'string'=>'string'],
'mb_decode_numericentity' => ['string', 'string'=>'string', 'map'=>'array', 'encoding='=>'string|null'],
'mb_detect_encoding' => ['string|false', 'string'=>'string', 'encodings='=>'array|string|null', 'strict='=>'bool'],
'mb_detect_order' => ['bool|list<string>', 'encoding='=>'array|string|null'],
'mb_encode_mimeheader' => ['string', 'string'=>'string', 'charset='=>'string|null', 'transfer_encoding='=>'string|null', 'newline='=>'string', 'indent='=>'int'],
'mb_encode_numericentity' => ['string', 'string'=>'string', 'map'=>'array', 'encoding='=>'string|null', 'hex='=>'bool'],
'mb_encoding_aliases' => ['list<string>|false', 'encoding'=>'string'],
'mb_ereg' => ['bool', 'pattern'=>'string', 'string'=>'string', '&w_matches='=>'array|null'],
'mb_ereg_match' => ['bool', 'pattern'=>'string', 'string'=>'string', 'options='=>'string|null'],
'mb_ereg_replace' => ['string|false|null', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string', 'options='=>'string|null'],
'mb_ereg_replace_callback' => ['string|false', 'pattern'=>'string', 'callback'=>'callable', 'string'=>'string', 'options='=>'string|null'],
'mb_ereg_search' => ['bool', 'pattern='=>'string|null', 'options='=>'string|null'],
'mb_ereg_search_getpos' => ['int'],
'mb_ereg_search_getregs' => ['string[]|false'],
'mb_ereg_search_init' => ['bool', 'string'=>'string', 'pattern='=>'string|null', 'options='=>'string|null'],
'mb_ereg_search_pos' => ['int[]|false', 'pattern='=>'string|null', 'options='=>'string|null'],
'mb_ereg_search_regs' => ['string[]|false', 'pattern='=>'string|null', 'options='=>'string|null'],
'mb_ereg_search_setpos' => ['bool', 'offset'=>'int'],
'mb_eregi' => ['bool', 'pattern'=>'string', 'string'=>'string', '&w_matches='=>'array|null'],
'mb_eregi_replace' => ['string|false|null', 'pattern'=>'string', 'replacement'=>'string', 'string'=>'string', 'options='=>'string|null'],
'mb_get_info' => ['array|string|int|false', 'type='=>'string'],
'mb_http_input' => ['array|string|false', 'type='=>'string|null'],
'mb_http_output' => ['string|bool', 'encoding='=>'string|null'],
'mb_internal_encoding' => ['string|bool', 'encoding='=>'string|null'],
'mb_language' => ['string|bool', 'language='=>'string|null'],
'mb_list_encodings' => ['list<string>'],
'mb_ord' => ['int|false', 'string'=>'string', 'encoding='=>'string|null'],
'mb_output_handler' => ['string', 'string'=>'string', 'status'=>'int'],
'mb_parse_str' => ['bool', 'string'=>'string', '&w_result'=>'array'],
'mb_preferred_mime_name' => ['string|false', 'encoding'=>'string'],
'mb_regex_encoding' => ['string|bool', 'encoding='=>'string|null'],
'mb_regex_set_options' => ['string', 'options='=>'string|null'],
'mb_scrub' => ['string', 'string'=>'string', 'encoding='=>'string|null'],
'mb_send_mail' => ['bool', 'to'=>'string', 'subject'=>'string', 'message'=>'string', 'additional_headers='=>'string|array', 'additional_params='=>'string|null'],
'mb_split' => ['list<string>', 'pattern'=>'string', 'string'=>'string', 'limit='=>'int'],
'mb_str_split' => ['list<string>', 'string'=>'string', 'length='=>'positive-int', 'encoding='=>'string|null'],
'mb_strcut' => ['string', 'string'=>'string', 'start'=>'int', 'length='=>'?int', 'encoding='=>'string|null'],
'mb_strimwidth' => ['string', 'string'=>'string', 'start'=>'int', 'width'=>'int', 'trim_marker='=>'string', 'encoding='=>'string|null'],
'mb_stripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string|null'],
'mb_stristr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool', 'encoding='=>'string|null'],
'mb_strlen' => ['int', 'string'=>'string', 'encoding='=>'string|null'],
'mb_strpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string|null'],
'mb_strrchr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool', 'encoding='=>'string|null'],
'mb_strrichr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool', 'encoding='=>'string|null'],
'mb_strripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string|null'],
'mb_strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'encoding='=>'string|null'],
'mb_strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool', 'encoding='=>'string|null'],
'mb_strtolower' => ['lowercase-string', 'string'=>'string', 'encoding='=>'string|null'],
'mb_strtoupper' => ['string', 'string'=>'string', 'encoding='=>'string|null'],
'mb_strwidth' => ['int', 'string'=>'string', 'encoding='=>'string|null'],
'mb_substitute_character' => ['bool|int|string', 'substitute_character='=>'int|string|null'],
'mb_substr' => ['string', 'string'=>'string', 'start'=>'int', 'length='=>'?int', 'encoding='=>'string|null'],
'mb_substr_count' => ['int', 'haystack'=>'string', 'needle'=>'string', 'encoding='=>'string|null'],
'mcrypt_cbc' => ['string', 'cipher'=>'string|int', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'],
'mcrypt_cfb' => ['string', 'cipher'=>'string|int', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'],
'mcrypt_create_iv' => ['string|false', 'size'=>'int', 'source='=>'int'],
'mcrypt_decrypt' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'string', 'iv='=>'string'],
'mcrypt_ecb' => ['string', 'cipher'=>'string|int', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'],
'mcrypt_enc_get_algorithms_name' => ['string', 'td'=>'resource'],
'mcrypt_enc_get_block_size' => ['int', 'td'=>'resource'],
'mcrypt_enc_get_iv_size' => ['int', 'td'=>'resource'],
'mcrypt_enc_get_key_size' => ['int', 'td'=>'resource'],
'mcrypt_enc_get_modes_name' => ['string', 'td'=>'resource'],
'mcrypt_enc_get_supported_key_sizes' => ['array', 'td'=>'resource'],
'mcrypt_enc_is_block_algorithm' => ['bool', 'td'=>'resource'],
'mcrypt_enc_is_block_algorithm_mode' => ['bool', 'td'=>'resource'],
'mcrypt_enc_is_block_mode' => ['bool', 'td'=>'resource'],
'mcrypt_enc_self_test' => ['int|false', 'td'=>'resource'],
'mcrypt_encrypt' => ['string', 'cipher'=>'string', 'key'=>'string', 'data'=>'string', 'mode'=>'string', 'iv='=>'string'],
'mcrypt_generic' => ['string', 'td'=>'resource', 'data'=>'string'],
'mcrypt_generic_deinit' => ['bool', 'td'=>'resource'],
'mcrypt_generic_end' => ['bool', 'td'=>'resource'],
'mcrypt_generic_init' => ['int|false', 'td'=>'resource', 'key'=>'string', 'iv'=>'string'],
'mcrypt_get_block_size' => ['int', 'cipher'=>'int|string', 'module'=>'string'],
'mcrypt_get_cipher_name' => ['string|false', 'cipher'=>'int|string'],
'mcrypt_get_iv_size' => ['int|false', 'cipher'=>'int|string', 'module'=>'string'],
'mcrypt_get_key_size' => ['int', 'cipher'=>'int|string', 'module'=>'string'],
'mcrypt_list_algorithms' => ['array', 'lib_dir='=>'string'],
'mcrypt_list_modes' => ['array', 'lib_dir='=>'string'],
'mcrypt_module_close' => ['bool', 'td'=>'resource'],
'mcrypt_module_get_algo_block_size' => ['int', 'algorithm'=>'string', 'lib_dir='=>'string'],
'mcrypt_module_get_algo_key_size' => ['int', 'algorithm'=>'string', 'lib_dir='=>'string'],
'mcrypt_module_get_supported_key_sizes' => ['array', 'algorithm'=>'string', 'lib_dir='=>'string'],
'mcrypt_module_is_block_algorithm' => ['bool', 'algorithm'=>'string', 'lib_dir='=>'string'],
'mcrypt_module_is_block_algorithm_mode' => ['bool', 'mode'=>'string', 'lib_dir='=>'string'],
'mcrypt_module_is_block_mode' => ['bool', 'mode'=>'string', 'lib_dir='=>'string'],
'mcrypt_module_open' => ['resource|false', 'cipher'=>'string', 'cipher_directory'=>'string', 'mode'=>'string', 'mode_directory'=>'string'],
'mcrypt_module_self_test' => ['bool', 'algorithm'=>'string', 'lib_dir='=>'string'],
'mcrypt_ofb' => ['string', 'cipher'=>'int|string', 'key'=>'string', 'data'=>'string', 'mode'=>'int', 'iv='=>'string'],
'md5' => ['string', 'string'=>'string', 'binary='=>'bool'],
'md5_file' => ['string|false', 'filename'=>'string', 'binary='=>'bool'],
'mdecrypt_generic' => ['string', 'td'=>'resource', 'data'=>'string'],
'Memcache::add' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'Memcache::addServer' => ['bool', 'host'=>'string', 'port='=>'int', 'persistent='=>'bool', 'weight='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'callable', 'timeoutms='=>'int'],
'Memcache::append' => [''],
'Memcache::cas' => [''],
'Memcache::close' => ['bool'],
'Memcache::connect' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'],
'Memcache::decrement' => ['int', 'key'=>'string', 'value='=>'int'],
'Memcache::delete' => ['bool', 'key'=>'string', 'timeout='=>'int'],
'Memcache::findServer' => [''],
'Memcache::flush' => ['bool'],
'Memcache::get' => ['string|array|false', 'key'=>'string', 'flags='=>'array', 'keys='=>'array'],
'Memcache::get\'1' => ['array', 'key'=>'string[]', 'flags='=>'int[]'],
'Memcache::getExtendedStats' => ['array', 'type='=>'string', 'slabid='=>'int', 'limit='=>'int'],
'Memcache::getServerStatus' => ['int', 'host'=>'string', 'port='=>'int'],
'Memcache::getStats' => ['array', 'type='=>'string', 'slabid='=>'int', 'limit='=>'int'],
'Memcache::getVersion' => ['string'],
'Memcache::increment' => ['int', 'key'=>'string', 'value='=>'int'],
'Memcache::pconnect' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'],
'Memcache::prepend' => ['string'],
'Memcache::replace' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'Memcache::set' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'Memcache::setCompressThreshold' => ['bool', 'threshold'=>'int', 'min_savings='=>'float'],
'Memcache::setFailureCallback' => [''],
'Memcache::setServerParams' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'callable'],
'memcache_add' => ['bool', 'memcache_obj'=>'Memcache', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'memcache_add_server' => ['bool', 'memcache_obj'=>'Memcache', 'host'=>'string', 'port='=>'int', 'persistent='=>'bool', 'weight='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'callable', 'timeoutms='=>'int'],
'memcache_append' => ['', 'memcache_obj'=>'Memcache'],
'memcache_cas' => ['', 'memcache_obj'=>'Memcache'],
'memcache_close' => ['bool', 'memcache_obj'=>'Memcache'],
'memcache_connect' => ['Memcache|false', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'],
'memcache_debug' => ['bool', 'on_off'=>'bool'],
'memcache_decrement' => ['int', 'memcache_obj'=>'Memcache', 'key'=>'string', 'value='=>'int'],
'memcache_delete' => ['bool', 'memcache_obj'=>'Memcache', 'key'=>'string', 'timeout='=>'int'],
'memcache_flush' => ['bool', 'memcache_obj'=>'Memcache'],
'memcache_get' => ['string', 'memcache_obj'=>'Memcache', 'key'=>'string', 'flags='=>'int'],
'memcache_get\'1' => ['array', 'memcache_obj'=>'Memcache', 'key'=>'string[]', 'flags='=>'int[]'],
'memcache_get_extended_stats' => ['array', 'memcache_obj'=>'Memcache', 'type='=>'string', 'slabid='=>'int', 'limit='=>'int'],
'memcache_get_server_status' => ['int', 'memcache_obj'=>'Memcache', 'host'=>'string', 'port='=>'int'],
'memcache_get_stats' => ['array', 'memcache_obj'=>'Memcache', 'type='=>'string', 'slabid='=>'int', 'limit='=>'int'],
'memcache_get_version' => ['string', 'memcache_obj'=>'Memcache'],
'memcache_increment' => ['int', 'memcache_obj'=>'Memcache', 'key'=>'string', 'value='=>'int'],
'memcache_pconnect' => ['Memcache|false', 'host'=>'string', 'port='=>'int', 'timeout='=>'int'],
'memcache_prepend' => ['string', 'memcache_obj'=>'Memcache'],
'memcache_replace' => ['bool', 'memcache_obj'=>'Memcache', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'memcache_set' => ['bool', 'memcache_obj'=>'Memcache', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'memcache_set_compress_threshold' => ['bool', 'memcache_obj'=>'Memcache', 'threshold'=>'int', 'min_savings='=>'float'],
'memcache_set_failure_callback' => ['', 'memcache_obj'=>'Memcache'],
'memcache_set_server_params' => ['bool', 'memcache_obj'=>'Memcache', 'host'=>'string', 'port='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'callable'],
'Memcached::__construct' => ['void', 'persistent_id='=>'mixed|string', 'on_new_object_cb='=>'mixed'],
'Memcached::add' => ['bool', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'],
'Memcached::addByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'],
'Memcached::addServer' => ['bool', 'host'=>'string', 'port'=>'int', 'weight='=>'int'],
'Memcached::addServers' => ['bool', 'servers'=>'array'],
'Memcached::append' => ['bool', 'key'=>'string', 'value'=>'string'],
'Memcached::appendByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'string'],
'Memcached::cas' => ['bool', 'cas_token'=>'float', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'],
'Memcached::casByKey' => ['bool', 'cas_token'=>'float', 'server_key'=>'string', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'],
'Memcached::decrement' => ['int|false', 'key'=>'string', 'offset='=>'int', 'initial_value='=>'int', 'expiry='=>'int'],
'Memcached::decrementByKey' => ['int|false', 'server_key'=>'string', 'key'=>'string', 'offset='=>'int', 'initial_value='=>'int', 'expiry='=>'int'],
'Memcached::delete' => ['bool', 'key'=>'string', 'time='=>'int'],
'Memcached::deleteByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'time='=>'int'],
'Memcached::deleteMulti' => ['array', 'keys'=>'array', 'time='=>'int'],
'Memcached::deleteMultiByKey' => ['bool', 'server_key'=>'string', 'keys'=>'array', 'time='=>'int'],
'Memcached::fetch' => ['array|false'],
'Memcached::fetchAll' => ['array|false'],
'Memcached::flush' => ['bool', 'delay='=>'int'],
'Memcached::flushBuffers' => [''],
'Memcached::get' => ['mixed|false', 'key'=>'string', 'cache_cb='=>'?callable', 'flags='=>'int'],
'Memcached::getAllKeys' => ['array|false'],
'Memcached::getByKey' => ['mixed|false', 'server_key'=>'string', 'key'=>'string', 'value_cb='=>'?callable', 'flags='=>'int'],
'Memcached::getDelayed' => ['bool', 'keys'=>'array', 'with_cas='=>'bool', 'value_cb='=>'callable'],
'Memcached::getDelayedByKey' => ['bool', 'server_key'=>'string', 'keys'=>'array', 'with_cas='=>'bool', 'value_cb='=>'?callable'],
'Memcached::getLastDisconnectedServer' => [''],
'Memcached::getLastErrorCode' => [''],
'Memcached::getLastErrorErrno' => [''],
'Memcached::getLastErrorMessage' => [''],
'Memcached::getMulti' => ['array|false', 'keys'=>'array', 'flags='=>'int'],
'Memcached::getMultiByKey' => ['array|false', 'server_key'=>'string', 'keys'=>'array', 'flags='=>'int'],
'Memcached::getOption' => ['mixed|false', 'option'=>'int'],
'Memcached::getResultCode' => ['int'],
'Memcached::getResultMessage' => ['string'],
'Memcached::getServerByKey' => ['array', 'server_key'=>'string'],
'Memcached::getServerList' => ['array'],
'Memcached::getStats' => ['array', 'type='=>'?string'],
'Memcached::getVersion' => ['array'],
'Memcached::increment' => ['int|false', 'key'=>'string', 'offset='=>'int', 'initial_value='=>'int', 'expiry='=>'int'],
'Memcached::incrementByKey' => ['int|false', 'server_key'=>'string', 'key'=>'string', 'offset='=>'int', 'initial_value='=>'int', 'expiry='=>'int'],
'Memcached::isPersistent' => ['bool'],
'Memcached::isPristine' => ['bool'],
'Memcached::prepend' => ['bool', 'key'=>'string', 'value'=>'string'],
'Memcached::prependByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'string'],
'Memcached::quit' => ['bool'],
'Memcached::replace' => ['bool', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'],
'Memcached::replaceByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'],
'Memcached::resetServerList' => ['bool'],
'Memcached::set' => ['bool', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'],
'Memcached::setBucket' => ['', 'host_map'=>'array', 'forward_map'=>'array', 'replicas'=>''],
'Memcached::setByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'value'=>'mixed', 'expiration='=>'int'],
'Memcached::setEncodingKey' => ['', 'key'=>''],
'Memcached::setMulti' => ['bool', 'items'=>'array', 'expiration='=>'int'],
'Memcached::setMultiByKey' => ['bool', 'server_key'=>'string', 'items'=>'array', 'expiration='=>'int'],
'Memcached::setOption' => ['bool', 'option'=>'int', 'value'=>'mixed'],
'Memcached::setOptions' => ['bool', 'options'=>'array'],
'Memcached::setSaslAuthData' => ['void', 'username'=>'string', 'password'=>'string'],
'Memcached::touch' => ['bool', 'key'=>'string', 'expiration'=>'int'],
'Memcached::touchByKey' => ['bool', 'server_key'=>'string', 'key'=>'string', 'expiration'=>'int'],
'MemcachePool::add' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'MemcachePool::addServer' => ['bool', 'host'=>'string', 'port='=>'int', 'persistent='=>'bool', 'weight='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'?callable', 'timeoutms='=>'int'],
'MemcachePool::append' => [''],
'MemcachePool::cas' => [''],
'MemcachePool::close' => ['bool'],
'MemcachePool::connect' => ['bool', 'host'=>'string', 'port'=>'int', 'timeout='=>'int'],
'MemcachePool::decrement' => ['int|false', 'key'=>'', 'value='=>'int|mixed'],
'MemcachePool::delete' => ['bool', 'key'=>'', 'timeout='=>'int|mixed'],
'MemcachePool::findServer' => [''],
'MemcachePool::flush' => ['bool'],
'MemcachePool::get' => ['array|string|false', 'key'=>'array|string', '&flags='=>'array|int'],
'MemcachePool::getExtendedStats' => ['array|false', 'type='=>'string', 'slabid='=>'int', 'limit='=>'int'],
'MemcachePool::getServerStatus' => ['int', 'host'=>'string', 'port='=>'int'],
'MemcachePool::getStats' => ['array|false', 'type='=>'string', 'slabid='=>'int', 'limit='=>'int'],
'MemcachePool::getVersion' => ['string|false'],
'MemcachePool::increment' => ['int|false', 'key'=>'', 'value='=>'int|mixed'],
'MemcachePool::prepend' => ['string'],
'MemcachePool::replace' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'MemcachePool::set' => ['bool', 'key'=>'string', 'var'=>'mixed', 'flag='=>'int', 'expire='=>'int'],
'MemcachePool::setCompressThreshold' => ['bool', 'thresold'=>'int', 'min_saving='=>'float'],
'MemcachePool::setFailureCallback' => [''],
'MemcachePool::setServerParams' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'int', 'retry_interval='=>'int', 'status='=>'bool', 'failure_callback='=>'?callable'],
'memory_get_peak_usage' => ['int', 'real_usage='=>'bool'],
'memory_get_usage' => ['int', 'real_usage='=>'bool'],
'MessageFormatter::__construct' => ['void', 'locale'=>'string', 'pattern'=>'string'],
'MessageFormatter::create' => ['MessageFormatter', 'locale'=>'string', 'pattern'=>'string'],
'MessageFormatter::format' => ['false|string', 'args'=>'array'],
'MessageFormatter::formatMessage' => ['false|string', 'locale'=>'string', 'pattern'=>'string', 'args'=>'array'],
'MessageFormatter::getErrorCode' => ['int'],
'MessageFormatter::getErrorMessage' => ['string'],
'MessageFormatter::getLocale' => ['string'],
'MessageFormatter::getPattern' => ['string'],
'MessageFormatter::parse' => ['array|false', 'value'=>'string'],
'MessageFormatter::parseMessage' => ['array|false', 'locale'=>'string', 'pattern'=>'string', 'source'=>'string'],
'MessageFormatter::setPattern' => ['bool', 'pattern'=>'string'],
'metaphone' => ['string|false', 'string'=>'string', 'max_phonemes='=>'int'],
'method_exists' => ['bool', 'object_or_class'=>'object|class-string|interface-string', 'method'=>'string'],
'mhash' => ['string', 'algo'=>'int', 'data'=>'string', 'key='=>'string'],
'mhash_count' => ['int'],
'mhash_get_block_size' => ['int|false', 'algo'=>'int'],
'mhash_get_hash_name' => ['string|false', 'algo'=>'int'],
'mhash_keygen_s2k' => ['string|false', 'algo'=>'int', 'password'=>'string', 'salt'=>'string', 'length'=>'int'],
'microtime' => ['string', 'as_float='=>'false'],
'microtime\'1' => ['float', 'as_float='=>'true'],
'mime_content_type' => ['string|false', 'filename'=>'string|resource'],
'min' => ['mixed', 'value'=>'non-empty-array'],
'min\'1' => ['mixed', 'value'=>'', 'values'=>'', '...args='=>''],
'ming_keypress' => ['int', 'char'=>'string'],
'ming_setcubicthreshold' => ['void', 'threshold'=>'int'],
'ming_setscale' => ['void', 'scale'=>'float'],
'ming_setswfcompression' => ['void', 'level'=>'int'],
'ming_useconstants' => ['void', 'use'=>'int'],
'ming_useswfversion' => ['void', 'version'=>'int'],
'mkdir' => ['bool', 'directory'=>'string', 'permissions='=>'int', 'recursive='=>'bool', 'context='=>'resource'],
'mktime' => ['int|false', 'hour'=>'int', 'minute='=>'int|null', 'second='=>'int|null', 'month='=>'int|null', 'day='=>'int|null', 'year='=>'int|null'],
'money_format' => ['string', 'format'=>'string', 'value'=>'float'],
'Mongo::__construct' => ['void', 'server='=>'string', 'options='=>'array', 'driver_options='=>'array'],
'Mongo::__get' => ['MongoDB', 'dbname'=>'string'],
'Mongo::__toString' => ['string'],
'Mongo::close' => ['bool'],
'Mongo::connect' => ['bool'],
'Mongo::connectUtil' => ['bool'],
'Mongo::dropDB' => ['array', 'db'=>'mixed'],
'Mongo::forceError' => ['bool'],
'Mongo::getConnections' => ['array'],
'Mongo::getHosts' => ['array'],
'Mongo::getPoolSize' => ['int'],
'Mongo::getReadPreference' => ['array'],
'Mongo::getSlave' => ['?string'],
'Mongo::getSlaveOkay' => ['bool'],
'Mongo::getWriteConcern' => ['array'],
'Mongo::killCursor' => ['', 'server_hash'=>'string', 'id'=>'MongoInt64|int'],
'Mongo::lastError' => ['?array'],
'Mongo::listDBs' => ['array'],
'Mongo::pairConnect' => ['bool'],
'Mongo::pairPersistConnect' => ['bool', 'username='=>'string', 'password='=>'string'],
'Mongo::persistConnect' => ['bool', 'username='=>'string', 'password='=>'string'],
'Mongo::poolDebug' => ['array'],
'Mongo::prevError' => ['array'],
'Mongo::resetError' => ['array'],
'Mongo::selectCollection' => ['MongoCollection', 'db'=>'string', 'collection'=>'string'],
'Mongo::selectDB' => ['MongoDB', 'name'=>'string'],
'Mongo::setPoolSize' => ['bool', 'size'=>'int'],
'Mongo::setReadPreference' => ['bool', 'readPreference'=>'string', 'tags='=>'array'],
'Mongo::setSlaveOkay' => ['bool', 'ok='=>'bool'],
'Mongo::switchSlave' => ['string'],
'MongoBinData::__construct' => ['void', 'data'=>'string', 'type='=>'int'],
'MongoBinData::__toString' => ['string'],
'MongoClient::__construct' => ['void', 'server='=>'string', 'options='=>'array', 'driver_options='=>'array'],
'MongoClient::__get' => ['MongoDB', 'dbname'=>'string'],
'MongoClient::__toString' => ['string'],
'MongoClient::close' => ['bool', 'connection='=>'bool|string'],
'MongoClient::connect' => ['bool'],
'MongoClient::dropDB' => ['array', 'db'=>'mixed'],
'MongoClient::getConnections' => ['array'],
'MongoClient::getHosts' => ['array'],
'MongoClient::getReadPreference' => ['array'],
'MongoClient::getWriteConcern' => ['array'],
'MongoClient::killCursor' => ['bool', 'server_hash'=>'string', 'id'=>'int|MongoInt64'],
'MongoClient::listDBs' => ['array'],
'MongoClient::selectCollection' => ['MongoCollection', 'db'=>'string', 'collection'=>'string'],
'MongoClient::selectDB' => ['MongoDB', 'name'=>'string'],
'MongoClient::setReadPreference' => ['bool', 'read_preference'=>'string', 'tags='=>'array'],
'MongoClient::setWriteConcern' => ['bool', 'w'=>'mixed', 'wtimeout='=>'int'],
'MongoClient::switchSlave' => ['string'],
'MongoCode::__construct' => ['void', 'code'=>'string', 'scope='=>'array'],
'MongoCode::__toString' => ['string'],
'MongoCollection::__construct' => ['void', 'db'=>'MongoDB', 'name'=>'string'],
'MongoCollection::__get' => ['MongoCollection', 'name'=>'string'],
'MongoCollection::__toString' => ['string'],
'MongoCollection::aggregate' => ['array', 'op'=>'array', 'op='=>'array', '...args='=>'array'],
'MongoCollection::aggregate\'1' => ['array', 'pipeline'=>'array', 'options='=>'array'],
'MongoCollection::aggregateCursor' => ['MongoCommandCursor', 'command'=>'array', 'options='=>'array'],
'MongoCollection::batchInsert' => ['array|bool', 'a'=>'array', 'options='=>'array'],
'MongoCollection::count' => ['int', 'query='=>'array', 'limit='=>'int', 'skip='=>'int'],
'MongoCollection::createDBRef' => ['array', 'a'=>'array'],
'MongoCollection::createIndex' => ['array', 'keys'=>'array', 'options='=>'array'],
'MongoCollection::deleteIndex' => ['array', 'keys'=>'string|array'],
'MongoCollection::deleteIndexes' => ['array'],
'MongoCollection::distinct' => ['array|false', 'key'=>'string', 'query='=>'array'],
'MongoCollection::drop' => ['array'],
'MongoCollection::ensureIndex' => ['bool', 'keys'=>'array', 'options='=>'array'],
'MongoCollection::find' => ['MongoCursor', 'query='=>'array', 'fields='=>'array'],
'MongoCollection::findAndModify' => ['array', 'query'=>'array', 'update='=>'array', 'fields='=>'array', 'options='=>'array'],
'MongoCollection::findOne' => ['?array', 'query='=>'array', 'fields='=>'array'],
'MongoCollection::getDBRef' => ['array', 'ref'=>'array'],
'MongoCollection::getIndexInfo' => ['array'],
'MongoCollection::getName' => ['string'],
'MongoCollection::getReadPreference' => ['array'],
'MongoCollection::getSlaveOkay' => ['bool'],
'MongoCollection::getWriteConcern' => ['array'],
'MongoCollection::group' => ['array', 'keys'=>'mixed', 'initial'=>'array', 'reduce'=>'MongoCode', 'options='=>'array'],
'MongoCollection::insert' => ['bool|array', 'a'=>'array|object', 'options='=>'array'],
'MongoCollection::parallelCollectionScan' => ['MongoCommandCursor[]', 'num_cursors'=>'int'],
'MongoCollection::remove' => ['bool|array', 'criteria='=>'array', 'options='=>'array'],
'MongoCollection::save' => ['bool|array', 'a'=>'array|object', 'options='=>'array'],
'MongoCollection::setReadPreference' => ['bool', 'read_preference'=>'string', 'tags='=>'array'],
'MongoCollection::setSlaveOkay' => ['bool', 'ok='=>'bool'],
'MongoCollection::setWriteConcern' => ['bool', 'w'=>'mixed', 'wtimeout='=>'int'],
'MongoCollection::toIndexString' => ['string', 'keys'=>'mixed'],
'MongoCollection::update' => ['bool', 'criteria'=>'array', 'newobj'=>'array', 'options='=>'array'],
'MongoCollection::validate' => ['array', 'scan_data='=>'bool'],
'MongoCommandCursor::__construct' => ['void', 'connection'=>'MongoClient', 'ns'=>'string', 'command'=>'array'],
'MongoCommandCursor::batchSize' => ['MongoCommandCursor', 'batchSize'=>'int'],
'MongoCommandCursor::createFromDocument' => ['MongoCommandCursor', 'connection'=>'MongoClient', 'hash'=>'string', 'document'=>'array'],
'MongoCommandCursor::current' => ['array'],
'MongoCommandCursor::dead' => ['bool'],
'MongoCommandCursor::getReadPreference' => ['array'],
'MongoCommandCursor::info' => ['array'],
'MongoCommandCursor::key' => ['int'],
'MongoCommandCursor::next' => ['void'],
'MongoCommandCursor::rewind' => ['array'],
'MongoCommandCursor::setReadPreference' => ['MongoCommandCursor', 'read_preference'=>'string', 'tags='=>'array'],
'MongoCommandCursor::timeout' => ['MongoCommandCursor', 'ms'=>'int'],
'MongoCommandCursor::valid' => ['bool'],
'MongoCursor::__construct' => ['void', 'connection'=>'MongoClient', 'ns'=>'string', 'query='=>'array', 'fields='=>'array'],
'MongoCursor::addOption' => ['MongoCursor', 'key'=>'string', 'value'=>'mixed'],
'MongoCursor::awaitData' => ['MongoCursor', 'wait='=>'bool'],
'MongoCursor::batchSize' => ['MongoCursor', 'num'=>'int'],
'MongoCursor::count' => ['int', 'foundonly='=>'bool'],
'MongoCursor::current' => ['array'],
'MongoCursor::dead' => ['bool'],
'MongoCursor::doQuery' => ['void'],
'MongoCursor::explain' => ['array'],
'MongoCursor::fields' => ['MongoCursor', 'f'=>'array'],
'MongoCursor::getNext' => ['array'],
'MongoCursor::getReadPreference' => ['array'],
'MongoCursor::hasNext' => ['bool'],
'MongoCursor::hint' => ['MongoCursor', 'key_pattern'=>'string|array|object'],
'MongoCursor::immortal' => ['MongoCursor', 'liveforever='=>'bool'],
'MongoCursor::info' => ['array'],
'MongoCursor::key' => ['string'],
'MongoCursor::limit' => ['MongoCursor', 'num'=>'int'],
'MongoCursor::maxTimeMS' => ['MongoCursor', 'ms'=>'int'],
'MongoCursor::next' => ['array'],
'MongoCursor::partial' => ['MongoCursor', 'okay='=>'bool'],
'MongoCursor::reset' => ['void'],
'MongoCursor::rewind' => ['void'],
'MongoCursor::setFlag' => ['MongoCursor', 'flag'=>'int', 'set='=>'bool'],
'MongoCursor::setReadPreference' => ['MongoCursor', 'read_preference'=>'string', 'tags='=>'array'],
'MongoCursor::skip' => ['MongoCursor', 'num'=>'int'],
'MongoCursor::slaveOkay' => ['MongoCursor', 'okay='=>'bool'],
'MongoCursor::snapshot' => ['MongoCursor'],
'MongoCursor::sort' => ['MongoCursor', 'fields'=>'array'],
'MongoCursor::tailable' => ['MongoCursor', 'tail='=>'bool'],
'MongoCursor::timeout' => ['MongoCursor', 'ms'=>'int'],
'MongoCursor::valid' => ['bool'],
'MongoCursorException::__clone' => ['void'],
'MongoCursorException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'MongoCursorException::__toString' => ['string'],
'MongoCursorException::__wakeup' => ['void'],
'MongoCursorException::getCode' => ['int'],
'MongoCursorException::getFile' => ['string'],
'MongoCursorException::getHost' => ['string'],
'MongoCursorException::getLine' => ['int'],
'MongoCursorException::getMessage' => ['string'],
'MongoCursorException::getPrevious' => ['Exception|Throwable'],
'MongoCursorException::getTrace' => ['list<array<string,mixed>>'],
'MongoCursorException::getTraceAsString' => ['string'],
'MongoCursorInterface::__construct' => ['void'],
'MongoCursorInterface::batchSize' => ['MongoCursorInterface', 'batchSize'=>'int'],
'MongoCursorInterface::current' => ['mixed'],
'MongoCursorInterface::dead' => ['bool'],
'MongoCursorInterface::getReadPreference' => ['array'],
'MongoCursorInterface::info' => ['array'],
'MongoCursorInterface::key' => ['int|string'],
'MongoCursorInterface::next' => ['void'],
'MongoCursorInterface::rewind' => ['void'],
'MongoCursorInterface::setReadPreference' => ['MongoCursorInterface', 'read_preference'=>'string', 'tags='=>'array'],
'MongoCursorInterface::timeout' => ['MongoCursorInterface', 'ms'=>'int'],
'MongoCursorInterface::valid' => ['bool'],
'MongoDate::__construct' => ['void', 'second='=>'int', 'usecond='=>'int'],
'MongoDate::__toString' => ['string'],
'MongoDate::toDateTime' => ['DateTime'],
'MongoDB::__construct' => ['void', 'conn'=>'MongoClient', 'name'=>'string'],
'MongoDB::__get' => ['MongoCollection', 'name'=>'string'],
'MongoDB::__toString' => ['string'],
'MongoDB::authenticate' => ['array', 'username'=>'string', 'password'=>'string'],
'MongoDB::command' => ['array', 'command'=>'array'],
'MongoDB::createCollection' => ['MongoCollection', 'name'=>'string', 'capped='=>'bool', 'size='=>'int', 'max='=>'int'],
'MongoDB::createDBRef' => ['array', 'collection'=>'string', 'a'=>'mixed'],
'MongoDB::drop' => ['array'],
'MongoDB::dropCollection' => ['array', 'coll'=>'MongoCollection|string'],
'MongoDB::execute' => ['array', 'code'=>'MongoCode|string', 'args='=>'array'],
'MongoDB::forceError' => ['bool'],
'MongoDB::getCollectionInfo' => ['array', 'options='=>'array'],
'MongoDB::getCollectionNames' => ['array', 'options='=>'array'],
'MongoDB::getDBRef' => ['array', 'ref'=>'array'],
'MongoDB::getGridFS' => ['MongoGridFS', 'prefix='=>'string'],
'MongoDB::getProfilingLevel' => ['int'],
'MongoDB::getReadPreference' => ['array'],
'MongoDB::getSlaveOkay' => ['bool'],
'MongoDB::getWriteConcern' => ['array'],
'MongoDB::lastError' => ['array'],
'MongoDB::listCollections' => ['array'],
'MongoDB::prevError' => ['array'],
'MongoDB::repair' => ['array', 'preserve_cloned_files='=>'bool', 'backup_original_files='=>'bool'],
'MongoDB::resetError' => ['array'],
'MongoDB::selectCollection' => ['MongoCollection', 'name'=>'string'],
'MongoDB::setProfilingLevel' => ['int', 'level'=>'int'],
'MongoDB::setReadPreference' => ['bool', 'read_preference'=>'string', 'tags='=>'array'],
'MongoDB::setSlaveOkay' => ['bool', 'ok='=>'bool'],
'MongoDB::setWriteConcern' => ['bool', 'w'=>'mixed', 'wtimeout='=>'int'],
'MongoDB\BSON\Binary::__construct' => ['void', 'data'=>'string', 'type'=>'int'],
'MongoDB\BSON\Binary::__toString' => ['string'],
'MongoDB\BSON\Binary::getData' => ['string'],
'MongoDB\BSON\Binary::getType' => ['int'],
'MongoDB\BSON\binary::jsonSerialize' => ['mixed'],
'MongoDB\BSON\binary::serialize' => ['string'],
'MongoDB\BSON\binary::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\binaryinterface::__toString' => ['string'],
'MongoDB\BSON\binaryinterface::getData' => ['string'],
'MongoDB\BSON\binaryinterface::getType' => ['int'],
'MongoDB\BSON\dbpointer::__construct' => ['void'],
'MongoDB\BSON\dbpointer::__toString' => ['string'],
'MongoDB\BSON\dbpointer::jsonSerialize' => ['mixed'],
'MongoDB\BSON\dbpointer::serialize' => ['string'],
'MongoDB\BSON\dbpointer::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\Decimal128::__construct' => ['void', 'value='=>'string'],
'MongoDB\BSON\Decimal128::__toString' => ['string'],
'MongoDB\BSON\decimal128::jsonSerialize' => ['mixed'],
'MongoDB\BSON\decimal128::serialize' => ['string'],
'MongoDB\BSON\decimal128::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\decimal128interface::__toString' => ['string'],
'MongoDB\BSON\fromJSON' => ['string', 'json'=>'string'],
'MongoDB\BSON\fromPHP' => ['string', 'value'=>'array|object'],
'MongoDB\BSON\int64::__construct' => ['void'],
'MongoDB\BSON\int64::__toString' => ['string'],
'MongoDB\BSON\int64::jsonSerialize' => ['mixed'],
'MongoDB\BSON\int64::serialize' => ['string'],
'MongoDB\BSON\int64::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\Javascript::__construct' => ['void', 'code'=>'string', 'scope='=>'array|object'],
'MongoDB\BSON\javascript::__toString' => ['string'],
'MongoDB\BSON\javascript::getCode' => ['string'],
'MongoDB\BSON\javascript::getScope' => ['?object'],
'MongoDB\BSON\javascript::jsonSerialize' => ['mixed'],
'MongoDB\BSON\javascript::serialize' => ['string'],
'MongoDB\BSON\javascript::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\javascriptinterface::__toString' => ['string'],
'MongoDB\BSON\javascriptinterface::getCode' => ['string'],
'MongoDB\BSON\javascriptinterface::getScope' => ['?object'],
'MongoDB\BSON\maxkey::__construct' => ['void'],
'MongoDB\BSON\maxkey::jsonSerialize' => ['mixed'],
'MongoDB\BSON\maxkey::serialize' => ['string'],
'MongoDB\BSON\maxkey::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\minkey::__construct' => ['void'],
'MongoDB\BSON\minkey::jsonSerialize' => ['mixed'],
'MongoDB\BSON\minkey::serialize' => ['string'],
'MongoDB\BSON\minkey::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\ObjectId::__construct' => ['void', 'id='=>'string'],
'MongoDB\BSON\ObjectId::__toString' => ['string'],
'MongoDB\BSON\objectid::getTimestamp' => ['int'],
'MongoDB\BSON\objectid::jsonSerialize' => ['mixed'],
'MongoDB\BSON\objectid::serialize' => ['string'],
'MongoDB\BSON\objectid::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\objectidinterface::__toString' => ['string'],
'MongoDB\BSON\objectidinterface::getTimestamp' => ['int'],
'MongoDB\BSON\Regex::__construct' => ['void', 'pattern'=>'string', 'flags='=>'string'],
'MongoDB\BSON\Regex::__toString' => ['string'],
'MongoDB\BSON\Regex::getFlags' => ['string'],
'MongoDB\BSON\Regex::getPattern' => ['string'],
'MongoDB\BSON\regex::jsonSerialize' => ['mixed'],
'MongoDB\BSON\regex::serialize' => ['string'],
'MongoDB\BSON\regex::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\regexinterface::__toString' => ['string'],
'MongoDB\BSON\regexinterface::getFlags' => ['string'],
'MongoDB\BSON\regexinterface::getPattern' => ['string'],
'MongoDB\BSON\Serializable::bsonSerialize' => ['array|object'],
'MongoDB\BSON\symbol::__construct' => ['void'],
'MongoDB\BSON\symbol::__toString' => ['string'],
'MongoDB\BSON\symbol::jsonSerialize' => ['mixed'],
'MongoDB\BSON\symbol::serialize' => ['string'],
'MongoDB\BSON\symbol::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\Timestamp::__construct' => ['void', 'increment'=>'int', 'timestamp'=>'int'],
'MongoDB\BSON\Timestamp::__toString' => ['string'],
'MongoDB\BSON\timestamp::getIncrement' => ['int'],
'MongoDB\BSON\timestamp::getTimestamp' => ['int'],
'MongoDB\BSON\timestamp::jsonSerialize' => ['mixed'],
'MongoDB\BSON\timestamp::serialize' => ['string'],
'MongoDB\BSON\timestamp::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\timestampinterface::__toString' => ['string'],
'MongoDB\BSON\timestampinterface::getIncrement' => ['int'],
'MongoDB\BSON\timestampinterface::getTimestamp' => ['int'],
'MongoDB\BSON\toJSON' => ['string', 'bson'=>'string'],
'MongoDB\BSON\toPHP' => ['object', 'bson'=>'string', 'typeMap='=>'array'],
'MongoDB\BSON\undefined::__construct' => ['void'],
'MongoDB\BSON\undefined::__toString' => ['string'],
'MongoDB\BSON\undefined::jsonSerialize' => ['mixed'],
'MongoDB\BSON\undefined::serialize' => ['string'],
'MongoDB\BSON\undefined::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\Unserializable::bsonUnserialize' => ['void', 'data'=>'array'],
'MongoDB\BSON\UTCDateTime::__construct' => ['void', 'milliseconds='=>'int|DateTimeInterface'],
'MongoDB\BSON\UTCDateTime::__toString' => ['string'],
'MongoDB\BSON\utcdatetime::jsonSerialize' => ['mixed'],
'MongoDB\BSON\utcdatetime::serialize' => ['string'],
'MongoDB\BSON\UTCDateTime::toDateTime' => ['DateTime'],
'MongoDB\BSON\utcdatetime::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\BSON\utcdatetimeinterface::__toString' => ['string'],
'MongoDB\BSON\utcdatetimeinterface::toDateTime' => ['DateTime'],
'MongoDB\Driver\BulkWrite::__construct' => ['void', 'ordered='=>'bool'],
'MongoDB\Driver\BulkWrite::count' => ['int'],
'MongoDB\Driver\BulkWrite::delete' => ['void', 'filter'=>'array|object', 'deleteOptions='=>'array'],
'MongoDB\Driver\BulkWrite::insert' => ['void|MongoDB\BSON\ObjectId', 'document'=>'array|object'],
'MongoDB\Driver\BulkWrite::update' => ['void', 'filter'=>'array|object', 'newObj'=>'array|object', 'updateOptions='=>'array'],
'MongoDB\Driver\Command::__construct' => ['void', 'document'=>'array|object'],
'MongoDB\Driver\Cursor::__construct' => ['void', 'server'=>'Server', 'responseDocument'=>'string'],
'MongoDB\Driver\Cursor::getId' => ['MongoDB\Driver\CursorId'],
'MongoDB\Driver\Cursor::getServer' => ['MongoDB\Driver\Server'],
'MongoDB\Driver\Cursor::isDead' => ['bool'],
'MongoDB\Driver\Cursor::setTypeMap' => ['void', 'typemap'=>'array'],
'MongoDB\Driver\Cursor::toArray' => ['array'],
'MongoDB\Driver\CursorId::__construct' => ['void', 'id'=>'string'],
'MongoDB\Driver\CursorId::__toString' => ['string'],
'MongoDB\Driver\CursorId::serialize' => ['string'],
'MongoDB\Driver\CursorId::unserialize' => ['void', 'serialized'=>'string'],
'mongodb\driver\exception\commandexception::getResultDocument' => ['object'],
'MongoDB\Driver\Exception\RuntimeException::__clone' => ['void'],
'MongoDB\Driver\Exception\RuntimeException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?RuntimeException|?Throwable'],
'MongoDB\Driver\Exception\RuntimeException::__toString' => ['string'],
'MongoDB\Driver\Exception\RuntimeException::__wakeup' => ['void'],
'MongoDB\Driver\Exception\RuntimeException::getCode' => ['int'],
'MongoDB\Driver\Exception\RuntimeException::getFile' => ['string'],
'MongoDB\Driver\Exception\RuntimeException::getLine' => ['int'],
'MongoDB\Driver\Exception\RuntimeException::getMessage' => ['string'],
'MongoDB\Driver\Exception\RuntimeException::getPrevious' => ['RuntimeException|Throwable'],
'MongoDB\Driver\Exception\RuntimeException::getTrace' => ['list<array<string,mixed>>'],
'MongoDB\Driver\Exception\RuntimeException::getTraceAsString' => ['string'],
'mongodb\driver\exception\runtimeexception::hasErrorLabel' => ['bool', 'errorLabel'=>'string'],
'MongoDB\Driver\Exception\WriteException::__clone' => ['void'],
'MongoDB\Driver\Exception\WriteException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?RuntimeException|?Throwable'],
'MongoDB\Driver\Exception\WriteException::__toString' => ['string'],
'MongoDB\Driver\Exception\WriteException::__wakeup' => ['void'],
'MongoDB\Driver\Exception\WriteException::getCode' => ['int'],
'MongoDB\Driver\Exception\WriteException::getFile' => ['string'],
'MongoDB\Driver\Exception\WriteException::getLine' => ['int'],
'MongoDB\Driver\Exception\WriteException::getMessage' => ['string'],
'MongoDB\Driver\Exception\WriteException::getPrevious' => ['RuntimeException|Throwable'],
'MongoDB\Driver\Exception\WriteException::getTrace' => ['list<array<string,mixed>>'],
'MongoDB\Driver\Exception\WriteException::getTraceAsString' => ['string'],
'MongoDB\Driver\Exception\WriteException::getWriteResult' => ['MongoDB\Driver\WriteResult'],
'MongoDB\Driver\Manager::__construct' => ['void', 'uri'=>'string', 'options='=>'array', 'driverOptions='=>'array'],
'MongoDB\Driver\Manager::executeBulkWrite' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'bulk'=>'MongoDB\Driver\BulkWrite', 'writeConcern='=>'MongoDB\Driver\WriteConcern'],
'MongoDB\Driver\Manager::executeCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command', 'readPreference='=>'MongoDB\Driver\ReadPreference'],
'MongoDB\Driver\Manager::executeDelete' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'filter'=>'array|object', 'deleteOptions='=>'array', 'writeConcern='=>'MongoDB\Driver\WriteConcern'],
'MongoDB\Driver\Manager::executeInsert' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'document'=>'array|object', 'writeConcern='=>'MongoDB\Driver\WriteConcern'],
'MongoDB\Driver\Manager::executeQuery' => ['MongoDB\Driver\Cursor', 'namespace'=>'string', 'query'=>'MongoDB\Driver\Query', 'readPreference='=>'MongoDB\Driver\ReadPreference'],
'mongodb\driver\manager::executeReadCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command', 'options='=>'array'],
'mongodb\driver\manager::executeReadWriteCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command', 'options='=>'array'],
'MongoDB\Driver\Manager::executeUpdate' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'filter'=>'array|object', 'newObj'=>'array|object', 'updateOptions='=>'array', 'writeConcern='=>'MongoDB\Driver\WriteConcern'],
'mongodb\driver\manager::executeWriteCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command', 'options='=>'array'],
'MongoDB\Driver\Manager::getReadConcern' => ['MongoDB\Driver\ReadConcern'],
'MongoDB\Driver\Manager::getReadPreference' => ['MongoDB\Driver\ReadPreference'],
'MongoDB\Driver\Manager::getServers' => ['MongoDB\Driver\Server[]'],
'MongoDB\Driver\Manager::getWriteConcern' => ['MongoDB\Driver\WriteConcern'],
'MongoDB\Driver\Manager::selectServer' => ['MongoDB\Driver\Server', 'readPreference'=>'MongoDB\Driver\ReadPreference'],
'mongodb\driver\manager::startSession' => ['MongoDB\Driver\Session', 'options='=>'array'],
'mongodb\driver\monitoring\commandfailedevent::getCommandName' => ['string'],
'mongodb\driver\monitoring\commandfailedevent::getDurationMicros' => ['int'],
'mongodb\driver\monitoring\commandfailedevent::getError' => ['Exception'],
'mongodb\driver\monitoring\commandfailedevent::getOperationId' => ['string'],
'mongodb\driver\monitoring\commandfailedevent::getReply' => ['object'],
'mongodb\driver\monitoring\commandfailedevent::getRequestId' => ['string'],
'mongodb\driver\monitoring\commandfailedevent::getServer' => ['MongoDB\Driver\Server'],
'mongodb\driver\monitoring\commandstartedevent::getCommand' => ['object'],
'mongodb\driver\monitoring\commandstartedevent::getCommandName' => ['string'],
'mongodb\driver\monitoring\commandstartedevent::getDatabaseName' => ['string'],
'mongodb\driver\monitoring\commandstartedevent::getOperationId' => ['string'],
'mongodb\driver\monitoring\commandstartedevent::getRequestId' => ['string'],
'mongodb\driver\monitoring\commandstartedevent::getServer' => ['MongoDB\Driver\Server'],
'mongodb\driver\monitoring\commandsubscriber::commandFailed' => ['void', 'event'=>'MongoDB\Driver\Monitoring\CommandFailedEvent'],
'mongodb\driver\monitoring\commandsubscriber::commandStarted' => ['void', 'event'=>'MongoDB\Driver\Monitoring\CommandStartedEvent'],
'mongodb\driver\monitoring\commandsubscriber::commandSucceeded' => ['void', 'event'=>'MongoDB\Driver\Monitoring\CommandSucceededEvent'],
'mongodb\driver\monitoring\commandsucceededevent::getCommandName' => ['string'],
'mongodb\driver\monitoring\commandsucceededevent::getDurationMicros' => ['int'],
'mongodb\driver\monitoring\commandsucceededevent::getOperationId' => ['string'],
'mongodb\driver\monitoring\commandsucceededevent::getReply' => ['object'],
'mongodb\driver\monitoring\commandsucceededevent::getRequestId' => ['string'],
'mongodb\driver\monitoring\commandsucceededevent::getServer' => ['MongoDB\Driver\Server'],
'MongoDB\Driver\Query::__construct' => ['void', 'filter'=>'array|object', 'queryOptions='=>'array'],
'MongoDB\Driver\ReadConcern::__construct' => ['void', 'level='=>'string'],
'MongoDB\Driver\ReadConcern::bsonSerialize' => ['object'],
'MongoDB\Driver\ReadConcern::getLevel' => ['?string'],
'MongoDB\Driver\ReadConcern::isDefault' => ['bool'],
'MongoDB\Driver\ReadConcern::serialize' => ['string'],
'MongoDB\Driver\ReadConcern::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\Driver\ReadPreference::__construct' => ['void', 'mode'=>'string|int', 'tagSets='=>'array', 'options='=>'array'],
'MongoDB\Driver\ReadPreference::bsonSerialize' => ['object'],
'MongoDB\Driver\ReadPreference::getHedge' => ['object|null'],
'MongoDB\Driver\ReadPreference::getMaxStalenessSeconds' => ['int'],
'MongoDB\Driver\ReadPreference::getMode' => ['int'],
'MongoDB\Driver\ReadPreference::getModeString' => ['string'],
'MongoDB\Driver\ReadPreference::getTagSets' => ['array'],
'MongoDB\Driver\ReadPreference::serialize' => ['string'],
'MongoDB\Driver\ReadPreference::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\Driver\Server::__construct' => ['void', 'host'=>'string', 'port'=>'string', 'options='=>'array', 'driverOptions='=>'array'],
'MongoDB\Driver\Server::executeBulkWrite' => ['MongoDB\Driver\WriteResult', 'namespace'=>'string', 'zwrite'=>'BulkWrite'],
'MongoDB\Driver\Server::executeCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command'],
'MongoDB\Driver\Server::executeQuery' => ['MongoDB\Driver\Cursor', 'namespace'=>'string', 'zquery'=>'Query'],
'mongodb\driver\server::executeReadCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command', 'options='=>'array'],
'mongodb\driver\server::executeReadWriteCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command', 'options='=>'array'],
'mongodb\driver\server::executeWriteCommand' => ['MongoDB\Driver\Cursor', 'db'=>'string', 'command'=>'MongoDB\Driver\Command', 'options='=>'array'],
'MongoDB\Driver\Server::getHost' => ['string'],
'MongoDB\Driver\Server::getInfo' => ['array'],
'MongoDB\Driver\Server::getLatency' => ['int'],
'MongoDB\Driver\Server::getPort' => ['int'],
'MongoDB\Driver\Server::getState' => [''],
'MongoDB\Driver\Server::getTags' => ['array'],
'MongoDB\Driver\Server::getType' => ['int'],
'MongoDB\Driver\Server::isArbiter' => ['bool'],
'MongoDB\Driver\Server::isDelayed' => [''],
'MongoDB\Driver\Server::isHidden' => ['bool'],
'MongoDB\Driver\Server::isPassive' => ['bool'],
'MongoDB\Driver\Server::isPrimary' => ['bool'],
'MongoDB\Driver\Server::isSecondary' => ['bool'],
'mongodb\driver\session::__construct' => ['void'],
'mongodb\driver\session::abortTransaction' => ['void'],
'mongodb\driver\session::advanceClusterTime' => ['void', 'clusterTime'=>'array|object'],
'mongodb\driver\session::advanceOperationTime' => ['void', 'operationTime'=>'MongoDB\BSON\TimestampInterface'],
'mongodb\driver\session::commitTransaction' => ['void'],
'mongodb\driver\session::endSession' => ['void'],
'mongodb\driver\session::getClusterTime' => ['?object'],
'mongodb\driver\session::getLogicalSessionId' => ['object'],
'mongodb\driver\session::getOperationTime' => ['MongoDB\BSON\Timestamp|null'],
'mongodb\driver\session::getTransactionOptions' => ['array|null'],
'mongodb\driver\session::getTransactionState' => ['string'],
'mongodb\driver\session::startTransaction' => ['void', 'options'=>'array|object'],
'MongoDB\Driver\WriteConcern::__construct' => ['void', 'wstring'=>'string|int', 'wtimeout='=>'int', 'journal='=>'bool'],
'MongoDB\Driver\WriteConcern::bsonSerialize' => ['object'],
'MongoDB\Driver\WriteConcern::getJournal' => ['?bool'],
'MongoDB\Driver\WriteConcern::getJurnal' => ['?bool'],
'MongoDB\Driver\WriteConcern::getW' => ['int|null|string'],
'MongoDB\Driver\WriteConcern::getWtimeout' => ['int'],
'MongoDB\Driver\WriteConcern::isDefault' => ['bool'],
'MongoDB\Driver\WriteConcern::serialize' => ['string'],
'MongoDB\Driver\WriteConcern::unserialize' => ['void', 'serialized'=>'string'],
'MongoDB\Driver\WriteConcernError::getCode' => ['int'],
'MongoDB\Driver\WriteConcernError::getInfo' => ['mixed'],
'MongoDB\Driver\WriteConcernError::getMessage' => ['string'],
'MongoDB\Driver\WriteError::getCode' => ['int'],
'MongoDB\Driver\WriteError::getIndex' => ['int'],
'MongoDB\Driver\WriteError::getInfo' => ['mixed'],
'MongoDB\Driver\WriteError::getMessage' => ['string'],
'MongoDB\Driver\WriteException::getWriteResult' => [''],
'MongoDB\Driver\WriteResult::getDeletedCount' => ['?int'],
'MongoDB\Driver\WriteResult::getInfo' => [''],
'MongoDB\Driver\WriteResult::getInsertedCount' => ['?int'],
'MongoDB\Driver\WriteResult::getMatchedCount' => ['?int'],
'MongoDB\Driver\WriteResult::getModifiedCount' => ['?int'],
'MongoDB\Driver\WriteResult::getServer' => ['MongoDB\Driver\Server'],
'MongoDB\Driver\WriteResult::getUpsertedCount' => ['?int'],
'MongoDB\Driver\WriteResult::getUpsertedIds' => ['array'],
'MongoDB\Driver\WriteResult::getWriteConcernError' => ['MongoDB\Driver\WriteConcernError|null'],
'MongoDB\Driver\WriteResult::getWriteErrors' => ['MongoDB\Driver\WriteError[]'],
'MongoDB\Driver\WriteResult::isAcknowledged' => ['bool'],
'MongoDBRef::create' => ['array', 'collection'=>'string', 'id'=>'mixed', 'database='=>'string'],
'MongoDBRef::get' => ['?array', 'db'=>'MongoDB', 'ref'=>'array'],
'MongoDBRef::isRef' => ['bool', 'ref'=>'mixed'],
'MongoDeleteBatch::__construct' => ['void', 'collection'=>'MongoCollection', 'write_options='=>'array'],
'MongoException::__clone' => ['void'],
'MongoException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'MongoException::__toString' => ['string'],
'MongoException::__wakeup' => ['void'],
'MongoException::getCode' => ['int'],
'MongoException::getFile' => ['string'],
'MongoException::getLine' => ['int'],
'MongoException::getMessage' => ['string'],
'MongoException::getPrevious' => ['Exception|Throwable'],
'MongoException::getTrace' => ['list<array<string,mixed>>'],
'MongoException::getTraceAsString' => ['string'],
'MongoGridFS::__construct' => ['void', 'db'=>'MongoDB', 'prefix='=>'string', 'chunks='=>'mixed'],
'MongoGridFS::__get' => ['MongoCollection', 'name'=>'string'],
'MongoGridFS::__toString' => ['string'],
'MongoGridFS::aggregate' => ['array', 'pipeline'=>'array', 'op'=>'array', 'pipelineOperators'=>'array'],
'MongoGridFS::aggregateCursor' => ['MongoCommandCursor', 'pipeline'=>'array', 'options'=>'array'],
'MongoGridFS::batchInsert' => ['mixed', 'a'=>'array', 'options='=>'array'],
'MongoGridFS::count' => ['int', 'query='=>'stdClass|array'],
'MongoGridFS::createDBRef' => ['array', 'a'=>'array'],
'MongoGridFS::createIndex' => ['array', 'keys'=>'array', 'options='=>'array'],
'MongoGridFS::delete' => ['bool', 'id'=>'mixed'],
'MongoGridFS::deleteIndex' => ['array', 'keys'=>'array|string'],
'MongoGridFS::deleteIndexes' => ['array'],
'MongoGridFS::distinct' => ['array|bool', 'key'=>'string', 'query='=>'?array'],
'MongoGridFS::drop' => ['array'],
'MongoGridFS::ensureIndex' => ['bool', 'keys'=>'array', 'options='=>'array'],
'MongoGridFS::find' => ['MongoGridFSCursor', 'query='=>'array', 'fields='=>'array'],
'MongoGridFS::findAndModify' => ['array', 'query'=>'array', 'update='=>'?array', 'fields='=>'?array', 'options='=>'?array'],
'MongoGridFS::findOne' => ['?MongoGridFSFile', 'query='=>'mixed', 'fields='=>'mixed'],
'MongoGridFS::get' => ['?MongoGridFSFile', 'id'=>'mixed'],
'MongoGridFS::getDBRef' => ['array', 'ref'=>'array'],
'MongoGridFS::getIndexInfo' => ['array'],
'MongoGridFS::getName' => ['string'],
'MongoGridFS::getReadPreference' => ['array'],
'MongoGridFS::getSlaveOkay' => ['bool'],
'MongoGridFS::group' => ['array', 'keys'=>'mixed', 'initial'=>'array', 'reduce'=>'MongoCode', 'condition='=>'array'],
'MongoGridFS::insert' => ['array|bool', 'a'=>'array|object', 'options='=>'array'],
'MongoGridFS::put' => ['mixed', 'filename'=>'string', 'extra='=>'array'],
'MongoGridFS::remove' => ['bool', 'criteria='=>'array', 'options='=>'array'],
'MongoGridFS::save' => ['array|bool', 'a'=>'array|object', 'options='=>'array'],
'MongoGridFS::setReadPreference' => ['bool', 'read_preference'=>'string', 'tags'=>'array'],
'MongoGridFS::setSlaveOkay' => ['bool', 'ok='=>'bool'],
'MongoGridFS::storeBytes' => ['mixed', 'bytes'=>'string', 'extra='=>'array', 'options='=>'array'],
'MongoGridFS::storeFile' => ['mixed', 'filename'=>'string', 'extra='=>'array', 'options='=>'array'],
'MongoGridFS::storeUpload' => ['mixed', 'name'=>'string', 'filename='=>'string'],
'MongoGridFS::toIndexString' => ['string', 'keys'=>'mixed'],
'MongoGridFS::update' => ['bool', 'criteria'=>'array', 'newobj'=>'array', 'options='=>'array'],
'MongoGridFS::validate' => ['array', 'scan_data='=>'bool'],
'MongoGridFSCursor::__construct' => ['void', 'gridfs'=>'MongoGridFS', 'connection'=>'resource', 'ns'=>'string', 'query'=>'array', 'fields'=>'array'],
'MongoGridFSCursor::addOption' => ['MongoCursor', 'key'=>'string', 'value'=>'mixed'],
'MongoGridFSCursor::awaitData' => ['MongoCursor', 'wait='=>'bool'],
'MongoGridFSCursor::batchSize' => ['MongoCursor', 'batchSize'=>'int'],
'MongoGridFSCursor::count' => ['int', 'all='=>'bool'],
'MongoGridFSCursor::current' => ['MongoGridFSFile'],
'MongoGridFSCursor::dead' => ['bool'],
'MongoGridFSCursor::doQuery' => ['void'],
'MongoGridFSCursor::explain' => ['array'],
'MongoGridFSCursor::fields' => ['MongoCursor', 'f'=>'array'],
'MongoGridFSCursor::getNext' => ['MongoGridFSFile'],
'MongoGridFSCursor::getReadPreference' => ['array'],
'MongoGridFSCursor::hasNext' => ['bool'],
'MongoGridFSCursor::hint' => ['MongoCursor', 'key_pattern'=>'mixed'],
'MongoGridFSCursor::immortal' => ['MongoCursor', 'liveForever='=>'bool'],
'MongoGridFSCursor::info' => ['array'],
'MongoGridFSCursor::key' => ['string'],
'MongoGridFSCursor::limit' => ['MongoCursor', 'num'=>'int'],
'MongoGridFSCursor::maxTimeMS' => ['MongoCursor', 'ms'=>'int'],
'MongoGridFSCursor::next' => ['void'],
'MongoGridFSCursor::partial' => ['MongoCursor', 'okay='=>'bool'],
'MongoGridFSCursor::reset' => ['void'],
'MongoGridFSCursor::rewind' => ['void'],
'MongoGridFSCursor::setFlag' => ['MongoCursor', 'flag'=>'int', 'set='=>'bool'],
'MongoGridFSCursor::setReadPreference' => ['MongoCursor', 'read_preference'=>'string', 'tags'=>'array'],
'MongoGridFSCursor::skip' => ['MongoCursor', 'num'=>'int'],
'MongoGridFSCursor::slaveOkay' => ['MongoCursor', 'okay='=>'bool'],
'MongoGridFSCursor::snapshot' => ['MongoCursor'],
'MongoGridFSCursor::sort' => ['MongoCursor', 'fields'=>'array'],
'MongoGridFSCursor::tailable' => ['MongoCursor', 'tail='=>'bool'],
'MongoGridFSCursor::timeout' => ['MongoCursor', 'ms'=>'int'],
'MongoGridFSCursor::valid' => ['bool'],
'MongoGridfsFile::__construct' => ['void', 'gridfs'=>'MongoGridFS', 'file'=>'array'],
'MongoGridFSFile::getBytes' => ['string'],
'MongoGridFSFile::getFilename' => ['string'],
'MongoGridFSFile::getResource' => ['resource'],
'MongoGridFSFile::getSize' => ['int'],
'MongoGridFSFile::write' => ['int', 'filename='=>'string'],
'MongoId::__construct' => ['void', 'id='=>'string|MongoId'],
'MongoId::__set_state' => ['MongoId', 'props'=>'array'],
'MongoId::__toString' => ['string'],
'MongoId::getHostname' => ['string'],
'MongoId::getInc' => ['int'],
'MongoId::getPID' => ['int'],
'MongoId::getTimestamp' => ['int'],
'MongoId::isValid' => ['bool', 'value'=>'mixed'],
'MongoInsertBatch::__construct' => ['void', 'collection'=>'MongoCollection', 'write_options='=>'array'],
'MongoInt32::__construct' => ['void', 'value'=>'string'],
'MongoInt32::__toString' => ['string'],
'MongoInt64::__construct' => ['void', 'value'=>'string'],
'MongoInt64::__toString' => ['string'],
'MongoLog::getCallback' => ['callable'],
'MongoLog::getLevel' => ['int'],
'MongoLog::getModule' => ['int'],
'MongoLog::setCallback' => ['void', 'log_function'=>'callable'],
'MongoLog::setLevel' => ['void', 'level'=>'int'],
'MongoLog::setModule' => ['void', 'module'=>'int'],
'MongoPool::getSize' => ['int'],
'MongoPool::info' => ['array'],
'MongoPool::setSize' => ['bool', 'size'=>'int'],
'MongoRegex::__construct' => ['void', 'regex'=>'string'],
'MongoRegex::__toString' => ['string'],
'MongoResultException::__clone' => ['void'],
'MongoResultException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'MongoResultException::__toString' => ['string'],
'MongoResultException::__wakeup' => ['void'],
'MongoResultException::getCode' => ['int'],
'MongoResultException::getDocument' => ['array'],
'MongoResultException::getFile' => ['string'],
'MongoResultException::getLine' => ['int'],
'MongoResultException::getMessage' => ['string'],
'MongoResultException::getPrevious' => ['Exception|Throwable'],
'MongoResultException::getTrace' => ['list<array<string,mixed>>'],
'MongoResultException::getTraceAsString' => ['string'],
'MongoTimestamp::__construct' => ['void', 'second='=>'int', 'inc='=>'int'],
'MongoTimestamp::__toString' => ['string'],
'MongoUpdateBatch::__construct' => ['void', 'collection'=>'MongoCollection', 'write_options='=>'array'],
'MongoUpdateBatch::add' => ['bool', 'item'=>'array'],
'MongoUpdateBatch::execute' => ['array', 'write_options'=>'array'],
'MongoWriteBatch::__construct' => ['void', 'collection'=>'MongoCollection', 'batch_type'=>'string', 'write_options'=>'array'],
'MongoWriteBatch::add' => ['bool', 'item'=>'array'],
'MongoWriteBatch::execute' => ['array', 'write_options'=>'array'],
'MongoWriteConcernException::__clone' => ['void'],
'MongoWriteConcernException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'MongoWriteConcernException::__toString' => ['string'],
'MongoWriteConcernException::__wakeup' => ['void'],
'MongoWriteConcernException::getCode' => ['int'],
'MongoWriteConcernException::getDocument' => ['array'],
'MongoWriteConcernException::getFile' => ['string'],
'MongoWriteConcernException::getLine' => ['int'],
'MongoWriteConcernException::getMessage' => ['string'],
'MongoWriteConcernException::getPrevious' => ['Exception|Throwable'],
'MongoWriteConcernException::getTrace' => ['list<array<string,mixed>>'],
'MongoWriteConcernException::getTraceAsString' => ['string'],
'monitor_custom_event' => ['void', 'class'=>'string', 'text'=>'string', 'severe='=>'int', 'user_data='=>'mixed'],
'monitor_httperror_event' => ['void', 'error_code'=>'int', 'url'=>'string', 'severe='=>'int'],
'monitor_license_info' => ['array'],
'monitor_pass_error' => ['void', 'errno'=>'int', 'errstr'=>'string', 'errfile'=>'string', 'errline'=>'int'],
'monitor_set_aggregation_hint' => ['void', 'hint'=>'string'],
'move_uploaded_file' => ['bool', 'from'=>'string', 'to'=>'string'],
'mqseries_back' => ['void', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_begin' => ['void', 'hconn'=>'resource', 'beginoptions'=>'array', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_close' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'options'=>'int', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_cmit' => ['void', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_conn' => ['void', 'qmanagername'=>'string', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_connx' => ['void', 'qmanagername'=>'string', 'connoptions'=>'array', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_disc' => ['void', 'hconn'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_get' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'md'=>'array', 'gmo'=>'array', 'bufferlength'=>'int', 'msg'=>'string', 'data_length'=>'int', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_inq' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'selectorcount'=>'int', 'selectors'=>'array', 'intattrcount'=>'int', 'intattr'=>'resource', 'charattrlength'=>'int', 'charattr'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_open' => ['void', 'hconn'=>'resource', 'objdesc'=>'array', 'option'=>'int', 'hobj'=>'resource', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_put' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'md'=>'array', 'pmo'=>'array', 'message'=>'string', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_put1' => ['void', 'hconn'=>'resource', 'objdesc'=>'resource', 'msgdesc'=>'resource', 'pmo'=>'resource', 'buffer'=>'string', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_set' => ['void', 'hconn'=>'resource', 'hobj'=>'resource', 'selectorcount'=>'int', 'selectors'=>'array', 'intattrcount'=>'int', 'intattrs'=>'array', 'charattrlength'=>'int', 'charattrs'=>'array', 'compcode'=>'resource', 'reason'=>'resource'],
'mqseries_strerror' => ['string', 'reason'=>'int'],
'ms_GetErrorObj' => ['errorObj'],
'ms_GetVersion' => ['string'],
'ms_GetVersionInt' => ['int'],
'ms_iogetStdoutBufferBytes' => ['int'],
'ms_iogetstdoutbufferstring' => ['void'],
'ms_ioinstallstdinfrombuffer' => ['void'],
'ms_ioinstallstdouttobuffer' => ['void'],
'ms_ioresethandlers' => ['void'],
'ms_iostripstdoutbuffercontentheaders' => ['void'],
'ms_iostripstdoutbuffercontenttype' => ['string'],
'ms_ResetErrorList' => ['void'],
'ms_TokenizeMap' => ['array', 'map_file_name'=>'string'],
'msession_connect' => ['bool', 'host'=>'string', 'port'=>'string'],
'msession_count' => ['int'],
'msession_create' => ['bool', 'session'=>'string', 'classname='=>'string', 'data='=>'string'],
'msession_destroy' => ['bool', 'name'=>'string'],
'msession_disconnect' => ['void'],
'msession_find' => ['array', 'name'=>'string', 'value'=>'string'],
'msession_get' => ['string', 'session'=>'string', 'name'=>'string', 'value'=>'string'],
'msession_get_array' => ['array', 'session'=>'string'],
'msession_get_data' => ['string', 'session'=>'string'],
'msession_inc' => ['string', 'session'=>'string', 'name'=>'string'],
'msession_list' => ['array'],
'msession_listvar' => ['array', 'name'=>'string'],
'msession_lock' => ['int', 'name'=>'string'],
'msession_plugin' => ['string', 'session'=>'string', 'value'=>'string', 'param='=>'string'],
'msession_randstr' => ['string', 'param'=>'int'],
'msession_set' => ['bool', 'session'=>'string', 'name'=>'string', 'value'=>'string'],
'msession_set_array' => ['void', 'session'=>'string', 'tuples'=>'array'],
'msession_set_data' => ['bool', 'session'=>'string', 'value'=>'string'],
'msession_timeout' => ['int', 'session'=>'string', 'param='=>'int'],
'msession_uniq' => ['string', 'param'=>'int', 'classname='=>'string', 'data='=>'string'],
'msession_unlock' => ['int', 'session'=>'string', 'key'=>'int'],
'msg_get_queue' => ['resource', 'key'=>'int', 'permissions='=>'int'],
'msg_queue_exists' => ['bool', 'key'=>'int'],
'msg_receive' => ['bool', 'queue'=>'resource', 'desired_message_type'=>'int', '&w_received_message_type'=>'int', 'max_message_size'=>'int', '&w_message'=>'mixed', 'unserialize='=>'bool', 'flags='=>'int', '&w_error_code='=>'int'],
'msg_remove_queue' => ['bool', 'queue'=>'resource'],
'msg_send' => ['bool', 'queue'=>'resource', 'message_type'=>'int', 'message'=>'mixed', 'serialize='=>'bool', 'blocking='=>'bool', '&w_error_code='=>'int'],
'msg_set_queue' => ['bool', 'queue'=>'resource', 'data'=>'array'],
'msg_stat_queue' => ['array', 'queue'=>'resource'],
'msgfmt_create' => ['MessageFormatter', 'locale'=>'string', 'pattern'=>'string'],
'msgfmt_format' => ['string|false', 'formatter'=>'MessageFormatter', 'values'=>'array'],
'msgfmt_format_message' => ['string|false', 'locale'=>'string', 'pattern'=>'string', 'values'=>'array'],
'msgfmt_get_error_code' => ['int', 'formatter'=>'MessageFormatter'],
'msgfmt_get_error_message' => ['string', 'formatter'=>'MessageFormatter'],
'msgfmt_get_locale' => ['string', 'formatter'=>'MessageFormatter'],
'msgfmt_get_pattern' => ['string', 'formatter'=>'MessageFormatter'],
'msgfmt_parse' => ['array|false', 'formatter'=>'MessageFormatter', 'string'=>'string'],
'msgfmt_parse_message' => ['array|false', 'locale'=>'string', 'pattern'=>'string', 'message'=>'string'],
'msgfmt_set_pattern' => ['bool', 'formatter'=>'MessageFormatter', 'pattern'=>'string'],
'msql_affected_rows' => ['int', 'result'=>'resource'],
'msql_close' => ['bool', 'link_identifier='=>'?resource'],
'msql_connect' => ['resource', 'hostname='=>'string'],
'msql_create_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'],
'msql_data_seek' => ['bool', 'result'=>'resource', 'row_number'=>'int'],
'msql_db_query' => ['resource', 'database'=>'string', 'query'=>'string', 'link_identifier='=>'?resource'],
'msql_drop_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'],
'msql_error' => ['string'],
'msql_fetch_array' => ['array', 'result'=>'resource', 'result_type='=>'int'],
'msql_fetch_field' => ['object', 'result'=>'resource', 'field_offset='=>'int'],
'msql_fetch_object' => ['object', 'result'=>'resource'],
'msql_fetch_row' => ['array', 'result'=>'resource'],
'msql_field_flags' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
'msql_field_len' => ['int', 'result'=>'resource', 'field_offset'=>'int'],
'msql_field_name' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
'msql_field_seek' => ['bool', 'result'=>'resource', 'field_offset'=>'int'],
'msql_field_table' => ['int', 'result'=>'resource', 'field_offset'=>'int'],
'msql_field_type' => ['string', 'result'=>'resource', 'field_offset'=>'int'],
'msql_free_result' => ['bool', 'result'=>'resource'],
'msql_list_dbs' => ['resource', 'link_identifier='=>'?resource'],
'msql_list_fields' => ['resource', 'database'=>'string', 'tablename'=>'string', 'link_identifier='=>'?resource'],
'msql_list_tables' => ['resource', 'database'=>'string', 'link_identifier='=>'?resource'],
'msql_num_fields' => ['int', 'result'=>'resource'],
'msql_num_rows' => ['int', 'query_identifier'=>'resource'],
'msql_pconnect' => ['resource', 'hostname='=>'string'],
'msql_query' => ['resource', 'query'=>'string', 'link_identifier='=>'?resource'],
'msql_result' => ['string', 'result'=>'resource', 'row'=>'int', 'field='=>'mixed'],
'msql_select_db' => ['bool', 'database_name'=>'string', 'link_identifier='=>'?resource'],
'mt_getrandmax' => ['int'],
'mt_rand' => ['int', 'min'=>'int', 'max'=>'int'],
'mt_rand\'1' => ['int'],
'mt_srand' => ['void', 'seed='=>'int', 'mode='=>'int'],
'MultipleIterator::__construct' => ['void', 'flags='=>'int'],
'MultipleIterator::attachIterator' => ['void', 'iterator'=>'Iterator', 'infos='=>'string'],
'MultipleIterator::containsIterator' => ['bool', 'iterator'=>'Iterator'],
'MultipleIterator::countIterators' => ['int'],
'MultipleIterator::current' => ['array|false'],
'MultipleIterator::detachIterator' => ['void', 'iterator'=>'Iterator'],
'MultipleIterator::getFlags' => ['int'],
'MultipleIterator::key' => ['array'],
'MultipleIterator::next' => ['void'],
'MultipleIterator::rewind' => ['void'],
'MultipleIterator::setFlags' => ['int', 'flags'=>'int'],
'MultipleIterator::valid' => ['bool'],
'Mutex::create' => ['long', 'lock='=>'bool'],
'Mutex::destroy' => ['bool', 'mutex'=>'long'],
'Mutex::lock' => ['bool', 'mutex'=>'long'],
'Mutex::trylock' => ['bool', 'mutex'=>'long'],
'Mutex::unlock' => ['bool', 'mutex'=>'long', 'destroy='=>'bool'],
'mysql_xdevapi\baseresult::getWarnings' => ['array'],
'mysql_xdevapi\baseresult::getWarningsCount' => ['integer'],
'mysql_xdevapi\collection::add' => ['mysql_xdevapi\CollectionAdd', 'document'=>'mixed'],
'mysql_xdevapi\collection::addOrReplaceOne' => ['mysql_xdevapi\Result', 'id'=>'string', 'doc'=>'string'],
'mysql_xdevapi\collection::count' => ['integer'],
'mysql_xdevapi\collection::createIndex' => ['void', 'index_name'=>'string', 'index_desc_json'=>'string'],
'mysql_xdevapi\collection::dropIndex' => ['bool', 'index_name'=>'string'],
'mysql_xdevapi\collection::existsInDatabase' => ['bool'],
'mysql_xdevapi\collection::find' => ['mysql_xdevapi\CollectionFind', 'search_condition='=>'string'],
'mysql_xdevapi\collection::getName' => ['string'],
'mysql_xdevapi\collection::getOne' => ['Document', 'id'=>'string'],
'mysql_xdevapi\collection::getSchema' => ['mysql_xdevapi\schema'],
'mysql_xdevapi\collection::getSession' => ['Session'],
'mysql_xdevapi\collection::modify' => ['mysql_xdevapi\CollectionModify', 'search_condition'=>'string'],
'mysql_xdevapi\collection::remove' => ['mysql_xdevapi\CollectionRemove', 'search_condition'=>'string'],
'mysql_xdevapi\collection::removeOne' => ['mysql_xdevapi\Result', 'id'=>'string'],
'mysql_xdevapi\collection::replaceOne' => ['mysql_xdevapi\Result', 'id'=>'string', 'doc'=>'string'],
'mysql_xdevapi\collectionadd::execute' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\collectionfind::bind' => ['mysql_xdevapi\CollectionFind', 'placeholder_values'=>'array'],
'mysql_xdevapi\collectionfind::execute' => ['mysql_xdevapi\DocResult'],
'mysql_xdevapi\collectionfind::fields' => ['mysql_xdevapi\CollectionFind', 'projection'=>'string'],
'mysql_xdevapi\collectionfind::groupBy' => ['mysql_xdevapi\CollectionFind', 'sort_expr'=>'string'],
'mysql_xdevapi\collectionfind::having' => ['mysql_xdevapi\CollectionFind', 'sort_expr'=>'string'],
'mysql_xdevapi\collectionfind::limit' => ['mysql_xdevapi\CollectionFind', 'rows'=>'integer'],
'mysql_xdevapi\collectionfind::lockExclusive' => ['mysql_xdevapi\CollectionFind', 'lock_waiting_option='=>'integer'],
'mysql_xdevapi\collectionfind::lockShared' => ['mysql_xdevapi\CollectionFind', 'lock_waiting_option='=>'integer'],
'mysql_xdevapi\collectionfind::offset' => ['mysql_xdevapi\CollectionFind', 'position'=>'integer'],
'mysql_xdevapi\collectionfind::sort' => ['mysql_xdevapi\CollectionFind', 'sort_expr'=>'string'],
'mysql_xdevapi\collectionmodify::arrayAppend' => ['mysql_xdevapi\CollectionModify', 'collection_field'=>'string', 'expression_or_literal'=>'string'],
'mysql_xdevapi\collectionmodify::arrayInsert' => ['mysql_xdevapi\CollectionModify', 'collection_field'=>'string', 'expression_or_literal'=>'string'],
'mysql_xdevapi\collectionmodify::bind' => ['mysql_xdevapi\CollectionModify', 'placeholder_values'=>'array'],
'mysql_xdevapi\collectionmodify::execute' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\collectionmodify::limit' => ['mysql_xdevapi\CollectionModify', 'rows'=>'integer'],
'mysql_xdevapi\collectionmodify::patch' => ['mysql_xdevapi\CollectionModify', 'document'=>'string'],
'mysql_xdevapi\collectionmodify::replace' => ['mysql_xdevapi\CollectionModify', 'collection_field'=>'string', 'expression_or_literal'=>'string'],
'mysql_xdevapi\collectionmodify::set' => ['mysql_xdevapi\CollectionModify', 'collection_field'=>'string', 'expression_or_literal'=>'string'],
'mysql_xdevapi\collectionmodify::skip' => ['mysql_xdevapi\CollectionModify', 'position'=>'integer'],
'mysql_xdevapi\collectionmodify::sort' => ['mysql_xdevapi\CollectionModify', 'sort_expr'=>'string'],
'mysql_xdevapi\collectionmodify::unset' => ['mysql_xdevapi\CollectionModify', 'fields'=>'array'],
'mysql_xdevapi\collectionremove::bind' => ['mysql_xdevapi\CollectionRemove', 'placeholder_values'=>'array'],
'mysql_xdevapi\collectionremove::execute' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\collectionremove::limit' => ['mysql_xdevapi\CollectionRemove', 'rows'=>'integer'],
'mysql_xdevapi\collectionremove::sort' => ['mysql_xdevapi\CollectionRemove', 'sort_expr'=>'string'],
'mysql_xdevapi\columnresult::getCharacterSetName' => ['string'],
'mysql_xdevapi\columnresult::getCollationName' => ['string'],
'mysql_xdevapi\columnresult::getColumnLabel' => ['string'],
'mysql_xdevapi\columnresult::getColumnName' => ['string'],
'mysql_xdevapi\columnresult::getFractionalDigits' => ['integer'],
'mysql_xdevapi\columnresult::getLength' => ['integer'],
'mysql_xdevapi\columnresult::getSchemaName' => ['string'],
'mysql_xdevapi\columnresult::getTableLabel' => ['string'],
'mysql_xdevapi\columnresult::getTableName' => ['string'],
'mysql_xdevapi\columnresult::getType' => ['integer'],
'mysql_xdevapi\columnresult::isNumberSigned' => ['integer'],
'mysql_xdevapi\columnresult::isPadded' => ['integer'],
'mysql_xdevapi\crudoperationbindable::bind' => ['mysql_xdevapi\CrudOperationBindable', 'placeholder_values'=>'array'],
'mysql_xdevapi\crudoperationlimitable::limit' => ['mysql_xdevapi\CrudOperationLimitable', 'rows'=>'integer'],
'mysql_xdevapi\crudoperationskippable::skip' => ['mysql_xdevapi\CrudOperationSkippable', 'skip'=>'integer'],
'mysql_xdevapi\crudoperationsortable::sort' => ['mysql_xdevapi\CrudOperationSortable', 'sort_expr'=>'string'],
'mysql_xdevapi\databaseobject::existsInDatabase' => ['bool'],
'mysql_xdevapi\databaseobject::getName' => ['string'],
'mysql_xdevapi\databaseobject::getSession' => ['mysql_xdevapi\Session'],
'mysql_xdevapi\docresult::fetchAll' => ['Array'],
'mysql_xdevapi\docresult::fetchOne' => ['Object'],
'mysql_xdevapi\docresult::getWarnings' => ['Array'],
'mysql_xdevapi\docresult::getWarningsCount' => ['integer'],
'mysql_xdevapi\executable::execute' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\getsession' => ['mysql_xdevapi\Session', 'uri'=>'string'],
'mysql_xdevapi\result::getAutoIncrementValue' => ['int'],
'mysql_xdevapi\result::getGeneratedIds' => ['ArrayOfInt'],
'mysql_xdevapi\result::getWarnings' => ['array'],
'mysql_xdevapi\result::getWarningsCount' => ['integer'],
'mysql_xdevapi\rowresult::fetchAll' => ['array'],
'mysql_xdevapi\rowresult::fetchOne' => ['object'],
'mysql_xdevapi\rowresult::getColumnCount' => ['integer'],
'mysql_xdevapi\rowresult::getColumnNames' => ['array'],
'mysql_xdevapi\rowresult::getColumns' => ['array'],
'mysql_xdevapi\rowresult::getWarnings' => ['array'],
'mysql_xdevapi\rowresult::getWarningsCount' => ['integer'],
'mysql_xdevapi\schema::createCollection' => ['mysql_xdevapi\Collection', 'name'=>'string'],
'mysql_xdevapi\schema::dropCollection' => ['bool', 'collection_name'=>'string'],
'mysql_xdevapi\schema::existsInDatabase' => ['bool'],
'mysql_xdevapi\schema::getCollection' => ['mysql_xdevapi\Collection', 'name'=>'string'],
'mysql_xdevapi\schema::getCollectionAsTable' => ['mysql_xdevapi\Table', 'name'=>'string'],
'mysql_xdevapi\schema::getCollections' => ['array'],
'mysql_xdevapi\schema::getName' => ['string'],
'mysql_xdevapi\schema::getSession' => ['mysql_xdevapi\Session'],
'mysql_xdevapi\schema::getTable' => ['mysql_xdevapi\Table', 'name'=>'string'],
'mysql_xdevapi\schema::getTables' => ['array'],
'mysql_xdevapi\schemaobject::getSchema' => ['mysql_xdevapi\Schema'],
'mysql_xdevapi\session::close' => ['bool'],
'mysql_xdevapi\session::commit' => ['Object'],
'mysql_xdevapi\session::createSchema' => ['mysql_xdevapi\Schema', 'schema_name'=>'string'],
'mysql_xdevapi\session::dropSchema' => ['bool', 'schema_name'=>'string'],
'mysql_xdevapi\session::executeSql' => ['Object', 'statement'=>'string'],
'mysql_xdevapi\session::generateUUID' => ['string'],
'mysql_xdevapi\session::getClientId' => ['integer'],
'mysql_xdevapi\session::getSchema' => ['mysql_xdevapi\Schema', 'schema_name'=>'string'],
'mysql_xdevapi\session::getSchemas' => ['array'],
'mysql_xdevapi\session::getServerVersion' => ['integer'],
'mysql_xdevapi\session::killClient' => ['object', 'client_id'=>'integer'],
'mysql_xdevapi\session::listClients' => ['array'],
'mysql_xdevapi\session::quoteName' => ['string', 'name'=>'string'],
'mysql_xdevapi\session::releaseSavepoint' => ['void', 'name'=>'string'],
'mysql_xdevapi\session::rollback' => ['void'],
'mysql_xdevapi\session::rollbackTo' => ['void', 'name'=>'string'],
'mysql_xdevapi\session::setSavepoint' => ['string', 'name='=>'string'],
'mysql_xdevapi\session::sql' => ['mysql_xdevapi\SqlStatement', 'query'=>'string'],
'mysql_xdevapi\session::startTransaction' => ['void'],
'mysql_xdevapi\sqlstatement::bind' => ['mysql_xdevapi\SqlStatement', 'param'=>'string'],
'mysql_xdevapi\sqlstatement::execute' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\sqlstatement::getNextResult' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\sqlstatement::getResult' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\sqlstatement::hasMoreResults' => ['bool'],
'mysql_xdevapi\sqlstatementresult::fetchAll' => ['array'],
'mysql_xdevapi\sqlstatementresult::fetchOne' => ['object'],
'mysql_xdevapi\sqlstatementresult::getAffectedItemsCount' => ['integer'],
'mysql_xdevapi\sqlstatementresult::getColumnCount' => ['integer'],
'mysql_xdevapi\sqlstatementresult::getColumnNames' => ['array'],
'mysql_xdevapi\sqlstatementresult::getColumns' => ['Array'],
'mysql_xdevapi\sqlstatementresult::getGeneratedIds' => ['array'],
'mysql_xdevapi\sqlstatementresult::getLastInsertId' => ['String'],
'mysql_xdevapi\sqlstatementresult::getWarnings' => ['array'],
'mysql_xdevapi\sqlstatementresult::getWarningsCount' => ['integer'],
'mysql_xdevapi\sqlstatementresult::hasData' => ['bool'],
'mysql_xdevapi\sqlstatementresult::nextResult' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\statement::getNextResult' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\statement::getResult' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\statement::hasMoreResults' => ['bool'],
'mysql_xdevapi\table::count' => ['integer'],
'mysql_xdevapi\table::delete' => ['mysql_xdevapi\TableDelete'],
'mysql_xdevapi\table::existsInDatabase' => ['bool'],
'mysql_xdevapi\table::getName' => ['string'],
'mysql_xdevapi\table::getSchema' => ['mysql_xdevapi\Schema'],
'mysql_xdevapi\table::getSession' => ['mysql_xdevapi\Session'],
'mysql_xdevapi\table::insert' => ['mysql_xdevapi\TableInsert', 'columns'=>'mixed', '...args='=>'mixed'],
'mysql_xdevapi\table::isView' => ['bool'],
'mysql_xdevapi\table::select' => ['mysql_xdevapi\TableSelect', 'columns'=>'mixed', '...args='=>'mixed'],
'mysql_xdevapi\table::update' => ['mysql_xdevapi\TableUpdate'],
'mysql_xdevapi\tabledelete::bind' => ['mysql_xdevapi\TableDelete', 'placeholder_values'=>'array'],
'mysql_xdevapi\tabledelete::execute' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\tabledelete::limit' => ['mysql_xdevapi\TableDelete', 'rows'=>'integer'],
'mysql_xdevapi\tabledelete::offset' => ['mysql_xdevapi\TableDelete', 'position'=>'integer'],
'mysql_xdevapi\tabledelete::orderby' => ['mysql_xdevapi\TableDelete', 'orderby_expr'=>'string'],
'mysql_xdevapi\tabledelete::where' => ['mysql_xdevapi\TableDelete', 'where_expr'=>'string'],
'mysql_xdevapi\tableinsert::execute' => ['mysql_xdevapi\Result'],
'mysql_xdevapi\tableinsert::values' => ['mysql_xdevapi\TableInsert', 'row_values'=>'array'],
'mysql_xdevapi\tableselect::bind' => ['mysql_xdevapi\TableSelect', 'placeholder_values'=>'array'],
'mysql_xdevapi\tableselect::execute' => ['mysql_xdevapi\RowResult'],
'mysql_xdevapi\tableselect::groupBy' => ['mysql_xdevapi\TableSelect', 'sort_expr'=>'mixed'],
'mysql_xdevapi\tableselect::having' => ['mysql_xdevapi\TableSelect', 'sort_expr'=>'string'],
'mysql_xdevapi\tableselect::limit' => ['mysql_xdevapi\TableSelect', 'rows'=>'integer'],
'mysql_xdevapi\tableselect::lockExclusive' => ['mysql_xdevapi\TableSelect', 'lock_waiting_option='=>'integer'],
'mysql_xdevapi\tableselect::lockShared' => ['mysql_xdevapi\TableSelect', 'lock_waiting_option='=>'integer'],
'mysql_xdevapi\tableselect::offset' => ['mysql_xdevapi\TableSelect', 'position'=>'integer'],
'mysql_xdevapi\tableselect::orderby' => ['mysql_xdevapi\TableSelect', 'sort_expr'=>'mixed', '...args='=>'mixed'],
'mysql_xdevapi\tableselect::where' => ['mysql_xdevapi\TableSelect', 'where_expr'=>'string'],
'mysql_xdevapi\tableupdate::bind' => ['mysql_xdevapi\TableUpdate', 'placeholder_values'=>'array'],
'mysql_xdevapi\tableupdate::execute' => ['mysql_xdevapi\TableUpdate'],
'mysql_xdevapi\tableupdate::limit' => ['mysql_xdevapi\TableUpdate', 'rows'=>'integer'],
'mysql_xdevapi\tableupdate::orderby' => ['mysql_xdevapi\TableUpdate', 'orderby_expr'=>'mixed', '...args='=>'mixed'],
'mysql_xdevapi\tableupdate::set' => ['mysql_xdevapi\TableUpdate', 'table_field'=>'string', 'expression_or_literal'=>'string'],
'mysql_xdevapi\tableupdate::where' => ['mysql_xdevapi\TableUpdate', 'where_expr'=>'string'],
'mysqli::__construct' => ['void', 'hostname='=>'string|null', 'username='=>'string|null', 'password='=>'string|null', 'database='=>'string|null', 'port='=>'int|null', 'socket='=>'string|null'],
'mysqli::autocommit' => ['bool', 'enable'=>'bool'],
'mysqli::begin_transaction' => ['bool', 'flags='=>'int', 'name='=>'string'],
'mysqli::change_user' => ['bool', 'username'=>'string', 'password'=>'string', 'database'=>'string'],
'mysqli::character_set_name' => ['string'],
'mysqli::close' => ['bool'],
'mysqli::commit' => ['bool', 'flags='=>'int', 'name='=>'string'],
'mysqli::connect' => ['bool', 'hostname='=>'string|null', 'username='=>'string|null', 'password='=>'string|null', 'database='=>'string|null', 'port='=>'int|null', 'socket='=>'string|null'],
'mysqli::debug' => ['bool', 'options'=>'string'],
'mysqli::disable_reads_from_master' => ['bool'],
'mysqli::dump_debug_info' => ['bool'],
'mysqli::escape_string' => ['string', 'string'=>'string'],
'mysqli::get_charset' => ['object'],
'mysqli::get_client_info' => ['string'],
'mysqli::get_connection_stats' => ['array|false'],
'mysqli::get_warnings' => ['mysqli_warning'],
'mysqli::init' => ['mysqli'],
'mysqli::kill' => ['bool', 'process_id'=>'int'],
'mysqli::more_results' => ['bool'],
'mysqli::multi_query' => ['bool', 'query'=>'string'],
'mysqli::next_result' => ['bool'],
'mysqli::options' => ['bool', 'option'=>'int', 'value'=>'mixed'],
'mysqli::ping' => ['bool'],
'mysqli::poll' => ['int|false', '&w_read'=>'array', '&w_write'=>'array', '&w_error'=>'array', 'seconds'=>'int', 'microseconds='=>'int'],
'mysqli::prepare' => ['mysqli_stmt|false', 'query'=>'string'],
'mysqli::query' => ['bool|mysqli_result', 'query'=>'string', 'result_mode='=>'int'],
'mysqli::real_connect' => ['bool', 'hostname='=>'string|null', 'username='=>'string|null', 'password='=>'string|null', 'database='=>'string|null', 'port='=>'int|null', 'socket='=>'string|null', 'flags='=>'int'],
'mysqli::real_escape_string' => ['string', 'string'=>'string'],
'mysqli::real_query' => ['bool', 'query'=>'string'],
'mysqli::reap_async_query' => ['mysqli_result|false'],
'mysqli::refresh' => ['bool', 'flags'=>'int'],
'mysqli::release_savepoint' => ['bool', 'name'=>'string'],
'mysqli::rollback' => ['bool', 'flags='=>'int', 'name='=>'string'],
'mysqli::rpl_query_type' => ['int', 'query'=>'string'],
'mysqli::savepoint' => ['bool', 'name'=>'string'],
'mysqli::select_db' => ['bool', 'database'=>'string'],
'mysqli::send_query' => ['bool', 'query'=>'string'],
'mysqli::set_charset' => ['bool', 'charset'=>'string'],
'mysqli::set_local_infile_default' => ['void'],
'mysqli::set_local_infile_handler' => ['bool', 'read_func='=>'callable'],
'mysqli::ssl_set' => ['bool', 'key'=>'string', 'certificate'=>'string', 'ca_certificate'=>'string', 'ca_path'=>'string', 'cipher_algos'=>'string'],
'mysqli::stat' => ['string|false'],
'mysqli::stmt_init' => ['mysqli_stmt'],
'mysqli::store_result' => ['mysqli_result|false', 'mode='=>'int'],
'mysqli::thread_safe' => ['bool'],
'mysqli::use_result' => ['mysqli_result|false'],
'mysqli_affected_rows' => ['int', 'mysql'=>'mysqli'],
'mysqli_autocommit' => ['bool', 'mysql'=>'mysqli', 'enable'=>'bool'],
'mysqli_begin_transaction' => ['bool', 'mysql'=>'mysqli', 'flags='=>'int', 'name='=>'string'],
'mysqli_change_user' => ['bool', 'mysql'=>'mysqli', 'username'=>'string', 'password'=>'string', 'database'=>'?string'],
'mysqli_character_set_name' => ['string', 'mysql'=>'mysqli'],
'mysqli_close' => ['bool', 'mysql'=>'mysqli'],
'mysqli_commit' => ['bool', 'mysql'=>'mysqli', 'flags='=>'int', 'name='=>'string'],
'mysqli_connect' => ['mysqli|false', 'hostname='=>'string|null', 'username='=>'string|null', 'password='=>'string|null', 'database='=>'string|null', 'port='=>'int|null', 'socket='=>'string|null'],
'mysqli_connect_errno' => ['int'],
'mysqli_connect_error' => ['?string'],
'mysqli_data_seek' => ['bool', 'result'=>'mysqli_result', 'offset'=>'int'],
'mysqli_debug' => ['bool', 'options'=>'string'],
'mysqli_disable_reads_from_master' => ['bool', 'link'=>'mysqli'],
'mysqli_disable_rpl_parse' => ['bool', 'link'=>'mysqli'],
'mysqli_driver::embedded_server_end' => ['void'],
'mysqli_driver::embedded_server_start' => ['bool', 'start'=>'int', 'arguments'=>'array', 'groups'=>'array'],
'mysqli_dump_debug_info' => ['bool', 'mysql'=>'mysqli'],
'mysqli_embedded_server_end' => ['void'],
'mysqli_embedded_server_start' => ['bool', 'start'=>'int', 'arguments'=>'array', 'groups'=>'array'],
'mysqli_enable_reads_from_master' => ['bool', 'link'=>'mysqli'],
'mysqli_enable_rpl_parse' => ['bool', 'link'=>'mysqli'],
'mysqli_errno' => ['int', 'mysql'=>'mysqli'],
'mysqli_error' => ['string', 'mysql'=>'mysqli'],
'mysqli_error_list' => ['array', 'mysql'=>'mysqli'],
'mysqli_escape_string' => ['string', 'mysql'=>'mysqli', 'string'=>'string'],
'mysqli_execute' => ['bool', 'statement'=>'mysqli_stmt', 'params='=>'list<mixed>|null'],
'mysqli_fetch_all' => ['array', 'result'=>'mysqli_result', 'mode='=>'int'],
'mysqli_fetch_array' => ['?array', 'result'=>'mysqli_result', 'mode='=>'int'],
'mysqli_fetch_assoc' => ['array<string,string>|null', 'result'=>'mysqli_result'],
'mysqli_fetch_column' => ['null|int|float|string|false', 'result'=>'mysqli_result', 'column='=>'int'],
'mysqli_fetch_field' => ['object|false', 'result'=>'mysqli_result'],
'mysqli_fetch_field_direct' => ['object|false', 'result'=>'mysqli_result', 'index'=>'int'],
'mysqli_fetch_fields' => ['array|false', 'result'=>'mysqli_result'],
'mysqli_fetch_lengths' => ['array|false', 'result'=>'mysqli_result'],
'mysqli_fetch_object' => ['?object', 'result'=>'mysqli_result', 'class='=>'string', 'constructor_args='=>'?array'],
'mysqli_fetch_row' => ['?array', 'result'=>'mysqli_result'],
'mysqli_field_count' => ['int', 'mysql'=>'mysqli'],
'mysqli_field_seek' => ['bool', 'result'=>'mysqli_result', 'index'=>'int'],
'mysqli_field_tell' => ['int', 'result'=>'mysqli_result'],
'mysqli_free_result' => ['void', 'result'=>'mysqli_result'],
'mysqli_get_cache_stats' => ['array|false'],
'mysqli_get_charset' => ['object', 'mysql'=>'mysqli'],
'mysqli_get_client_info' => ['string', 'mysql'=>'mysqli'],
'mysqli_get_client_stats' => ['array|false'],
'mysqli_get_client_version' => ['int', 'link'=>'mysqli'],
'mysqli_get_connection_stats' => ['array|false', 'mysql'=>'mysqli'],
'mysqli_get_host_info' => ['string', 'mysql'=>'mysqli'],
'mysqli_get_links_stats' => ['array'],
'mysqli_get_proto_info' => ['int', 'mysql'=>'mysqli'],
'mysqli_get_server_info' => ['string', 'mysql'=>'mysqli'],
'mysqli_get_server_version' => ['int', 'mysql'=>'mysqli'],
'mysqli_get_warnings' => ['mysqli_warning', 'mysql'=>'mysqli'],
'mysqli_info' => ['?string', 'mysql'=>'mysqli'],
'mysqli_init' => ['mysqli|false'],
'mysqli_insert_id' => ['int|string', 'mysql'=>'mysqli'],
'mysqli_kill' => ['bool', 'mysql'=>'mysqli', 'process_id'=>'int'],
'mysqli_link_construct' => ['object'],
'mysqli_master_query' => ['bool', 'link'=>'mysqli', 'query'=>'string'],
'mysqli_more_results' => ['bool', 'mysql'=>'mysqli'],
'mysqli_multi_query' => ['bool', 'mysql'=>'mysqli', 'query'=>'string'],
'mysqli_next_result' => ['bool', 'mysql'=>'mysqli'],
'mysqli_num_fields' => ['int', 'result'=>'mysqli_result'],
'mysqli_num_rows' => ['int', 'result'=>'mysqli_result'],
'mysqli_options' => ['bool', 'mysql'=>'mysqli', 'option'=>'int', 'value'=>'mixed'],
'mysqli_ping' => ['bool', 'mysql'=>'mysqli'],
'mysqli_poll' => ['int|false', 'read'=>'array', 'write'=>'array', 'error'=>'array', 'seconds'=>'int', 'microseconds='=>'int'],
'mysqli_prepare' => ['mysqli_stmt|false', 'mysql'=>'mysqli', 'query'=>'string'],
'mysqli_query' => ['mysqli_result|bool', 'mysql'=>'mysqli', 'query'=>'string', 'result_mode='=>'int'],
'mysqli_real_connect' => ['bool', 'mysql='=>'mysqli', 'hostname='=>'string|null', 'username='=>'string|null', 'password='=>'string|null', 'database='=>'string|null', 'port='=>'int|null', 'socket='=>'string|null', 'flags='=>'int'],
'mysqli_real_escape_string' => ['string', 'mysql'=>'mysqli', 'string'=>'string'],
'mysqli_real_query' => ['bool', 'mysql'=>'mysqli', 'query'=>'string'],
'mysqli_reap_async_query' => ['mysqli_result|false', 'mysql'=>'mysqli'],
'mysqli_refresh' => ['bool', 'mysql'=>'mysqli', 'flags'=>'int'],
'mysqli_release_savepoint' => ['bool', 'mysql'=>'mysqli', 'name'=>'string'],
'mysqli_report' => ['bool', 'flags'=>'int'],
'mysqli_result::__construct' => ['void', 'mysql'=>'mysqli', 'result_mode='=>'int'],
'mysqli_result::close' => ['void'],
'mysqli_result::data_seek' => ['bool', 'offset'=>'int'],
'mysqli_result::fetch_all' => ['array', 'mode='=>'int'],
'mysqli_result::fetch_array' => ['?array', 'mode='=>'int'],
'mysqli_result::fetch_assoc' => ['array<string,string>|null'],
'mysqli_result::fetch_column' => ['null|int|float|string|false', 'column='=>'int'],
'mysqli_result::fetch_field' => ['object|false'],
'mysqli_result::fetch_field_direct' => ['object|false', 'index'=>'int'],
'mysqli_result::fetch_fields' => ['array|false'],
'mysqli_result::fetch_object' => ['object|stdClass|null', 'class='=>'string', 'constructor_args='=>'array'],
'mysqli_result::fetch_row' => ['?array'],
'mysqli_result::field_seek' => ['bool', 'index'=>'int'],
'mysqli_result::free' => ['void'],
'mysqli_result::free_result' => ['void'],
'mysqli_rollback' => ['bool', 'mysql'=>'mysqli', 'flags='=>'int', 'name='=>'string'],
'mysqli_rpl_parse_enabled' => ['int', 'link'=>'mysqli'],
'mysqli_rpl_probe' => ['bool', 'link'=>'mysqli'],
'mysqli_rpl_query_type' => ['int', 'link'=>'mysqli', 'query'=>'string'],
'mysqli_savepoint' => ['bool', 'mysql'=>'mysqli', 'name'=>'string'],
'mysqli_savepoint_libmysql' => ['bool'],
'mysqli_select_db' => ['bool', 'mysql'=>'mysqli', 'database'=>'string'],
'mysqli_send_query' => ['bool', 'link'=>'mysqli', 'query'=>'string'],
'mysqli_set_charset' => ['bool', 'mysql'=>'mysqli', 'charset'=>'string'],
'mysqli_set_local_infile_default' => ['void', 'link'=>'mysqli'],
'mysqli_set_local_infile_handler' => ['bool', 'link'=>'mysqli', 'read_func'=>'callable'],
'mysqli_set_opt' => ['bool', 'mysql'=>'mysqli', 'option'=>'int', 'value'=>'mixed'],
'mysqli_slave_query' => ['bool', 'link'=>'mysqli', 'query'=>'string'],
'mysqli_sqlstate' => ['string', 'mysql'=>'mysqli'],
'mysqli_ssl_set' => ['bool', 'mysql'=>'mysqli', 'key'=>'string', 'certificate'=>'string', 'ca_certificate'=>'string', 'ca_path'=>'string', 'cipher_algos'=>'string'],
'mysqli_stat' => ['string|false', 'mysql'=>'mysqli'],
'mysqli_stmt::__construct' => ['void', 'mysql'=>'mysqli', 'query'=>'string'],
'mysqli_stmt::attr_get' => ['false|int', 'attribute'=>'int'],
'mysqli_stmt::attr_set' => ['bool', 'attribute'=>'int', 'value'=>'int'],
'mysqli_stmt::bind_param' => ['bool', 'types'=>'string', '&vars'=>'mixed', '&...args='=>'mixed'],
'mysqli_stmt::bind_result' => ['bool', '&w_var1'=>'', '&...w_vars='=>''],
'mysqli_stmt::close' => ['bool'],
'mysqli_stmt::data_seek' => ['void', 'offset'=>'int'],
'mysqli_stmt::execute' => ['bool', 'params='=>'list<mixed>|null'],
'mysqli_stmt::fetch' => ['bool|null'],
'mysqli_stmt::free_result' => ['void'],
'mysqli_stmt::get_result' => ['mysqli_result|false'],
'mysqli_stmt::get_warnings' => ['object'],
'mysqli_stmt::more_results' => ['bool'],
'mysqli_stmt::next_result' => ['bool'],
'mysqli_stmt::num_rows' => ['int'],
'mysqli_stmt::prepare' => ['bool', 'query'=>'string'],
'mysqli_stmt::reset' => ['bool'],
'mysqli_stmt::result_metadata' => ['mysqli_result|false'],
'mysqli_stmt::send_long_data' => ['bool', 'param_num'=>'int', 'data'=>'string'],
'mysqli_stmt::store_result' => ['bool'],
'mysqli_stmt_affected_rows' => ['int|string', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_attr_get' => ['int|false', 'statement'=>'mysqli_stmt', 'attribute'=>'int'],
'mysqli_stmt_attr_set' => ['bool', 'statement'=>'mysqli_stmt', 'attribute'=>'int', 'value'=>'int'],
'mysqli_stmt_bind_param' => ['bool', 'statement'=>'mysqli_stmt', 'types'=>'string', '&vars'=>'mixed', '&...args='=>'mixed'],
'mysqli_stmt_bind_result' => ['bool', 'statement'=>'mysqli_stmt', '&w_var1'=>'', '&...w_vars='=>''],
'mysqli_stmt_close' => ['bool', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_data_seek' => ['void', 'statement'=>'mysqli_stmt', 'offset'=>'int'],
'mysqli_stmt_errno' => ['int', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_error' => ['string', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_error_list' => ['array', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_execute' => ['bool', 'statement'=>'mysqli_stmt', 'params='=>'list<mixed>|null'],
'mysqli_stmt_fetch' => ['bool|null', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_field_count' => ['int', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_free_result' => ['void', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_get_result' => ['mysqli_result|false', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_get_warnings' => ['object', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_init' => ['mysqli_stmt', 'mysql'=>'mysqli'],
'mysqli_stmt_insert_id' => ['mixed', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_more_results' => ['bool', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_next_result' => ['bool', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_num_rows' => ['int', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_param_count' => ['int', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_prepare' => ['bool', 'statement'=>'mysqli_stmt', 'query'=>'string'],
'mysqli_stmt_reset' => ['bool', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_result_metadata' => ['mysqli_result|false', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_send_long_data' => ['bool', 'statement'=>'mysqli_stmt', 'param_num'=>'int', 'data'=>'string'],
'mysqli_stmt_sqlstate' => ['string', 'statement'=>'mysqli_stmt'],
'mysqli_stmt_store_result' => ['bool', 'statement'=>'mysqli_stmt'],
'mysqli_store_result' => ['mysqli_result|false', 'mysql'=>'mysqli', 'mode='=>'int'],
'mysqli_thread_id' => ['int', 'mysql'=>'mysqli'],
'mysqli_thread_safe' => ['bool'],
'mysqli_use_result' => ['mysqli_result|false', 'mysql'=>'mysqli'],
'mysqli_warning::__construct' => ['void'],
'mysqli_warning::next' => ['bool'],
'mysqli_warning_count' => ['int', 'mysql'=>'mysqli'],
'mysqlnd_memcache_get_config' => ['array', 'connection'=>'mixed'],
'mysqlnd_memcache_set' => ['bool', 'mysql_connection'=>'mixed', 'memcache_connection='=>'Memcached', 'pattern='=>'string', 'callback='=>'callable'],
'mysqlnd_ms_dump_servers' => ['array', 'connection'=>'mixed'],
'mysqlnd_ms_fabric_select_global' => ['array', 'connection'=>'mixed', 'table_name'=>'mixed'],
'mysqlnd_ms_fabric_select_shard' => ['array', 'connection'=>'mixed', 'table_name'=>'mixed', 'shard_key'=>'mixed'],
'mysqlnd_ms_get_last_gtid' => ['string', 'connection'=>'mixed'],
'mysqlnd_ms_get_last_used_connection' => ['array', 'connection'=>'mixed'],
'mysqlnd_ms_get_stats' => ['array'],
'mysqlnd_ms_match_wild' => ['bool', 'table_name'=>'string', 'wildcard'=>'string'],
'mysqlnd_ms_query_is_select' => ['int', 'query'=>'string'],
'mysqlnd_ms_set_qos' => ['bool', 'connection'=>'mixed', 'service_level'=>'int', 'service_level_option='=>'int', 'option_value='=>'mixed'],
'mysqlnd_ms_set_user_pick_server' => ['bool', 'function'=>'string'],
'mysqlnd_ms_xa_begin' => ['int', 'connection'=>'mixed', 'gtrid'=>'string', 'timeout='=>'int'],
'mysqlnd_ms_xa_commit' => ['int', 'connection'=>'mixed', 'gtrid'=>'string'],
'mysqlnd_ms_xa_gc' => ['int', 'connection'=>'mixed', 'gtrid='=>'string', 'ignore_max_retries='=>'bool'],
'mysqlnd_ms_xa_rollback' => ['int', 'connection'=>'mixed', 'gtrid'=>'string'],
'mysqlnd_qc_change_handler' => ['bool', 'handler'=>''],
'mysqlnd_qc_clear_cache' => ['bool'],
'mysqlnd_qc_get_available_handlers' => ['array'],
'mysqlnd_qc_get_cache_info' => ['array'],
'mysqlnd_qc_get_core_stats' => ['array'],
'mysqlnd_qc_get_handler' => ['array'],
'mysqlnd_qc_get_normalized_query_trace_log' => ['array'],
'mysqlnd_qc_get_query_trace_log' => ['array'],
'mysqlnd_qc_set_cache_condition' => ['bool', 'condition_type'=>'int', 'condition'=>'mixed', 'condition_option'=>'mixed'],
'mysqlnd_qc_set_is_select' => ['mixed', 'callback'=>'string'],
'mysqlnd_qc_set_storage_handler' => ['bool', 'handler'=>'string'],
'mysqlnd_qc_set_user_handlers' => ['bool', 'get_hash'=>'string', 'find_query_in_cache'=>'string', 'return_to_cache'=>'string', 'add_query_to_cache_if_not_exists'=>'string', 'query_is_select'=>'string', 'update_query_run_time_stats'=>'string', 'get_stats'=>'string', 'clear_cache'=>'string'],
'mysqlnd_uh_convert_to_mysqlnd' => ['resource', '&rw_mysql_connection'=>'mysqli'],
'mysqlnd_uh_set_connection_proxy' => ['bool', '&rw_connection_proxy'=>'MysqlndUhConnection', '&rw_mysqli_connection='=>'mysqli'],
'mysqlnd_uh_set_statement_proxy' => ['bool', '&rw_statement_proxy'=>'MysqlndUhStatement'],
'MysqlndUhConnection::__construct' => ['void'],
'MysqlndUhConnection::changeUser' => ['bool', 'connection'=>'mysqlnd_connection', 'user'=>'string', 'password'=>'string', 'database'=>'string', 'silent'=>'bool', 'passwd_len'=>'int'],
'MysqlndUhConnection::charsetName' => ['string', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::close' => ['bool', 'connection'=>'mysqlnd_connection', 'close_type'=>'int'],
'MysqlndUhConnection::connect' => ['bool', 'connection'=>'mysqlnd_connection', 'host'=>'string', 'use'=>'string', 'password'=>'string', 'database'=>'string', 'port'=>'int', 'socket'=>'string', 'mysql_flags'=>'int'],
'MysqlndUhConnection::endPSession' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::escapeString' => ['string', 'connection'=>'mysqlnd_connection', 'escape_string'=>'string'],
'MysqlndUhConnection::getAffectedRows' => ['int', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getErrorNumber' => ['int', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getErrorString' => ['string', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getFieldCount' => ['int', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getHostInformation' => ['string', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getLastInsertId' => ['int', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getLastMessage' => ['void', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getProtocolInformation' => ['string', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getServerInformation' => ['string', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getServerStatistics' => ['string', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getServerVersion' => ['int', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getSqlstate' => ['string', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getStatistics' => ['array', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getThreadId' => ['int', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::getWarningCount' => ['int', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::init' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::killConnection' => ['bool', 'connection'=>'mysqlnd_connection', 'pid'=>'int'],
'MysqlndUhConnection::listFields' => ['array', 'connection'=>'mysqlnd_connection', 'table'=>'string', 'achtung_wild'=>'string'],
'MysqlndUhConnection::listMethod' => ['void', 'connection'=>'mysqlnd_connection', 'query'=>'string', 'achtung_wild'=>'string', 'par1'=>'string'],
'MysqlndUhConnection::moreResults' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::nextResult' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::ping' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::query' => ['bool', 'connection'=>'mysqlnd_connection', 'query'=>'string'],
'MysqlndUhConnection::queryReadResultsetHeader' => ['bool', 'connection'=>'mysqlnd_connection', 'mysqlnd_stmt'=>'mysqlnd_statement'],
'MysqlndUhConnection::reapQuery' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::refreshServer' => ['bool', 'connection'=>'mysqlnd_connection', 'options'=>'int'],
'MysqlndUhConnection::restartPSession' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::selectDb' => ['bool', 'connection'=>'mysqlnd_connection', 'database'=>'string'],
'MysqlndUhConnection::sendClose' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::sendQuery' => ['bool', 'connection'=>'mysqlnd_connection', 'query'=>'string'],
'MysqlndUhConnection::serverDumpDebugInformation' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::setAutocommit' => ['bool', 'connection'=>'mysqlnd_connection', 'mode'=>'int'],
'MysqlndUhConnection::setCharset' => ['bool', 'connection'=>'mysqlnd_connection', 'charset'=>'string'],
'MysqlndUhConnection::setClientOption' => ['bool', 'connection'=>'mysqlnd_connection', 'option'=>'int', 'value'=>'int'],
'MysqlndUhConnection::setServerOption' => ['void', 'connection'=>'mysqlnd_connection', 'option'=>'int'],
'MysqlndUhConnection::shutdownServer' => ['void', 'MYSQLND_UH_RES_MYSQLND_NAME'=>'string', 'level'=>'string'],
'MysqlndUhConnection::simpleCommand' => ['bool', 'connection'=>'mysqlnd_connection', 'command'=>'int', 'arg'=>'string', 'ok_packet'=>'int', 'silent'=>'bool', 'ignore_upsert_status'=>'bool'],
'MysqlndUhConnection::simpleCommandHandleResponse' => ['bool', 'connection'=>'mysqlnd_connection', 'ok_packet'=>'int', 'silent'=>'bool', 'command'=>'int', 'ignore_upsert_status'=>'bool'],
'MysqlndUhConnection::sslSet' => ['bool', 'connection'=>'mysqlnd_connection', 'key'=>'string', 'cert'=>'string', 'ca'=>'string', 'capath'=>'string', 'cipher'=>'string'],
'MysqlndUhConnection::stmtInit' => ['resource', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::storeResult' => ['resource', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::txCommit' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::txRollback' => ['bool', 'connection'=>'mysqlnd_connection'],
'MysqlndUhConnection::useResult' => ['resource', 'connection'=>'mysqlnd_connection'],
'MysqlndUhPreparedStatement::__construct' => ['void'],
'MysqlndUhPreparedStatement::execute' => ['bool', 'statement'=>'mysqlnd_prepared_statement'],
'MysqlndUhPreparedStatement::prepare' => ['bool', 'statement'=>'mysqlnd_prepared_statement', 'query'=>'string'],
'natcasesort' => ['bool', '&rw_array'=>'array'],
'natsort' => ['bool', '&rw_array'=>'array'],
'ncurses_addch' => ['int', 'ch'=>'int'],
'ncurses_addchnstr' => ['int', 's'=>'string', 'n'=>'int'],
'ncurses_addchstr' => ['int', 's'=>'string'],
'ncurses_addnstr' => ['int', 's'=>'string', 'n'=>'int'],
'ncurses_addstr' => ['int', 'text'=>'string'],
'ncurses_assume_default_colors' => ['int', 'fg'=>'int', 'bg'=>'int'],
'ncurses_attroff' => ['int', 'attributes'=>'int'],
'ncurses_attron' => ['int', 'attributes'=>'int'],
'ncurses_attrset' => ['int', 'attributes'=>'int'],
'ncurses_baudrate' => ['int'],
'ncurses_beep' => ['int'],
'ncurses_bkgd' => ['int', 'attrchar'=>'int'],
'ncurses_bkgdset' => ['void', 'attrchar'=>'int'],
'ncurses_border' => ['int', 'left'=>'int', 'right'=>'int', 'top'=>'int', 'bottom'=>'int', 'tl_corner'=>'int', 'tr_corner'=>'int', 'bl_corner'=>'int', 'br_corner'=>'int'],
'ncurses_bottom_panel' => ['int', 'panel'=>'resource'],
'ncurses_can_change_color' => ['bool'],
'ncurses_cbreak' => ['bool'],
'ncurses_clear' => ['bool'],
'ncurses_clrtobot' => ['bool'],
'ncurses_clrtoeol' => ['bool'],
'ncurses_color_content' => ['int', 'color'=>'int', 'r'=>'int', 'g'=>'int', 'b'=>'int'],
'ncurses_color_set' => ['int', 'pair'=>'int'],
'ncurses_curs_set' => ['int', 'visibility'=>'int'],
'ncurses_def_prog_mode' => ['bool'],
'ncurses_def_shell_mode' => ['bool'],
'ncurses_define_key' => ['int', 'definition'=>'string', 'keycode'=>'int'],
'ncurses_del_panel' => ['bool', 'panel'=>'resource'],
'ncurses_delay_output' => ['int', 'milliseconds'=>'int'],
'ncurses_delch' => ['bool'],
'ncurses_deleteln' => ['bool'],
'ncurses_delwin' => ['bool', 'window'=>'resource'],
'ncurses_doupdate' => ['bool'],
'ncurses_echo' => ['bool'],
'ncurses_echochar' => ['int', 'character'=>'int'],
'ncurses_end' => ['int'],
'ncurses_erase' => ['bool'],
'ncurses_erasechar' => ['string'],
'ncurses_filter' => ['void'],
'ncurses_flash' => ['bool'],
'ncurses_flushinp' => ['bool'],
'ncurses_getch' => ['int'],
'ncurses_getmaxyx' => ['void', 'window'=>'resource', 'y'=>'int', 'x'=>'int'],
'ncurses_getmouse' => ['bool', 'mevent'=>'array'],
'ncurses_getyx' => ['void', 'window'=>'resource', 'y'=>'int', 'x'=>'int'],
'ncurses_halfdelay' => ['int', 'tenth'=>'int'],
'ncurses_has_colors' => ['bool'],
'ncurses_has_ic' => ['bool'],
'ncurses_has_il' => ['bool'],
'ncurses_has_key' => ['int', 'keycode'=>'int'],
'ncurses_hide_panel' => ['int', 'panel'=>'resource'],
'ncurses_hline' => ['int', 'charattr'=>'int', 'n'=>'int'],
'ncurses_inch' => ['string'],
'ncurses_init' => ['void'],
'ncurses_init_color' => ['int', 'color'=>'int', 'r'=>'int', 'g'=>'int', 'b'=>'int'],
'ncurses_init_pair' => ['int', 'pair'=>'int', 'fg'=>'int', 'bg'=>'int'],
'ncurses_insch' => ['int', 'character'=>'int'],
'ncurses_insdelln' => ['int', 'count'=>'int'],
'ncurses_insertln' => ['int'],
'ncurses_insstr' => ['int', 'text'=>'string'],
'ncurses_instr' => ['int', 'buffer'=>'string'],
'ncurses_isendwin' => ['bool'],
'ncurses_keyok' => ['int', 'keycode'=>'int', 'enable'=>'bool'],
'ncurses_keypad' => ['int', 'window'=>'resource', 'bf'=>'bool'],
'ncurses_killchar' => ['string'],
'ncurses_longname' => ['string'],
'ncurses_meta' => ['int', 'window'=>'resource', '_8bit'=>'bool'],
'ncurses_mouse_trafo' => ['bool', 'y'=>'int', 'x'=>'int', 'toscreen'=>'bool'],
'ncurses_mouseinterval' => ['int', 'milliseconds'=>'int'],
'ncurses_mousemask' => ['int', 'newmask'=>'int', 'oldmask'=>'int'],
'ncurses_move' => ['int', 'y'=>'int', 'x'=>'int'],
'ncurses_move_panel' => ['int', 'panel'=>'resource', 'startx'=>'int', 'starty'=>'int'],
'ncurses_mvaddch' => ['int', 'y'=>'int', 'x'=>'int', 'c'=>'int'],
'ncurses_mvaddchnstr' => ['int', 'y'=>'int', 'x'=>'int', 's'=>'string', 'n'=>'int'],
'ncurses_mvaddchstr' => ['int', 'y'=>'int', 'x'=>'int', 's'=>'string'],
'ncurses_mvaddnstr' => ['int', 'y'=>'int', 'x'=>'int', 's'=>'string', 'n'=>'int'],
'ncurses_mvaddstr' => ['int', 'y'=>'int', 'x'=>'int', 's'=>'string'],
'ncurses_mvcur' => ['int', 'old_y'=>'int', 'old_x'=>'int', 'new_y'=>'int', 'new_x'=>'int'],
'ncurses_mvdelch' => ['int', 'y'=>'int', 'x'=>'int'],
'ncurses_mvgetch' => ['int', 'y'=>'int', 'x'=>'int'],
'ncurses_mvhline' => ['int', 'y'=>'int', 'x'=>'int', 'attrchar'=>'int', 'n'=>'int'],
'ncurses_mvinch' => ['int', 'y'=>'int', 'x'=>'int'],
'ncurses_mvvline' => ['int', 'y'=>'int', 'x'=>'int', 'attrchar'=>'int', 'n'=>'int'],
'ncurses_mvwaddstr' => ['int', 'window'=>'resource', 'y'=>'int', 'x'=>'int', 'text'=>'string'],
'ncurses_napms' => ['int', 'milliseconds'=>'int'],
'ncurses_new_panel' => ['resource', 'window'=>'resource'],
'ncurses_newpad' => ['resource', 'rows'=>'int', 'cols'=>'int'],
'ncurses_newwin' => ['resource', 'rows'=>'int', 'cols'=>'int', 'y'=>'int', 'x'=>'int'],
'ncurses_nl' => ['bool'],
'ncurses_nocbreak' => ['bool'],
'ncurses_noecho' => ['bool'],
'ncurses_nonl' => ['bool'],
'ncurses_noqiflush' => ['void'],
'ncurses_noraw' => ['bool'],
'ncurses_pair_content' => ['int', 'pair'=>'int', 'f'=>'int', 'b'=>'int'],
'ncurses_panel_above' => ['resource', 'panel'=>'resource'],
'ncurses_panel_below' => ['resource', 'panel'=>'resource'],
'ncurses_panel_window' => ['resource', 'panel'=>'resource'],
'ncurses_pnoutrefresh' => ['int', 'pad'=>'resource', 'pminrow'=>'int', 'pmincol'=>'int', 'sminrow'=>'int', 'smincol'=>'int', 'smaxrow'=>'int', 'smaxcol'=>'int'],
'ncurses_prefresh' => ['int', 'pad'=>'resource', 'pminrow'=>'int', 'pmincol'=>'int', 'sminrow'=>'int', 'smincol'=>'int', 'smaxrow'=>'int', 'smaxcol'=>'int'],
'ncurses_putp' => ['int', 'text'=>'string'],
'ncurses_qiflush' => ['void'],
'ncurses_raw' => ['bool'],
'ncurses_refresh' => ['int', 'ch'=>'int'],
'ncurses_replace_panel' => ['int', 'panel'=>'resource', 'window'=>'resource'],
'ncurses_reset_prog_mode' => ['int'],
'ncurses_reset_shell_mode' => ['int'],
'ncurses_resetty' => ['bool'],
'ncurses_savetty' => ['bool'],
'ncurses_scr_dump' => ['int', 'filename'=>'string'],
'ncurses_scr_init' => ['int', 'filename'=>'string'],
'ncurses_scr_restore' => ['int', 'filename'=>'string'],
'ncurses_scr_set' => ['int', 'filename'=>'string'],
'ncurses_scrl' => ['int', 'count'=>'int'],
'ncurses_show_panel' => ['int', 'panel'=>'resource'],
'ncurses_slk_attr' => ['int'],
'ncurses_slk_attroff' => ['int', 'intarg'=>'int'],
'ncurses_slk_attron' => ['int', 'intarg'=>'int'],
'ncurses_slk_attrset' => ['int', 'intarg'=>'int'],
'ncurses_slk_clear' => ['bool'],
'ncurses_slk_color' => ['int', 'intarg'=>'int'],
'ncurses_slk_init' => ['bool', 'format'=>'int'],
'ncurses_slk_noutrefresh' => ['bool'],
'ncurses_slk_refresh' => ['int'],
'ncurses_slk_restore' => ['int'],
'ncurses_slk_set' => ['bool', 'labelnr'=>'int', 'label'=>'string', 'format'=>'int'],
'ncurses_slk_touch' => ['int'],
'ncurses_standend' => ['int'],
'ncurses_standout' => ['int'],
'ncurses_start_color' => ['int'],
'ncurses_termattrs' => ['bool'],
'ncurses_termname' => ['string'],
'ncurses_timeout' => ['void', 'millisec'=>'int'],
'ncurses_top_panel' => ['int', 'panel'=>'resource'],
'ncurses_typeahead' => ['int', 'fd'=>'int'],
'ncurses_ungetch' => ['int', 'keycode'=>'int'],
'ncurses_ungetmouse' => ['bool', 'mevent'=>'array'],
'ncurses_update_panels' => ['void'],
'ncurses_use_default_colors' => ['bool'],
'ncurses_use_env' => ['void', 'flag'=>'bool'],
'ncurses_use_extended_names' => ['int', 'flag'=>'bool'],
'ncurses_vidattr' => ['int', 'intarg'=>'int'],
'ncurses_vline' => ['int', 'charattr'=>'int', 'n'=>'int'],
'ncurses_waddch' => ['int', 'window'=>'resource', 'ch'=>'int'],
'ncurses_waddstr' => ['int', 'window'=>'resource', 'string'=>'string', 'n='=>'int'],
'ncurses_wattroff' => ['int', 'window'=>'resource', 'attrs'=>'int'],
'ncurses_wattron' => ['int', 'window'=>'resource', 'attrs'=>'int'],
'ncurses_wattrset' => ['int', 'window'=>'resource', 'attrs'=>'int'],
'ncurses_wborder' => ['int', 'window'=>'resource', 'left'=>'int', 'right'=>'int', 'top'=>'int', 'bottom'=>'int', 'tl_corner'=>'int', 'tr_corner'=>'int', 'bl_corner'=>'int', 'br_corner'=>'int'],
'ncurses_wclear' => ['int', 'window'=>'resource'],
'ncurses_wcolor_set' => ['int', 'window'=>'resource', 'color_pair'=>'int'],
'ncurses_werase' => ['int', 'window'=>'resource'],
'ncurses_wgetch' => ['int', 'window'=>'resource'],
'ncurses_whline' => ['int', 'window'=>'resource', 'charattr'=>'int', 'n'=>'int'],
'ncurses_wmouse_trafo' => ['bool', 'window'=>'resource', 'y'=>'int', 'x'=>'int', 'toscreen'=>'bool'],
'ncurses_wmove' => ['int', 'window'=>'resource', 'y'=>'int', 'x'=>'int'],
'ncurses_wnoutrefresh' => ['int', 'window'=>'resource'],
'ncurses_wrefresh' => ['int', 'window'=>'resource'],
'ncurses_wstandend' => ['int', 'window'=>'resource'],
'ncurses_wstandout' => ['int', 'window'=>'resource'],
'ncurses_wvline' => ['int', 'window'=>'resource', 'charattr'=>'int', 'n'=>'int'],
'net_get_interfaces' => ['array<string,array<string,mixed>>|false'],
'newrelic_add_custom_parameter' => ['bool', 'key'=>'string', 'value'=>'bool|float|int|string'],
'newrelic_add_custom_tracer' => ['bool', 'function_name'=>'string'],
'newrelic_background_job' => ['void', 'flag='=>'bool'],
'newrelic_capture_params' => ['void', 'enable='=>'bool'],
'newrelic_custom_metric' => ['bool', 'metric_name'=>'string', 'value'=>'float'],
'newrelic_disable_autorum' => ['true'],
'newrelic_end_of_transaction' => ['void'],
'newrelic_end_transaction' => ['bool', 'ignore='=>'bool'],
'newrelic_get_browser_timing_footer' => ['string', 'include_tags='=>'bool'],
'newrelic_get_browser_timing_header' => ['string', 'include_tags='=>'bool'],
'newrelic_ignore_apdex' => ['void'],
'newrelic_ignore_transaction' => ['void'],
'newrelic_name_transaction' => ['bool', 'name'=>'string'],
'newrelic_notice_error' => ['void', 'message'=>'string', 'exception='=>'Exception|Throwable'],
'newrelic_notice_error\'1' => ['void', 'unused_1'=>'string', 'message'=>'string', 'unused_2'=>'string', 'unused_3'=>'int', 'unused_4='=>''],
'newrelic_record_custom_event' => ['void', 'name'=>'string', 'attributes'=>'array'],
'newrelic_record_datastore_segment' => ['mixed', 'func'=>'callable', 'parameters'=>'array'],
'newrelic_set_appname' => ['bool', 'name'=>'string', 'license='=>'string', 'xmit='=>'bool'],
'newrelic_set_user_attributes' => ['bool', 'user'=>'string', 'account'=>'string', 'product'=>'string'],
'newrelic_start_transaction' => ['bool', 'appname'=>'string', 'license='=>'string'],
'newt_bell' => ['void'],
'newt_button' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string'],
'newt_button_bar' => ['resource', 'buttons'=>'array'],
'newt_centered_window' => ['int', 'width'=>'int', 'height'=>'int', 'title='=>'string'],
'newt_checkbox' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string', 'def_value'=>'string', 'seq='=>'string'],
'newt_checkbox_get_value' => ['string', 'checkbox'=>'resource'],
'newt_checkbox_set_flags' => ['void', 'checkbox'=>'resource', 'flags'=>'int', 'sense'=>'int'],
'newt_checkbox_set_value' => ['void', 'checkbox'=>'resource', 'value'=>'string'],
'newt_checkbox_tree' => ['resource', 'left'=>'int', 'top'=>'int', 'height'=>'int', 'flags='=>'int'],
'newt_checkbox_tree_add_item' => ['void', 'checkboxtree'=>'resource', 'text'=>'string', 'data'=>'mixed', 'flags'=>'int', 'index'=>'int', '...args='=>'int'],
'newt_checkbox_tree_find_item' => ['array', 'checkboxtree'=>'resource', 'data'=>'mixed'],
'newt_checkbox_tree_get_current' => ['mixed', 'checkboxtree'=>'resource'],
'newt_checkbox_tree_get_entry_value' => ['string', 'checkboxtree'=>'resource', 'data'=>'mixed'],
'newt_checkbox_tree_get_multi_selection' => ['array', 'checkboxtree'=>'resource', 'seqnum'=>'string'],
'newt_checkbox_tree_get_selection' => ['array', 'checkboxtree'=>'resource'],
'newt_checkbox_tree_multi' => ['resource', 'left'=>'int', 'top'=>'int', 'height'=>'int', 'seq'=>'string', 'flags='=>'int'],
'newt_checkbox_tree_set_current' => ['void', 'checkboxtree'=>'resource', 'data'=>'mixed'],
'newt_checkbox_tree_set_entry' => ['void', 'checkboxtree'=>'resource', 'data'=>'mixed', 'text'=>'string'],
'newt_checkbox_tree_set_entry_value' => ['void', 'checkboxtree'=>'resource', 'data'=>'mixed', 'value'=>'string'],
'newt_checkbox_tree_set_width' => ['void', 'checkbox_tree'=>'resource', 'width'=>'int'],
'newt_clear_key_buffer' => ['void'],
'newt_cls' => ['void'],
'newt_compact_button' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string'],
'newt_component_add_callback' => ['void', 'component'=>'resource', 'func_name'=>'mixed', 'data'=>'mixed'],
'newt_component_takes_focus' => ['void', 'component'=>'resource', 'takes_focus'=>'bool'],
'newt_create_grid' => ['resource', 'cols'=>'int', 'rows'=>'int'],
'newt_cursor_off' => ['void'],
'newt_cursor_on' => ['void'],
'newt_delay' => ['void', 'microseconds'=>'int'],
'newt_draw_form' => ['void', 'form'=>'resource'],
'newt_draw_root_text' => ['void', 'left'=>'int', 'top'=>'int', 'text'=>'string'],
'newt_entry' => ['resource', 'left'=>'int', 'top'=>'int', 'width'=>'int', 'init_value='=>'string', 'flags='=>'int'],
'newt_entry_get_value' => ['string', 'entry'=>'resource'],
'newt_entry_set' => ['void', 'entry'=>'resource', 'value'=>'string', 'cursor_at_end='=>'bool'],
'newt_entry_set_filter' => ['void', 'entry'=>'resource', 'filter'=>'callable', 'data'=>'mixed'],
'newt_entry_set_flags' => ['void', 'entry'=>'resource', 'flags'=>'int', 'sense'=>'int'],
'newt_finished' => ['int'],
'newt_form' => ['resource', 'vert_bar='=>'resource', 'help='=>'string', 'flags='=>'int'],
'newt_form_add_component' => ['void', 'form'=>'resource', 'component'=>'resource'],
'newt_form_add_components' => ['void', 'form'=>'resource', 'components'=>'array'],
'newt_form_add_hot_key' => ['void', 'form'=>'resource', 'key'=>'int'],
'newt_form_destroy' => ['void', 'form'=>'resource'],
'newt_form_get_current' => ['resource', 'form'=>'resource'],
'newt_form_run' => ['void', 'form'=>'resource', 'exit_struct'=>'array'],
'newt_form_set_background' => ['void', 'from'=>'resource', 'background'=>'int'],
'newt_form_set_height' => ['void', 'form'=>'resource', 'height'=>'int'],
'newt_form_set_size' => ['void', 'form'=>'resource'],
'newt_form_set_timer' => ['void', 'form'=>'resource', 'milliseconds'=>'int'],
'newt_form_set_width' => ['void', 'form'=>'resource', 'width'=>'int'],
'newt_form_watch_fd' => ['void', 'form'=>'resource', 'stream'=>'resource', 'flags='=>'int'],
'newt_get_screen_size' => ['void', 'cols'=>'int', 'rows'=>'int'],
'newt_grid_add_components_to_form' => ['void', 'grid'=>'resource', 'form'=>'resource', 'recurse'=>'bool'],
'newt_grid_basic_window' => ['resource', 'text'=>'resource', 'middle'=>'resource', 'buttons'=>'resource'],
'newt_grid_free' => ['void', 'grid'=>'resource', 'recurse'=>'bool'],
'newt_grid_get_size' => ['void', 'grid'=>'resource', 'width'=>'int', 'height'=>'int'],
'newt_grid_h_close_stacked' => ['resource', 'element1_type'=>'int', 'element1'=>'resource', '...args='=>'resource'],
'newt_grid_h_stacked' => ['resource', 'element1_type'=>'int', 'element1'=>'resource', '...args='=>'resource'],
'newt_grid_place' => ['void', 'grid'=>'resource', 'left'=>'int', 'top'=>'int'],
'newt_grid_set_field' => ['void', 'grid'=>'resource', 'col'=>'int', 'row'=>'int', 'type'=>'int', 'value'=>'resource', 'pad_left'=>'int', 'pad_top'=>'int', 'pad_right'=>'int', 'pad_bottom'=>'int', 'anchor'=>'int', 'flags='=>'int'],
'newt_grid_simple_window' => ['resource', 'text'=>'resource', 'middle'=>'resource', 'buttons'=>'resource'],
'newt_grid_v_close_stacked' => ['resource', 'element1_type'=>'int', 'element1'=>'resource', '...args='=>'resource'],
'newt_grid_v_stacked' => ['resource', 'element1_type'=>'int', 'element1'=>'resource', '...args='=>'resource'],
'newt_grid_wrapped_window' => ['void', 'grid'=>'resource', 'title'=>'string'],
'newt_grid_wrapped_window_at' => ['void', 'grid'=>'resource', 'title'=>'string', 'left'=>'int', 'top'=>'int'],
'newt_init' => ['int'],
'newt_label' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string'],
'newt_label_set_text' => ['void', 'label'=>'resource', 'text'=>'string'],
'newt_listbox' => ['resource', 'left'=>'int', 'top'=>'int', 'height'=>'int', 'flags='=>'int'],
'newt_listbox_append_entry' => ['void', 'listbox'=>'resource', 'text'=>'string', 'data'=>'mixed'],
'newt_listbox_clear' => ['void', 'listobx'=>'resource'],
'newt_listbox_clear_selection' => ['void', 'listbox'=>'resource'],
'newt_listbox_delete_entry' => ['void', 'listbox'=>'resource', 'key'=>'mixed'],
'newt_listbox_get_current' => ['string', 'listbox'=>'resource'],
'newt_listbox_get_selection' => ['array', 'listbox'=>'resource'],
'newt_listbox_insert_entry' => ['void', 'listbox'=>'resource', 'text'=>'string', 'data'=>'mixed', 'key'=>'mixed'],
'newt_listbox_item_count' => ['int', 'listbox'=>'resource'],
'newt_listbox_select_item' => ['void', 'listbox'=>'resource', 'key'=>'mixed', 'sense'=>'int'],
'newt_listbox_set_current' => ['void', 'listbox'=>'resource', 'num'=>'int'],
'newt_listbox_set_current_by_key' => ['void', 'listbox'=>'resource', 'key'=>'mixed'],
'newt_listbox_set_data' => ['void', 'listbox'=>'resource', 'num'=>'int', 'data'=>'mixed'],
'newt_listbox_set_entry' => ['void', 'listbox'=>'resource', 'num'=>'int', 'text'=>'string'],
'newt_listbox_set_width' => ['void', 'listbox'=>'resource', 'width'=>'int'],
'newt_listitem' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string', 'is_default'=>'bool', 'prev_item'=>'resource', 'data'=>'mixed', 'flags='=>'int'],
'newt_listitem_get_data' => ['mixed', 'item'=>'resource'],
'newt_listitem_set' => ['void', 'item'=>'resource', 'text'=>'string'],
'newt_open_window' => ['int', 'left'=>'int', 'top'=>'int', 'width'=>'int', 'height'=>'int', 'title='=>'string'],
'newt_pop_help_line' => ['void'],
'newt_pop_window' => ['void'],
'newt_push_help_line' => ['void', 'text='=>'string'],
'newt_radio_get_current' => ['resource', 'set_member'=>'resource'],
'newt_radiobutton' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'string', 'is_default'=>'bool', 'prev_button='=>'resource'],
'newt_redraw_help_line' => ['void'],
'newt_reflow_text' => ['string', 'text'=>'string', 'width'=>'int', 'flex_down'=>'int', 'flex_up'=>'int', 'actual_width'=>'int', 'actual_height'=>'int'],
'newt_refresh' => ['void'],
'newt_resize_screen' => ['void', 'redraw='=>'bool'],
'newt_resume' => ['void'],
'newt_run_form' => ['resource', 'form'=>'resource'],
'newt_scale' => ['resource', 'left'=>'int', 'top'=>'int', 'width'=>'int', 'full_value'=>'int'],
'newt_scale_set' => ['void', 'scale'=>'resource', 'amount'=>'int'],
'newt_scrollbar_set' => ['void', 'scrollbar'=>'resource', 'where'=>'int', 'total'=>'int'],
'newt_set_help_callback' => ['void', 'function'=>'mixed'],
'newt_set_suspend_callback' => ['void', 'function'=>'callable', 'data'=>'mixed'],
'newt_suspend' => ['void'],
'newt_textbox' => ['resource', 'left'=>'int', 'top'=>'int', 'width'=>'int', 'height'=>'int', 'flags='=>'int'],
'newt_textbox_get_num_lines' => ['int', 'textbox'=>'resource'],
'newt_textbox_reflowed' => ['resource', 'left'=>'int', 'top'=>'int', 'text'=>'char', 'width'=>'int', 'flex_down'=>'int', 'flex_up'=>'int', 'flags='=>'int'],
'newt_textbox_set_height' => ['void', 'textbox'=>'resource', 'height'=>'int'],
'newt_textbox_set_text' => ['void', 'textbox'=>'resource', 'text'=>'string'],
'newt_vertical_scrollbar' => ['resource', 'left'=>'int', 'top'=>'int', 'height'=>'int', 'normal_colorset='=>'int', 'thumb_colorset='=>'int'],
'newt_wait_for_key' => ['void'],
'newt_win_choice' => ['int', 'title'=>'string', 'button1_text'=>'string', 'button2_text'=>'string', 'format'=>'string', 'args='=>'mixed', '...args='=>'mixed'],
'newt_win_entries' => ['int', 'title'=>'string', 'text'=>'string', 'suggested_width'=>'int', 'flex_down'=>'int', 'flex_up'=>'int', 'data_width'=>'int', 'items'=>'array', 'button1'=>'string', '...args='=>'string'],
'newt_win_menu' => ['int', 'title'=>'string', 'text'=>'string', 'suggestedwidth'=>'int', 'flexdown'=>'int', 'flexup'=>'int', 'maxlistheight'=>'int', 'items'=>'array', 'listitem'=>'int', 'button1='=>'string', '...args='=>'string'],
'newt_win_message' => ['void', 'title'=>'string', 'button_text'=>'string', 'format'=>'string', 'args='=>'mixed', '...args='=>'mixed'],
'newt_win_messagev' => ['void', 'title'=>'string', 'button_text'=>'string', 'format'=>'string', 'args'=>'array'],
'newt_win_ternary' => ['int', 'title'=>'string', 'button1_text'=>'string', 'button2_text'=>'string', 'button3_text'=>'string', 'format'=>'string', 'args='=>'mixed', '...args='=>'mixed'],
'next' => ['mixed', '&r_array'=>'array|object'],
'ngettext' => ['string', 'singular'=>'string', 'plural'=>'string', 'count'=>'int'],
'nl2br' => ['string', 'string'=>'string', 'use_xhtml='=>'bool'],
'nl_langinfo' => ['string|false', 'item'=>'int'],
'NoRewindIterator::__construct' => ['void', 'iterator'=>'Iterator'],
'NoRewindIterator::current' => ['mixed'],
'NoRewindIterator::getInnerIterator' => ['Iterator'],
'NoRewindIterator::key' => ['mixed'],
'NoRewindIterator::next' => ['void'],
'NoRewindIterator::rewind' => ['void'],
'NoRewindIterator::valid' => ['bool'],
'Normalizer::getRawDecomposition' => ['string|null', 'input'=>'string'],
'Normalizer::isNormalized' => ['bool', 'input'=>'string', 'form='=>'int'],
'Normalizer::normalize' => ['string', 'input'=>'string', 'form='=>'int'],
'normalizer_get_raw_decomposition' => ['string|null', 'string'=>'string'],
'normalizer_is_normalized' => ['bool', 'string'=>'string', 'form='=>'int'],
'normalizer_normalize' => ['string', 'string'=>'string', 'form='=>'int'],
'notes_body' => ['array', 'server'=>'string', 'mailbox'=>'string', 'msg_number'=>'int'],
'notes_copy_db' => ['bool', 'from_database_name'=>'string', 'to_database_name'=>'string'],
'notes_create_db' => ['bool', 'database_name'=>'string'],
'notes_create_note' => ['bool', 'database_name'=>'string', 'form_name'=>'string'],
'notes_drop_db' => ['bool', 'database_name'=>'string'],
'notes_find_note' => ['int', 'database_name'=>'string', 'name'=>'string', 'type='=>'string'],
'notes_header_info' => ['object', 'server'=>'string', 'mailbox'=>'string', 'msg_number'=>'int'],
'notes_list_msgs' => ['bool', 'db'=>'string'],
'notes_mark_read' => ['bool', 'database_name'=>'string', 'user_name'=>'string', 'note_id'=>'string'],
'notes_mark_unread' => ['bool', 'database_name'=>'string', 'user_name'=>'string', 'note_id'=>'string'],
'notes_nav_create' => ['bool', 'database_name'=>'string', 'name'=>'string'],
'notes_search' => ['array', 'database_name'=>'string', 'keywords'=>'string'],
'notes_unread' => ['array', 'database_name'=>'string', 'user_name'=>'string'],
'notes_version' => ['float', 'database_name'=>'string'],
'nsapi_request_headers' => ['array'],
'nsapi_response_headers' => ['array'],
'nsapi_virtual' => ['bool', 'uri'=>'string'],
'nthmac' => ['string', 'clent'=>'string', 'data'=>'string'],
'number_format' => ['string', 'num'=>'float|int', 'decimals='=>'int'],
'number_format\'1' => ['string', 'num'=>'float|int', 'decimals'=>'int', 'decimal_separator'=>'string', 'thousands_separator'=>'string'],
'NumberFormatter::__construct' => ['void', 'locale'=>'string', 'style'=>'int', 'pattern='=>'string'],
'NumberFormatter::create' => ['NumberFormatter|false', 'locale'=>'string', 'style'=>'int', 'pattern='=>'string'],
'NumberFormatter::format' => ['string|false', 'num'=>'', 'type='=>'int'],
'NumberFormatter::formatCurrency' => ['string', 'num'=>'float', 'currency'=>'string'],
'NumberFormatter::getAttribute' => ['int|false', 'attr'=>'int'],
'NumberFormatter::getErrorCode' => ['int'],
'NumberFormatter::getErrorMessage' => ['string'],
'NumberFormatter::getLocale' => ['string', 'type='=>'int'],
'NumberFormatter::getPattern' => ['string|false'],
'NumberFormatter::getSymbol' => ['string|false', 'attr'=>'int'],
'NumberFormatter::getTextAttribute' => ['string|false', 'attr'=>'int'],
'NumberFormatter::parse' => ['float|false', 'string'=>'string', 'type='=>'int', '&rw_position='=>'int'],
'NumberFormatter::parseCurrency' => ['float|false', 'string'=>'string', '&w_currency'=>'string', '&rw_position='=>'int'],
'NumberFormatter::setAttribute' => ['bool', 'attr'=>'int', 'value'=>''],
'NumberFormatter::setPattern' => ['bool', 'pattern'=>'string'],
'NumberFormatter::setSymbol' => ['bool', 'attr'=>'int', 'symbol'=>'string'],
'NumberFormatter::setTextAttribute' => ['bool', 'attr'=>'int', 'value'=>'string'],
'numfmt_create' => ['NumberFormatter|false', 'locale'=>'string', 'style'=>'int', 'pattern='=>'string'],
'numfmt_format' => ['string|false', 'formatter'=>'NumberFormatter', 'num'=>'int|float', 'type='=>'int'],
'numfmt_format_currency' => ['string|false', 'formatter'=>'NumberFormatter', 'amount'=>'float', 'currency'=>'string'],
'numfmt_get_attribute' => ['int|false', 'formatter'=>'NumberFormatter', 'attribute'=>'int'],
'numfmt_get_error_code' => ['int', 'formatter'=>'NumberFormatter'],
'numfmt_get_error_message' => ['string', 'formatter'=>'NumberFormatter'],
'numfmt_get_locale' => ['string', 'formatter'=>'NumberFormatter', 'type='=>'int'],
'numfmt_get_pattern' => ['string|false', 'formatter'=>'NumberFormatter'],
'numfmt_get_symbol' => ['string|false', 'formatter'=>'NumberFormatter', 'symbol'=>'int'],
'numfmt_get_text_attribute' => ['string|false', 'formatter'=>'NumberFormatter', 'attribute'=>'int'],
'numfmt_parse' => ['float|int|false', 'formatter'=>'NumberFormatter', 'string'=>'string', 'type='=>'int', '&rw_offset='=>'int'],
'numfmt_parse_currency' => ['float|false', 'formatter'=>'NumberFormatter', 'string'=>'string', '&w_currency'=>'string', '&rw_offset='=>'int'],
'numfmt_set_attribute' => ['bool', 'formatter'=>'NumberFormatter', 'attribute'=>'int', 'value'=>'int'],
'numfmt_set_pattern' => ['bool', 'formatter'=>'NumberFormatter', 'pattern'=>'string'],
'numfmt_set_symbol' => ['bool', 'formatter'=>'NumberFormatter', 'symbol'=>'int', 'value'=>'string'],
'numfmt_set_text_attribute' => ['bool', 'formatter'=>'NumberFormatter', 'attribute'=>'int', 'value'=>'string'],
'OAuth::__construct' => ['void', 'consumer_key'=>'string', 'consumer_secret'=>'string', 'signature_method='=>'string', 'auth_type='=>'int'],
'OAuth::__destruct' => ['void'],
'OAuth::disableDebug' => ['bool'],
'OAuth::disableRedirects' => ['bool'],
'OAuth::disableSSLChecks' => ['bool'],
'OAuth::enableDebug' => ['bool'],
'OAuth::enableRedirects' => ['bool'],
'OAuth::enableSSLChecks' => ['bool'],
'OAuth::fetch' => ['mixed', 'protected_resource_url'=>'string', 'extra_parameters='=>'array', 'http_method='=>'string', 'http_headers='=>'array'],
'OAuth::generateSignature' => ['string', 'http_method'=>'string', 'url'=>'string', 'extra_parameters='=>'mixed'],
'OAuth::getAccessToken' => ['array|false', 'access_token_url'=>'string', 'auth_session_handle='=>'string', 'verifier_token='=>'string', 'http_method='=>'string'],
'OAuth::getCAPath' => ['array'],
'OAuth::getLastResponse' => ['string'],
'OAuth::getLastResponseHeaders' => ['string|false'],
'OAuth::getLastResponseInfo' => ['array'],
'OAuth::getRequestHeader' => ['string|false', 'http_method'=>'string', 'url'=>'string', 'extra_parameters='=>'mixed'],
'OAuth::getRequestToken' => ['array|false', 'request_token_url'=>'string', 'callback_url='=>'string', 'http_method='=>'string'],
'OAuth::setAuthType' => ['bool', 'auth_type'=>'int'],
'OAuth::setCAPath' => ['mixed', 'ca_path='=>'string', 'ca_info='=>'string'],
'OAuth::setNonce' => ['mixed', 'nonce'=>'string'],
'OAuth::setRequestEngine' => ['void', 'reqengine'=>'int'],
'OAuth::setRSACertificate' => ['mixed', 'cert'=>'string'],
'OAuth::setSSLChecks' => ['bool', 'sslcheck'=>'int'],
'OAuth::setTimeout' => ['void', 'timeout'=>'int'],
'OAuth::setTimestamp' => ['mixed', 'timestamp'=>'string'],
'OAuth::setToken' => ['bool', 'token'=>'string', 'token_secret'=>'string'],
'OAuth::setVersion' => ['bool', 'version'=>'string'],
'oauth_get_sbs' => ['string', 'http_method'=>'string', 'uri'=>'string', 'request_parameters='=>'array'],
'oauth_urlencode' => ['string', 'uri'=>'string'],
'OAuthProvider::__construct' => ['void', 'params_array='=>'array'],
'OAuthProvider::addRequiredParameter' => ['bool', 'req_params'=>'string'],
'OAuthProvider::callconsumerHandler' => ['void'],
'OAuthProvider::callTimestampNonceHandler' => ['void'],
'OAuthProvider::calltokenHandler' => ['void'],
'OAuthProvider::checkOAuthRequest' => ['void', 'uri='=>'string', 'method='=>'string'],
'OAuthProvider::consumerHandler' => ['void', 'callback_function'=>'callable'],
'OAuthProvider::generateToken' => ['string', 'size'=>'int', 'strong='=>'bool'],
'OAuthProvider::is2LeggedEndpoint' => ['void', 'params_array'=>'mixed'],
'OAuthProvider::isRequestTokenEndpoint' => ['void', 'will_issue_request_token'=>'bool'],
'OAuthProvider::removeRequiredParameter' => ['bool', 'req_params'=>'string'],
'OAuthProvider::reportProblem' => ['string', 'oauthexception'=>'string', 'send_headers='=>'bool'],
'OAuthProvider::setParam' => ['bool', 'param_key'=>'string', 'param_val='=>'mixed'],
'OAuthProvider::setRequestTokenPath' => ['bool', 'path'=>'string'],
'OAuthProvider::timestampNonceHandler' => ['void', 'callback_function'=>'callable'],
'OAuthProvider::tokenHandler' => ['void', 'callback_function'=>'callable'],
'ob_clean' => ['bool'],
'ob_deflatehandler' => ['string', 'data'=>'string', 'mode'=>'int'],
'ob_end_clean' => ['bool'],
'ob_end_flush' => ['bool'],
'ob_etaghandler' => ['string', 'data'=>'string', 'mode'=>'int'],
'ob_flush' => ['bool'],
'ob_get_clean' => ['string|false'],
'ob_get_contents' => ['string|false'],
'ob_get_flush' => ['string|false'],
'ob_get_length' => ['int|false'],
'ob_get_level' => ['int'],
'ob_get_status' => ['array', 'full_status='=>'bool'],
'ob_gzhandler' => ['string|false', 'data'=>'string', 'flags'=>'int'],
'ob_iconv_handler' => ['string', 'contents'=>'string', 'status'=>'int'],
'ob_implicit_flush' => ['void', 'enable='=>'int'],
'ob_inflatehandler' => ['string', 'data'=>'string', 'mode'=>'int'],
'ob_list_handlers' => ['false|list<string>'],
'ob_start' => ['bool', 'callback='=>'string|array|?callable', 'chunk_size='=>'int', 'flags='=>'int'],
'ob_tidyhandler' => ['string', 'input'=>'string', 'mode='=>'int'],
'oci_bind_array_by_name' => ['bool', 'statement'=>'resource', 'param'=>'string', '&rw_var'=>'array', 'max_array_length'=>'int', 'max_item_length='=>'int', 'type='=>'int'],
'oci_bind_by_name' => ['bool', 'statement'=>'resource', 'param'=>'string', '&rw_var'=>'mixed', 'max_length='=>'int', 'type='=>'int'],
'oci_cancel' => ['bool', 'statement'=>'resource'],
'oci_client_version' => ['string'],
'oci_close' => ['bool', 'connection'=>'resource'],
'OCICollection::append' => ['bool', 'value'=>'mixed'],
'OCICollection::assign' => ['bool', 'from'=>'OCI_Collection'],
'OCICollection::assignElem' => ['bool', 'index'=>'int', 'value'=>'mixed'],
'OCICollection::free' => ['bool'],
'OCICollection::getElem' => ['mixed', 'index'=>'int'],
'OCICollection::max' => ['int|false'],
'OCICollection::size' => ['int|false'],
'OCICollection::trim' => ['bool', 'num'=>'int'],
'oci_collection_append' => ['bool', 'collection'=>'string'],
'oci_collection_assign' => ['bool', 'to'=>'object'],
'oci_collection_element_assign' => ['bool', 'collection'=>'int', 'index'=>'string'],
'oci_collection_element_get' => ['string', 'collection'=>'int'],
'oci_collection_max' => ['int'],
'oci_collection_size' => ['int'],
'oci_collection_trim' => ['bool', 'collection'=>'int'],
'oci_commit' => ['bool', 'connection'=>'resource'],
'oci_connect' => ['resource|false', 'username'=>'string', 'password'=>'string', 'connection_string='=>'string', 'encoding='=>'string', 'session_mode='=>'int'],
'oci_define_by_name' => ['bool', 'statement'=>'resource', 'column'=>'string', '&w_var'=>'mixed', 'type='=>'int'],
'oci_error' => ['array|false', 'connection_or_statement='=>'resource'],
'oci_execute' => ['bool', 'statement'=>'resource', 'mode='=>'int'],
'oci_fetch' => ['bool', 'statement'=>'resource'],
'oci_fetch_all' => ['int|false', 'statement'=>'resource', '&w_output'=>'array', 'offset='=>'int', 'limit='=>'int', 'flags='=>'int'],
'oci_fetch_array' => ['array|false', 'statement'=>'resource', 'mode='=>'int'],
'oci_fetch_assoc' => ['array|false', 'statement'=>'resource'],
'oci_fetch_object' => ['object|false', 'statement'=>'resource'],
'oci_fetch_row' => ['array|false', 'statement'=>'resource'],
'oci_field_is_null' => ['bool', 'statement'=>'resource', 'column'=>'mixed'],
'oci_field_name' => ['string|false', 'statement'=>'resource', 'column'=>'mixed'],
'oci_field_precision' => ['int|false', 'statement'=>'resource', 'column'=>'mixed'],
'oci_field_scale' => ['int|false', 'statement'=>'resource', 'column'=>'mixed'],
'oci_field_size' => ['int|false', 'statement'=>'resource', 'column'=>'mixed'],
'oci_field_type' => ['mixed|false', 'statement'=>'resource', 'column'=>'mixed'],
'oci_field_type_raw' => ['int|false', 'statement'=>'resource', 'column'=>'mixed'],
'oci_free_collection' => ['bool'],
'oci_free_cursor' => ['bool', 'statement'=>'resource'],
'oci_free_descriptor' => ['bool'],
'oci_free_statement' => ['bool', 'statement'=>'resource'],
'oci_get_implicit' => ['bool', 'stmt'=>''],
'oci_get_implicit_resultset' => ['resource|false', 'statement'=>'resource'],
'oci_internal_debug' => ['void', 'onoff'=>'bool'],
'OCILob::append' => ['bool', 'lob_from'=>'OCILob'],
'OCILob::close' => ['bool'],
'OCILob::eof' => ['bool'],
'OCILob::erase' => ['int|false', 'offset='=>'int', 'length='=>'int'],
'OCILob::export' => ['bool', 'filename'=>'string', 'start='=>'int', 'length='=>'int'],
'OCILob::flush' => ['bool', 'flag='=>'int'],
'OCILob::free' => ['bool'],
'OCILob::getbuffering' => ['bool'],
'OCILob::import' => ['bool', 'filename'=>'string'],
'OCILob::load' => ['string|false'],
'OCILob::read' => ['string|false', 'length'=>'int'],
'OCILob::rewind' => ['bool'],
'OCILob::save' => ['bool', 'data'=>'string', 'offset='=>'int'],
'OCILob::savefile' => ['bool', 'filename'=>''],
'OCILob::seek' => ['bool', 'offset'=>'int', 'whence='=>'int'],
'OCILob::setbuffering' => ['bool', 'on_off'=>'bool'],
'OCILob::size' => ['int|false'],
'OCILob::tell' => ['int|false'],
'OCILob::truncate' => ['bool', 'length='=>'int'],
'OCILob::write' => ['int|false', 'data'=>'string', 'length='=>'int'],
'OCILob::writeTemporary' => ['bool', 'data'=>'string', 'lob_type='=>'int'],
'OCILob::writetofile' => ['bool', 'filename'=>'', 'start'=>'', 'length'=>''],
'oci_lob_append' => ['bool', 'to'=>'object'],
'oci_lob_close' => ['bool'],
'oci_lob_copy' => ['bool', 'to'=>'OCILob', 'from'=>'OCILob', 'length='=>'int'],
'oci_lob_eof' => ['bool'],
'oci_lob_erase' => ['int', 'lob'=>'int', 'offset'=>'int'],
'oci_lob_export' => ['bool', 'lob'=>'string', 'filename'=>'int', 'offset'=>'int'],
'oci_lob_flush' => ['bool', 'lob'=>'int'],
'oci_lob_import' => ['bool', 'lob'=>'string'],
'oci_lob_is_equal' => ['bool', 'lob1'=>'OCILob', 'lob2'=>'OCILob'],
'oci_lob_load' => ['string'],
'oci_lob_read' => ['string', 'lob'=>'int'],
'oci_lob_rewind' => ['bool'],
'oci_lob_save' => ['bool', 'lob'=>'string', 'data'=>'int'],
'oci_lob_seek' => ['bool', 'lob'=>'int', 'offset'=>'int'],
'oci_lob_size' => ['int'],
'oci_lob_tell' => ['int'],
'oci_lob_truncate' => ['bool', 'lob'=>'int'],
'oci_lob_write' => ['int', 'lob'=>'string', 'data'=>'int'],
'oci_lob_write_temporary' => ['bool', 'value'=>'string', 'lob_type'=>'int'],
'oci_new_collection' => ['OCICollection|false', 'connection'=>'resource', 'type_name'=>'string', 'schema='=>'string'],
'oci_new_connect' => ['resource|false', 'username'=>'string', 'password'=>'string', 'connection_string='=>'string', 'encoding='=>'string', 'session_mode='=>'int'],
'oci_new_cursor' => ['resource|false', 'connection'=>'resource'],
'oci_new_descriptor' => ['OCILob|false', 'connection'=>'resource', 'type='=>'int'],
'oci_num_fields' => ['int|false', 'statement'=>'resource'],
'oci_num_rows' => ['int|false', 'statement'=>'resource'],
'oci_parse' => ['resource|false', 'connection'=>'resource', 'sql'=>'string'],
'oci_password_change' => ['bool', 'connection'=>'resource', 'username'=>'string', 'old_password'=>'string', 'new_password'=>'string'],
'oci_pconnect' => ['resource|false', 'username'=>'string', 'password'=>'string', 'connection_string='=>'string', 'encoding='=>'string', 'session_mode='=>'int'],
'oci_register_taf_callback' => ['bool', 'connection'=>'resource', 'callback='=>'callable'],
'oci_result' => ['mixed|false', 'statement'=>'resource', 'column'=>'mixed'],
'oci_rollback' => ['bool', 'connection'=>'resource'],
'oci_server_version' => ['string|false', 'connection'=>'resource'],
'oci_set_action' => ['bool', 'connection'=>'resource', 'action'=>'string'],
'oci_set_call_timeout' => ['bool', 'connection'=>'resource', 'timeout'=>'int'],
'oci_set_client_identifier' => ['bool', 'connection'=>'resource', 'client_id'=>'string'],
'oci_set_client_info' => ['bool', 'connection'=>'resource', 'client_info'=>'string'],
'oci_set_db_operation' => ['bool', 'connection'=>'resource', 'action'=>'string'],
'oci_set_edition' => ['bool', 'edition'=>'string'],
'oci_set_module_name' => ['bool', 'connection'=>'resource', 'name'=>'string'],
'oci_set_prefetch' => ['bool', 'statement'=>'resource', 'rows'=>'int'],
'oci_statement_type' => ['string|false', 'statement'=>'resource'],
'oci_unregister_taf_callback' => ['bool', 'connection'=>'resource'],
'ocifetchinto' => ['int|bool', 'statement'=>'resource', '&w_result'=>'array', 'mode='=>'int'],
'ocigetbufferinglob' => ['bool'],
'ocisetbufferinglob' => ['bool', 'lob'=>'bool'],
'octdec' => ['int|float', 'octal_string'=>'string'],
'odbc_autocommit' => ['mixed', 'odbc'=>'resource', 'enable='=>'bool'],
'odbc_binmode' => ['bool', 'statement'=>'resource', 'mode'=>'int'],
'odbc_close' => ['void', 'odbc'=>'resource'],
'odbc_close_all' => ['void'],
'odbc_columnprivileges' => ['resource|false', 'odbc'=>'resource', 'catalog'=>'string', 'schema'=>'string', 'table'=>'string', 'column'=>'string'],
'odbc_columns' => ['resource|false', 'odbc'=>'resource', 'catalog='=>'string', 'schema='=>'string', 'table='=>'string', 'column='=>'string'],
'odbc_commit' => ['bool', 'odbc'=>'resource'],
'odbc_connect' => ['resource|false', 'dsn'=>'string', 'user'=>'string', 'password'=>'string', 'cursor_option='=>'int'],
'odbc_cursor' => ['string', 'statement'=>'resource'],
'odbc_data_source' => ['array|false', 'odbc'=>'resource', 'fetch_type'=>'int'],
'odbc_do' => ['resource', 'odbc'=>'resource', 'query'=>'string', 'flags='=>'int'],
'odbc_error' => ['string', 'odbc='=>'resource'],
'odbc_errormsg' => ['string', 'odbc='=>'resource'],
'odbc_exec' => ['resource', 'odbc'=>'resource', 'query'=>'string', 'flags='=>'int'],
'odbc_execute' => ['bool', 'statement'=>'resource', 'params='=>'array'],
'odbc_fetch_array' => ['array|false', 'statement'=>'resource', 'row='=>'int'],
'odbc_fetch_into' => ['int', 'statement'=>'resource', '&w_array'=>'array', 'row='=>'int'],
'odbc_fetch_object' => ['object|false', 'statement'=>'resource', 'row='=>'int'],
'odbc_fetch_row' => ['bool', 'statement'=>'resource', 'row='=>'int'],
'odbc_field_len' => ['int|false', 'statement'=>'resource', 'field'=>'int'],
'odbc_field_name' => ['string|false', 'statement'=>'resource', 'field'=>'int'],
'odbc_field_num' => ['int|false', 'statement'=>'resource', 'field'=>'string'],
'odbc_field_precision' => ['int', 'statement'=>'resource', 'field'=>'int'],
'odbc_field_scale' => ['int|false', 'statement'=>'resource', 'field'=>'int'],
'odbc_field_type' => ['string|false', 'statement'=>'resource', 'field'=>'int'],
'odbc_foreignkeys' => ['resource|false', 'odbc'=>'resource', 'pk_catalog'=>'string', 'pk_schema'=>'string', 'pk_table'=>'string', 'fk_catalog'=>'string', 'fk_schema'=>'string', 'fk_table'=>'string'],
'odbc_free_result' => ['bool', 'statement'=>'resource'],
'odbc_gettypeinfo' => ['resource', 'odbc'=>'resource', 'data_type='=>'int'],
'odbc_longreadlen' => ['bool', 'statement'=>'resource', 'length'=>'int'],
'odbc_next_result' => ['bool', 'statement'=>'resource'],
'odbc_num_fields' => ['int', 'statement'=>'resource'],
'odbc_num_rows' => ['int', 'statement'=>'resource'],
'odbc_pconnect' => ['resource|false', 'dsn'=>'string', 'user'=>'string', 'password'=>'string', 'cursor_option='=>'int'],
'odbc_prepare' => ['resource|false', 'odbc'=>'resource', 'query'=>'string'],
'odbc_primarykeys' => ['resource|false', 'odbc'=>'resource', 'catalog'=>'string', 'schema'=>'string', 'table'=>'string'],
'odbc_procedurecolumns' => ['resource|false', 'odbc'=>'resource', 'catalog'=>'string', 'schema'=>'string', 'procedure'=>'string', 'column'=>'string'],
'odbc_procedures' => ['resource|false', 'odbc'=>'resource', 'catalog'=>'string', 'schema'=>'string', 'procedure'=>'string'],
'odbc_result' => ['mixed|false', 'statement'=>'resource', 'field'=>'mixed'],
'odbc_result_all' => ['int|false', 'statement'=>'resource', 'format='=>'string'],
'odbc_rollback' => ['bool', 'odbc'=>'resource'],
'odbc_setoption' => ['bool', 'odbc'=>'resource', 'which'=>'int', 'option'=>'int', 'value'=>'int'],
'odbc_specialcolumns' => ['resource|false', 'odbc'=>'resource', 'type'=>'int', 'catalog'=>'string', 'schema'=>'string', 'table'=>'string', 'scope'=>'int', 'nullable'=>'int'],
'odbc_statistics' => ['resource|false', 'odbc'=>'resource', 'catalog'=>'string', 'schema'=>'string', 'table'=>'string', 'unique'=>'int', 'accuracy'=>'int'],
'odbc_tableprivileges' => ['resource|false', 'odbc'=>'resource', 'catalog'=>'string', 'schema'=>'string', 'table'=>'string'],
'odbc_tables' => ['resource|false', 'odbc'=>'resource', 'catalog='=>'string', 'schema='=>'string', 'table='=>'string', 'types='=>'string'],
'opcache_compile_file' => ['bool', 'filename'=>'string'],
'opcache_get_configuration' => ['array'],
'opcache_get_status' => ['array|false', 'include_scripts='=>'bool'],
'opcache_invalidate' => ['bool', 'filename'=>'string', 'force='=>'bool'],
'opcache_is_script_cached' => ['bool', 'filename'=>'string'],
'opcache_reset' => ['bool'],
'openal_buffer_create' => ['resource'],
'openal_buffer_data' => ['bool', 'buffer'=>'resource', 'format'=>'int', 'data'=>'string', 'freq'=>'int'],
'openal_buffer_destroy' => ['bool', 'buffer'=>'resource'],
'openal_buffer_get' => ['int', 'buffer'=>'resource', 'property'=>'int'],
'openal_buffer_loadwav' => ['bool', 'buffer'=>'resource', 'wavfile'=>'string'],
'openal_context_create' => ['resource', 'device'=>'resource'],
'openal_context_current' => ['bool', 'context'=>'resource'],
'openal_context_destroy' => ['bool', 'context'=>'resource'],
'openal_context_process' => ['bool', 'context'=>'resource'],
'openal_context_suspend' => ['bool', 'context'=>'resource'],
'openal_device_close' => ['bool', 'device'=>'resource'],
'openal_device_open' => ['resource|false', 'device_desc='=>'string'],
'openal_listener_get' => ['mixed', 'property'=>'int'],
'openal_listener_set' => ['bool', 'property'=>'int', 'setting'=>'mixed'],
'openal_source_create' => ['resource'],
'openal_source_destroy' => ['bool', 'source'=>'resource'],
'openal_source_get' => ['mixed', 'source'=>'resource', 'property'=>'int'],
'openal_source_pause' => ['bool', 'source'=>'resource'],
'openal_source_play' => ['bool', 'source'=>'resource'],
'openal_source_rewind' => ['bool', 'source'=>'resource'],
'openal_source_set' => ['bool', 'source'=>'resource', 'property'=>'int', 'setting'=>'mixed'],
'openal_source_stop' => ['bool', 'source'=>'resource'],
'openal_stream' => ['resource', 'source'=>'resource', 'format'=>'int', 'rate'=>'int'],
'opendir' => ['resource|false', 'directory'=>'string', 'context='=>'resource'],
'openlog' => ['bool', 'prefix'=>'string', 'flags'=>'int', 'facility'=>'int'],
'openssl_cipher_iv_length' => ['int|false', 'cipher_algo'=>'string'],
'openssl_csr_export' => ['bool', 'csr'=>'string|resource', '&w_output'=>'string', 'no_text='=>'bool'],
'openssl_csr_export_to_file' => ['bool', 'csr'=>'string|resource', 'output_filename'=>'string', 'no_text='=>'bool'],
'openssl_csr_get_public_key' => ['resource|false', 'csr'=>'string|resource', 'short_names='=>'bool'],
'openssl_csr_get_subject' => ['array|false', 'csr'=>'string|resource', 'short_names='=>'bool'],
'openssl_csr_new' => ['resource|false', 'distinguished_names'=>'array', '&w_private_key'=>'resource', 'options='=>'array', 'extra_attributes='=>'array'],
'openssl_csr_sign' => ['resource|false', 'csr'=>'string|resource', 'ca_certificate'=>'string|resource|null', 'private_key'=>'string|resource|array', 'days'=>'int', 'options='=>'array', 'serial='=>'int'],
'openssl_decrypt' => ['string|false', 'data'=>'string', 'cipher_algo'=>'string', 'passphrase'=>'string', 'options='=>'int', 'iv='=>'string', 'tag='=>'string', 'aad='=>'string'],
'openssl_dh_compute_key' => ['string|false', 'public_key'=>'string', 'private_key'=>'resource'],
'openssl_digest' => ['string|false', 'data'=>'string', 'digest_algo'=>'string', 'binary='=>'bool'],
'openssl_encrypt' => ['string|false', 'data'=>'string', 'cipher_algo'=>'string', 'passphrase'=>'string', 'options='=>'int', 'iv='=>'string', '&w_tag='=>'string', 'aad='=>'string', 'tag_length='=>'int'],
'openssl_error_string' => ['string|false'],
'openssl_free_key' => ['void', 'key'=>'resource'],
'openssl_get_cert_locations' => ['array'],
'openssl_get_cipher_methods' => ['array', 'aliases='=>'bool'],
'openssl_get_curve_names' => ['list<string>'],
'openssl_get_md_methods' => ['array', 'aliases='=>'bool'],
'openssl_get_privatekey' => ['resource|false', 'private_key'=>'string', 'passphrase='=>'string'],
'openssl_get_publickey' => ['resource|false', 'public_key'=>'resource|string'],
'openssl_open' => ['bool', 'data'=>'string', '&w_output'=>'string', 'encrypted_key'=>'string', 'private_key'=>'string|array|resource', 'cipher_algo='=>'string', 'iv='=>'string'],
'openssl_pbkdf2' => ['string|false', 'password'=>'string', 'salt'=>'string', 'key_length'=>'int', 'iterations'=>'int', 'digest_algo='=>'string'],
'openssl_pkcs12_export' => ['bool', 'certificate'=>'string|resource', '&w_output'=>'string', 'private_key'=>'string|array|resource', 'passphrase'=>'string', 'options='=>'array'],
'openssl_pkcs12_export_to_file' => ['bool', 'certificate'=>'string|resource', 'output_filename'=>'string', 'private_key'=>'string|array|resource', 'passphrase'=>'string', 'options='=>'array'],
'openssl_pkcs12_read' => ['bool', 'pkcs12'=>'string', '&w_certificates'=>'array', 'passphrase'=>'string'],
'openssl_pkcs7_decrypt' => ['bool', 'input_filename'=>'string', 'output_filename'=>'string', 'certificate'=>'string|resource', 'private_key='=>'string|resource|array'],
'openssl_pkcs7_encrypt' => ['bool', 'input_filename'=>'string', 'output_filename'=>'string', 'certificate'=>'string|resource|array', 'headers'=>'array', 'flags='=>'int', 'cipher_algo='=>'int'],
'openssl_pkcs7_read' => ['bool', 'input_filename'=>'string', '&w_certificates'=>'array'],
'openssl_pkcs7_sign' => ['bool', 'input_filename'=>'string', 'output_filename'=>'string', 'certificate'=>'string|resource', 'private_key'=>'string|resource|array', 'headers'=>'array', 'flags='=>'int', 'untrusted_certificates_filename='=>'string'],
'openssl_pkcs7_verify' => ['bool|int', 'input_filename'=>'string', 'flags'=>'int', 'signers_certificates_filename='=>'string', 'ca_info='=>'array', 'untrusted_certificates_filename='=>'string', 'content='=>'string', 'output_filename='=>'string'],
'openssl_pkey_derive' => ['string|false', 'public_key'=>'mixed', 'private_key'=>'mixed', 'key_length='=>'?int'],
'openssl_pkey_export' => ['bool', 'key'=>'resource', '&w_output'=>'string', 'passphrase='=>'string|null', 'options='=>'array'],
'openssl_pkey_export_to_file' => ['bool', 'key'=>'resource|string|array', 'output_filename'=>'string', 'passphrase='=>'string|null', 'options='=>'array'],
'openssl_pkey_free' => ['void', 'key'=>'resource'],
'openssl_pkey_get_details' => ['array|false', 'key'=>'resource'],
'openssl_pkey_get_private' => ['OpenSSLAsymmetricKey|false', 'private_key'=>'OpenSSLAsymmetricKey|OpenSSLCertificate|array|string', 'passphrase='=>'?string'],
'openssl_pkey_get_public' => ['resource|false', 'public_key'=>'resource|string'],
'openssl_pkey_new' => ['resource|false', 'options='=>'array'],
'openssl_private_decrypt' => ['bool', 'data'=>'string', '&w_decrypted_data'=>'string', 'private_key'=>'string|resource|array', 'padding='=>'int'],
'openssl_private_encrypt' => ['bool', 'data'=>'string', '&w_encrypted_data'=>'string', 'private_key'=>'string|resource|array', 'padding='=>'int'],
'openssl_public_decrypt' => ['bool', 'data'=>'string', '&w_decrypted_data'=>'string', 'public_key'=>'string|resource', 'padding='=>'int'],
'openssl_public_encrypt' => ['bool', 'data'=>'string', '&w_encrypted_data'=>'string', 'public_key'=>'string|resource', 'padding='=>'int'],
'openssl_random_pseudo_bytes' => ['string|false', 'length'=>'int', '&w_strong_result='=>'bool'],
'openssl_seal' => ['int|false', 'data'=>'string', '&w_sealed_data'=>'string', '&w_encrypted_keys'=>'array', 'public_key'=>'array', 'cipher_algo='=>'string', '&rw_iv='=>'string'],
'openssl_sign' => ['bool', 'data'=>'string', '&w_signature'=>'string', 'private_key'=>'OpenSSLAsymmetricKey|OpenSSLCertificate|array{OpenSSLAsymmetricKey|OpenSSLCertificate|string, string}|string', 'algorithm='=>'int|string'],
'openssl_spki_export' => ['?string', 'spki'=>'string'],
'openssl_spki_export_challenge' => ['?string', 'spki'=>'string'],
'openssl_spki_new' => ['?string', 'private_key'=>'resource', 'challenge'=>'string', 'digest_algo='=>'int'],
'openssl_spki_verify' => ['bool', 'spki'=>'string'],
'openssl_verify' => ['-1|0|1', 'data'=>'string', 'signature'=>'string', 'public_key'=>'resource|string', 'algorithm='=>'int|string'],
'openssl_x509_check_private_key' => ['bool', 'certificate'=>'string|resource', 'private_key'=>'string|resource|array'],
'openssl_x509_checkpurpose' => ['bool|int', 'certificate'=>'string|resource', 'purpose'=>'int', 'ca_info='=>'array', 'untrusted_certificates_file='=>'string'],
'openssl_x509_export' => ['bool', 'certificate'=>'string|resource', '&w_output'=>'string', 'no_text='=>'bool'],
'openssl_x509_export_to_file' => ['bool', 'certificate'=>'string|resource', 'output_filename'=>'string', 'no_text='=>'bool'],
'openssl_x509_fingerprint' => ['string|false', 'certificate'=>'string|resource', 'digest_algo='=>'string', 'binary='=>'bool'],
'openssl_x509_free' => ['void', 'certificate'=>'resource'],
'openssl_x509_parse' => ['array|false', 'certificate'=>'OpenSSLCertificate|string', 'short_names='=>'bool'],
'openssl_x509_read' => ['OpenSSLCertificate|false', 'certificate'=>'OpenSSLCertificate|string'],
'ord' => ['int', 'character'=>'string'],
'OuterIterator::current' => ['mixed'],
'OuterIterator::getInnerIterator' => ['Iterator'],
'OuterIterator::key' => ['int|string'],
'OuterIterator::next' => ['void'],
'OuterIterator::rewind' => ['void'],
'OuterIterator::valid' => ['bool'],
'OutOfBoundsException::__clone' => ['void'],
'OutOfBoundsException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?OutOfBoundsException'],
'OutOfBoundsException::__toString' => ['string'],
'OutOfBoundsException::getCode' => ['int'],
'OutOfBoundsException::getFile' => ['string'],
'OutOfBoundsException::getLine' => ['int'],
'OutOfBoundsException::getMessage' => ['string'],
'OutOfBoundsException::getPrevious' => ['Throwable|OutOfBoundsException|null'],
'OutOfBoundsException::getTrace' => ['list<array<string,mixed>>'],
'OutOfBoundsException::getTraceAsString' => ['string'],
'OutOfRangeException::__clone' => ['void'],
'OutOfRangeException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?OutOfRangeException'],
'OutOfRangeException::__toString' => ['string'],
'OutOfRangeException::getCode' => ['int'],
'OutOfRangeException::getFile' => ['string'],
'OutOfRangeException::getLine' => ['int'],
'OutOfRangeException::getMessage' => ['string'],
'OutOfRangeException::getPrevious' => ['Throwable|OutOfRangeException|null'],
'OutOfRangeException::getTrace' => ['list<array<string,mixed>>'],
'OutOfRangeException::getTraceAsString' => ['string'],
'output_add_rewrite_var' => ['bool', 'name'=>'string', 'value'=>'string'],
'output_cache_disable' => ['void'],
'output_cache_disable_compression' => ['void'],
'output_cache_exists' => ['bool', 'key'=>'string', 'lifetime'=>'int'],
'output_cache_fetch' => ['string', 'key'=>'string', 'function'=>'', 'lifetime'=>'int'],
'output_cache_get' => ['mixed|false', 'key'=>'string', 'lifetime'=>'int'],
'output_cache_output' => ['string', 'key'=>'string', 'function'=>'', 'lifetime'=>'int'],
'output_cache_put' => ['bool', 'key'=>'string', 'data'=>'mixed'],
'output_cache_remove' => ['bool', 'filename'=>''],
'output_cache_remove_key' => ['bool', 'key'=>'string'],
'output_cache_remove_url' => ['bool', 'url'=>'string'],
'output_cache_stop' => ['void'],
'output_reset_rewrite_vars' => ['bool'],
'outputformatObj::getOption' => ['string', 'property_name'=>'string'],
'outputformatObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'outputformatObj::setOption' => ['void', 'property_name'=>'string', 'new_value'=>'string'],
'outputformatObj::validate' => ['int'],
'OverflowException::__clone' => ['void'],
'OverflowException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?OverflowException'],
'OverflowException::__toString' => ['string'],
'OverflowException::getCode' => ['int'],
'OverflowException::getFile' => ['string'],
'OverflowException::getLine' => ['int'],
'OverflowException::getMessage' => ['string'],
'OverflowException::getPrevious' => ['Throwable|OverflowException|null'],
'OverflowException::getTrace' => ['list<array<string,mixed>>'],
'OverflowException::getTraceAsString' => ['string'],
'overload' => ['', 'class_name'=>'string'],
'override_function' => ['bool', 'function_name'=>'string', 'function_args'=>'string', 'function_code'=>'string'],
'OwsrequestObj::__construct' => ['void'],
'OwsrequestObj::addParameter' => ['int', 'name'=>'string', 'value'=>'string'],
'OwsrequestObj::getName' => ['string', 'index'=>'int'],
'OwsrequestObj::getValue' => ['string', 'index'=>'int'],
'OwsrequestObj::getValueByName' => ['string', 'name'=>'string'],
'OwsrequestObj::loadParams' => ['int'],
'OwsrequestObj::setParameter' => ['int', 'name'=>'string', 'value'=>'string'],
'pack' => ['string|false', 'format'=>'string', '...values='=>'mixed'],
'parallel\Future::done' => ['bool'],
'parallel\Future::select' => ['mixed', '&resolving'=>'parallel\Future[]', '&w_resolved'=>'parallel\Future[]', '&w_errored'=>'parallel\Future[]', '&w_timedout='=>'parallel\Future[]', 'timeout='=>'int'],
'parallel\Future::value' => ['mixed', 'timeout='=>'int'],
'parallel\Runtime::__construct' => ['void', 'arg'=>'string|array'],
'parallel\Runtime::__construct\'1' => ['void', 'bootstrap'=>'string', 'configuration'=>'array<string,mixed>'],
'parallel\Runtime::close' => ['void'],
'parallel\Runtime::kill' => ['void'],
'parallel\Runtime::run' => ['?parallel\Future', 'closure'=>'Closure', 'args='=>'array'],
'ParentIterator::__construct' => ['void', 'iterator'=>'RecursiveIterator'],
'ParentIterator::accept' => ['bool'],
'ParentIterator::getChildren' => ['ParentIterator'],
'ParentIterator::hasChildren' => ['bool'],
'ParentIterator::next' => ['void'],
'ParentIterator::rewind' => ['void'],
'ParentIterator::valid' => [''],
'Parle\Lexer::advance' => ['void'],
'Parle\Lexer::build' => ['void'],
'Parle\Lexer::callout' => ['void', 'id'=>'int', 'callback'=>'callable'],
'Parle\Lexer::consume' => ['void', 'data'=>'string'],
'Parle\Lexer::dump' => ['void'],
'Parle\Lexer::getToken' => ['Parle\Token'],
'Parle\Lexer::insertMacro' => ['void', 'name'=>'string', 'regex'=>'string'],
'Parle\Lexer::push' => ['void', 'regex'=>'string', 'id'=>'int'],
'Parle\Lexer::reset' => ['void', 'pos'=>'int'],
'Parle\Parser::advance' => ['void'],
'Parle\Parser::build' => ['void'],
'Parle\Parser::consume' => ['void', 'data'=>'string', 'lexer'=>'Parle\Lexer'],
'Parle\Parser::dump' => ['void'],
'Parle\Parser::errorInfo' => ['Parle\ErrorInfo'],
'Parle\Parser::left' => ['void', 'token'=>'string'],
'Parle\Parser::nonassoc' => ['void', 'token'=>'string'],
'Parle\Parser::precedence' => ['void', 'token'=>'string'],
'Parle\Parser::push' => ['int', 'name'=>'string', 'rule'=>'string'],
'Parle\Parser::reset' => ['void', 'tokenId'=>'int'],
'Parle\Parser::right' => ['void', 'token'=>'string'],
'Parle\Parser::sigil' => ['string', 'idx'=>'array'],
'Parle\Parser::token' => ['void', 'token'=>'string'],
'Parle\Parser::tokenId' => ['int', 'token'=>'string'],
'Parle\Parser::trace' => ['string'],
'Parle\Parser::validate' => ['bool', 'data'=>'string', 'lexer'=>'Parle\Lexer'],
'Parle\RLexer::advance' => ['void'],
'Parle\RLexer::build' => ['void'],
'Parle\RLexer::callout' => ['void', 'id'=>'int', 'callback'=>'callable'],
'Parle\RLexer::consume' => ['void', 'data'=>'string'],
'Parle\RLexer::dump' => ['void'],
'Parle\RLexer::getToken' => ['Parle\Token'],
'parle\rlexer::insertMacro' => ['void', 'name'=>'string', 'regex'=>'string'],
'Parle\RLexer::push' => ['void', 'state'=>'string', 'regex'=>'string', 'newState'=>'string'],
'Parle\RLexer::pushState' => ['int', 'state'=>'string'],
'Parle\RLexer::reset' => ['void', 'pos'=>'int'],
'Parle\RParser::advance' => ['void'],
'Parle\RParser::build' => ['void'],
'Parle\RParser::consume' => ['void', 'data'=>'string', 'lexer'=>'Parle\Lexer'],
'Parle\RParser::dump' => ['void'],
'Parle\RParser::errorInfo' => ['Parle\ErrorInfo'],
'Parle\RParser::left' => ['void', 'token'=>'string'],
'Parle\RParser::nonassoc' => ['void', 'token'=>'string'],
'Parle\RParser::precedence' => ['void', 'token'=>'string'],
'Parle\RParser::push' => ['int', 'name'=>'string', 'rule'=>'string'],
'Parle\RParser::reset' => ['void', 'tokenId'=>'int'],
'Parle\RParser::right' => ['void', 'token'=>'string'],
'Parle\RParser::sigil' => ['string', 'idx'=>'array'],
'Parle\RParser::token' => ['void', 'token'=>'string'],
'Parle\RParser::tokenId' => ['int', 'token'=>'string'],
'Parle\RParser::trace' => ['string'],
'Parle\RParser::validate' => ['bool', 'data'=>'string', 'lexer'=>'Parle\Lexer'],
'Parle\Stack::pop' => ['void'],
'Parle\Stack::push' => ['void', 'item'=>'mixed'],
'parse_ini_file' => ['array|false', 'filename'=>'string', 'process_sections='=>'bool', 'scanner_mode='=>'int'],
'parse_ini_string' => ['array|false', 'ini_string'=>'string', 'process_sections='=>'bool', 'scanner_mode='=>'int'],
'parse_str' => ['void', 'string'=>'string', '&w_result'=>'array'],
'parse_url' => ['mixed|false', 'url'=>'string', 'component='=>'int'],
'ParseError::__clone' => ['void'],
'ParseError::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?ParseError'],
'ParseError::__toString' => ['string'],
'ParseError::getCode' => ['int'],
'ParseError::getFile' => ['string'],
'ParseError::getLine' => ['int'],
'ParseError::getMessage' => ['string'],
'ParseError::getPrevious' => ['Throwable|ParseError|null'],
'ParseError::getTrace' => ['list<array<string,mixed>>'],
'ParseError::getTraceAsString' => ['string'],
'parsekit_compile_file' => ['array', 'filename'=>'string', 'errors='=>'array', 'options='=>'int'],
'parsekit_compile_string' => ['array', 'phpcode'=>'string', 'errors='=>'array', 'options='=>'int'],
'parsekit_func_arginfo' => ['array', 'function'=>'mixed'],
'passthru' => ['void', 'command'=>'string', '&w_result_code='=>'int'],
'password_get_info' => ['array', 'hash'=>'string'],
'password_hash' => ['string', 'password'=>'string', 'algo'=>'int|string|null', 'options='=>'array'],
'password_make_salt' => ['bool', 'password'=>'string', 'hash'=>'string'],
'password_needs_rehash' => ['bool', 'hash'=>'string', 'algo'=>'int|string|null', 'options='=>'array'],
'password_verify' => ['bool', 'password'=>'string', 'hash'=>'string'],
'pathinfo' => ['array|string', 'path'=>'string', 'flags='=>'int'],
'pclose' => ['int', 'handle'=>'resource'],
'pcnlt_sigwaitinfo' => ['int', 'set'=>'array', '&w_siginfo'=>'array'],
'pcntl_alarm' => ['int', 'seconds'=>'int'],
'pcntl_async_signals' => ['bool', 'enable='=>'bool'],
'pcntl_errno' => ['int'],
'pcntl_exec' => ['null|false', 'path'=>'string', 'args='=>'array', 'env_vars='=>'array'],
'pcntl_fork' => ['int'],
'pcntl_get_last_error' => ['int'],
'pcntl_getpriority' => ['int', 'process_id='=>'int', 'mode='=>'int'],
'pcntl_setpriority' => ['bool', 'priority'=>'int', 'process_id='=>'int', 'mode='=>'int'],
'pcntl_signal' => ['bool', 'signal'=>'int', 'handler'=>'callable():void|callable(int):void|callable(int,array):void|int', 'restart_syscalls='=>'bool'],
'pcntl_signal_dispatch' => ['bool'],
'pcntl_signal_get_handler' => ['int|string', 'signal'=>'int'],
'pcntl_sigprocmask' => ['bool', 'mode'=>'int', 'signals'=>'array', '&w_old_signals='=>'array'],
'pcntl_sigtimedwait' => ['int', 'signals'=>'array', '&w_info='=>'array', 'seconds='=>'int', 'nanoseconds='=>'int'],
'pcntl_sigwaitinfo' => ['int', 'signals'=>'array', '&w_info='=>'array'],
'pcntl_strerror' => ['string|false', 'error_code'=>'int'],
'pcntl_wait' => ['int', '&w_status'=>'int', 'flags='=>'int', '&w_resource_usage='=>'array'],
'pcntl_waitpid' => ['int', 'process_id'=>'int', '&w_status'=>'int', 'flags='=>'int', '&w_resource_usage='=>'array'],
'pcntl_wexitstatus' => ['int', 'status'=>'int'],
'pcntl_wifcontinued' => ['bool', 'status'=>'int'],
'pcntl_wifexited' => ['bool', 'status'=>'int'],
'pcntl_wifsignaled' => ['bool', 'status'=>'int'],
'pcntl_wifstopped' => ['bool', 'status'=>'int'],
'pcntl_wstopsig' => ['int', 'status'=>'int'],
'pcntl_wtermsig' => ['int', 'status'=>'int'],
'PDF_activate_item' => ['bool', 'pdfdoc'=>'resource', 'id'=>'int'],
'PDF_add_launchlink' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string'],
'PDF_add_locallink' => ['bool', 'pdfdoc'=>'resource', 'lowerleftx'=>'float', 'lowerlefty'=>'float', 'upperrightx'=>'float', 'upperrighty'=>'float', 'page'=>'int', 'dest'=>'string'],
'PDF_add_nameddest' => ['bool', 'pdfdoc'=>'resource', 'name'=>'string', 'optlist'=>'string'],
'PDF_add_note' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'contents'=>'string', 'title'=>'string', 'icon'=>'string', 'open'=>'int'],
'PDF_add_pdflink' => ['bool', 'pdfdoc'=>'resource', 'bottom_left_x'=>'float', 'bottom_left_y'=>'float', 'up_right_x'=>'float', 'up_right_y'=>'float', 'filename'=>'string', 'page'=>'int', 'dest'=>'string'],
'PDF_add_table_cell' => ['int', 'pdfdoc'=>'resource', 'table'=>'int', 'column'=>'int', 'row'=>'int', 'text'=>'string', 'optlist'=>'string'],
'PDF_add_textflow' => ['int', 'pdfdoc'=>'resource', 'textflow'=>'int', 'text'=>'string', 'optlist'=>'string'],
'PDF_add_thumbnail' => ['bool', 'pdfdoc'=>'resource', 'image'=>'int'],
'PDF_add_weblink' => ['bool', 'pdfdoc'=>'resource', 'lowerleftx'=>'float', 'lowerlefty'=>'float', 'upperrightx'=>'float', 'upperrighty'=>'float', 'url'=>'string'],
'PDF_arc' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float', 'r'=>'float', 'alpha'=>'float', 'beta'=>'float'],
'PDF_arcn' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float', 'r'=>'float', 'alpha'=>'float', 'beta'=>'float'],
'PDF_attach_file' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string', 'description'=>'string', 'author'=>'string', 'mimetype'=>'string', 'icon'=>'string'],
'PDF_begin_document' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string', 'optlist'=>'string'],
'PDF_begin_font' => ['bool', 'pdfdoc'=>'resource', 'filename'=>'string', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float', 'optlist'=>'string'],
'PDF_begin_glyph' => ['bool', 'pdfdoc'=>'resource', 'glyphname'=>'string', 'wx'=>'float', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float'],
'PDF_begin_item' => ['int', 'pdfdoc'=>'resource', 'tag'=>'string', 'optlist'=>'string'],
'PDF_begin_layer' => ['bool', 'pdfdoc'=>'resource', 'layer'=>'int'],
'PDF_begin_page' => ['bool', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float'],
'PDF_begin_page_ext' => ['bool', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float', 'optlist'=>'string'],
'PDF_begin_pattern' => ['int', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float', 'xstep'=>'float', 'ystep'=>'float', 'painttype'=>'int'],
'PDF_begin_template' => ['int', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float'],
'PDF_begin_template_ext' => ['int', 'pdfdoc'=>'resource', 'width'=>'float', 'height'=>'float', 'optlist'=>'string'],
'PDF_circle' => ['bool', 'pdfdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'r'=>'float'],
'PDF_clip' => ['bool', 'p'=>'resource'],
'PDF_close' => ['bool', 'p'=>'resource'],
'PDF_close_image' => ['bool', 'p'=>'resource', 'image'=>'int'],
'PDF_close_pdi' => ['bool', 'p'=>'resource', 'doc'=>'int'],
'PDF_close_pdi_page' => ['bool', 'p'=>'resource', 'page'=>'int'],
'PDF_closepath' => ['bool', 'p'=>'resource'],
'PDF_closepath_fill_stroke' => ['bool', 'p'=>'resource'],
'PDF_closepath_stroke' => ['bool', 'p'=>'resource'],
'PDF_concat' => ['bool', 'p'=>'resource', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float'],
'PDF_continue_text' => ['bool', 'p'=>'resource', 'text'=>'string'],
'PDF_create_3dview' => ['int', 'pdfdoc'=>'resource', 'username'=>'string', 'optlist'=>'string'],
'PDF_create_action' => ['int', 'pdfdoc'=>'resource', 'type'=>'string', 'optlist'=>'string'],
'PDF_create_annotation' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'type'=>'string', 'optlist'=>'string'],
'PDF_create_bookmark' => ['int', 'pdfdoc'=>'resource', 'text'=>'string', 'optlist'=>'string'],
'PDF_create_field' => ['bool', 'pdfdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'name'=>'string', 'type'=>'string', 'optlist'=>'string'],
'PDF_create_fieldgroup' => ['bool', 'pdfdoc'=>'resource', 'name'=>'string', 'optlist'=>'string'],
'PDF_create_gstate' => ['int', 'pdfdoc'=>'resource', 'optlist'=>'string'],
'PDF_create_pvf' => ['bool', 'pdfdoc'=>'resource', 'filename'=>'string', 'data'=>'string', 'optlist'=>'string'],
'PDF_create_textflow' => ['int', 'pdfdoc'=>'resource', 'text'=>'string', 'optlist'=>'string'],
'PDF_curveto' => ['bool', 'p'=>'resource', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'],
'PDF_define_layer' => ['int', 'pdfdoc'=>'resource', 'name'=>'string', 'optlist'=>'string'],
'PDF_delete' => ['bool', 'pdfdoc'=>'resource'],
'PDF_delete_pvf' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string'],
'PDF_delete_table' => ['bool', 'pdfdoc'=>'resource', 'table'=>'int', 'optlist'=>'string'],
'PDF_delete_textflow' => ['bool', 'pdfdoc'=>'resource', 'textflow'=>'int'],
'PDF_encoding_set_char' => ['bool', 'pdfdoc'=>'resource', 'encoding'=>'string', 'slot'=>'int', 'glyphname'=>'string', 'uv'=>'int'],
'PDF_end_document' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'],
'PDF_end_font' => ['bool', 'pdfdoc'=>'resource'],
'PDF_end_glyph' => ['bool', 'pdfdoc'=>'resource'],
'PDF_end_item' => ['bool', 'pdfdoc'=>'resource', 'id'=>'int'],
'PDF_end_layer' => ['bool', 'pdfdoc'=>'resource'],
'PDF_end_page' => ['bool', 'p'=>'resource'],
'PDF_end_page_ext' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'],
'PDF_end_pattern' => ['bool', 'p'=>'resource'],
'PDF_end_template' => ['bool', 'p'=>'resource'],
'PDF_endpath' => ['bool', 'p'=>'resource'],
'PDF_fill' => ['bool', 'p'=>'resource'],
'PDF_fill_imageblock' => ['int', 'pdfdoc'=>'resource', 'page'=>'int', 'blockname'=>'string', 'image'=>'int', 'optlist'=>'string'],
'PDF_fill_pdfblock' => ['int', 'pdfdoc'=>'resource', 'page'=>'int', 'blockname'=>'string', 'contents'=>'int', 'optlist'=>'string'],
'PDF_fill_stroke' => ['bool', 'p'=>'resource'],
'PDF_fill_textblock' => ['int', 'pdfdoc'=>'resource', 'page'=>'int', 'blockname'=>'string', 'text'=>'string', 'optlist'=>'string'],
'PDF_findfont' => ['int', 'p'=>'resource', 'fontname'=>'string', 'encoding'=>'string', 'embed'=>'int'],
'PDF_fit_image' => ['bool', 'pdfdoc'=>'resource', 'image'=>'int', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'],
'PDF_fit_pdi_page' => ['bool', 'pdfdoc'=>'resource', 'page'=>'int', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'],
'PDF_fit_table' => ['string', 'pdfdoc'=>'resource', 'table'=>'int', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'optlist'=>'string'],
'PDF_fit_textflow' => ['string', 'pdfdoc'=>'resource', 'textflow'=>'int', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'optlist'=>'string'],
'PDF_fit_textline' => ['bool', 'pdfdoc'=>'resource', 'text'=>'string', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'],
'PDF_get_apiname' => ['string', 'pdfdoc'=>'resource'],
'PDF_get_buffer' => ['string', 'p'=>'resource'],
'PDF_get_errmsg' => ['string', 'pdfdoc'=>'resource'],
'PDF_get_errnum' => ['int', 'pdfdoc'=>'resource'],
'PDF_get_majorversion' => ['int'],
'PDF_get_minorversion' => ['int'],
'PDF_get_parameter' => ['string', 'p'=>'resource', 'key'=>'string', 'modifier'=>'float'],
'PDF_get_pdi_parameter' => ['string', 'p'=>'resource', 'key'=>'string', 'doc'=>'int', 'page'=>'int', 'reserved'=>'int'],
'PDF_get_pdi_value' => ['float', 'p'=>'resource', 'key'=>'string', 'doc'=>'int', 'page'=>'int', 'reserved'=>'int'],
'PDF_get_value' => ['float', 'p'=>'resource', 'key'=>'string', 'modifier'=>'float'],
'PDF_info_font' => ['float', 'pdfdoc'=>'resource', 'font'=>'int', 'keyword'=>'string', 'optlist'=>'string'],
'PDF_info_matchbox' => ['float', 'pdfdoc'=>'resource', 'boxname'=>'string', 'num'=>'int', 'keyword'=>'string'],
'PDF_info_table' => ['float', 'pdfdoc'=>'resource', 'table'=>'int', 'keyword'=>'string'],
'PDF_info_textflow' => ['float', 'pdfdoc'=>'resource', 'textflow'=>'int', 'keyword'=>'string'],
'PDF_info_textline' => ['float', 'pdfdoc'=>'resource', 'text'=>'string', 'keyword'=>'string', 'optlist'=>'string'],
'PDF_initgraphics' => ['bool', 'p'=>'resource'],
'PDF_lineto' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float'],
'PDF_load_3ddata' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string', 'optlist'=>'string'],
'PDF_load_font' => ['int', 'pdfdoc'=>'resource', 'fontname'=>'string', 'encoding'=>'string', 'optlist'=>'string'],
'PDF_load_iccprofile' => ['int', 'pdfdoc'=>'resource', 'profilename'=>'string', 'optlist'=>'string'],
'PDF_load_image' => ['int', 'pdfdoc'=>'resource', 'imagetype'=>'string', 'filename'=>'string', 'optlist'=>'string'],
'PDF_makespotcolor' => ['int', 'p'=>'resource', 'spotname'=>'string'],
'PDF_moveto' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float'],
'PDF_new' => ['resource'],
'PDF_open_ccitt' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string', 'width'=>'int', 'height'=>'int', 'bitreverse'=>'int', 'k'=>'int', 'blackls1'=>'int'],
'PDF_open_file' => ['bool', 'p'=>'resource', 'filename'=>'string'],
'PDF_open_image' => ['int', 'p'=>'resource', 'imagetype'=>'string', 'source'=>'string', 'data'=>'string', 'length'=>'int', 'width'=>'int', 'height'=>'int', 'components'=>'int', 'bpc'=>'int', 'params'=>'string'],
'PDF_open_image_file' => ['int', 'p'=>'resource', 'imagetype'=>'string', 'filename'=>'string', 'stringparam'=>'string', 'intparam'=>'int'],
'PDF_open_memory_image' => ['int', 'p'=>'resource', 'image'=>'resource'],
'PDF_open_pdi' => ['int', 'pdfdoc'=>'resource', 'filename'=>'string', 'optlist'=>'string', 'length'=>'int'],
'PDF_open_pdi_document' => ['int', 'p'=>'resource', 'filename'=>'string', 'optlist'=>'string'],
'PDF_open_pdi_page' => ['int', 'p'=>'resource', 'doc'=>'int', 'pagenumber'=>'int', 'optlist'=>'string'],
'PDF_pcos_get_number' => ['float', 'p'=>'resource', 'doc'=>'int', 'path'=>'string'],
'PDF_pcos_get_stream' => ['string', 'p'=>'resource', 'doc'=>'int', 'optlist'=>'string', 'path'=>'string'],
'PDF_pcos_get_string' => ['string', 'p'=>'resource', 'doc'=>'int', 'path'=>'string'],
'PDF_place_image' => ['bool', 'pdfdoc'=>'resource', 'image'=>'int', 'x'=>'float', 'y'=>'float', 'scale'=>'float'],
'PDF_place_pdi_page' => ['bool', 'pdfdoc'=>'resource', 'page'=>'int', 'x'=>'float', 'y'=>'float', 'sx'=>'float', 'sy'=>'float'],
'PDF_process_pdi' => ['int', 'pdfdoc'=>'resource', 'doc'=>'int', 'page'=>'int', 'optlist'=>'string'],
'PDF_rect' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'],
'PDF_restore' => ['bool', 'p'=>'resource'],
'PDF_resume_page' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'],
'PDF_rotate' => ['bool', 'p'=>'resource', 'phi'=>'float'],
'PDF_save' => ['bool', 'p'=>'resource'],
'PDF_scale' => ['bool', 'p'=>'resource', 'sx'=>'float', 'sy'=>'float'],
'PDF_set_border_color' => ['bool', 'p'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'PDF_set_border_dash' => ['bool', 'pdfdoc'=>'resource', 'black'=>'float', 'white'=>'float'],
'PDF_set_border_style' => ['bool', 'pdfdoc'=>'resource', 'style'=>'string', 'width'=>'float'],
'PDF_set_gstate' => ['bool', 'pdfdoc'=>'resource', 'gstate'=>'int'],
'PDF_set_info' => ['bool', 'p'=>'resource', 'key'=>'string', 'value'=>'string'],
'PDF_set_layer_dependency' => ['bool', 'pdfdoc'=>'resource', 'type'=>'string', 'optlist'=>'string'],
'PDF_set_parameter' => ['bool', 'p'=>'resource', 'key'=>'string', 'value'=>'string'],
'PDF_set_text_pos' => ['bool', 'p'=>'resource', 'x'=>'float', 'y'=>'float'],
'PDF_set_value' => ['bool', 'p'=>'resource', 'key'=>'string', 'value'=>'float'],
'PDF_setcolor' => ['bool', 'p'=>'resource', 'fstype'=>'string', 'colorspace'=>'string', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float'],
'PDF_setdash' => ['bool', 'pdfdoc'=>'resource', 'b'=>'float', 'w'=>'float'],
'PDF_setdashpattern' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'],
'PDF_setflat' => ['bool', 'pdfdoc'=>'resource', 'flatness'=>'float'],
'PDF_setfont' => ['bool', 'pdfdoc'=>'resource', 'font'=>'int', 'fontsize'=>'float'],
'PDF_setgray' => ['bool', 'p'=>'resource', 'g'=>'float'],
'PDF_setgray_fill' => ['bool', 'p'=>'resource', 'g'=>'float'],
'PDF_setgray_stroke' => ['bool', 'p'=>'resource', 'g'=>'float'],
'PDF_setlinecap' => ['bool', 'p'=>'resource', 'linecap'=>'int'],
'PDF_setlinejoin' => ['bool', 'p'=>'resource', 'value'=>'int'],
'PDF_setlinewidth' => ['bool', 'p'=>'resource', 'width'=>'float'],
'PDF_setmatrix' => ['bool', 'p'=>'resource', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float'],
'PDF_setmiterlimit' => ['bool', 'pdfdoc'=>'resource', 'miter'=>'float'],
'PDF_setrgbcolor' => ['bool', 'p'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'PDF_setrgbcolor_fill' => ['bool', 'p'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'PDF_setrgbcolor_stroke' => ['bool', 'p'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'PDF_shading' => ['int', 'pdfdoc'=>'resource', 'shtype'=>'string', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float', 'optlist'=>'string'],
'PDF_shading_pattern' => ['int', 'pdfdoc'=>'resource', 'shading'=>'int', 'optlist'=>'string'],
'PDF_shfill' => ['bool', 'pdfdoc'=>'resource', 'shading'=>'int'],
'PDF_show' => ['bool', 'pdfdoc'=>'resource', 'text'=>'string'],
'PDF_show_boxed' => ['int', 'p'=>'resource', 'text'=>'string', 'left'=>'float', 'top'=>'float', 'width'=>'float', 'height'=>'float', 'mode'=>'string', 'feature'=>'string'],
'PDF_show_xy' => ['bool', 'p'=>'resource', 'text'=>'string', 'x'=>'float', 'y'=>'float'],
'PDF_skew' => ['bool', 'p'=>'resource', 'alpha'=>'float', 'beta'=>'float'],
'PDF_stringwidth' => ['float', 'p'=>'resource', 'text'=>'string', 'font'=>'int', 'fontsize'=>'float'],
'PDF_stroke' => ['bool', 'p'=>'resource'],
'PDF_suspend_page' => ['bool', 'pdfdoc'=>'resource', 'optlist'=>'string'],
'PDF_translate' => ['bool', 'p'=>'resource', 'tx'=>'float', 'ty'=>'float'],
'PDF_utf16_to_utf8' => ['string', 'pdfdoc'=>'resource', 'utf16string'=>'string'],
'PDF_utf32_to_utf16' => ['string', 'pdfdoc'=>'resource', 'utf32string'=>'string', 'ordering'=>'string'],
'PDF_utf8_to_utf16' => ['string', 'pdfdoc'=>'resource', 'utf8string'=>'string', 'ordering'=>'string'],
'PDFlib::activate_item' => ['bool', 'id'=>''],
'PDFlib::add_launchlink' => ['bool', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string'],
'PDFlib::add_locallink' => ['bool', 'lowerleftx'=>'float', 'lowerlefty'=>'float', 'upperrightx'=>'float', 'upperrighty'=>'float', 'page'=>'int', 'dest'=>'string'],
'PDFlib::add_nameddest' => ['bool', 'name'=>'string', 'optlist'=>'string'],
'PDFlib::add_note' => ['bool', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'contents'=>'string', 'title'=>'string', 'icon'=>'string', 'open'=>'int'],
'PDFlib::add_pdflink' => ['bool', 'bottom_left_x'=>'float', 'bottom_left_y'=>'float', 'up_right_x'=>'float', 'up_right_y'=>'float', 'filename'=>'string', 'page'=>'int', 'dest'=>'string'],
'PDFlib::add_table_cell' => ['int', 'table'=>'int', 'column'=>'int', 'row'=>'int', 'text'=>'string', 'optlist'=>'string'],
'PDFlib::add_textflow' => ['int', 'textflow'=>'int', 'text'=>'string', 'optlist'=>'string'],
'PDFlib::add_thumbnail' => ['bool', 'image'=>'int'],
'PDFlib::add_weblink' => ['bool', 'lowerleftx'=>'float', 'lowerlefty'=>'float', 'upperrightx'=>'float', 'upperrighty'=>'float', 'url'=>'string'],
'PDFlib::arc' => ['bool', 'x'=>'float', 'y'=>'float', 'r'=>'float', 'alpha'=>'float', 'beta'=>'float'],
'PDFlib::arcn' => ['bool', 'x'=>'float', 'y'=>'float', 'r'=>'float', 'alpha'=>'float', 'beta'=>'float'],
'PDFlib::attach_file' => ['bool', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string', 'description'=>'string', 'author'=>'string', 'mimetype'=>'string', 'icon'=>'string'],
'PDFlib::begin_document' => ['int', 'filename'=>'string', 'optlist'=>'string'],
'PDFlib::begin_font' => ['bool', 'filename'=>'string', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float', 'optlist'=>'string'],
'PDFlib::begin_glyph' => ['bool', 'glyphname'=>'string', 'wx'=>'float', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float'],
'PDFlib::begin_item' => ['int', 'tag'=>'string', 'optlist'=>'string'],
'PDFlib::begin_layer' => ['bool', 'layer'=>'int'],
'PDFlib::begin_page' => ['bool', 'width'=>'float', 'height'=>'float'],
'PDFlib::begin_page_ext' => ['bool', 'width'=>'float', 'height'=>'float', 'optlist'=>'string'],
'PDFlib::begin_pattern' => ['int', 'width'=>'float', 'height'=>'float', 'xstep'=>'float', 'ystep'=>'float', 'painttype'=>'int'],
'PDFlib::begin_template' => ['int', 'width'=>'float', 'height'=>'float'],
'PDFlib::begin_template_ext' => ['int', 'width'=>'float', 'height'=>'float', 'optlist'=>'string'],
'PDFlib::circle' => ['bool', 'x'=>'float', 'y'=>'float', 'r'=>'float'],
'PDFlib::clip' => ['bool'],
'PDFlib::close' => ['bool'],
'PDFlib::close_image' => ['bool', 'image'=>'int'],
'PDFlib::close_pdi' => ['bool', 'doc'=>'int'],
'PDFlib::close_pdi_page' => ['bool', 'page'=>'int'],
'PDFlib::closepath' => ['bool'],
'PDFlib::closepath_fill_stroke' => ['bool'],
'PDFlib::closepath_stroke' => ['bool'],
'PDFlib::concat' => ['bool', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float'],
'PDFlib::continue_text' => ['bool', 'text'=>'string'],
'PDFlib::create_3dview' => ['int', 'username'=>'string', 'optlist'=>'string'],
'PDFlib::create_action' => ['int', 'type'=>'string', 'optlist'=>'string'],
'PDFlib::create_annotation' => ['bool', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'type'=>'string', 'optlist'=>'string'],
'PDFlib::create_bookmark' => ['int', 'text'=>'string', 'optlist'=>'string'],
'PDFlib::create_field' => ['bool', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'name'=>'string', 'type'=>'string', 'optlist'=>'string'],
'PDFlib::create_fieldgroup' => ['bool', 'name'=>'string', 'optlist'=>'string'],
'PDFlib::create_gstate' => ['int', 'optlist'=>'string'],
'PDFlib::create_pvf' => ['bool', 'filename'=>'string', 'data'=>'string', 'optlist'=>'string'],
'PDFlib::create_textflow' => ['int', 'text'=>'string', 'optlist'=>'string'],
'PDFlib::curveto' => ['bool', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'],
'PDFlib::define_layer' => ['int', 'name'=>'string', 'optlist'=>'string'],
'PDFlib::delete' => ['bool'],
'PDFlib::delete_pvf' => ['int', 'filename'=>'string'],
'PDFlib::delete_table' => ['bool', 'table'=>'int', 'optlist'=>'string'],
'PDFlib::delete_textflow' => ['bool', 'textflow'=>'int'],
'PDFlib::encoding_set_char' => ['bool', 'encoding'=>'string', 'slot'=>'int', 'glyphname'=>'string', 'uv'=>'int'],
'PDFlib::end_document' => ['bool', 'optlist'=>'string'],
'PDFlib::end_font' => ['bool'],
'PDFlib::end_glyph' => ['bool'],
'PDFlib::end_item' => ['bool', 'id'=>'int'],
'PDFlib::end_layer' => ['bool'],
'PDFlib::end_page' => ['bool', 'p'=>''],
'PDFlib::end_page_ext' => ['bool', 'optlist'=>'string'],
'PDFlib::end_pattern' => ['bool', 'p'=>''],
'PDFlib::end_template' => ['bool', 'p'=>''],
'PDFlib::endpath' => ['bool', 'p'=>''],
'PDFlib::fill' => ['bool'],
'PDFlib::fill_imageblock' => ['int', 'page'=>'int', 'blockname'=>'string', 'image'=>'int', 'optlist'=>'string'],
'PDFlib::fill_pdfblock' => ['int', 'page'=>'int', 'blockname'=>'string', 'contents'=>'int', 'optlist'=>'string'],
'PDFlib::fill_stroke' => ['bool'],
'PDFlib::fill_textblock' => ['int', 'page'=>'int', 'blockname'=>'string', 'text'=>'string', 'optlist'=>'string'],
'PDFlib::findfont' => ['int', 'fontname'=>'string', 'encoding'=>'string', 'embed'=>'int'],
'PDFlib::fit_image' => ['bool', 'image'=>'int', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'],
'PDFlib::fit_pdi_page' => ['bool', 'page'=>'int', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'],
'PDFlib::fit_table' => ['string', 'table'=>'int', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'optlist'=>'string'],
'PDFlib::fit_textflow' => ['string', 'textflow'=>'int', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'optlist'=>'string'],
'PDFlib::fit_textline' => ['bool', 'text'=>'string', 'x'=>'float', 'y'=>'float', 'optlist'=>'string'],
'PDFlib::get_apiname' => ['string'],
'PDFlib::get_buffer' => ['string'],
'PDFlib::get_errmsg' => ['string'],
'PDFlib::get_errnum' => ['int'],
'PDFlib::get_majorversion' => ['int'],
'PDFlib::get_minorversion' => ['int'],
'PDFlib::get_parameter' => ['string', 'key'=>'string', 'modifier'=>'float'],
'PDFlib::get_pdi_parameter' => ['string', 'key'=>'string', 'doc'=>'int', 'page'=>'int', 'reserved'=>'int'],
'PDFlib::get_pdi_value' => ['float', 'key'=>'string', 'doc'=>'int', 'page'=>'int', 'reserved'=>'int'],
'PDFlib::get_value' => ['float', 'key'=>'string', 'modifier'=>'float'],
'PDFlib::info_font' => ['float', 'font'=>'int', 'keyword'=>'string', 'optlist'=>'string'],
'PDFlib::info_matchbox' => ['float', 'boxname'=>'string', 'num'=>'int', 'keyword'=>'string'],
'PDFlib::info_table' => ['float', 'table'=>'int', 'keyword'=>'string'],
'PDFlib::info_textflow' => ['float', 'textflow'=>'int', 'keyword'=>'string'],
'PDFlib::info_textline' => ['float', 'text'=>'string', 'keyword'=>'string', 'optlist'=>'string'],
'PDFlib::initgraphics' => ['bool'],
'PDFlib::lineto' => ['bool', 'x'=>'float', 'y'=>'float'],
'PDFlib::load_3ddata' => ['int', 'filename'=>'string', 'optlist'=>'string'],
'PDFlib::load_font' => ['int', 'fontname'=>'string', 'encoding'=>'string', 'optlist'=>'string'],
'PDFlib::load_iccprofile' => ['int', 'profilename'=>'string', 'optlist'=>'string'],
'PDFlib::load_image' => ['int', 'imagetype'=>'string', 'filename'=>'string', 'optlist'=>'string'],
'PDFlib::makespotcolor' => ['int', 'spotname'=>'string'],
'PDFlib::moveto' => ['bool', 'x'=>'float', 'y'=>'float'],
'PDFlib::open_ccitt' => ['int', 'filename'=>'string', 'width'=>'int', 'height'=>'int', 'BitReverse'=>'int', 'k'=>'int', 'Blackls1'=>'int'],
'PDFlib::open_file' => ['bool', 'filename'=>'string'],
'PDFlib::open_image' => ['int', 'imagetype'=>'string', 'source'=>'string', 'data'=>'string', 'length'=>'int', 'width'=>'int', 'height'=>'int', 'components'=>'int', 'bpc'=>'int', 'params'=>'string'],
'PDFlib::open_image_file' => ['int', 'imagetype'=>'string', 'filename'=>'string', 'stringparam'=>'string', 'intparam'=>'int'],
'PDFlib::open_memory_image' => ['int', 'image'=>'resource'],
'PDFlib::open_pdi' => ['int', 'filename'=>'string', 'optlist'=>'string', 'length'=>'int'],
'PDFlib::open_pdi_document' => ['int', 'filename'=>'string', 'optlist'=>'string'],
'PDFlib::open_pdi_page' => ['int', 'doc'=>'int', 'pagenumber'=>'int', 'optlist'=>'string'],
'PDFlib::pcos_get_number' => ['float', 'doc'=>'int', 'path'=>'string'],
'PDFlib::pcos_get_stream' => ['string', 'doc'=>'int', 'optlist'=>'string', 'path'=>'string'],
'PDFlib::pcos_get_string' => ['string', 'doc'=>'int', 'path'=>'string'],
'PDFlib::place_image' => ['bool', 'image'=>'int', 'x'=>'float', 'y'=>'float', 'scale'=>'float'],
'PDFlib::place_pdi_page' => ['bool', 'page'=>'int', 'x'=>'float', 'y'=>'float', 'sx'=>'float', 'sy'=>'float'],
'PDFlib::process_pdi' => ['int', 'doc'=>'int', 'page'=>'int', 'optlist'=>'string'],
'PDFlib::rect' => ['bool', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'],
'PDFlib::restore' => ['bool', 'p'=>''],
'PDFlib::resume_page' => ['bool', 'optlist'=>'string'],
'PDFlib::rotate' => ['bool', 'phi'=>'float'],
'PDFlib::save' => ['bool', 'p'=>''],
'PDFlib::scale' => ['bool', 'sx'=>'float', 'sy'=>'float'],
'PDFlib::set_border_color' => ['bool', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'PDFlib::set_border_dash' => ['bool', 'black'=>'float', 'white'=>'float'],
'PDFlib::set_border_style' => ['bool', 'style'=>'string', 'width'=>'float'],
'PDFlib::set_gstate' => ['bool', 'gstate'=>'int'],
'PDFlib::set_info' => ['bool', 'key'=>'string', 'value'=>'string'],
'PDFlib::set_layer_dependency' => ['bool', 'type'=>'string', 'optlist'=>'string'],
'PDFlib::set_parameter' => ['bool', 'key'=>'string', 'value'=>'string'],
'PDFlib::set_text_pos' => ['bool', 'x'=>'float', 'y'=>'float'],
'PDFlib::set_value' => ['bool', 'key'=>'string', 'value'=>'float'],
'PDFlib::setcolor' => ['bool', 'fstype'=>'string', 'colorspace'=>'string', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float'],
'PDFlib::setdash' => ['bool', 'b'=>'float', 'w'=>'float'],
'PDFlib::setdashpattern' => ['bool', 'optlist'=>'string'],
'PDFlib::setflat' => ['bool', 'flatness'=>'float'],
'PDFlib::setfont' => ['bool', 'font'=>'int', 'fontsize'=>'float'],
'PDFlib::setgray' => ['bool', 'g'=>'float'],
'PDFlib::setgray_fill' => ['bool', 'g'=>'float'],
'PDFlib::setgray_stroke' => ['bool', 'g'=>'float'],
'PDFlib::setlinecap' => ['bool', 'linecap'=>'int'],
'PDFlib::setlinejoin' => ['bool', 'value'=>'int'],
'PDFlib::setlinewidth' => ['bool', 'width'=>'float'],
'PDFlib::setmatrix' => ['bool', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'e'=>'float', 'f'=>'float'],
'PDFlib::setmiterlimit' => ['bool', 'miter'=>'float'],
'PDFlib::setrgbcolor' => ['bool', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'PDFlib::setrgbcolor_fill' => ['bool', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'PDFlib::setrgbcolor_stroke' => ['bool', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'PDFlib::shading' => ['int', 'shtype'=>'string', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float', 'optlist'=>'string'],
'PDFlib::shading_pattern' => ['int', 'shading'=>'int', 'optlist'=>'string'],
'PDFlib::shfill' => ['bool', 'shading'=>'int'],
'PDFlib::show' => ['bool', 'text'=>'string'],
'PDFlib::show_boxed' => ['int', 'text'=>'string', 'left'=>'float', 'top'=>'float', 'width'=>'float', 'height'=>'float', 'mode'=>'string', 'feature'=>'string'],
'PDFlib::show_xy' => ['bool', 'text'=>'string', 'x'=>'float', 'y'=>'float'],
'PDFlib::skew' => ['bool', 'alpha'=>'float', 'beta'=>'float'],
'PDFlib::stringwidth' => ['float', 'text'=>'string', 'font'=>'int', 'fontsize'=>'float'],
'PDFlib::stroke' => ['bool', 'p'=>''],
'PDFlib::suspend_page' => ['bool', 'optlist'=>'string'],
'PDFlib::translate' => ['bool', 'tx'=>'float', 'ty'=>'float'],
'PDFlib::utf16_to_utf8' => ['string', 'utf16string'=>'string'],
'PDFlib::utf32_to_utf16' => ['string', 'utf32string'=>'string', 'ordering'=>'string'],
'PDFlib::utf8_to_utf16' => ['string', 'utf8string'=>'string', 'ordering'=>'string'],
'PDO::__construct' => ['void', 'dsn'=>'string', 'username='=>'?string', 'passwd='=>'?string', 'options='=>'?array'],
'PDO::__sleep' => ['list<string>'],
'PDO::__wakeup' => ['void'],
'PDO::beginTransaction' => ['bool'],
'PDO::commit' => ['bool'],
'PDO::cubrid_schema' => ['array', 'schema_type'=>'int', 'table_name='=>'string', 'col_name='=>'string'],
'PDO::errorCode' => ['?string'],
'PDO::errorInfo' => ['array{0: ?string, 1: ?int, 2: ?string, 3?: mixed, 4?: mixed}'],
'PDO::exec' => ['int|false', 'query'=>'string'],
'PDO::getAttribute' => ['', 'attribute'=>'int'],
'PDO::getAvailableDrivers' => ['array'],
'PDO::inTransaction' => ['bool'],
'PDO::lastInsertId' => ['string', 'name='=>'string|null'],
'PDO::pgsqlCopyFromArray' => ['bool', 'table_name'=>'string', 'rows'=>'array', 'delimiter'=>'string', 'null_as'=>'string', 'fields'=>'string'],
'PDO::pgsqlCopyFromFile' => ['bool', 'table_name'=>'string', 'filename'=>'string', 'delimiter'=>'string', 'null_as'=>'string', 'fields'=>'string'],
'PDO::pgsqlCopyToArray' => ['array', 'table_name'=>'string', 'delimiter'=>'string', 'null_as'=>'string', 'fields'=>'string'],
'PDO::pgsqlCopyToFile' => ['bool', 'table_name'=>'string', 'filename'=>'string', 'delimiter'=>'string', 'null_as'=>'string', 'fields'=>'string'],
'PDO::pgsqlGetNotify' => ['array{message:string,pid:int,payload?:string}|false', 'result_type='=>'PDO::FETCH_*', 'ms_timeout='=>'int'],
'PDO::pgsqlGetPid' => ['int'],
'PDO::pgsqlLOBCreate' => ['string'],
'PDO::pgsqlLOBOpen' => ['resource', 'oid'=>'string', 'mode='=>'string'],
'PDO::pgsqlLOBUnlink' => ['bool', 'oid'=>'string'],
'PDO::prepare' => ['PDOStatement|false', 'statement'=>'string', 'options='=>'array'],
'PDO::query' => ['PDOStatement|false', 'sql'=>'string'],
'PDO::query\'1' => ['PDOStatement|false', 'sql'=>'string', 'fetch_column'=>'int', 'colno='=>'int'],
'PDO::query\'2' => ['PDOStatement|false', 'sql'=>'string', 'fetch_class'=>'int', 'classname'=>'string', 'ctorargs'=>'array'],
'PDO::query\'3' => ['PDOStatement|false', 'sql'=>'string', 'fetch_into'=>'int', 'object'=>'object'],
'PDO::quote' => ['string|false', 'string'=>'string', 'paramtype='=>'int'],
'PDO::rollBack' => ['bool'],
'PDO::setAttribute' => ['bool', 'attribute'=>'int', 'value'=>''],
'PDO::sqliteCreateAggregate' => ['bool', 'function_name'=>'string', 'step_func'=>'callable', 'finalize_func'=>'callable', 'num_args='=>'int'],
'PDO::sqliteCreateCollation' => ['bool', 'name'=>'string', 'callback'=>'callable'],
'PDO::sqliteCreateFunction' => ['bool', 'function_name'=>'string', 'callback'=>'callable', 'num_args='=>'int'],
'pdo_drivers' => ['array'],
'PDOException::getCode' => ['string'],
'PDOException::getFile' => ['string'],
'PDOException::getLine' => ['int'],
'PDOException::getMessage' => ['string'],
'PDOException::getPrevious' => ['?Throwable'],
'PDOException::getTrace' => ['list<array<string,mixed>>'],
'PDOException::getTraceAsString' => ['string'],
'PDOStatement::__sleep' => ['list<string>'],
'PDOStatement::__wakeup' => ['void'],
'PDOStatement::bindColumn' => ['bool', 'column'=>'mixed', '&rw_var'=>'mixed', 'type='=>'int', 'maxLength='=>'int', 'driverOptions='=>'mixed'],
'PDOStatement::bindParam' => ['bool', 'param,'=>'string|int', '&rw_var'=>'mixed', 'type='=>'int', 'maxLength='=>'int', 'driverOptions='=>'mixed'],
'PDOStatement::bindValue' => ['bool', 'param'=>'string|int', 'value'=>'mixed', 'type='=>'int'],
'PDOStatement::closeCursor' => ['bool'],
'PDOStatement::columnCount' => ['int'],
'PDOStatement::debugDumpParams' => ['bool|null'],
'PDOStatement::errorCode' => ['string|null'],
'PDOStatement::errorInfo' => ['array{0: ?string, 1: ?int, 2: ?string, 3?: mixed, 4?: mixed}'],
'PDOStatement::execute' => ['bool', 'params='=>'?array'],
'PDOStatement::fetch' => ['mixed', 'mode='=>'int', 'cursorOrientation='=>'int', 'cursorOffset='=>'int'],
'PDOStatement::fetchAll' => ['array|false', 'mode='=>'int', '...args='=>'mixed'],
'PDOStatement::fetchColumn' => ['mixed', 'column='=>'int'],
'PDOStatement::fetchObject' => ['object|false', 'class='=>'?string', 'ctorArgs='=>'?array'],
'PDOStatement::getAttribute' => ['mixed', 'attribute'=>'int'],
'PDOStatement::getColumnMeta' => ['array|false', 'column'=>'int'],
'PDOStatement::nextRowset' => ['bool'],
'PDOStatement::rowCount' => ['int'],
'PDOStatement::setAttribute' => ['bool', 'attribute'=>'int', 'value'=>'mixed'],
'PDOStatement::setFetchMode' => ['bool', 'mode'=>'int', '...args='=> 'mixed'],
'pfsockopen' => ['resource|false', 'hostname'=>'string', 'port='=>'int', '&w_error_code='=>'int', '&w_error_message='=>'string', 'timeout='=>'float'],
'pg_affected_rows' => ['int', 'result'=>'\PgSql\Result'],
'pg_cancel_query' => ['bool', 'connection'=>'\PgSql\Connection'],
'pg_client_encoding' => ['string', 'connection='=>'\PgSql\Connection'],
'pg_close' => ['bool', 'connection='=>'\PgSql\Connection'],
'pg_connect' => ['\PgSql\Connection|false', 'connection_string'=>'string', 'flags='=>'int'],
'pg_connect_poll' => ['int', 'connection'=>'\PgSql\Connection'],
'pg_connection_busy' => ['bool', 'connection'=>'\PgSql\Connection'],
'pg_connection_reset' => ['bool', 'connection'=>'\PgSql\Connection'],
'pg_connection_status' => ['int', 'connection'=>'\PgSql\Connection'],
'pg_consume_input' => ['bool', 'connection'=>'\PgSql\Connection'],
'pg_convert' => ['array|false', 'connection'=>'\PgSql\Connection', 'table_name'=>'string', 'values'=>'array', 'flags='=>'int'],
'pg_copy_from' => ['bool', 'connection'=>'\PgSql\Connection', 'table_name'=>'string', 'rows'=>'array', 'separator='=>'string', 'null_as='=>'string'],
'pg_copy_to' => ['array|false', 'connection'=>'\PgSql\Connection', 'table_name'=>'string', 'separator='=>'string', 'null_as='=>'string'],
'pg_dbname' => ['string', 'connection='=>'\PgSql\Connection'],
'pg_delete' => ['string|bool', 'connection'=>'\PgSql\Connection', 'table_name'=>'string', 'conditions'=>'array', 'flags='=>'int'],
'pg_end_copy' => ['bool', 'connection='=>'\PgSql\Connection'],
'pg_escape_bytea' => ['string', 'connection'=>'\PgSql\Connection', 'string'=>'string'],
'pg_escape_bytea\'1' => ['string', 'connection'=>'string'],
'pg_escape_identifier' => ['string|false', 'connection'=>'\PgSql\Connection', 'string'=>'string'],
'pg_escape_identifier\'1' => ['string|false', 'connection'=>'string'],
'pg_escape_literal' => ['string|false', 'connection'=>'\PgSql\Connection', 'string'=>'string'],
'pg_escape_literal\'1' => ['string|false', 'connection'=>'string'],
'pg_escape_string' => ['string', 'connection'=>'\PgSql\Connection', 'string'=>'string'],
'pg_escape_string\'1' => ['string', 'connection'=>'string'],
'pg_exec' => ['\PgSql\Result|false', 'connection'=>'\PgSql\Connection', 'query'=>'string'],
'pg_execute' => ['\PgSql\Result|false', 'connection'=>'\PgSql\Connection', 'statement_name'=>'string', 'params'=>'array'],
'pg_execute\'1' => ['\PgSql\Result|false', 'connection'=>'string', 'statement_name'=>'array'],
'pg_fetch_all' => ['array<array>', 'result'=>'\PgSql\Result', 'result_type='=>'int'],
'pg_fetch_all_columns' => ['array', 'result'=>'\PgSql\Result', 'field='=>'int'],
'pg_fetch_array' => ['array<string|null>|false', 'result'=>'\PgSql\Result', 'row='=>'?int', 'mode='=>'int'],
'pg_fetch_assoc' => ['array<string, mixed>|false', 'result'=>'\PgSql\Result', 'row='=>'?int'],
'pg_fetch_object' => ['object|false', 'result'=>'\PgSql\Result', 'row='=>'?int', 'class='=>'string', 'constructor_args='=>'array'],
'pg_fetch_result' => ['string|false|null', 'result'=>'\PgSql\Result', 'row'=>'string|int'],
'pg_fetch_result\'1' => ['string|false|null', 'result'=>'\PgSql\Result', 'row'=>'?int', 'field'=>'string|int'],
'pg_fetch_row' => ['array|false', 'result'=>'\PgSql\Result', 'row='=>'?int', 'mode='=>'int'],
'pg_field_is_null' => ['int|false', 'result'=>'\PgSql\Result', 'row'=>'string|int'],
'pg_field_is_null\'1' => ['int|false', 'result'=>'\PgSql\Result', 'row'=>'int', 'field'=>'string|int'],
'pg_field_name' => ['string', 'result'=>'\PgSql\Result', 'field'=>'int'],
'pg_field_num' => ['int', 'result'=>'\PgSql\Result', 'field'=>'string'],
'pg_field_prtlen' => ['int|false', 'result'=>'\PgSql\Result', 'row'=>'string|int'],
'pg_field_prtlen\'1' => ['int|false', 'result'=>'\PgSql\Result', 'row'=>'int', 'field'=>'string|int'],
'pg_field_size' => ['int', 'result'=>'\PgSql\Result', 'field'=>'int'],
'pg_field_table' => ['string|int|false', 'result'=>'\PgSql\Result', 'field'=>'int', 'oid_only='=>'bool'],
'pg_field_type' => ['string', 'result'=>'\PgSql\Result', 'field'=>'int'],
'pg_field_type_oid' => ['int|string', 'result'=>'\PgSql\Result', 'field'=>'int'],
'pg_flush' => ['int|bool', 'connection'=>'\PgSql\Connection'],
'pg_free_result' => ['bool', 'result'=>'\PgSql\Result'],
'pg_get_notify' => ['array|false', 'result'=>'\PgSql\Result', 'mode='=>'int'],
'pg_get_pid' => ['int', 'connection'=>'\PgSql\Connection'],
'pg_get_result' => ['\PgSql\Result|false', 'connection='=>'\PgSql\Connection'],
'pg_host' => ['string', 'connection='=>'\PgSql\Connection'],
'pg_insert' => ['\PgSql\Result|string|false', 'connection'=>'\PgSql\Connection', 'table_name'=>'string', 'values'=>'array', 'flags='=>'int'],
'pg_last_error' => ['string', 'connection='=>'\PgSql\Connection', 'operation='=>'int'],
'pg_last_notice' => ['string|array|bool', 'connection'=>'\PgSql\Connection', 'mode='=>'int'],
'pg_last_oid' => ['string|int|false', 'result'=>'\PgSql\Result'],
'pg_lo_close' => ['bool', 'lob'=>'\PgSql\Lob'],
'pg_lo_create' => ['int|string|false', 'connection='=>'\PgSql\Connection', 'oid='=>'int|string'],
'pg_lo_export' => ['bool', 'connection'=>'\PgSql\Connection', 'oid'=>'int|string', 'filename'=>'string'],
'pg_lo_export\'1' => ['bool', 'connection'=>'int|string', 'oid'=>'string'],
'pg_lo_import' => ['int|string|false', 'connection'=>'\PgSql\Connection', 'filename'=>'string', 'oid'=>'string|int'],
'pg_lo_import\'1' => ['int|string|false', 'connection'=>'string', 'filename'=>'string|int'],
'pg_lo_open' => ['\PgSql\Lob|false', 'connection'=>'\PgSql\Connection', 'oid'=>'int|string', 'mode'=>'string'],
'pg_lo_open\'1' => ['\PgSql\Lob|false', 'connection'=>'int|string', 'oid'=>'string'],
'pg_lo_read' => ['string|false', 'lob'=>'\PgSql\Lob', 'length='=>'int'],
'pg_lo_read_all' => ['int', 'lob'=>'\PgSql\Lob'],
'pg_lo_seek' => ['bool', 'lob'=>'\PgSql\Lob', 'offset'=>'int', 'whence='=>'int'],
'pg_lo_tell' => ['int', 'lob'=>'\PgSql\Lob'],
'pg_lo_truncate' => ['bool', 'lob'=>'\PgSql\Lob', 'size'=>'int'],
'pg_lo_unlink' => ['bool', 'connection'=>'\PgSql\Connection', 'oid'=>'int|string'],
'pg_lo_unlink\'1' => ['bool', 'connection'=>'int|string'],
'pg_lo_write' => ['int|false', 'lob'=>'\PgSql\Lob', 'data'=>'string', 'length='=>'int'],
'pg_meta_data' => ['array|false', 'connection'=>'\PgSql\Connection', 'table_name'=>'string', 'extended='=>'bool'],
'pg_num_fields' => ['int', 'result'=>'\PgSql\Result'],
'pg_num_rows' => ['int', 'result'=>'\PgSql\Result'],
'pg_options' => ['string', 'connection='=>'\PgSql\Connection'],
'pg_parameter_status' => ['string|false', 'connection'=>'\PgSql\Connection', 'name'=>'string'],
'pg_parameter_status\'1' => ['string|false', 'connection'=>'string'],
'pg_pconnect' => ['\PgSql\Connection|false', 'connection_string'=>'string', 'flags='=>'string', 'port='=>'string|int', 'options='=>'string', 'tty='=>'string', 'database='=>'string'],
'pg_ping' => ['bool', 'connection='=>'\PgSql\Connection'],
'pg_port' => ['int', 'connection='=>'\PgSql\Connection'],
'pg_prepare' => ['\PgSql\Result|false', 'connection'=>'\PgSql\Connection', 'statement_name'=>'string', 'query'=>'string'],
'pg_prepare\'1' => ['\PgSql\Result|false', 'connection'=>'string', 'statement_name'=>'string'],
'pg_put_line' => ['bool', 'connection'=>'\PgSql\Connection', 'data'=>'string'],
'pg_put_line\'1' => ['bool', 'connection'=>'string'],
'pg_query' => ['\PgSql\Result|false', 'connection'=>'\PgSql\Connection', 'query'=>'string'],
'pg_query\'1' => ['\PgSql\Result|false', 'connection'=>'string'],
'pg_query_params' => ['\PgSql\Result|false', 'connection'=>'\PgSql\Connection', 'query'=>'string', 'params'=>'array'],
'pg_query_params\'1' => ['\PgSql\Result|false', 'connection'=>'string', 'query'=>'array'],
'pg_result_error' => ['string|false', 'result'=>'\PgSql\Result'],
'pg_result_error_field' => ['string|false|null', 'result'=>'\PgSql\Result', 'field_code'=>'int'],
'pg_result_seek' => ['bool', 'result'=>'\PgSql\Result', 'row'=>'int'],
'pg_result_status' => ['string|int', 'result'=>'\PgSql\Result', 'mode='=>'int'],
'pg_select' => ['string|array|false', 'connection'=>'\PgSql\Connection', 'table_name'=>'string', 'assoc_array'=>'array', 'options='=>'int', 'result_type='=>'int'],
'pg_send_execute' => ['bool|int', 'connection'=>'\PgSql\Connection', 'query'=>'string', 'params'=>'array'],
'pg_send_prepare' => ['bool|int', 'connection'=>'\PgSql\Connection', 'statement_name'=>'string', 'query'=>'string'],
'pg_send_query' => ['bool|int', 'connection'=>'\PgSql\Connection', 'query'=>'string'],
'pg_send_query_params' => ['bool|int', 'connection'=>'\PgSql\Connection', 'query'=>'string', 'params'=>'array'],
'pg_set_client_encoding' => ['int', 'connection'=>'\PgSql\Connection', 'encoding'=>'string'],
'pg_set_client_encoding\'1' => ['int', 'connection'=>'string'],
'pg_set_error_verbosity' => ['int|false', 'connection'=>'\PgSql\Connection', 'verbosity'=>'int'],
'pg_set_error_verbosity\'1' => ['int|false', 'connection'=>'int'],
'pg_socket' => ['resource|false', 'connection'=>'\PgSql\Connection'],
'pg_trace' => ['bool', 'filename'=>'string', 'mode='=>'string', 'connection='=>'\PgSql\Connection'],
'pg_transaction_status' => ['int', 'connection'=>'\PgSql\Connection'],
'pg_tty' => ['string', 'connection='=>'\PgSql\Connection'],
'pg_unescape_bytea' => ['string', 'string'=>'string'],
'pg_untrace' => ['bool', 'connection='=>'\PgSql\Connection'],
'pg_update' => ['string|bool', 'connection'=>'\PgSql\Connection', 'table_name'=>'string', 'values'=>'array', 'conditions'=>'array', 'flags='=>'int'],
'pg_version' => ['array', 'connection='=>'\PgSql\Connection'],
'Phar::__construct' => ['void', 'fname'=>'string', 'flags='=>'int', 'alias='=>'string'],
'Phar::addEmptyDir' => ['void', 'dirname'=>'string'],
'Phar::addFile' => ['void', 'file'=>'string', 'localname='=>'string'],
'Phar::addFromString' => ['void', 'localname'=>'string', 'contents'=>'string'],
'Phar::apiVersion' => ['string'],
'Phar::buildFromDirectory' => ['array', 'base_dir'=>'string', 'regex='=>'string'],
'Phar::buildFromIterator' => ['array', 'iter'=>'Iterator', 'base_directory='=>'string'],
'Phar::canCompress' => ['bool', 'method='=>'int'],
'Phar::canWrite' => ['bool'],
'Phar::compress' => ['Phar', 'compression'=>'int', 'extension='=>'string'],
'Phar::compressAllFilesBZIP2' => ['bool'],
'Phar::compressAllFilesGZ' => ['bool'],
'Phar::compressFiles' => ['void', 'compression'=>'int'],
'Phar::convertToData' => ['PharData', 'format='=>'int', 'compression='=>'int', 'extension='=>'string'],
'Phar::convertToExecutable' => ['Phar', 'format='=>'int', 'compression='=>'int', 'extension='=>'string'],
'Phar::copy' => ['bool', 'oldfile'=>'string', 'newfile'=>'string'],
'Phar::count' => ['int'],
'Phar::createDefaultStub' => ['string', 'indexfile='=>'string', 'webindexfile='=>'string'],
'Phar::decompress' => ['Phar', 'extension='=>'string'],
'Phar::decompressFiles' => ['bool'],
'Phar::delete' => ['bool', 'entry'=>'string'],
'Phar::delMetadata' => ['bool'],
'Phar::extractTo' => ['bool', 'pathto'=>'string', 'files='=>'string|array|null', 'overwrite='=>'bool'],
'Phar::getAlias' => ['string'],
'Phar::getMetadata' => ['mixed'],
'Phar::getModified' => ['bool'],
'Phar::getPath' => ['string'],
'Phar::getSignature' => ['array{hash:string, hash_type:string}'],
'Phar::getStub' => ['string'],
'Phar::getSupportedCompression' => ['array'],
'Phar::getSupportedSignatures' => ['array'],
'Phar::getVersion' => ['string'],
'Phar::hasMetadata' => ['bool'],
'Phar::interceptFileFuncs' => ['void'],
'Phar::isBuffering' => ['bool'],
'Phar::isCompressed' => ['mixed|false'],
'Phar::isFileFormat' => ['bool', 'format'=>'int'],
'Phar::isValidPharFilename' => ['bool', 'filename'=>'string', 'executable='=>'bool'],
'Phar::isWritable' => ['bool'],
'Phar::loadPhar' => ['bool', 'filename'=>'string', 'alias='=>'string'],
'Phar::mapPhar' => ['bool', 'alias='=>'string', 'dataoffset='=>'int'],
'Phar::mount' => ['void', 'pharpath'=>'string', 'externalpath'=>'string'],
'Phar::mungServer' => ['void', 'munglist'=>'array'],
'Phar::offsetExists' => ['bool', 'offset'=>'string'],
'Phar::offsetGet' => ['PharFileInfo', 'offset'=>'string'],
'Phar::offsetSet' => ['void', 'offset'=>'string', 'value'=>'string'],
'Phar::offsetUnset' => ['bool', 'offset'=>'string'],
'Phar::running' => ['string', 'retphar='=>'bool'],
'Phar::setAlias' => ['bool', 'alias'=>'string'],
'Phar::setDefaultStub' => ['bool', 'index='=>'string', 'webindex='=>'string'],
'Phar::setMetadata' => ['void', 'metadata'=>''],
'Phar::setSignatureAlgorithm' => ['void', 'sigtype'=>'int', 'privatekey='=>'string'],
'Phar::setStub' => ['bool', 'stub'=>'string', 'length='=>'int'],
'Phar::startBuffering' => ['void'],
'Phar::stopBuffering' => ['void'],
'Phar::uncompressAllFiles' => ['bool'],
'Phar::unlinkArchive' => ['bool', 'archive'=>'string'],
'Phar::webPhar' => ['', 'alias='=>'string', 'index='=>'string', 'f404='=>'string', 'mimetypes='=>'array', 'rewrites='=>'array'],
'PharData::__construct' => ['void', 'fname'=>'string', 'flags='=>'?int', 'alias='=>'?string', 'format='=>'int'],
'PharData::addEmptyDir' => ['bool', 'dirname'=>'string'],
'PharData::addFile' => ['void', 'file'=>'string', 'localname='=>'string'],
'PharData::addFromString' => ['bool', 'localname'=>'string', 'contents'=>'string'],
'PharData::buildFromDirectory' => ['array', 'base_dir'=>'string', 'regex='=>'string'],
'PharData::buildFromIterator' => ['array', 'iter'=>'Iterator', 'base_directory='=>'string'],
'PharData::compress' => ['PharData', 'compression'=>'int', 'extension='=>'string'],
'PharData::compressFiles' => ['bool', 'compression'=>'int'],
'PharData::convertToData' => ['PharData', 'format='=>'int', 'compression='=>'int', 'extension='=>'string'],
'PharData::convertToExecutable' => ['Phar', 'format='=>'int', 'compression='=>'int', 'extension='=>'string'],
'PharData::copy' => ['bool', 'oldfile'=>'string', 'newfile'=>'string'],
'PharData::decompress' => ['PharData', 'extension='=>'string'],
'PharData::decompressFiles' => ['bool'],
'PharData::delete' => ['bool', 'entry'=>'string'],
'PharData::delMetadata' => ['bool'],
'PharData::extractTo' => ['bool', 'pathto'=>'string', 'files='=>'string|array|null', 'overwrite='=>'bool'],
'PharData::isWritable' => ['bool'],
'PharData::offsetExists' => ['bool', 'offset'=>'string'],
'PharData::offsetGet' => ['PharFileInfo', 'offset'=>'string'],
'PharData::offsetSet' => ['void', 'offset'=>'string', 'value'=>'string'],
'PharData::offsetUnset' => ['bool', 'offset'=>'string'],
'PharData::setAlias' => ['bool', 'alias'=>'string'],
'PharData::setDefaultStub' => ['bool', 'index='=>'string', 'webindex='=>'string'],
'phardata::setMetadata' => ['void', 'metadata'=>'mixed'],
'phardata::setSignatureAlgorithm' => ['void', 'sigtype'=>'int'],
'PharData::setStub' => ['bool', 'stub'=>'string', 'length='=>'int'],
'PharFileInfo::__construct' => ['void', 'entry'=>'string'],
'PharFileInfo::chmod' => ['void', 'permissions'=>'int'],
'PharFileInfo::compress' => ['bool', 'compression'=>'int'],
'PharFileInfo::decompress' => ['bool'],
'PharFileInfo::delMetadata' => ['bool'],
'PharFileInfo::getCompressedSize' => ['int'],
'PharFileInfo::getContent' => ['string'],
'PharFileInfo::getCRC32' => ['int'],
'PharFileInfo::getMetadata' => ['mixed'],
'PharFileInfo::getPharFlags' => ['int'],
'PharFileInfo::hasMetadata' => ['bool'],
'PharFileInfo::isCompressed' => ['bool', 'compression_type='=>'int'],
'PharFileInfo::isCompressedBZIP2' => ['bool'],
'PharFileInfo::isCompressedGZ' => ['bool'],
'PharFileInfo::isCRCChecked' => ['bool'],
'PharFileInfo::setCompressedBZIP2' => ['bool'],
'PharFileInfo::setCompressedGZ' => ['bool'],
'PharFileInfo::setMetadata' => ['void', 'metadata'=>'mixed'],
'PharFileInfo::setUncompressed' => ['bool'],
'phdfs::__construct' => ['void', 'ip'=>'string', 'port'=>'string'],
'phdfs::__destruct' => ['void'],
'phdfs::connect' => ['bool'],
'phdfs::copy' => ['bool', 'source_file'=>'string', 'destination_file'=>'string'],
'phdfs::create_directory' => ['bool', 'path'=>'string'],
'phdfs::delete' => ['bool', 'path'=>'string'],
'phdfs::disconnect' => ['bool'],
'phdfs::exists' => ['bool', 'path'=>'string'],
'phdfs::file_info' => ['array', 'path'=>'string'],
'phdfs::list_directory' => ['array', 'path'=>'string'],
'phdfs::read' => ['string', 'path'=>'string', 'length='=>'string'],
'phdfs::rename' => ['bool', 'old_path'=>'string', 'new_path'=>'string'],
'phdfs::tell' => ['int', 'path'=>'string'],
'phdfs::write' => ['bool', 'path'=>'string', 'buffer'=>'string', 'mode='=>'string'],
'php_check_syntax' => ['bool', 'filename'=>'string', 'error_message='=>'string'],
'php_ini_loaded_file' => ['string|false'],
'php_ini_scanned_files' => ['string|false'],
'php_logo_guid' => ['string'],
'php_sapi_name' => ['string'],
'php_strip_whitespace' => ['string', 'filename'=>'string'],
'php_uname' => ['string', 'mode='=>'string'],
'php_user_filter::filter' => ['int', 'in'=>'resource', 'out'=>'resource', '&rw_consumed'=>'int', 'closing'=>'bool'],
'php_user_filter::onClose' => ['void'],
'php_user_filter::onCreate' => ['bool'],
'phpcredits' => ['bool', 'flags='=>'int'],
'phpdbg_break_file' => ['void', 'file'=>'string', 'line'=>'int'],
'phpdbg_break_function' => ['void', 'function'=>'string'],
'phpdbg_break_method' => ['void', 'class'=>'string', 'method'=>'string'],
'phpdbg_break_next' => ['void'],
'phpdbg_clear' => ['void'],
'phpdbg_color' => ['void', 'element'=>'int', 'color'=>'string'],
'phpdbg_end_oplog' => ['array', 'options='=>'array'],
'phpdbg_exec' => ['mixed', 'context='=>'string'],
'phpdbg_get_executable' => ['array', 'options='=>'array'],
'phpdbg_prompt' => ['void', 'string'=>'string'],
'phpdbg_start_oplog' => ['void'],
'phpinfo' => ['bool', 'flags='=>'int'],
'PhpToken::tokenize' => ['list<PhpToken>', 'code'=>'string', 'flags='=>'int'],
'PhpToken::is' => ['bool', 'kind'=>'string|int|string[]|int[]'],
'PhpToken::isIgnorable' => ['bool'],
'PhpToken::getTokenName' => ['string'],
'phpversion' => ['string|false', 'extension='=>'string'],
'pht\AtomicInteger::__construct' => ['void', 'value='=>'int'],
'pht\AtomicInteger::dec' => ['void'],
'pht\AtomicInteger::get' => ['int'],
'pht\AtomicInteger::inc' => ['void'],
'pht\AtomicInteger::lock' => ['void'],
'pht\AtomicInteger::set' => ['void', 'value'=>'int'],
'pht\AtomicInteger::unlock' => ['void'],
'pht\HashTable::lock' => ['void'],
'pht\HashTable::size' => ['int'],
'pht\HashTable::unlock' => ['void'],
'pht\Queue::front' => ['mixed'],
'pht\Queue::lock' => ['void'],
'pht\Queue::pop' => ['mixed'],
'pht\Queue::push' => ['void', 'value'=>'mixed'],
'pht\Queue::size' => ['int'],
'pht\Queue::unlock' => ['void'],
'pht\Runnable::run' => ['void'],
'pht\thread::addClassTask' => ['void', 'className'=>'string', '...ctorArgs='=>'mixed'],
'pht\thread::addFileTask' => ['void', 'fileName'=>'string', '...globals='=>'mixed'],
'pht\thread::addFunctionTask' => ['void', 'func'=>'callable', '...funcArgs='=>'mixed'],
'pht\thread::join' => ['void'],
'pht\thread::start' => ['void'],
'pht\thread::taskCount' => ['int'],
'pht\threaded::lock' => ['void'],
'pht\threaded::unlock' => ['void'],
'pht\Vector::__construct' => ['void', 'size='=>'int', 'value='=>'mixed'],
'pht\Vector::deleteAt' => ['void', 'offset'=>'int'],
'pht\Vector::insertAt' => ['void', 'value'=>'mixed', 'offset'=>'int'],
'pht\Vector::lock' => ['void'],
'pht\Vector::pop' => ['mixed'],
'pht\Vector::push' => ['void', 'value'=>'mixed'],
'pht\Vector::resize' => ['void', 'size'=>'int', 'value='=>'mixed'],
'pht\Vector::shift' => ['mixed'],
'pht\Vector::size' => ['int'],
'pht\Vector::unlock' => ['void'],
'pht\Vector::unshift' => ['void', 'value'=>'mixed'],
'pht\Vector::updateAt' => ['void', 'value'=>'mixed', 'offset'=>'int'],
'pi' => ['float'],
'pointObj::__construct' => ['void'],
'pointObj::distanceToLine' => ['float', 'p1'=>'pointObj', 'p2'=>'pointObj'],
'pointObj::distanceToPoint' => ['float', 'poPoint'=>'pointObj'],
'pointObj::distanceToShape' => ['float', 'shape'=>'shapeObj'],
'pointObj::draw' => ['int', 'map'=>'mapObj', 'layer'=>'layerObj', 'img'=>'imageObj', 'class_index'=>'int', 'text'=>'string'],
'pointObj::ms_newPointObj' => ['pointObj'],
'pointObj::project' => ['int', 'in'=>'projectionObj', 'out'=>'projectionObj'],
'pointObj::setXY' => ['int', 'x'=>'float', 'y'=>'float', 'm'=>'float'],
'pointObj::setXYZ' => ['int', 'x'=>'float', 'y'=>'float', 'z'=>'float', 'm'=>'float'],
'Pool::__construct' => ['void', 'size'=>'int', 'class'=>'string', 'ctor='=>'array'],
'Pool::collect' => ['int', 'collector='=>'Callable'],
'Pool::resize' => ['void', 'size'=>'int'],
'Pool::shutdown' => ['void'],
'Pool::submit' => ['int', 'task'=>'Threaded'],
'Pool::submitTo' => ['int', 'worker'=>'int', 'task'=>'Threaded'],
'popen' => ['resource|false', 'command'=>'string', 'mode'=>'string'],
'pos' => ['mixed', 'array'=>'array'],
'posix_access' => ['bool', 'filename'=>'string', 'flags='=>'int'],
'posix_ctermid' => ['string|false'],
'posix_errno' => ['int'],
'posix_get_last_error' => ['int'],
'posix_getcwd' => ['string|false'],
'posix_getegid' => ['int'],
'posix_geteuid' => ['int'],
'posix_getgid' => ['int'],
'posix_getgrgid' => ['array{name: string, passwd: string, gid: int, members: list<string>}|false', 'group_id'=>'int'],
'posix_getgrnam' => ['array{name: string, passwd: string, gid: int, members: list<string>}|false', 'name'=>'string'],
'posix_getgroups' => ['list<int>|false'],
'posix_getlogin' => ['string|false'],
'posix_getpgid' => ['int|false', 'process_id'=>'int'],
'posix_getpgrp' => ['int'],
'posix_getpid' => ['int'],
'posix_getppid' => ['int'],
'posix_getpwnam' => ['array{name: string, passwd: string, uid: int, gid: int, gecos: string, dir: string, shell: string}|false', 'username'=>'string'],
'posix_getpwuid' => ['array{name: string, passwd: string, uid: int, gid: int, gecos: string, dir: string, shell: string}|false', 'user_id'=>'int'],
'posix_getrlimit' => ['array{"soft core": string, "hard core": string, "soft data": string, "hard data": string, "soft stack": integer, "hard stack": string, "soft totalmem": string, "hard totalmem": string, "soft rss": string, "hard rss": string, "soft maxproc": integer, "hard maxproc": integer, "soft memlock": integer, "hard memlock": integer, "soft cpu": string, "hard cpu": string, "soft filesize": string, "hard filesize": string, "soft openfiles": integer, "hard openfiles": integer}|false'],
'posix_getsid' => ['int|false', 'process_id'=>'int'],
'posix_getuid' => ['int'],
'posix_initgroups' => ['bool', 'username'=>'string', 'group_id'=>'int'],
'posix_isatty' => ['bool', 'file_descriptor'=>'resource|int'],
'posix_kill' => ['bool', 'process_id'=>'int', 'signal'=>'int'],
'posix_mkfifo' => ['bool', 'filename'=>'string', 'permissions'=>'int'],
'posix_mknod' => ['bool', 'filename'=>'string', 'flags'=>'int', 'major='=>'int', 'minor='=>'int'],
'posix_setegid' => ['bool', 'group_id'=>'int'],
'posix_seteuid' => ['bool', 'user_id'=>'int'],
'posix_setgid' => ['bool', 'group_id'=>'int'],
'posix_setpgid' => ['bool', 'process_id'=>'int', 'process_group_id'=>'int'],
'posix_setrlimit' => ['bool', 'resource'=>'int', 'soft_limit'=>'int', 'hard_limit'=>'int'],
'posix_setsid' => ['int'],
'posix_setuid' => ['bool', 'user_id'=>'int'],
'posix_strerror' => ['string', 'error_code'=>'int'],
'posix_times' => ['array{ticks: int, utime: int, stime: int, cutime: int, cstime: int}|false'],
'posix_ttyname' => ['string|false', 'file_descriptor'=>'resource|int'],
'posix_uname' => ['array{sysname: string, nodename: string, release: string, version: string, machine: string, domainname: string}|false'],
'Postal\Expand::expand_address' => ['string[]', 'address'=>'string', 'options='=>'array<string, mixed>'],
'Postal\Parser::parse_address' => ['array<string,string>', 'address'=>'string', 'options='=>'array<string, string>'],
'pow' => ['float|int', 'num'=>'int|float', 'exponent'=>'int|float'],
'preg_filter' => ['null|string|string[]', 'pattern'=>'mixed', 'replacement'=>'mixed', 'subject'=>'mixed', 'limit='=>'int', '&w_count='=>'int'],
'preg_grep' => ['array|false', 'pattern'=>'string', 'array'=>'array', 'flags='=>'int'],
'preg_last_error' => ['int'],
'preg_match' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_matches='=>'string[]', 'flags='=>'0|', 'offset='=>'int'],
'preg_match\'1' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_matches='=>'array', 'flags='=>'int', 'offset='=>'int'],
'preg_match_all' => ['int|false', 'pattern'=>'string', 'subject'=>'string', '&w_matches='=>'array', 'flags='=>'int', 'offset='=>'int'],
'preg_quote' => ['string', 'str'=>'string', 'delimiter='=>'string'],
'preg_replace' => ['string|string[]|null', 'pattern'=>'string|array', 'replacement'=>'string|array', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'],
'preg_replace_callback' => ['string|null', 'pattern'=>'string|array', 'callback'=>'callable(string[]):string', 'subject'=>'string', 'limit='=>'int', '&w_count='=>'int'],
'preg_replace_callback\'1' => ['string[]|null', 'pattern'=>'string|array', 'callback'=>'callable(string[]):string', 'subject'=>'string[]', 'limit='=>'int', '&w_count='=>'int'],
'preg_replace_callback_array' => ['string|string[]|null', 'pattern'=>'array<string,callable(array):string>', 'subject'=>'string|array', 'limit='=>'int', '&w_count='=>'int'],
'preg_split' => ['list<string>|false', 'pattern'=>'string', 'subject'=>'string', 'limit'=>'int', 'flags='=>'null'],
'preg_split\'1' => ['list<string>|list<list<string|int>>|false', 'pattern'=>'string', 'subject'=>'string', 'limit='=>'int', 'flags='=>'int'],
'prev' => ['mixed', '&r_array'=>'array|object'],
'print' => ['int', 'arg'=>'string'],
'print_r' => ['string', 'value'=>'mixed'],
'print_r\'1' => ['true', 'value'=>'mixed', 'return='=>'bool'],
'printf' => ['int', 'format'=>'string', '...values='=>'string|int|float'],
'proc_close' => ['int', 'process'=>'resource'],
'proc_get_status' => ['array{command: string, pid: int, running: bool, signaled: bool, stopped: bool, exitcode: int, termsig: int, stopsig: int}', 'process'=>'resource'],
'proc_nice' => ['bool', 'priority'=>'int'],
'proc_open' => ['resource|false', 'cmd'=>'string|array', 'descriptorspec'=>'array', '&w_pipes'=>'resource[]', 'cwd='=>'?string', 'env='=>'?array', 'other_options='=>'array'],
'proc_terminate' => ['bool', 'process'=>'resource', 'signal='=>'int'],
'projectionObj::__construct' => ['void', 'projectionString'=>'string'],
'projectionObj::getUnits' => ['int'],
'projectionObj::ms_newProjectionObj' => ['projectionObj', 'projectionString'=>'string'],
'property_exists' => ['bool', 'object_or_class'=>'object|string', 'property'=>'string'],
'ps_add_bookmark' => ['int', 'psdoc'=>'resource', 'text'=>'string', 'parent='=>'int', 'open='=>'int'],
'ps_add_launchlink' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string'],
'ps_add_locallink' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'page'=>'int', 'dest'=>'string'],
'ps_add_note' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'contents'=>'string', 'title'=>'string', 'icon'=>'string', 'open'=>'int'],
'ps_add_pdflink' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'filename'=>'string', 'page'=>'int', 'dest'=>'string'],
'ps_add_weblink' => ['bool', 'psdoc'=>'resource', 'llx'=>'float', 'lly'=>'float', 'urx'=>'float', 'ury'=>'float', 'url'=>'string'],
'ps_arc' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'alpha'=>'float', 'beta'=>'float'],
'ps_arcn' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'radius'=>'float', 'alpha'=>'float', 'beta'=>'float'],
'ps_begin_page' => ['bool', 'psdoc'=>'resource', 'width'=>'float', 'height'=>'float'],
'ps_begin_pattern' => ['int', 'psdoc'=>'resource', 'width'=>'float', 'height'=>'float', 'xstep'=>'float', 'ystep'=>'float', 'painttype'=>'int'],
'ps_begin_template' => ['int', 'psdoc'=>'resource', 'width'=>'float', 'height'=>'float'],
'ps_circle' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'radius'=>'float'],
'ps_clip' => ['bool', 'psdoc'=>'resource'],
'ps_close' => ['bool', 'psdoc'=>'resource'],
'ps_close_image' => ['void', 'psdoc'=>'resource', 'imageid'=>'int'],
'ps_closepath' => ['bool', 'psdoc'=>'resource'],
'ps_closepath_stroke' => ['bool', 'psdoc'=>'resource'],
'ps_continue_text' => ['bool', 'psdoc'=>'resource', 'text'=>'string'],
'ps_curveto' => ['bool', 'psdoc'=>'resource', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'],
'ps_delete' => ['bool', 'psdoc'=>'resource'],
'ps_end_page' => ['bool', 'psdoc'=>'resource'],
'ps_end_pattern' => ['bool', 'psdoc'=>'resource'],
'ps_end_template' => ['bool', 'psdoc'=>'resource'],
'ps_fill' => ['bool', 'psdoc'=>'resource'],
'ps_fill_stroke' => ['bool', 'psdoc'=>'resource'],
'ps_findfont' => ['int', 'psdoc'=>'resource', 'fontname'=>'string', 'encoding'=>'string', 'embed='=>'bool'],
'ps_get_buffer' => ['string', 'psdoc'=>'resource'],
'ps_get_parameter' => ['string', 'psdoc'=>'resource', 'name'=>'string', 'modifier='=>'float'],
'ps_get_value' => ['float', 'psdoc'=>'resource', 'name'=>'string', 'modifier='=>'float'],
'ps_hyphenate' => ['array', 'psdoc'=>'resource', 'text'=>'string'],
'ps_include_file' => ['bool', 'psdoc'=>'resource', 'file'=>'string'],
'ps_lineto' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'],
'ps_makespotcolor' => ['int', 'psdoc'=>'resource', 'name'=>'string', 'reserved='=>'int'],
'ps_moveto' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'],
'ps_new' => ['resource'],
'ps_open_file' => ['bool', 'psdoc'=>'resource', 'filename='=>'string'],
'ps_open_image' => ['int', 'psdoc'=>'resource', 'type'=>'string', 'source'=>'string', 'data'=>'string', 'length'=>'int', 'width'=>'int', 'height'=>'int', 'components'=>'int', 'bpc'=>'int', 'params'=>'string'],
'ps_open_image_file' => ['int', 'psdoc'=>'resource', 'type'=>'string', 'filename'=>'string', 'stringparam='=>'string', 'intparam='=>'int'],
'ps_open_memory_image' => ['int', 'psdoc'=>'resource', 'gd'=>'int'],
'ps_place_image' => ['bool', 'psdoc'=>'resource', 'imageid'=>'int', 'x'=>'float', 'y'=>'float', 'scale'=>'float'],
'ps_rect' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float', 'width'=>'float', 'height'=>'float'],
'ps_restore' => ['bool', 'psdoc'=>'resource'],
'ps_rotate' => ['bool', 'psdoc'=>'resource', 'rot'=>'float'],
'ps_save' => ['bool', 'psdoc'=>'resource'],
'ps_scale' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'],
'ps_set_border_color' => ['bool', 'psdoc'=>'resource', 'red'=>'float', 'green'=>'float', 'blue'=>'float'],
'ps_set_border_dash' => ['bool', 'psdoc'=>'resource', 'black'=>'float', 'white'=>'float'],
'ps_set_border_style' => ['bool', 'psdoc'=>'resource', 'style'=>'string', 'width'=>'float'],
'ps_set_info' => ['bool', 'p'=>'resource', 'key'=>'string', 'value'=>'string'],
'ps_set_parameter' => ['bool', 'psdoc'=>'resource', 'name'=>'string', 'value'=>'string'],
'ps_set_text_pos' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'],
'ps_set_value' => ['bool', 'psdoc'=>'resource', 'name'=>'string', 'value'=>'float'],
'ps_setcolor' => ['bool', 'psdoc'=>'resource', 'type'=>'string', 'colorspace'=>'string', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float'],
'ps_setdash' => ['bool', 'psdoc'=>'resource', 'on'=>'float', 'off'=>'float'],
'ps_setflat' => ['bool', 'psdoc'=>'resource', 'value'=>'float'],
'ps_setfont' => ['bool', 'psdoc'=>'resource', 'fontid'=>'int', 'size'=>'float'],
'ps_setgray' => ['bool', 'psdoc'=>'resource', 'gray'=>'float'],
'ps_setlinecap' => ['bool', 'psdoc'=>'resource', 'type'=>'int'],
'ps_setlinejoin' => ['bool', 'psdoc'=>'resource', 'type'=>'int'],
'ps_setlinewidth' => ['bool', 'psdoc'=>'resource', 'width'=>'float'],
'ps_setmiterlimit' => ['bool', 'psdoc'=>'resource', 'value'=>'float'],
'ps_setoverprintmode' => ['bool', 'psdoc'=>'resource', 'mode'=>'int'],
'ps_setpolydash' => ['bool', 'psdoc'=>'resource', 'arr'=>'float'],
'ps_shading' => ['int', 'psdoc'=>'resource', 'type'=>'string', 'x0'=>'float', 'y0'=>'float', 'x1'=>'float', 'y1'=>'float', 'c1'=>'float', 'c2'=>'float', 'c3'=>'float', 'c4'=>'float', 'optlist'=>'string'],
'ps_shading_pattern' => ['int', 'psdoc'=>'resource', 'shadingid'=>'int', 'optlist'=>'string'],
'ps_shfill' => ['bool', 'psdoc'=>'resource', 'shadingid'=>'int'],
'ps_show' => ['bool', 'psdoc'=>'resource', 'text'=>'string'],
'ps_show2' => ['bool', 'psdoc'=>'resource', 'text'=>'string', 'length'=>'int'],
'ps_show_boxed' => ['int', 'psdoc'=>'resource', 'text'=>'string', 'left'=>'float', 'bottom'=>'float', 'width'=>'float', 'height'=>'float', 'hmode'=>'string', 'feature='=>'string'],
'ps_show_xy' => ['bool', 'psdoc'=>'resource', 'text'=>'string', 'x'=>'float', 'y'=>'float'],
'ps_show_xy2' => ['bool', 'psdoc'=>'resource', 'text'=>'string', 'length'=>'int', 'xcoor'=>'float', 'ycoor'=>'float'],
'ps_string_geometry' => ['array', 'psdoc'=>'resource', 'text'=>'string', 'fontid='=>'int', 'size='=>'float'],
'ps_stringwidth' => ['float', 'psdoc'=>'resource', 'text'=>'string', 'fontid='=>'int', 'size='=>'float'],
'ps_stroke' => ['bool', 'psdoc'=>'resource'],
'ps_symbol' => ['bool', 'psdoc'=>'resource', 'ord'=>'int'],
'ps_symbol_name' => ['string', 'psdoc'=>'resource', 'ord'=>'int', 'fontid='=>'int'],
'ps_symbol_width' => ['float', 'psdoc'=>'resource', 'ord'=>'int', 'fontid='=>'int', 'size='=>'float'],
'ps_translate' => ['bool', 'psdoc'=>'resource', 'x'=>'float', 'y'=>'float'],
'pspell_add_to_personal' => ['bool', 'dictionary'=>'PSpell\Dictionary', 'word'=>'string'],
'pspell_add_to_session' => ['bool', 'dictionary'=>'PSpell\Dictionary', 'word'=>'string'],
'pspell_check' => ['bool', 'dictionary'=>'PSpell\Dictionary', 'word'=>'string'],
'pspell_clear_session' => ['bool', 'dictionary'=>'PSpell\Dictionary'],
'pspell_config_create' => ['int|false', 'language'=>'string', 'spelling='=>'string', 'jargon='=>'string', 'encoding='=>'string'],
'pspell_config_data_dir' => ['bool', 'config'=>'PSpell\Config', 'directory'=>'string'],
'pspell_config_dict_dir' => ['bool', 'config'=>'PSpell\Config', 'directory'=>'string'],
'pspell_config_ignore' => ['bool', 'config'=>'PSpell\Config', 'min_length'=>'int'],
'pspell_config_mode' => ['bool', 'config'=>'PSpell\Config', 'mode'=>'int'],
'pspell_config_personal' => ['bool', 'config'=>'PSpell\Config', 'filename'=>'string'],
'pspell_config_repl' => ['bool', 'config'=>'PSpell\Config', 'filename'=>'string'],
'pspell_config_runtogether' => ['bool', 'config'=>'PSpell\Config', 'allow'=>'bool'],
'pspell_config_save_repl' => ['bool', 'config'=>'PSpell\Config', 'save'=>'bool'],
'pspell_new' => ['int|false', 'language'=>'string', 'spelling='=>'string', 'jargon='=>'string', 'encoding='=>'string', 'mode='=>'int'],
'pspell_new_config' => ['int|false', 'config'=>'PSpell\Config'],
'pspell_new_personal' => ['int|false', 'filename'=>'string', 'language'=>'string', 'spelling='=>'string', 'jargon='=>'string', 'encoding='=>'string', 'mode='=>'int'],
'pspell_save_wordlist' => ['bool', 'dictionary'=>'PSpell\Dictionary'],
'pspell_store_replacement' => ['bool', 'dictionary'=>'PSpell\Dictionary', 'misspelled'=>'string', 'correct'=>'string'],
'pspell_suggest' => ['array', 'dictionary'=>'PSpell\Dictionary', 'word'=>'string'],
'putenv' => ['bool', 'assignment'=>'string'],
'px_close' => ['bool', 'pxdoc'=>'resource'],
'px_create_fp' => ['bool', 'pxdoc'=>'resource', 'file'=>'resource', 'fielddesc'=>'array'],
'px_date2string' => ['string', 'pxdoc'=>'resource', 'value'=>'int', 'format'=>'string'],
'px_delete' => ['bool', 'pxdoc'=>'resource'],
'px_delete_record' => ['bool', 'pxdoc'=>'resource', 'num'=>'int'],
'px_get_field' => ['array', 'pxdoc'=>'resource', 'fieldno'=>'int'],
'px_get_info' => ['array', 'pxdoc'=>'resource'],
'px_get_parameter' => ['string', 'pxdoc'=>'resource', 'name'=>'string'],
'px_get_record' => ['array', 'pxdoc'=>'resource', 'num'=>'int', 'mode='=>'int'],
'px_get_schema' => ['array', 'pxdoc'=>'resource', 'mode='=>'int'],
'px_get_value' => ['float', 'pxdoc'=>'resource', 'name'=>'string'],
'px_insert_record' => ['int', 'pxdoc'=>'resource', 'data'=>'array'],
'px_new' => ['resource'],
'px_numfields' => ['int', 'pxdoc'=>'resource'],
'px_numrecords' => ['int', 'pxdoc'=>'resource'],
'px_open_fp' => ['bool', 'pxdoc'=>'resource', 'file'=>'resource'],
'px_put_record' => ['bool', 'pxdoc'=>'resource', 'record'=>'array', 'recpos='=>'int'],
'px_retrieve_record' => ['array', 'pxdoc'=>'resource', 'num'=>'int', 'mode='=>'int'],
'px_set_blob_file' => ['bool', 'pxdoc'=>'resource', 'filename'=>'string'],
'px_set_parameter' => ['bool', 'pxdoc'=>'resource', 'name'=>'string', 'value'=>'string'],
'px_set_tablename' => ['void', 'pxdoc'=>'resource', 'name'=>'string'],
'px_set_targetencoding' => ['bool', 'pxdoc'=>'resource', 'encoding'=>'string'],
'px_set_value' => ['bool', 'pxdoc'=>'resource', 'name'=>'string', 'value'=>'float'],
'px_timestamp2string' => ['string', 'pxdoc'=>'resource', 'value'=>'float', 'format'=>'string'],
'px_update_record' => ['bool', 'pxdoc'=>'resource', 'data'=>'array', 'num'=>'int'],
'qdom_error' => ['string'],
'qdom_tree' => ['QDomDocument', 'doc'=>'string'],
'querymapObj::convertToString' => ['string'],
'querymapObj::free' => ['void'],
'querymapObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'querymapObj::updateFromString' => ['int', 'snippet'=>'string'],
'QuickHashIntHash::__construct' => ['void', 'size'=>'int', 'options='=>'int'],
'QuickHashIntHash::add' => ['bool', 'key'=>'int', 'value='=>'int'],
'QuickHashIntHash::delete' => ['bool', 'key'=>'int'],
'QuickHashIntHash::exists' => ['bool', 'key'=>'int'],
'QuickHashIntHash::get' => ['int', 'key'=>'int'],
'QuickHashIntHash::getSize' => ['int'],
'QuickHashIntHash::loadFromFile' => ['QuickHashIntHash', 'filename'=>'string', 'options='=>'int'],
'QuickHashIntHash::loadFromString' => ['QuickHashIntHash', 'contents'=>'string', 'options='=>'int'],
'QuickHashIntHash::saveToFile' => ['void', 'filename'=>'string'],
'QuickHashIntHash::saveToString' => ['string'],
'QuickHashIntHash::set' => ['bool', 'key'=>'int', 'value'=>'int'],
'QuickHashIntHash::update' => ['bool', 'key'=>'int', 'value'=>'int'],
'QuickHashIntSet::__construct' => ['void', 'size'=>'int', 'options='=>'int'],
'QuickHashIntSet::add' => ['bool', 'key'=>'int'],
'QuickHashIntSet::delete' => ['bool', 'key'=>'int'],
'QuickHashIntSet::exists' => ['bool', 'key'=>'int'],
'QuickHashIntSet::getSize' => ['int'],
'QuickHashIntSet::loadFromFile' => ['QuickHashIntSet', 'filename'=>'string', 'size='=>'int', 'options='=>'int'],
'QuickHashIntSet::loadFromString' => ['QuickHashIntSet', 'contents'=>'string', 'size='=>'int', 'options='=>'int'],
'QuickHashIntSet::saveToFile' => ['void', 'filename'=>'string'],
'QuickHashIntSet::saveToString' => ['string'],
'QuickHashIntStringHash::__construct' => ['void', 'size'=>'int', 'options='=>'int'],
'QuickHashIntStringHash::add' => ['bool', 'key'=>'int', 'value'=>'string'],
'QuickHashIntStringHash::delete' => ['bool', 'key'=>'int'],
'QuickHashIntStringHash::exists' => ['bool', 'key'=>'int'],
'QuickHashIntStringHash::get' => ['mixed', 'key'=>'int'],
'QuickHashIntStringHash::getSize' => ['int'],
'QuickHashIntStringHash::loadFromFile' => ['QuickHashIntStringHash', 'filename'=>'string', 'size='=>'int', 'options='=>'int'],
'QuickHashIntStringHash::loadFromString' => ['QuickHashIntStringHash', 'contents'=>'string', 'size='=>'int', 'options='=>'int'],
'QuickHashIntStringHash::saveToFile' => ['void', 'filename'=>'string'],
'QuickHashIntStringHash::saveToString' => ['string'],
'QuickHashIntStringHash::set' => ['int', 'key'=>'int', 'value'=>'string'],
'QuickHashIntStringHash::update' => ['bool', 'key'=>'int', 'value'=>'string'],
'QuickHashStringIntHash::__construct' => ['void', 'size'=>'int', 'options='=>'int'],
'QuickHashStringIntHash::add' => ['bool', 'key'=>'string', 'value'=>'int'],
'QuickHashStringIntHash::delete' => ['bool', 'key'=>'string'],
'QuickHashStringIntHash::exists' => ['bool', 'key'=>'string'],
'QuickHashStringIntHash::get' => ['mixed', 'key'=>'string'],
'QuickHashStringIntHash::getSize' => ['int'],
'QuickHashStringIntHash::loadFromFile' => ['QuickHashStringIntHash', 'filename'=>'string', 'size='=>'int', 'options='=>'int'],
'QuickHashStringIntHash::loadFromString' => ['QuickHashStringIntHash', 'contents'=>'string', 'size='=>'int', 'options='=>'int'],
'QuickHashStringIntHash::saveToFile' => ['void', 'filename'=>'string'],
'QuickHashStringIntHash::saveToString' => ['string'],
'QuickHashStringIntHash::set' => ['int', 'key'=>'string', 'value'=>'int'],
'QuickHashStringIntHash::update' => ['bool', 'key'=>'string', 'value'=>'int'],
'quoted_printable_decode' => ['string', 'string'=>'string'],
'quoted_printable_encode' => ['string', 'string'=>'string'],
'quotemeta' => ['string', 'string'=>'string'],
'rad2deg' => ['float', 'num'=>'float'],
'radius_acct_open' => ['resource|false'],
'radius_add_server' => ['bool', 'radius_handle'=>'resource', 'hostname'=>'string', 'port'=>'int', 'secret'=>'string', 'timeout'=>'int', 'max_tries'=>'int'],
'radius_auth_open' => ['resource|false'],
'radius_close' => ['bool', 'radius_handle'=>'resource'],
'radius_config' => ['bool', 'radius_handle'=>'resource', 'file'=>'string'],
'radius_create_request' => ['bool', 'radius_handle'=>'resource', 'type'=>'int'],
'radius_cvt_addr' => ['string', 'data'=>'string'],
'radius_cvt_int' => ['int', 'data'=>'string'],
'radius_cvt_string' => ['string', 'data'=>'string'],
'radius_demangle' => ['string', 'radius_handle'=>'resource', 'mangled'=>'string'],
'radius_demangle_mppe_key' => ['string', 'radius_handle'=>'resource', 'mangled'=>'string'],
'radius_get_attr' => ['mixed', 'radius_handle'=>'resource'],
'radius_get_tagged_attr_data' => ['string', 'data'=>'string'],
'radius_get_tagged_attr_tag' => ['int', 'data'=>'string'],
'radius_get_vendor_attr' => ['array', 'data'=>'string'],
'radius_put_addr' => ['bool', 'radius_handle'=>'resource', 'type'=>'int', 'addr'=>'string'],
'radius_put_attr' => ['bool', 'radius_handle'=>'resource', 'type'=>'int', 'value'=>'string'],
'radius_put_int' => ['bool', 'radius_handle'=>'resource', 'type'=>'int', 'value'=>'int'],
'radius_put_string' => ['bool', 'radius_handle'=>'resource', 'type'=>'int', 'value'=>'string'],
'radius_put_vendor_addr' => ['bool', 'radius_handle'=>'resource', 'vendor'=>'int', 'type'=>'int', 'addr'=>'string'],
'radius_put_vendor_attr' => ['bool', 'radius_handle'=>'resource', 'vendor'=>'int', 'type'=>'int', 'value'=>'string'],
'radius_put_vendor_int' => ['bool', 'radius_handle'=>'resource', 'vendor'=>'int', 'type'=>'int', 'value'=>'int'],
'radius_put_vendor_string' => ['bool', 'radius_handle'=>'resource', 'vendor'=>'int', 'type'=>'int', 'value'=>'string'],
'radius_request_authenticator' => ['string', 'radius_handle'=>'resource'],
'radius_salt_encrypt_attr' => ['string', 'radius_handle'=>'resource', 'data'=>'string'],
'radius_send_request' => ['int|false', 'radius_handle'=>'resource'],
'radius_server_secret' => ['string', 'radius_handle'=>'resource'],
'radius_strerror' => ['string', 'radius_handle'=>'resource'],
'rand' => ['int', 'min'=>'int', 'max'=>'int'],
'rand\'1' => ['int'],
'random_bytes' => ['string', 'length'=>'int'],
'random_int' => ['int', 'min'=>'int', 'max'=>'int'],
'range' => ['array', 'start'=>'mixed', 'end'=>'mixed', 'step='=>'int|float'],
'RangeException::__clone' => ['void'],
'RangeException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?RangeException'],
'RangeException::__toString' => ['string'],
'RangeException::getCode' => ['int'],
'RangeException::getFile' => ['string'],
'RangeException::getLine' => ['int'],
'RangeException::getMessage' => ['string'],
'RangeException::getPrevious' => ['Throwable|RangeException|null'],
'RangeException::getTrace' => ['list<array<string,mixed>>'],
'RangeException::getTraceAsString' => ['string'],
'rar_allow_broken_set' => ['bool', 'rarfile'=>'RarArchive', 'allow_broken'=>'bool'],
'rar_broken_is' => ['bool', 'rarfile'=>'rararchive'],
'rar_close' => ['bool', 'rarfile'=>'rararchive'],
'rar_comment_get' => ['string', 'rarfile'=>'rararchive'],
'rar_entry_get' => ['RarEntry', 'rarfile'=>'RarArchive', 'entryname'=>'string'],
'rar_list' => ['RarArchive', 'rarfile'=>'rararchive'],
'rar_open' => ['RarArchive', 'filename'=>'string', 'password='=>'string', 'volume_callback='=>'callable'],
'rar_solid_is' => ['bool', 'rarfile'=>'rararchive'],
'rar_wrapper_cache_stats' => ['string'],
'RarArchive::__toString' => ['string'],
'RarArchive::close' => ['bool'],
'RarArchive::getComment' => ['string|null'],
'RarArchive::getEntries' => ['RarEntry[]|false'],
'RarArchive::getEntry' => ['RarEntry|false', 'entryname'=>'string'],
'RarArchive::isBroken' => ['bool'],
'RarArchive::isSolid' => ['bool'],
'RarArchive::open' => ['RarArchive|false', 'filename'=>'string', 'password='=>'string', 'volume_callback='=>'callable'],
'RarArchive::setAllowBroken' => ['bool', 'allow_broken'=>'bool'],
'RarEntry::__toString' => ['string'],
'RarEntry::extract' => ['bool', 'dir'=>'string', 'filepath='=>'string', 'password='=>'string', 'extended_data='=>'bool'],
'RarEntry::getAttr' => ['int|false'],
'RarEntry::getCrc' => ['string|false'],
'RarEntry::getFileTime' => ['string|false'],
'RarEntry::getHostOs' => ['int|false'],
'RarEntry::getMethod' => ['int|false'],
'RarEntry::getName' => ['string|false'],
'RarEntry::getPackedSize' => ['int|false'],
'RarEntry::getStream' => ['resource|false', 'password='=>'string'],
'RarEntry::getUnpackedSize' => ['int|false'],
'RarEntry::getVersion' => ['int|false'],
'RarEntry::isDirectory' => ['bool'],
'RarEntry::isEncrypted' => ['bool'],
'RarException::getCode' => ['int'],
'RarException::getFile' => ['string'],
'RarException::getLine' => ['int'],
'RarException::getMessage' => ['string'],
'RarException::getPrevious' => ['Exception|Throwable'],
'RarException::getTrace' => ['list<array<string,mixed>>'],
'RarException::getTraceAsString' => ['string'],
'RarException::isUsingExceptions' => ['bool'],
'RarException::setUsingExceptions' => ['RarEntry', 'using_exceptions'=>'bool'],
'rawurldecode' => ['string', 'string'=>'string'],
'rawurlencode' => ['string', 'string'=>'string'],
'rd_kafka_err2str' => ['string', 'err'=>'int'],
'rd_kafka_errno' => ['int'],
'rd_kafka_errno2err' => ['int', 'errnox'=>'int'],
'rd_kafka_offset_tail' => ['int', 'cnt'=>'int'],
'RdKafka::addBrokers' => ['int', 'broker_list'=>'string'],
'RdKafka::flush' => ['int', 'timeout_ms'=>'int'],
'RdKafka::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'RdKafka\Topic', 'timeout_ms'=>'int'],
'RdKafka::getOutQLen' => ['int'],
'RdKafka::newQueue' => ['RdKafka\Queue'],
'RdKafka::newTopic' => ['RdKafka\Topic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'],
'RdKafka::poll' => ['void', 'timeout_ms'=>'int'],
'RdKafka::setLogLevel' => ['void', 'level'=>'int'],
'RdKafka\Conf::dump' => ['array<string, string>'],
'RdKafka\Conf::set' => ['void', 'name'=>'string', 'value'=>'string'],
'RdKafka\Conf::setDefaultTopicConf' => ['void', 'topic_conf'=>'RdKafka\TopicConf'],
'RdKafka\Conf::setDrMsgCb' => ['void', 'callback'=>'callable'],
'RdKafka\Conf::setErrorCb' => ['void', 'callback'=>'callable'],
'RdKafka\Conf::setRebalanceCb' => ['void', 'callback'=>'callable'],
'RdKafka\Conf::setStatsCb' => ['void', 'callback'=>'callable'],
'RdKafka\Consumer::__construct' => ['void', 'conf='=>'?RdKafka\Conf'],
'RdKafka\Consumer::addBrokers' => ['int', 'broker_list'=>'string'],
'RdKafka\Consumer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'RdKafka\Topic', 'timeout_ms'=>'int'],
'RdKafka\Consumer::getOutQLen' => ['int'],
'RdKafka\Consumer::newQueue' => ['RdKafka\Queue'],
'RdKafka\Consumer::newTopic' => ['RdKafka\ConsumerTopic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'],
'RdKafka\Consumer::poll' => ['void', 'timeout_ms'=>'int'],
'RdKafka\Consumer::setLogLevel' => ['void', 'level'=>'int'],
'RdKafka\ConsumerTopic::__construct' => ['void'],
'RdKafka\ConsumerTopic::consume' => ['RdKafka\Message', 'partition'=>'int', 'timeout_ms'=>'int'],
'RdKafka\ConsumerTopic::consumeQueueStart' => ['void', 'partition'=>'int', 'offset'=>'int', 'queue'=>'RdKafka\Queue'],
'RdKafka\ConsumerTopic::consumeStart' => ['void', 'partition'=>'int', 'offset'=>'int'],
'RdKafka\ConsumerTopic::consumeStop' => ['void', 'partition'=>'int'],
'RdKafka\ConsumerTopic::getName' => ['string'],
'RdKafka\ConsumerTopic::offsetStore' => ['void', 'partition'=>'int', 'offset'=>'int'],
'RdKafka\KafkaConsumer::__construct' => ['void', 'conf'=>'RdKafka\Conf'],
'RdKafka\KafkaConsumer::assign' => ['void', 'topic_partitions='=>'RdKafka\TopicPartition[]|null'],
'RdKafka\KafkaConsumer::commit' => ['void', 'message_or_offsets='=>'RdKafka\Message|RdKafka\TopicPartition[]|null'],
'RdKafka\KafkaConsumer::commitAsync' => ['void', 'message_or_offsets='=>'RdKafka\Message|RdKafka\TopicPartition[]|null'],
'RdKafka\KafkaConsumer::consume' => ['RdKafka\Message', 'timeout_ms'=>'int'],
'RdKafka\KafkaConsumer::getAssignment' => ['RdKafka\TopicPartition[]'],
'RdKafka\KafkaConsumer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'RdKafka\KafkaConsumerTopic', 'timeout_ms'=>'int'],
'RdKafka\KafkaConsumer::getSubscription' => ['array'],
'RdKafka\KafkaConsumer::subscribe' => ['void', 'topics'=>'array'],
'RdKafka\KafkaConsumer::unsubscribe' => ['void'],
'RdKafka\KafkaConsumerTopic::getName' => ['string'],
'RdKafka\KafkaConsumerTopic::offsetStore' => ['void', 'partition'=>'int', 'offset'=>'int'],
'RdKafka\Message::errstr' => ['string'],
'RdKafka\Metadata::getBrokers' => ['RdKafka\Metadata\Collection'],
'RdKafka\Metadata::getOrigBrokerId' => ['int'],
'RdKafka\Metadata::getOrigBrokerName' => ['string'],
'RdKafka\Metadata::getTopics' => ['RdKafka\Metadata\Collection|RdKafka\Metadata\Topic[]'],
'RdKafka\Metadata\Collection::__construct' => ['void'],
'RdKafka\Metadata\Collection::count' => ['int'],
'RdKafka\Metadata\Collection::current' => ['mixed'],
'RdKafka\Metadata\Collection::key' => ['mixed'],
'RdKafka\Metadata\Collection::next' => ['void'],
'RdKafka\Metadata\Collection::rewind' => ['void'],
'RdKafka\Metadata\Collection::valid' => ['bool'],
'RdKafka\Metadata\Partition::getErr' => ['mixed'],
'RdKafka\Metadata\Partition::getId' => ['int'],
'RdKafka\Metadata\Partition::getIsrs' => ['mixed'],
'RdKafka\Metadata\Partition::getLeader' => ['mixed'],
'RdKafka\Metadata\Partition::getReplicas' => ['mixed'],
'RdKafka\Metadata\Topic::getErr' => ['mixed'],
'RdKafka\Metadata\Topic::getPartitions' => ['RdKafka\Metadata\Partition[]'],
'RdKafka\Metadata\Topic::getTopic' => ['string'],
'RdKafka\Producer::__construct' => ['void', 'conf='=>'?RdKafka\Conf'],
'RdKafka\Producer::addBrokers' => ['int', 'broker_list'=>'string'],
'RdKafka\Producer::getMetadata' => ['RdKafka\Metadata', 'all_topics'=>'bool', 'only_topic='=>'RdKafka\Topic', 'timeout_ms'=>'int'],
'RdKafka\Producer::getOutQLen' => ['int'],
'RdKafka\Producer::newQueue' => ['RdKafka\Queue'],
'RdKafka\Producer::newTopic' => ['RdKafka\ProducerTopic', 'topic_name'=>'string', 'topic_conf='=>'?RdKafka\TopicConf'],
'RdKafka\Producer::poll' => ['void', 'timeout_ms'=>'int'],
'RdKafka\Producer::setLogLevel' => ['void', 'level'=>'int'],
'RdKafka\ProducerTopic::__construct' => ['void'],
'RdKafka\ProducerTopic::getName' => ['string'],
'RdKafka\ProducerTopic::produce' => ['void', 'partition'=>'int', 'msgflags'=>'int', 'payload'=>'string', 'key='=>'?string'],
'RdKafka\ProducerTopic::producev' => ['void', 'partition'=>'int', 'msgflags'=>'int', 'payload'=>'string', 'key='=>'?string', 'headers='=>'?array<string, string>', 'timestamp_ms='=>'?int', 'opaque='=>'?string'],
'RdKafka\Queue::__construct' => ['void'],
'RdKafka\Queue::consume' => ['?RdKafka\Message', 'timeout_ms'=>'string'],
'RdKafka\Topic::getName' => ['string'],
'RdKafka\TopicConf::dump' => ['array<string, string>'],
'RdKafka\TopicConf::set' => ['void', 'name'=>'string', 'value'=>'string'],
'RdKafka\TopicConf::setPartitioner' => ['void', 'partitioner'=>'int'],
'RdKafka\TopicPartition::__construct' => ['void', 'topic'=>'string', 'partition'=>'int', 'offset='=>'int'],
'RdKafka\TopicPartition::getOffset' => ['int'],
'RdKafka\TopicPartition::getPartition' => ['int'],
'RdKafka\TopicPartition::getTopic' => ['string'],
'RdKafka\TopicPartition::setOffset' => ['void', 'offset'=>'string'],
'RdKafka\TopicPartition::setPartition' => ['void', 'partition'=>'string'],
'RdKafka\TopicPartition::setTopic' => ['void', 'topic_name'=>'string'],
'readdir' => ['string|false', 'dir_handle='=>'resource'],
'readfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
'readgzfile' => ['int|false', 'filename'=>'string', 'use_include_path='=>'int'],
'readline' => ['string|false', 'prompt='=>'?string'],
'readline_add_history' => ['bool', 'prompt'=>'string'],
'readline_callback_handler_install' => ['bool', 'prompt'=>'string', 'callback'=>'callable'],
'readline_callback_handler_remove' => ['bool'],
'readline_callback_read_char' => ['void'],
'readline_clear_history' => ['bool'],
'readline_completion_function' => ['bool', 'callback'=>'callable'],
'readline_info' => ['mixed', 'var_name='=>'string', 'value='=>'string|int|bool'],
'readline_list_history' => ['array'],
'readline_on_new_line' => ['void'],
'readline_read_history' => ['bool', 'filename='=>'string'],
'readline_redisplay' => ['void'],
'readline_write_history' => ['bool', 'filename='=>'string'],
'readlink' => ['string|false', 'path'=>'string'],
'realpath' => ['string|false', 'path'=>'string'],
'realpath_cache_get' => ['array'],
'realpath_cache_size' => ['int'],
'recode' => ['string', 'request'=>'string', 'string'=>'string'],
'recode_file' => ['bool', 'request'=>'string', 'input'=>'resource', 'output'=>'resource'],
'recode_string' => ['string|false', 'request'=>'string', 'string'=>'string'],
'rectObj::__construct' => ['void'],
'rectObj::draw' => ['int', 'map'=>'mapObj', 'layer'=>'layerObj', 'img'=>'imageObj', 'class_index'=>'int', 'text'=>'string'],
'rectObj::fit' => ['float', 'width'=>'int', 'height'=>'int'],
'rectObj::ms_newRectObj' => ['rectObj'],
'rectObj::project' => ['int', 'in'=>'projectionObj', 'out'=>'projectionObj'],
'rectObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'rectObj::setextent' => ['void', 'minx'=>'float', 'miny'=>'float', 'maxx'=>'float', 'maxy'=>'float'],
'RecursiveArrayIterator::__construct' => ['void', 'array='=>'array|object', 'flags='=>'int'],
'RecursiveArrayIterator::append' => ['void', 'value'=>'mixed'],
'RecursiveArrayIterator::asort' => ['void'],
'RecursiveArrayIterator::count' => ['int'],
'RecursiveArrayIterator::current' => ['mixed'],
'RecursiveArrayIterator::getArrayCopy' => ['array'],
'RecursiveArrayIterator::getChildren' => ['RecursiveArrayIterator'],
'RecursiveArrayIterator::getFlags' => ['void'],
'RecursiveArrayIterator::hasChildren' => ['bool'],
'RecursiveArrayIterator::key' => ['false|int|string'],
'RecursiveArrayIterator::ksort' => ['void'],
'RecursiveArrayIterator::natcasesort' => ['void'],
'RecursiveArrayIterator::natsort' => ['void'],
'RecursiveArrayIterator::next' => ['void'],
'RecursiveArrayIterator::offsetExists' => ['void', 'index'=>'string'],
'RecursiveArrayIterator::offsetGet' => ['mixed', 'index'=>'string'],
'RecursiveArrayIterator::offsetSet' => ['void', 'index'=>'string', 'newval'=>'string'],
'RecursiveArrayIterator::offsetUnset' => ['void', 'index'=>'string'],
'RecursiveArrayIterator::rewind' => ['void'],
'RecursiveArrayIterator::seek' => ['void', 'position'=>'int'],
'RecursiveArrayIterator::serialize' => ['string'],
'RecursiveArrayIterator::setFlags' => ['void', 'flags'=>'string'],
'RecursiveArrayIterator::uasort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'],
'RecursiveArrayIterator::uksort' => ['void', 'cmp_function'=>'callable(mixed,mixed):int'],
'RecursiveArrayIterator::unserialize' => ['string', 'serialized'=>'string'],
'RecursiveArrayIterator::valid' => ['bool'],
'RecursiveCachingIterator::__construct' => ['void', 'it'=>'Iterator', 'flags='=>'int'],
'RecursiveCachingIterator::__toString' => ['string'],
'RecursiveCachingIterator::count' => ['int'],
'RecursiveCachingIterator::current' => ['void'],
'RecursiveCachingIterator::getCache' => ['array'],
'RecursiveCachingIterator::getChildren' => ['RecursiveCachingIterator'],
'RecursiveCachingIterator::getFlags' => ['int'],
'RecursiveCachingIterator::getInnerIterator' => ['Iterator'],
'RecursiveCachingIterator::hasChildren' => ['bool'],
'RecursiveCachingIterator::hasNext' => ['bool'],
'RecursiveCachingIterator::key' => ['bool|float|int|string'],
'RecursiveCachingIterator::next' => ['void'],
'RecursiveCachingIterator::offsetExists' => ['bool', 'index'=>'string'],
'RecursiveCachingIterator::offsetGet' => ['string', 'index'=>'string'],
'RecursiveCachingIterator::offsetSet' => ['void', 'index'=>'string', 'newval'=>'string'],
'RecursiveCachingIterator::offsetUnset' => ['void', 'index'=>'string'],
'RecursiveCachingIterator::rewind' => ['void'],
'RecursiveCachingIterator::setFlags' => ['void', 'flags'=>'int'],
'RecursiveCachingIterator::valid' => ['bool'],
'RecursiveCallbackFilterIterator::__construct' => ['void', 'iterator'=>'RecursiveIterator', 'func'=>'callable'],
'RecursiveCallbackFilterIterator::accept' => ['bool'],
'RecursiveCallbackFilterIterator::current' => ['mixed'],
'RecursiveCallbackFilterIterator::getChildren' => ['RecursiveCallbackFilterIterator'],
'RecursiveCallbackFilterIterator::getInnerIterator' => ['Iterator'],
'RecursiveCallbackFilterIterator::hasChildren' => ['bool'],
'RecursiveCallbackFilterIterator::key' => ['bool|float|int|string'],
'RecursiveCallbackFilterIterator::next' => ['void'],
'RecursiveCallbackFilterIterator::rewind' => ['void'],
'RecursiveCallbackFilterIterator::valid' => ['bool'],
'RecursiveDirectoryIterator::__construct' => ['void', 'path'=>'string', 'flags='=>'int'],
'RecursiveDirectoryIterator::__toString' => ['string'],
'RecursiveDirectoryIterator::_bad_state_ex' => [''],
'RecursiveDirectoryIterator::current' => ['string|SplFileInfo|FilesystemIterator'],
'RecursiveDirectoryIterator::getATime' => ['int'],
'RecursiveDirectoryIterator::getBasename' => ['string', 'suffix='=>'string'],
'RecursiveDirectoryIterator::getChildren' => ['RecursiveDirectoryIterator'],
'RecursiveDirectoryIterator::getCTime' => ['int'],
'RecursiveDirectoryIterator::getExtension' => ['string'],
'RecursiveDirectoryIterator::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'RecursiveDirectoryIterator::getFilename' => ['string'],
'RecursiveDirectoryIterator::getFlags' => ['int'],
'RecursiveDirectoryIterator::getGroup' => ['int'],
'RecursiveDirectoryIterator::getInode' => ['int'],
'RecursiveDirectoryIterator::getLinkTarget' => ['string'],
'RecursiveDirectoryIterator::getMTime' => ['int'],
'RecursiveDirectoryIterator::getOwner' => ['int'],
'RecursiveDirectoryIterator::getPath' => ['string'],
'RecursiveDirectoryIterator::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'RecursiveDirectoryIterator::getPathname' => ['string'],
'RecursiveDirectoryIterator::getPerms' => ['int'],
'RecursiveDirectoryIterator::getRealPath' => ['string'],
'RecursiveDirectoryIterator::getSize' => ['int'],
'RecursiveDirectoryIterator::getSubPath' => ['string'],
'RecursiveDirectoryIterator::getSubPathname' => ['string'],
'RecursiveDirectoryIterator::getType' => ['string'],
'RecursiveDirectoryIterator::hasChildren' => ['bool', 'allow_links='=>'bool'],
'RecursiveDirectoryIterator::isDir' => ['bool'],
'RecursiveDirectoryIterator::isDot' => ['bool'],
'RecursiveDirectoryIterator::isExecutable' => ['bool'],
'RecursiveDirectoryIterator::isFile' => ['bool'],
'RecursiveDirectoryIterator::isLink' => ['bool'],
'RecursiveDirectoryIterator::isReadable' => ['bool'],
'RecursiveDirectoryIterator::isWritable' => ['bool'],
'RecursiveDirectoryIterator::key' => ['string'],
'RecursiveDirectoryIterator::next' => ['void'],
'RecursiveDirectoryIterator::openFile' => ['SplFileObject', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
'RecursiveDirectoryIterator::rewind' => ['void'],
'RecursiveDirectoryIterator::seek' => ['void', 'position'=>'int'],
'RecursiveDirectoryIterator::setFileClass' => ['void', 'class_name='=>'string'],
'RecursiveDirectoryIterator::setFlags' => ['void', 'flags='=>'int'],
'RecursiveDirectoryIterator::setInfoClass' => ['void', 'class_name='=>'string'],
'RecursiveDirectoryIterator::valid' => ['bool'],
'RecursiveFilterIterator::__construct' => ['void', 'iterator'=>'RecursiveIterator'],
'RecursiveFilterIterator::accept' => ['bool'],
'RecursiveFilterIterator::current' => ['mixed'],
'RecursiveFilterIterator::getChildren' => ['RecursiveFilterIterator'],
'RecursiveFilterIterator::getInnerIterator' => ['Iterator'],
'RecursiveFilterIterator::hasChildren' => ['bool'],
'RecursiveFilterIterator::key' => ['mixed'],
'RecursiveFilterIterator::next' => ['void'],
'RecursiveFilterIterator::rewind' => ['void'],
'RecursiveFilterIterator::valid' => ['bool'],
'RecursiveIterator::__construct' => ['void'],
'RecursiveIterator::current' => ['mixed'],
'RecursiveIterator::getChildren' => ['RecursiveIterator'],
'RecursiveIterator::hasChildren' => ['bool'],
'RecursiveIterator::key' => ['int|string'],
'RecursiveIterator::next' => ['void'],
'RecursiveIterator::rewind' => ['void'],
'RecursiveIterator::valid' => ['bool'],
'RecursiveIteratorIterator::__construct' => ['void', 'iterator'=>'RecursiveIterator|IteratorAggregate', 'mode='=>'int', 'flags='=>'int'],
'RecursiveIteratorIterator::beginChildren' => ['void'],
'RecursiveIteratorIterator::beginIteration' => ['RecursiveIterator'],
'RecursiveIteratorIterator::callGetChildren' => ['RecursiveIterator'],
'RecursiveIteratorIterator::callHasChildren' => ['bool'],
'RecursiveIteratorIterator::current' => ['mixed'],
'RecursiveIteratorIterator::endChildren' => ['void'],
'RecursiveIteratorIterator::endIteration' => ['RecursiveIterator'],
'RecursiveIteratorIterator::getDepth' => ['int'],
'RecursiveIteratorIterator::getInnerIterator' => ['RecursiveIterator'],
'RecursiveIteratorIterator::getMaxDepth' => ['int|false'],
'RecursiveIteratorIterator::getSubIterator' => ['RecursiveIterator', 'level='=>'int'],
'RecursiveIteratorIterator::key' => ['mixed'],
'RecursiveIteratorIterator::next' => ['void'],
'RecursiveIteratorIterator::nextElement' => ['void'],
'RecursiveIteratorIterator::rewind' => ['void'],
'RecursiveIteratorIterator::setMaxDepth' => ['void', 'max_depth='=>'int'],
'RecursiveIteratorIterator::valid' => ['bool'],
'RecursiveRegexIterator::__construct' => ['void', 'iterator'=>'RecursiveIterator', 'regex'=>'string', 'mode='=>'int', 'flags='=>'int', 'preg_flags='=>'int'],
'RecursiveRegexIterator::accept' => ['bool'],
'RecursiveRegexIterator::current' => [''],
'RecursiveRegexIterator::getChildren' => ['RecursiveRegexIterator'],
'RecursiveRegexIterator::getFlags' => ['int'],
'RecursiveRegexIterator::getInnerIterator' => ['Iterator'],
'RecursiveRegexIterator::getMode' => ['int'],
'RecursiveRegexIterator::getPregFlags' => ['int'],
'RecursiveRegexIterator::getRegex' => ['string'],
'RecursiveRegexIterator::hasChildren' => ['bool'],
'RecursiveRegexIterator::key' => [''],
'RecursiveRegexIterator::next' => [''],
'RecursiveRegexIterator::rewind' => [''],
'RecursiveRegexIterator::setFlags' => ['void', 'new_flags'=>'int'],
'RecursiveRegexIterator::setMode' => ['void', 'new_mode'=>'int'],
'RecursiveRegexIterator::setPregFlags' => ['void', 'new_flags'=>'int'],
'RecursiveRegexIterator::valid' => [''],
'RecursiveTreeIterator::__construct' => ['void', 'iterator'=>'RecursiveIterator|IteratorAggregate', 'flags='=>'int', 'cit_flags='=>'int', 'mode'=>'int'],
'RecursiveTreeIterator::beginChildren' => ['void'],
'RecursiveTreeIterator::beginIteration' => ['RecursiveIterator'],
'RecursiveTreeIterator::callGetChildren' => ['RecursiveIterator'],
'RecursiveTreeIterator::callHasChildren' => ['bool'],
'RecursiveTreeIterator::current' => ['string'],
'RecursiveTreeIterator::endChildren' => ['void'],
'RecursiveTreeIterator::endIteration' => ['void'],
'RecursiveTreeIterator::getDepth' => ['int'],
'RecursiveTreeIterator::getEntry' => ['string'],
'RecursiveTreeIterator::getInnerIterator' => ['RecursiveIterator'],
'RecursiveTreeIterator::getMaxDepth' => ['false|int'],
'RecursiveTreeIterator::getPostfix' => ['string'],
'RecursiveTreeIterator::getPrefix' => ['string'],
'RecursiveTreeIterator::getSubIterator' => ['RecursiveIterator', 'level='=>'int'],
'RecursiveTreeIterator::key' => ['string'],
'RecursiveTreeIterator::next' => ['void'],
'RecursiveTreeIterator::nextElement' => ['void'],
'RecursiveTreeIterator::rewind' => ['void'],
'RecursiveTreeIterator::setMaxDepth' => ['void', 'max_depth='=>'int'],
'RecursiveTreeIterator::setPostfix' => ['void', 'prefix'=>'string'],
'RecursiveTreeIterator::setPrefixPart' => ['void', 'part'=>'int', 'prefix'=>'string'],
'RecursiveTreeIterator::valid' => ['bool'],
'Redis::__construct' => ['void'],
'Redis::__destruct' => ['void'],
'Redis::_prefix' => ['string', 'value'=>'mixed'],
'Redis::_serialize' => ['mixed', 'value'=>'mixed'],
'Redis::_unserialize' => ['mixed', 'value'=>'string'],
'Redis::append' => ['int', 'key'=>'string', 'value'=>'string'],
'Redis::auth' => ['bool', 'password'=>'string'],
'Redis::bgRewriteAOF' => ['bool'],
'Redis::bgSave' => ['bool'],
'Redis::bitCount' => ['int', 'key'=>'string'],
'Redis::bitOp' => ['int', 'operation'=>'string', 'ret_key'=>'string', 'key'=>'string', '...other_keys='=>'string'],
'Redis::bitpos' => ['int', 'key'=>'string', 'bit'=>'int', 'start='=>'int', 'end='=>'int'],
'Redis::blPop' => ['array', 'keys'=>'string[]', 'timeout'=>'int'],
'Redis::blPop\'1' => ['array', 'key'=>'string', 'timeout_or_key'=>'int|string', '...extra_args'=>'int|string'],
'Redis::brPop' => ['array', 'keys'=>'string[]', 'timeout'=>'int'],
'Redis::brPop\'1' => ['array', 'key'=>'string', 'timeout_or_key'=>'int|string', '...extra_args'=>'int|string'],
'Redis::brpoplpush' => ['string|false', 'srcKey'=>'string', 'dstKey'=>'string', 'timeout'=>'int'],
'Redis::clearLastError' => ['bool'],
'Redis::client' => ['mixed', 'command'=>'string', 'arg='=>'string'],
'Redis::close' => ['bool'],
'Redis::command' => ['', '...args'=>''],
'Redis::config' => ['string', 'operation'=>'string', 'key'=>'string', 'value='=>'string'],
'Redis::connect' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'float', 'reserved='=>'null', 'retry_interval='=>'?int', 'read_timeout='=>'float'],
'Redis::dbSize' => ['int'],
'Redis::debug' => ['', 'key'=>''],
'Redis::decr' => ['int', 'key'=>'string'],
'Redis::decrBy' => ['int', 'key'=>'string', 'value'=>'int'],
'Redis::decrByFloat' => ['float', 'key'=>'string', 'value'=>'float'],
'Redis::del' => ['int', 'key'=>'string', '...args'=>'string'],
'Redis::del\'1' => ['int', 'key'=>'string[]'],
'Redis::delete' => ['int', 'key'=>'string', '...args'=>'string'],
'Redis::delete\'1' => ['int', 'key'=>'string[]'],
'Redis::discard' => [''],
'Redis::dump' => ['string|false', 'key'=>'string'],
'Redis::echo' => ['string', 'message'=>'string'],
'Redis::eval' => ['mixed', 'script'=>'', 'args='=>'', 'numKeys='=>''],
'Redis::evalSha' => ['mixed', 'scriptSha'=>'string', 'args='=>'array', 'numKeys='=>'int'],
'Redis::evaluate' => ['mixed', 'script'=>'string', 'args='=>'array', 'numKeys='=>'int'],
'Redis::evaluateSha' => ['', 'scriptSha'=>'string', 'args='=>'array', 'numKeys='=>'int'],
'Redis::exec' => ['array'],
'Redis::exists' => ['int', 'keys'=>'string|string[]'],
'Redis::exists\'1' => ['int', '...keys'=>'string'],
'Redis::expire' => ['bool', 'key'=>'string', 'ttl'=>'int'],
'Redis::expireAt' => ['bool', 'key'=>'string', 'expiry'=>'int'],
'Redis::flushAll' => ['bool', 'async='=>'bool'],
'Redis::flushDb' => ['bool', 'async='=>'bool'],
'Redis::geoAdd' => ['int', 'key'=>'string', 'longitude'=>'float', 'latitude'=>'float', 'member'=>'string', '...other_triples='=>'string|int|float'],
'Redis::geoDist' => ['float', 'key'=>'string', 'member1'=>'string', 'member2'=>'string', 'unit='=>'string'],
'Redis::geoHash' => ['array<int,string>', 'key'=>'string', 'member'=>'string', '...other_members='=>'string'],
'Redis::geoPos' => ['array<int,array{0:string,1:string}>', 'key'=>'string', 'member'=>'string', '...members='=>'string'],
'Redis::geoRadius' => ['array<int,mixed>|int', 'key'=>'string', 'longitude'=>'float', 'latitude'=>'float', 'radius'=>'float', 'unit'=>'float', 'options='=>'array<string,mixed>'],
'Redis::geoRadiusByMember' => ['array<int,mixed>|int', 'key'=>'string', 'member'=>'string', 'radius'=>'float', 'units'=>'string', 'options='=>'array<string,mixed>'],
'Redis::get' => ['string|false', 'key'=>'string'],
'Redis::getAuth' => ['string|false|null'],
'Redis::getBit' => ['int', 'key'=>'string', 'offset'=>'int'],
'Redis::getDBNum' => ['int|false'],
'Redis::getHost' => ['string|false'],
'Redis::getKeys' => ['array<int,string>', 'pattern'=>'string'],
'Redis::getLastError' => ['?string'],
'Redis::getMode' => ['int'],
'Redis::getMultiple' => ['array', 'keys'=>'string[]'],
'Redis::getOption' => ['int', 'name'=>'int'],
'Redis::getPersistentID' => ['string|false|null'],
'Redis::getPort' => ['int|false'],
'Redis::getRange' => ['int', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'Redis::getReadTimeout' => ['float|false'],
'Redis::getSet' => ['string', 'key'=>'string', 'string'=>'string'],
'Redis::getTimeout' => ['float|false'],
'Redis::hDel' => ['int|false', 'key'=>'string', 'hashKey1'=>'string', '...otherHashKeys='=>'string'],
'Redis::hExists' => ['bool', 'key'=>'string', 'hashKey'=>'string'],
'Redis::hGet' => ['string|false', 'key'=>'string', 'hashKey'=>'string'],
'Redis::hGetAll' => ['array', 'key'=>'string'],
'Redis::hIncrBy' => ['int', 'key'=>'string', 'hashKey'=>'string', 'value'=>'int'],
'Redis::hIncrByFloat' => ['float', 'key'=>'string', 'field'=>'string', 'increment'=>'float'],
'Redis::hKeys' => ['array', 'key'=>'string'],
'Redis::hLen' => ['int|false', 'key'=>'string'],
'Redis::hMGet' => ['array', 'key'=>'string', 'hashKeys'=>'array'],
'Redis::hMSet' => ['bool', 'key'=>'string', 'hashKeys'=>'array'],
'Redis::hScan' => ['array', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'string', 'count='=>'int'],
'Redis::hSet' => ['int|false', 'key'=>'string', 'hashKey'=>'string', 'value'=>'string'],
'Redis::hSetNx' => ['bool', 'key'=>'string', 'hashKey'=>'string', 'value'=>'string'],
'Redis::hStrLen' => ['', 'key'=>'', 'member'=>''],
'Redis::hVals' => ['array', 'key'=>'string'],
'Redis::incr' => ['int', 'key'=>'string'],
'Redis::incrBy' => ['int', 'key'=>'string', 'value'=>'int'],
'Redis::incrByFloat' => ['float', 'key'=>'string', 'value'=>'float'],
'Redis::info' => ['array', 'option='=>'string'],
'Redis::isConnected' => ['bool'],
'Redis::keys' => ['array<int,string>', 'pattern'=>'string'],
'Redis::lastSave' => ['int'],
'Redis::lGet' => ['string', 'key'=>'string', 'index'=>'int'],
'Redis::lGetRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'Redis::lIndex' => ['string|false', 'key'=>'string', 'index'=>'int'],
'Redis::lInsert' => ['int', 'key'=>'string', 'position'=>'int', 'pivot'=>'string', 'value'=>'string'],
'Redis::listTrim' => ['', 'key'=>'string', 'start'=>'int', 'stop'=>'int'],
'Redis::lLen' => ['int|false', 'key'=>'string'],
'Redis::lPop' => ['string|false', 'key'=>'string'],
'Redis::lPush' => ['int|false', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'],
'Redis::lPushx' => ['int|false', 'key'=>'string', 'value'=>'string'],
'Redis::lRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'Redis::lRem' => ['int|false', 'key'=>'string', 'value'=>'string', 'count'=>'int'],
'Redis::lRemove' => ['int', 'key'=>'string', 'value'=>'string', 'count'=>'int'],
'Redis::lSet' => ['bool', 'key'=>'string', 'index'=>'int', 'value'=>'string'],
'Redis::lSize' => ['int', 'key'=>'string'],
'Redis::lTrim' => ['array|false', 'key'=>'string', 'start'=>'int', 'stop'=>'int'],
'Redis::mGet' => ['array', 'keys'=>'string[]'],
'Redis::migrate' => ['bool', 'host'=>'string', 'port'=>'int', 'key'=>'string|string[]', 'db'=>'int', 'timeout'=>'int', 'copy='=>'bool', 'replace='=>'bool'],
'Redis::move' => ['bool', 'key'=>'string', 'dbindex'=>'int'],
'Redis::mSet' => ['bool', 'pairs'=>'array'],
'Redis::mSetNx' => ['bool', 'pairs'=>'array'],
'Redis::multi' => ['Redis', 'mode='=>'int'],
'Redis::object' => ['string|long|false', 'info'=>'string', 'key'=>'string'],
'Redis::open' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'float', 'reserved='=>'null', 'retry_interval='=>'?int', 'read_timeout='=>'float'],
'Redis::pconnect' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'float', 'persistent_id='=>'string', 'retry_interval='=>'?int'],
'Redis::persist' => ['bool', 'key'=>'string'],
'Redis::pExpire' => ['bool', 'key'=>'string', 'ttl'=>'int'],
'Redis::pexpireAt' => ['bool', 'key'=>'string', 'expiry'=>'int'],
'Redis::pfAdd' => ['bool', 'key'=>'string', 'elements'=>'array'],
'Redis::pfCount' => ['int', 'key'=>'array|string'],
'Redis::pfMerge' => ['bool', 'destkey'=>'string', 'sourcekeys'=>'array'],
'Redis::ping' => ['string'],
'Redis::pipeline' => ['Redis'],
'Redis::popen' => ['bool', 'host'=>'string', 'port='=>'int', 'timeout='=>'float', 'persistent_id='=>'string', 'retry_interval='=>'?int'],
'Redis::psetex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'],
'Redis::psubscribe' => ['', 'patterns'=>'array', 'callback'=>'array|string'],
'Redis::pttl' => ['int|false', 'key'=>'string'],
'Redis::publish' => ['int', 'channel'=>'string', 'message'=>'string'],
'Redis::pubsub' => ['array|int', 'keyword'=>'string', 'argument='=>'array|string'],
'Redis::punsubscribe' => ['', 'pattern'=>'string', '...other_patterns='=>'string'],
'Redis::randomKey' => ['string'],
'Redis::rawCommand' => ['mixed', 'command'=>'string', '...arguments='=>'mixed'],
'Redis::rename' => ['bool', 'srckey'=>'string', 'dstkey'=>'string'],
'Redis::renameKey' => ['bool', 'srckey'=>'string', 'dstkey'=>'string'],
'Redis::renameNx' => ['bool', 'srckey'=>'string', 'dstkey'=>'string'],
'Redis::resetStat' => ['bool'],
'Redis::restore' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'],
'Redis::role' => ['array', 'nodeParams'=>'string|array{0:string,1:int}'],
'Redis::rPop' => ['string|false', 'key'=>'string'],
'Redis::rpoplpush' => ['string', 'srcKey'=>'string', 'dstKey'=>'string'],
'Redis::rPush' => ['int|false', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'],
'Redis::rPushx' => ['int|false', 'key'=>'string', 'value'=>'string'],
'Redis::sAdd' => ['int|false', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'],
'Redis::sAddArray' => ['bool', 'key'=>'string', 'values'=>'array'],
'Redis::save' => ['bool'],
'Redis::scan' => ['array<int,string>|false', '&rw_iterator'=>'?int', 'pattern='=>'?string', 'count='=>'?int'],
'Redis::sCard' => ['int', 'key'=>'string'],
'Redis::sContains' => ['', 'key'=>'string', 'value'=>'string'],
'Redis::script' => ['mixed', 'command'=>'string', '...args='=>'mixed'],
'Redis::sDiff' => ['array', 'key1'=>'string', '...other_keys='=>'string'],
'Redis::sDiffStore' => ['int|false', 'dstKey'=>'string', 'key'=>'string', '...other_keys='=>'string'],
'Redis::select' => ['bool', 'dbindex'=>'int'],
'Redis::sendEcho' => ['string', 'msg'=>'string'],
'Redis::set' => ['bool', 'key'=>'string', 'value'=>'mixed', 'options='=>'array'],
'Redis::set\'1' => ['bool', 'key'=>'string', 'value'=>'mixed', 'timeout='=>'int'],
'Redis::setBit' => ['int', 'key'=>'string', 'offset'=>'int', 'value'=>'int'],
'Redis::setEx' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'],
'Redis::setNx' => ['bool', 'key'=>'string', 'value'=>'string'],
'Redis::setOption' => ['bool', 'name'=>'int', 'value'=>'mixed'],
'Redis::setRange' => ['int', 'key'=>'string', 'offset'=>'int', 'end'=>'int'],
'Redis::setTimeout' => ['', 'key'=>'string', 'ttl'=>'int'],
'Redis::sGetMembers' => ['', 'key'=>'string'],
'Redis::sInter' => ['array|false', 'key'=>'string', '...other_keys='=>'string'],
'Redis::sInterStore' => ['int|false', 'dstKey'=>'string', 'key'=>'string', '...other_keys='=>'string'],
'Redis::sIsMember' => ['bool', 'key'=>'string', 'value'=>'string'],
'Redis::slave' => ['bool', 'host'=>'string', 'port'=>'int'],
'Redis::slave\'1' => ['bool', 'host'=>'string', 'port'=>'int'],
'Redis::slaveof' => ['bool', 'host='=>'string', 'port='=>'int'],
'Redis::slowLog' => ['mixed', 'operation'=>'string', 'length='=>'int'],
'Redis::sMembers' => ['array', 'key'=>'string'],
'Redis::sMove' => ['bool', 'srcKey'=>'string', 'dstKey'=>'string', 'member'=>'string'],
'Redis::sort' => ['array|int', 'key'=>'string', 'options='=>'array'],
'Redis::sortAsc' => ['array', 'key'=>'string', 'pattern='=>'string', 'get='=>'string', 'start='=>'int', 'end='=>'int', 'getList='=>'bool'],
'Redis::sortAscAlpha' => ['array', 'key'=>'string', 'pattern='=>'', 'get='=>'string', 'start='=>'int', 'end='=>'int', 'getList='=>'bool'],
'Redis::sortDesc' => ['array', 'key'=>'string', 'pattern='=>'', 'get='=>'string', 'start='=>'int', 'end='=>'int', 'getList='=>'bool'],
'Redis::sortDescAlpha' => ['array', 'key'=>'string', 'pattern='=>'', 'get='=>'string', 'start='=>'int', 'end='=>'int', 'getList='=>'bool'],
'Redis::sPop' => ['string|false', 'key'=>'string'],
'Redis::sRandMember' => ['array|string|false', 'key'=>'string', 'count='=>'int'],
'Redis::sRem' => ['int', 'key'=>'string', 'member1'=>'string', '...other_members='=>'string'],
'Redis::sRemove' => ['int', 'key'=>'string', 'member1'=>'string', '...other_members='=>'string'],
'Redis::sScan' => ['array|bool', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'string', 'count='=>'int'],
'Redis::sSize' => ['int', 'key'=>'string'],
'Redis::strLen' => ['int', 'key'=>'string'],
'Redis::subscribe' => ['mixed|null', 'channels'=>'array', 'callback'=>'string|array'],
'Redis::substr' => ['', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'Redis::sUnion' => ['array', 'key'=>'string', '...other_keys='=>'string'],
'Redis::sUnionStore' => ['int', 'dstKey'=>'string', 'key'=>'string', '...other_keys='=>'string'],
'Redis::swapdb' => ['bool', 'srcdb'=>'int', 'dstdb'=>'int'],
'Redis::time' => ['array'],
'Redis::ttl' => ['int|false', 'key'=>'string'],
'Redis::type' => ['int', 'key'=>'string'],
'Redis::unlink' => ['int', 'key'=>'string', '...args'=>'string'],
'Redis::unlink\'1' => ['int', 'key'=>'string[]'],
'Redis::unsubscribe' => ['', 'channel'=>'string', '...other_channels='=>'string'],
'Redis::unwatch' => [''],
'Redis::wait' => ['int', 'numSlaves'=>'int', 'timeout'=>'int'],
'Redis::watch' => ['void', 'key'=>'string', '...other_keys='=>'string'],
'Redis::xack' => ['', 'str_key'=>'string', 'str_group'=>'string', 'arr_ids'=>'array'],
'Redis::xadd' => ['', 'str_key'=>'string', 'str_id'=>'string', 'arr_fields'=>'array', 'i_maxlen='=>'', 'boo_approximate='=>''],
'Redis::xclaim' => ['', 'str_key'=>'string', 'str_group'=>'string', 'str_consumer'=>'string', 'i_min_idle'=>'', 'arr_ids'=>'array', 'arr_opts='=>'array'],
'Redis::xdel' => ['', 'str_key'=>'string', 'arr_ids'=>'array'],
'Redis::xgroup' => ['', 'str_operation'=>'string', 'str_key='=>'string', 'str_arg1='=>'', 'str_arg2='=>'', 'str_arg3='=>''],
'Redis::xinfo' => ['', 'str_cmd'=>'string', 'str_key='=>'string', 'str_group='=>'string'],
'Redis::xlen' => ['', 'key'=>''],
'Redis::xpending' => ['', 'str_key'=>'string', 'str_group'=>'string', 'str_start='=>'', 'str_end='=>'', 'i_count='=>'', 'str_consumer='=>'string'],
'Redis::xrange' => ['', 'str_key'=>'string', 'str_start'=>'', 'str_end'=>'', 'i_count='=>''],
'Redis::xread' => ['', 'arr_streams'=>'array', 'i_count='=>'', 'i_block='=>''],
'Redis::xreadgroup' => ['', 'str_group'=>'string', 'str_consumer'=>'string', 'arr_streams'=>'array', 'i_count='=>'', 'i_block='=>''],
'Redis::xrevrange' => ['', 'str_key'=>'string', 'str_start'=>'', 'str_end'=>'', 'i_count='=>''],
'Redis::xtrim' => ['', 'str_key'=>'string', 'i_maxlen'=>'', 'boo_approximate='=>''],
'Redis::zAdd' => ['int', 'key'=>'string', 'score1'=>'float', 'value1'=>'string', 'score2='=>'float', 'value2='=>'string', 'scoreN='=>'float', 'valueN='=>'string'],
'Redis::zAdd\'1' => ['int', 'options'=>'array', 'key'=>'string', 'score1'=>'float', 'value1'=>'string', 'score2='=>'float', 'value2='=>'string', 'scoreN='=>'float', 'valueN='=>'string'],
'Redis::zCard' => ['int', 'key'=>'string'],
'Redis::zCount' => ['int', 'key'=>'string', 'start'=>'string', 'end'=>'string'],
'Redis::zDelete' => ['int', 'key'=>'string', 'member'=>'string', '...other_members='=>'string'],
'Redis::zDeleteRangeByRank' => ['', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'Redis::zDeleteRangeByScore' => ['', 'key'=>'string', 'start'=>'float', 'end'=>'float'],
'Redis::zIncrBy' => ['float', 'key'=>'string', 'value'=>'float', 'member'=>'string'],
'Redis::zInter' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'],
'Redis::zInterStore' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'],
'Redis::zLexCount' => ['int', 'key'=>'string', 'min'=>'string', 'max'=>'string'],
'Redis::zRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscores='=>'bool'],
'Redis::zRangeByLex' => ['array|false', 'key'=>'string', 'min'=>'int', 'max'=>'int', 'offset='=>'int', 'limit='=>'int'],
'Redis::zRangeByScore' => ['array', 'key'=>'string', 'start'=>'int|string', 'end'=>'int|string', 'options='=>'array'],
'Redis::zRank' => ['int', 'key'=>'string', 'member'=>'string'],
'Redis::zRem' => ['int', 'key'=>'string', 'member'=>'string', '...other_members='=>'string'],
'Redis::zRemove' => ['int', 'key'=>'string', 'member'=>'string', '...other_members='=>'string'],
'Redis::zRemoveRangeByRank' => ['int', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'Redis::zRemoveRangeByScore' => ['int', 'key'=>'string', 'start'=>'float|string', 'end'=>'float|string'],
'Redis::zRemRangeByLex' => ['int', 'key'=>'string', 'min'=>'string', 'max'=>'string'],
'Redis::zRemRangeByRank' => ['int', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'Redis::zRemRangeByScore' => ['int', 'key'=>'string', 'start'=>'float|string', 'end'=>'float|string'],
'Redis::zReverseRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscore='=>'bool'],
'Redis::zRevRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscore='=>'bool'],
'Redis::zRevRangeByLex' => ['array', 'key'=>'string', 'min'=>'string', 'max'=>'string', 'offset='=>'int', 'limit='=>'int'],
'Redis::zRevRangeByScore' => ['array', 'key'=>'string', 'start'=>'string', 'end'=>'string', 'options='=>'array'],
'Redis::zRevRank' => ['int', 'key'=>'string', 'member'=>'string'],
'Redis::zScan' => ['array|bool', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'string', 'count='=>'int'],
'Redis::zScore' => ['float|false', 'key'=>'string', 'member'=>'string'],
'Redis::zSize' => ['', 'key'=>'string'],
'Redis::zUnion' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'],
'Redis::zUnionStore' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'],
'RedisArray::__call' => ['mixed', 'function_name'=>'string', 'arguments'=>'array'],
'RedisArray::__construct' => ['void', 'name='=>'string', 'hosts='=>'?array', 'opts='=>'?array'],
'RedisArray::_continuum' => [''],
'RedisArray::_distributor' => [''],
'RedisArray::_function' => ['string'],
'RedisArray::_hosts' => ['array'],
'RedisArray::_instance' => ['', 'host'=>''],
'RedisArray::_rehash' => ['', 'callable='=>'callable'],
'RedisArray::_target' => ['string', 'key'=>'string'],
'RedisArray::bgsave' => [''],
'RedisArray::del' => ['bool', 'key'=>'string', '...args'=>'string'],
'RedisArray::delete' => ['bool', 'key'=>'string', '...args'=>'string'],
'RedisArray::delete\'1' => ['bool', 'key'=>'string[]'],
'RedisArray::discard' => [''],
'RedisArray::exec' => ['array'],
'RedisArray::flushAll' => ['bool', 'async='=>'bool'],
'RedisArray::flushDb' => ['bool', 'async='=>'bool'],
'RedisArray::getMultiple' => ['', 'keys'=>''],
'RedisArray::getOption' => ['', 'opt'=>''],
'RedisArray::info' => ['array'],
'RedisArray::keys' => ['array<int,string>', 'pattern'=>''],
'RedisArray::mGet' => ['array', 'keys'=>'string[]'],
'RedisArray::mSet' => ['bool', 'pairs'=>'array'],
'RedisArray::multi' => ['RedisArray', 'host'=>'string', 'mode='=>'int'],
'RedisArray::ping' => ['string'],
'RedisArray::save' => ['bool'],
'RedisArray::select' => ['', 'index'=>''],
'RedisArray::setOption' => ['', 'opt'=>'', 'value'=>''],
'RedisArray::unlink' => ['int', 'key'=>'string', '...other_keys='=>'string'],
'RedisArray::unlink\'1' => ['int', 'key'=>'string[]'],
'RedisArray::unwatch' => [''],
'RedisCluster::__construct' => ['void', 'name'=>'?string', 'seeds='=>'string[]', 'timeout='=>'float', 'readTimeout='=>'float', 'persistent='=>'bool', 'auth='=>'?string'],
'RedisCluster::_masters' => ['array'],
'RedisCluster::_prefix' => ['string', 'value'=>'mixed'],
'RedisCluster::_redir' => [''],
'RedisCluster::_serialize' => ['mixed', 'value'=>'mixed'],
'RedisCluster::_unserialize' => ['mixed', 'value'=>'string'],
'RedisCluster::append' => ['int', 'key'=>'string', 'value'=>'string'],
'RedisCluster::bgrewriteaof' => ['bool', 'nodeParams'=>'string|array{0:string,1:int}'],
'RedisCluster::bgsave' => ['bool', 'nodeParams'=>'string|array{0:string,1:int}'],
'RedisCluster::bitCount' => ['int', 'key'=>'string'],
'RedisCluster::bitOp' => ['int', 'operation'=>'string', 'retKey'=>'string', 'key1'=>'string', '...other_keys='=>'string'],
'RedisCluster::bitpos' => ['int', 'key'=>'string', 'bit'=>'int', 'start='=>'int', 'end='=>'int'],
'RedisCluster::blPop' => ['array', 'keys'=>'array', 'timeout'=>'int'],
'RedisCluster::brPop' => ['array', 'keys'=>'array', 'timeout'=>'int'],
'RedisCluster::brpoplpush' => ['string|false', 'srcKey'=>'string', 'dstKey'=>'string', 'timeout'=>'int'],
'RedisCluster::clearLastError' => ['bool'],
'RedisCluster::client' => ['', 'nodeParams'=>'string|array{0:string,1:int}', 'subCmd='=>'string', '...args='=>''],
'RedisCluster::close' => [''],
'RedisCluster::cluster' => ['mixed', 'nodeParams'=>'string|array{0:string,1:int}', 'command'=>'string', 'arguments='=>'mixed'],
'RedisCluster::command' => ['array|bool'],
'RedisCluster::config' => ['array|bool', 'nodeParams'=>'string|array{0:string,1:int}', 'operation'=>'string', 'key'=>'string', 'value='=>'string'],
'RedisCluster::dbSize' => ['int', 'nodeParams'=>'string|array{0:string,1:int}'],
'RedisCluster::decr' => ['int', 'key'=>'string'],
'RedisCluster::decrBy' => ['int', 'key'=>'string', 'value'=>'int'],
'RedisCluster::del' => ['int', 'key'=>'string', '...other_keys='=>'string'],
'RedisCluster::del\'1' => ['int', 'key'=>'string[]'],
'RedisCluster::discard' => [''],
'RedisCluster::dump' => ['string|false', 'key'=>'string'],
'RedisCluster::echo' => ['string', 'nodeParams'=>'string|array{0:string,1:int}', 'msg'=>'string'],
'RedisCluster::eval' => ['mixed', 'script'=>'', 'args='=>'', 'numKeys='=>''],
'RedisCluster::evalSha' => ['mixed', 'scriptSha'=>'string', 'args='=>'array', 'numKeys='=>'int'],
'RedisCluster::exec' => ['array|void'],
'RedisCluster::exists' => ['bool', 'key'=>'string'],
'RedisCluster::expire' => ['bool', 'key'=>'string', 'ttl'=>'int'],
'RedisCluster::expireAt' => ['bool', 'key'=>'string', 'timestamp'=>'int'],
'RedisCluster::flushAll' => ['bool', 'nodeParams'=>'string|array{0:string,1:int}', 'async='=>'bool'],
'RedisCluster::flushDB' => ['bool', 'nodeParams'=>'string|array{0:string,1:int}', 'async='=>'bool'],
'RedisCluster::geoAdd' => ['int', 'key'=>'string', 'longitude'=>'float', 'latitude'=>'float', 'member'=>'string', '...other_members='=>'float|string'],
'RedisCluster::geoDist' => ['', 'key'=>'string', 'member1'=>'string', 'member2'=>'string', 'unit='=>'string'],
'RedisCluster::geohash' => ['array<int,string>', 'key'=>'string', 'member'=>'string', '...other_members='=>'string'],
'RedisCluster::geopos' => ['array<int,array{0:string,1:string}>', 'key'=>'string', 'member'=>'string', '...other_members='=>'string'],
'RedisCluster::geoRadius' => ['', 'key'=>'string', 'longitude'=>'float', 'latitude'=>'float', 'radius'=>'float', 'radiusUnit'=>'string', 'options='=>'array'],
'RedisCluster::geoRadiusByMember' => ['string[]', 'key'=>'string', 'member'=>'string', 'radius'=>'float', 'radiusUnit'=>'string', 'options='=>'array'],
'RedisCluster::get' => ['string|false', 'key'=>'string'],
'RedisCluster::getBit' => ['int', 'key'=>'string', 'offset'=>'int'],
'RedisCluster::getLastError' => ['?string'],
'RedisCluster::getMode' => ['int'],
'RedisCluster::getOption' => ['int', 'name'=>'string'],
'RedisCluster::getRange' => ['string', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'RedisCluster::getSet' => ['string', 'key'=>'string', 'value'=>'string'],
'RedisCluster::hDel' => ['int|false', 'key'=>'string', 'hashKey'=>'string', '...other_hashKeys='=>'string[]'],
'RedisCluster::hExists' => ['bool', 'key'=>'string', 'hashKey'=>'string'],
'RedisCluster::hGet' => ['string|false', 'key'=>'string', 'hashKey'=>'string'],
'RedisCluster::hGetAll' => ['array', 'key'=>'string'],
'RedisCluster::hIncrBy' => ['int', 'key'=>'string', 'hashKey'=>'string', 'value'=>'int'],
'RedisCluster::hIncrByFloat' => ['float', 'key'=>'string', 'field'=>'string', 'increment'=>'float'],
'RedisCluster::hKeys' => ['array', 'key'=>'string'],
'RedisCluster::hLen' => ['int|false', 'key'=>'string'],
'RedisCluster::hMGet' => ['array', 'key'=>'string', 'hashKeys'=>'array'],
'RedisCluster::hMSet' => ['bool', 'key'=>'string', 'hashKeys'=>'array'],
'RedisCluster::hScan' => ['array', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'string', 'count='=>'int'],
'RedisCluster::hSet' => ['int', 'key'=>'string', 'hashKey'=>'string', 'value'=>'string'],
'RedisCluster::hSetNx' => ['bool', 'key'=>'string', 'hashKey'=>'string', 'value'=>'string'],
'RedisCluster::hStrlen' => ['int', 'key'=>'string', 'member'=>'string'],
'RedisCluster::hVals' => ['array', 'key'=>'string'],
'RedisCluster::incr' => ['int', 'key'=>'string'],
'RedisCluster::incrBy' => ['int', 'key'=>'string', 'value'=>'int'],
'RedisCluster::incrByFloat' => ['float', 'key'=>'string', 'increment'=>'float'],
'RedisCluster::info' => ['array', 'nodeParams'=>'string|array{0:string,1:int}', 'option='=>'string'],
'RedisCluster::keys' => ['array', 'pattern'=>'string'],
'RedisCluster::lastSave' => ['int', 'nodeParams'=>'string|array{0:string,1:int}'],
'RedisCluster::lGet' => ['', 'key'=>'string', 'index'=>'int'],
'RedisCluster::lIndex' => ['string|false', 'key'=>'string', 'index'=>'int'],
'RedisCluster::lInsert' => ['int', 'key'=>'string', 'position'=>'int', 'pivot'=>'string', 'value'=>'string'],
'RedisCluster::lLen' => ['int', 'key'=>'string'],
'RedisCluster::lPop' => ['string|false', 'key'=>'string'],
'RedisCluster::lPush' => ['int|false', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'],
'RedisCluster::lPushx' => ['int|false', 'key'=>'string', 'value'=>'string'],
'RedisCluster::lRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'RedisCluster::lRem' => ['int|false', 'key'=>'string', 'value'=>'string', 'count'=>'int'],
'RedisCluster::lSet' => ['bool', 'key'=>'string', 'index'=>'int', 'value'=>'string'],
'RedisCluster::lTrim' => ['array|false', 'key'=>'string', 'start'=>'int', 'stop'=>'int'],
'RedisCluster::mget' => ['array', 'array'=>'array'],
'RedisCluster::mset' => ['bool', 'array'=>'array'],
'RedisCluster::msetnx' => ['int', 'array'=>'array'],
'RedisCluster::multi' => ['Redis', 'mode='=>'int'],
'RedisCluster::object' => ['string|int|false', 'string'=>'string', 'key'=>'string'],
'RedisCluster::persist' => ['bool', 'key'=>'string'],
'RedisCluster::pExpire' => ['bool', 'key'=>'string', 'ttl'=>'int'],
'RedisCluster::pExpireAt' => ['bool', 'key'=>'string', 'timestamp'=>'int'],
'RedisCluster::pfAdd' => ['bool', 'key'=>'string', 'elements'=>'array'],
'RedisCluster::pfCount' => ['int', 'key'=>'string'],
'RedisCluster::pfMerge' => ['bool', 'destKey'=>'string', 'sourceKeys'=>'array'],
'RedisCluster::ping' => ['string', 'nodeParams'=>'string|array{0:string,1:int}'],
'RedisCluster::psetex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'],
'RedisCluster::psubscribe' => ['mixed', 'patterns'=>'array', 'callback'=>'string'],
'RedisCluster::pttl' => ['int', 'key'=>'string'],
'RedisCluster::publish' => ['int', 'channel'=>'string', 'message'=>'string'],
'RedisCluster::pubsub' => ['array', 'nodeParams'=>'string', 'keyword'=>'string', '...argument='=>'string'],
'RedisCluster::punSubscribe' => ['', 'channels'=>'', 'callback'=>''],
'RedisCluster::randomKey' => ['string', 'nodeParams'=>'string|array{0:string,1:int}'],
'RedisCluster::rawCommand' => ['mixed', 'nodeParams'=>'string|array{0:string,1:int}', 'command'=>'string', 'arguments='=>'mixed'],
'RedisCluster::rename' => ['bool', 'srcKey'=>'string', 'dstKey'=>'string'],
'RedisCluster::renameNx' => ['bool', 'srcKey'=>'string', 'dstKey'=>'string'],
'RedisCluster::restore' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'],
'RedisCluster::role' => ['array'],
'RedisCluster::rPop' => ['string|false', 'key'=>'string'],
'RedisCluster::rpoplpush' => ['string|false', 'srcKey'=>'string', 'dstKey'=>'string'],
'RedisCluster::rPush' => ['int|false', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'],
'RedisCluster::rPushx' => ['int|false', 'key'=>'string', 'value'=>'string'],
'RedisCluster::sAdd' => ['int|false', 'key'=>'string', 'value1'=>'string', 'value2='=>'string', 'valueN='=>'string'],
'RedisCluster::sAddArray' => ['int|false', 'key'=>'string', 'valueArray'=>'array'],
'RedisCluster::save' => ['bool', 'nodeParams'=>'string|array{0:string,1:int}'],
'RedisCluster::scan' => ['array|false', '&iterator'=>'int', 'nodeParams'=>'string|array{0:string,1:int}', 'pattern='=>'string', 'count='=>'int'],
'RedisCluster::sCard' => ['int', 'key'=>'string'],
'RedisCluster::script' => ['string|bool|array', 'nodeParams'=>'string|array{0:string,1:int}', 'command'=>'string', 'script='=>'string', '...other_scripts='=>'string[]'],
'RedisCluster::sDiff' => ['list<string>', 'key1'=>'string', 'key2'=>'string', '...other_keys='=>'string'],
'RedisCluster::sDiffStore' => ['int', 'dstKey'=>'string', 'key1'=>'string', '...other_keys='=>'string'],
'RedisCluster::set' => ['bool', 'key'=>'string', 'value'=>'string', 'timeout='=>'array|int'],
'RedisCluster::setBit' => ['int', 'key'=>'string', 'offset'=>'int', 'value'=>'bool|int'],
'RedisCluster::setex' => ['bool', 'key'=>'string', 'ttl'=>'int', 'value'=>'string'],
'RedisCluster::setnx' => ['bool', 'key'=>'string', 'value'=>'string'],
'RedisCluster::setOption' => ['bool', 'name'=>'string|int', 'value'=>'string|int'],
'RedisCluster::setRange' => ['string', 'key'=>'string', 'offset'=>'int', 'value'=>'string'],
'RedisCluster::sInter' => ['list<string>', 'key'=>'string', '...other_keys='=>'string'],
'RedisCluster::sInterStore' => ['int', 'dstKey'=>'string', 'key'=>'string', '...other_keys='=>'string'],
'RedisCluster::sIsMember' => ['bool', 'key'=>'string', 'value'=>'string'],
'RedisCluster::slowLog' => ['array|int|bool', 'nodeParams'=>'string|array{0:string,1:int}', 'command'=>'string', 'length='=>'int'],
'RedisCluster::sMembers' => ['list<string>', 'key'=>'string'],
'RedisCluster::sMove' => ['bool', 'srcKey'=>'string', 'dstKey'=>'string', 'member'=>'string'],
'RedisCluster::sort' => ['array', 'key'=>'string', 'option='=>'array'],
'RedisCluster::sPop' => ['string', 'key'=>'string'],
'RedisCluster::sRandMember' => ['array|string', 'key'=>'string', 'count='=>'int'],
'RedisCluster::sRem' => ['int', 'key'=>'string', 'member1'=>'string', '...other_members='=>'string'],
'RedisCluster::sScan' => ['array|false', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'null', 'count='=>'int'],
'RedisCluster::strlen' => ['int', 'key'=>'string'],
'RedisCluster::subscribe' => ['mixed', 'channels'=>'array', 'callback'=>'string'],
'RedisCluster::sUnion' => ['list<string>', 'key1'=>'string', '...other_keys='=>'string'],
'RedisCluster::sUnion\'1' => ['list<string>', 'keys'=>'string[]'],
'RedisCluster::sUnionStore' => ['int', 'dstKey'=>'string', 'key1'=>'string', '...other_keys='=>'string'],
'RedisCluster::time' => ['array'],
'RedisCluster::ttl' => ['int', 'key'=>'string'],
'RedisCluster::type' => ['int', 'key'=>'string'],
'RedisCluster::unlink' => ['int', 'key'=>'string', '...other_keys='=>'string'],
'RedisCluster::unSubscribe' => ['', 'channels'=>'', '...other_channels='=>''],
'RedisCluster::unwatch' => [''],
'RedisCluster::watch' => ['void', 'key'=>'string', '...other_keys='=>'string'],
'RedisCluster::xack' => ['', 'str_key'=>'string', 'str_group'=>'string', 'arr_ids'=>'array'],
'RedisCluster::xadd' => ['', 'str_key'=>'string', 'str_id'=>'string', 'arr_fields'=>'array', 'i_maxlen='=>'', 'boo_approximate='=>''],
'RedisCluster::xclaim' => ['', 'str_key'=>'string', 'str_group'=>'string', 'str_consumer'=>'string', 'i_min_idle'=>'', 'arr_ids'=>'array', 'arr_opts='=>'array'],
'RedisCluster::xdel' => ['', 'str_key'=>'string', 'arr_ids'=>'array'],
'RedisCluster::xgroup' => ['', 'str_operation'=>'string', 'str_key='=>'string', 'str_arg1='=>'', 'str_arg2='=>'', 'str_arg3='=>''],
'RedisCluster::xinfo' => ['', 'str_cmd'=>'string', 'str_key='=>'string', 'str_group='=>'string'],
'RedisCluster::xlen' => ['', 'key'=>''],
'RedisCluster::xpending' => ['', 'str_key'=>'string', 'str_group'=>'string', 'str_start='=>'', 'str_end='=>'', 'i_count='=>'', 'str_consumer='=>'string'],
'RedisCluster::xrange' => ['', 'str_key'=>'string', 'str_start'=>'', 'str_end'=>'', 'i_count='=>''],
'RedisCluster::xread' => ['', 'arr_streams'=>'array', 'i_count='=>'', 'i_block='=>''],
'RedisCluster::xreadgroup' => ['', 'str_group'=>'string', 'str_consumer'=>'string', 'arr_streams'=>'array', 'i_count='=>'', 'i_block='=>''],
'RedisCluster::xrevrange' => ['', 'str_key'=>'string', 'str_start'=>'', 'str_end'=>'', 'i_count='=>''],
'RedisCluster::xtrim' => ['', 'str_key'=>'string', 'i_maxlen'=>'', 'boo_approximate='=>''],
'RedisCluster::zAdd' => ['int', 'key'=>'string', 'score1'=>'float', 'value1'=>'string', 'score2='=>'float', 'value2='=>'string', 'scoreN='=>'float', 'valueN='=>'string'],
'RedisCluster::zCard' => ['int', 'key'=>'string'],
'RedisCluster::zCount' => ['int', 'key'=>'string', 'start'=>'string', 'end'=>'string'],
'RedisCluster::zIncrBy' => ['float', 'key'=>'string', 'value'=>'float', 'member'=>'string'],
'RedisCluster::zInterStore' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'],
'RedisCluster::zLexCount' => ['int', 'key'=>'string', 'min'=>'int', 'max'=>'int'],
'RedisCluster::zRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscores='=>'bool'],
'RedisCluster::zRangeByLex' => ['array', 'key'=>'string', 'min'=>'int', 'max'=>'int', 'offset='=>'int', 'limit='=>'int'],
'RedisCluster::zRangeByScore' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'options='=>'array'],
'RedisCluster::zRank' => ['int', 'key'=>'string', 'member'=>'string'],
'RedisCluster::zRem' => ['int', 'key'=>'string', 'member1'=>'string', '...other_members='=>'string'],
'RedisCluster::zRemRangeByLex' => ['array', 'key'=>'string', 'min'=>'int', 'max'=>'int'],
'RedisCluster::zRemRangeByRank' => ['int', 'key'=>'string', 'start'=>'int', 'end'=>'int'],
'RedisCluster::zRemRangeByScore' => ['int', 'key'=>'string', 'start'=>'float|string', 'end'=>'float|string'],
'RedisCluster::zRevRange' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'withscore='=>'bool'],
'RedisCluster::zRevRangeByLex' => ['array', 'key'=>'string', 'min'=>'int', 'max'=>'int', 'offset='=>'int', 'limit='=>'int'],
'RedisCluster::zRevRangeByScore' => ['array', 'key'=>'string', 'start'=>'int', 'end'=>'int', 'options='=>'array'],
'RedisCluster::zRevRank' => ['int', 'key'=>'string', 'member'=>'string'],
'RedisCluster::zScan' => ['array|false', 'key'=>'string', '&iterator'=>'int', 'pattern='=>'string', 'count='=>'int'],
'RedisCluster::zScore' => ['float', 'key'=>'string', 'member'=>'string'],
'RedisCluster::zUnionStore' => ['int', 'Output'=>'string', 'ZSetKeys'=>'array', 'Weights='=>'?array', 'aggregateFunction='=>'string'],
'Reflection::export' => ['?string', 'r'=>'reflector', 'return='=>'bool'],
'Reflection::getModifierNames' => ['array', 'modifiers'=>'int'],
'ReflectionClass::__clone' => ['void'],
'ReflectionClass::__construct' => ['void', 'argument'=>'object|class-string'],
'ReflectionClass::__toString' => ['string'],
'ReflectionClass::export' => ['?string', 'argument'=>'string|object', 'return='=>'bool'],
'ReflectionClass::getAttributes' => ['list<ReflectionAttribute>', 'name='=>'?string', 'flags='=>'int'],
'ReflectionClass::getConstant' => ['mixed', 'name'=>'string'],
'ReflectionClass::getConstants' => ['array<string,mixed>', 'filter=' => '?int'],
'ReflectionClass::getConstructor' => ['?ReflectionMethod'],
'ReflectionClass::getDefaultProperties' => ['array'],
'ReflectionClass::getDocComment' => ['string|false'],
'ReflectionClass::getEndLine' => ['int|false'],
'ReflectionClass::getExtension' => ['?ReflectionExtension'],
'ReflectionClass::getExtensionName' => ['string|false'],
'ReflectionClass::getFileName' => ['string|false'],
'ReflectionClass::getInterfaceNames' => ['list<class-string>'],
'ReflectionClass::getInterfaces' => ['array<class-string, ReflectionClass>'],
'ReflectionClass::getMethod' => ['ReflectionMethod', 'name'=>'string'],
'ReflectionClass::getMethods' => ['list<ReflectionMethod>', 'filter='=>'int'],
'ReflectionClass::getModifiers' => ['int'],
'ReflectionClass::getName' => ['class-string'],
'ReflectionClass::getNamespaceName' => ['string'],
'ReflectionClass::getParentClass' => ['ReflectionClass|false'],
'ReflectionClass::getProperties' => ['list<ReflectionProperty>', 'filter='=>'int'],
'ReflectionClass::getProperty' => ['ReflectionProperty', 'name'=>'string'],
'ReflectionClass::getReflectionConstant' => ['ReflectionClassConstant|false', 'name'=>'string'],
'ReflectionClass::getReflectionConstants' => ['list<ReflectionClassConstant>', 'filter='=>'?int'],
'ReflectionClass::getShortName' => ['string'],
'ReflectionClass::getStartLine' => ['int|false'],
'ReflectionClass::getStaticProperties' => ['array<string, ReflectionProperty>'],
'ReflectionClass::getStaticPropertyValue' => ['mixed', 'name'=>'string', 'default='=>'mixed'],
'ReflectionClass::getTraitAliases' => ['array<string,string>|null'],
'ReflectionClass::getTraitNames' => ['list<trait-string>|null'],
'ReflectionClass::getTraits' => ['array<trait-string,ReflectionClass>'],
'ReflectionClass::hasConstant' => ['bool', 'name'=>'string'],
'ReflectionClass::hasMethod' => ['bool', 'name'=>'string'],
'ReflectionClass::hasProperty' => ['bool', 'name'=>'string'],
'ReflectionClass::implementsInterface' => ['bool', 'interface_name'=>'interface-string|ReflectionClass'],
'ReflectionClass::inNamespace' => ['bool'],
'ReflectionClass::isAbstract' => ['bool'],
'ReflectionClass::isAnonymous' => ['bool'],
'ReflectionClass::isCloneable' => ['bool'],
'ReflectionClass::isFinal' => ['bool'],
'ReflectionClass::isInstance' => ['bool', 'object'=>'object'],
'ReflectionClass::isInstantiable' => ['bool'],
'ReflectionClass::isInterface' => ['bool'],
'ReflectionClass::isInternal' => ['bool'],
'ReflectionClass::isIterable' => ['bool'],
'ReflectionClass::isIterateable' => ['bool'],
'ReflectionClass::isSubclassOf' => ['bool', 'class'=>'class-string|ReflectionClass'],
'ReflectionClass::isTrait' => ['bool'],
'ReflectionClass::isUserDefined' => ['bool'],
'ReflectionClass::newInstance' => ['object', '...args='=>'mixed'],
'ReflectionClass::newInstanceArgs' => ['object', 'args='=>'array<array-key, mixed>'],
'ReflectionClass::newInstanceWithoutConstructor' => ['object'],
'ReflectionClass::setStaticPropertyValue' => ['void', 'name'=>'string', 'value'=>'mixed'],
'ReflectionClassConstant::__construct' => ['void', 'class'=>'mixed', 'name'=>'string'],
'ReflectionClassConstant::__toString' => ['string'],
'ReflectionClassConstant::export' => ['string', 'class'=>'mixed', 'name'=>'string', 'return='=>'bool'],
'ReflectionClassConstant::getAttributes' => ['list<ReflectionAttribute>', 'name='=>'?string', 'flags='=>'int'],
'ReflectionClassConstant::getDeclaringClass' => ['ReflectionClass'],
'ReflectionClassConstant::getDocComment' => ['string|false'],
'ReflectionClassConstant::getModifiers' => ['int'],
'ReflectionClassConstant::getName' => ['string'],
'ReflectionClassConstant::getValue' => ['scalar|array<scalar>|null'],
'ReflectionClassConstant::isPrivate' => ['bool'],
'ReflectionClassConstant::isProtected' => ['bool'],
'ReflectionClassConstant::isPublic' => ['bool'],
'ReflectionExtension::__clone' => ['void'],
'ReflectionExtension::__construct' => ['void', 'name'=>'string'],
'ReflectionExtension::__toString' => ['string'],
'ReflectionExtension::export' => ['?string', 'name'=>'string', 'return='=>'bool'],
'ReflectionExtension::getClasses' => ['array<class-string,ReflectionClass>'],
'ReflectionExtension::getClassNames' => ['list<class-string>'],
'ReflectionExtension::getConstants' => ['array<string,mixed>'],
'ReflectionExtension::getDependencies' => ['array<string,string>'],
'ReflectionExtension::getFunctions' => ['array<string,ReflectionFunction>'],
'ReflectionExtension::getINIEntries' => ['array<string,mixed>'],
'ReflectionExtension::getName' => ['string'],
'ReflectionExtension::getVersion' => ['string'],
'ReflectionExtension::info' => ['void'],
'ReflectionExtension::isPersistent' => ['bool'],
'ReflectionExtension::isTemporary' => ['bool'],
'ReflectionFunction::__construct' => ['void', 'name'=>'callable-string|Closure'],
'ReflectionFunction::__toString' => ['string'],
'ReflectionFunction::export' => ['?string', 'name'=>'string', 'return='=>'bool'],
'ReflectionFunction::getClosure' => ['?Closure'],
'ReflectionFunction::getClosureScopeClass' => ['ReflectionClass'],
'ReflectionFunction::getClosureThis' => ['bool'],
'ReflectionFunction::getDocComment' => ['string|false'],
'ReflectionFunction::getEndLine' => ['int|false'],
'ReflectionFunction::getExtension' => ['?ReflectionExtension'],
'ReflectionFunction::getExtensionName' => ['string|false'],
'ReflectionFunction::getFileName' => ['string|false'],
'ReflectionFunction::getName' => ['callable-string'],
'ReflectionFunction::getNamespaceName' => ['string'],
'ReflectionFunction::getNumberOfParameters' => ['int'],
'ReflectionFunction::getNumberOfRequiredParameters' => ['int'],
'ReflectionFunction::getParameters' => ['list<ReflectionParameter>'],
'ReflectionFunction::getReturnType' => ['?ReflectionType'],
'ReflectionFunction::getShortName' => ['string'],
'ReflectionFunction::getStartLine' => ['int|false'],
'ReflectionFunction::getStaticVariables' => ['array'],
'ReflectionFunction::hasReturnType' => ['bool'],
'ReflectionFunction::inNamespace' => ['bool'],
'ReflectionFunction::invoke' => ['mixed', '...args='=>'mixed'],
'ReflectionFunction::invokeArgs' => ['mixed', 'args'=>'array'],
'ReflectionFunction::isClosure' => ['bool'],
'ReflectionFunction::isDeprecated' => ['bool'],
'ReflectionFunction::isDisabled' => ['bool'],
'ReflectionFunction::isGenerator' => ['bool'],
'ReflectionFunction::isInternal' => ['bool'],
'ReflectionFunction::isUserDefined' => ['bool'],
'ReflectionFunction::isVariadic' => ['bool'],
'ReflectionFunction::returnsReference' => ['bool'],
'ReflectionFunctionAbstract::__clone' => ['void'],
'ReflectionFunctionAbstract::__toString' => ['string'],
'ReflectionFunctionAbstract::export' => ['?string'],
'ReflectionFunctionAbstract::getAttributes' => ['list<ReflectionAttribute>', 'name='=>'?string', 'flags='=>'int'],
'ReflectionFunctionAbstract::getClosureScopeClass' => ['ReflectionClass|null'],
'ReflectionFunctionAbstract::getClosureThis' => ['object|null'],
'ReflectionFunctionAbstract::getDocComment' => ['string|false'],
'ReflectionFunctionAbstract::getEndLine' => ['int|false'],
'ReflectionFunctionAbstract::getExtension' => ['ReflectionExtension'],
'ReflectionFunctionAbstract::getExtensionName' => ['string'],
'ReflectionFunctionAbstract::getFileName' => ['string|false'],
'ReflectionFunctionAbstract::getName' => ['string'],
'ReflectionFunctionAbstract::getNamespaceName' => ['string'],
'ReflectionFunctionAbstract::getNumberOfParameters' => ['int'],
'ReflectionFunctionAbstract::getNumberOfRequiredParameters' => ['int'],
'ReflectionFunctionAbstract::getParameters' => ['list<ReflectionParameter>'],
'ReflectionFunctionAbstract::getReturnType' => ['?ReflectionType'],
'ReflectionFunctionAbstract::getShortName' => ['string'],
'ReflectionFunctionAbstract::getStartLine' => ['int|false'],
'ReflectionFunctionAbstract::getStaticVariables' => ['array'],
'ReflectionFunctionAbstract::hasReturnType' => ['bool'],
'ReflectionFunctionAbstract::inNamespace' => ['bool'],
'ReflectionFunctionAbstract::isClosure' => ['bool'],
'ReflectionFunctionAbstract::isDeprecated' => ['bool'],
'ReflectionFunctionAbstract::isGenerator' => ['bool'],
'ReflectionFunctionAbstract::isInternal' => ['bool'],
'ReflectionFunctionAbstract::isUserDefined' => ['bool'],
'ReflectionFunctionAbstract::isVariadic' => ['bool'],
'ReflectionFunctionAbstract::returnsReference' => ['bool'],
'ReflectionGenerator::__construct' => ['void', 'generator'=>'object'],
'ReflectionGenerator::getExecutingFile' => ['string'],
'ReflectionGenerator::getExecutingGenerator' => ['Generator'],
'ReflectionGenerator::getExecutingLine' => ['int'],
'ReflectionGenerator::getFunction' => ['ReflectionFunctionAbstract'],
'ReflectionGenerator::getThis' => ['?object'],
'ReflectionGenerator::getTrace' => ['array', 'options='=>'int'],
'ReflectionMethod::__construct' => ['void', 'class'=>'class-string|object', 'name'=>'string'],
'ReflectionMethod::__construct\'1' => ['void', 'class_method'=>'string'],
'ReflectionMethod::__toString' => ['string'],
'ReflectionMethod::export' => ['?string', 'class'=>'string', 'name'=>'string', 'return='=>'bool'],
'ReflectionMethod::getClosure' => ['?Closure', 'object='=>'object'],
'ReflectionMethod::getClosureScopeClass' => ['ReflectionClass'],
'ReflectionMethod::getClosureThis' => ['object'],
'ReflectionMethod::getDeclaringClass' => ['ReflectionClass'],
'ReflectionMethod::getDocComment' => ['false|string'],
'ReflectionMethod::getEndLine' => ['false|int'],
'ReflectionMethod::getExtension' => ['ReflectionExtension'],
'ReflectionMethod::getExtensionName' => ['string'],
'ReflectionMethod::getFileName' => ['false|string'],
'ReflectionMethod::getModifiers' => ['int'],
'ReflectionMethod::getName' => ['string'],
'ReflectionMethod::getNamespaceName' => ['string'],
'ReflectionMethod::getNumberOfParameters' => ['int'],
'ReflectionMethod::getNumberOfRequiredParameters' => ['int'],
'ReflectionMethod::getParameters' => ['list<\ReflectionParameter>'],
'ReflectionMethod::getPrototype' => ['ReflectionMethod'],
'ReflectionMethod::getReturnType' => ['?ReflectionType'],
'ReflectionMethod::getShortName' => ['string'],
'ReflectionMethod::getStartLine' => ['false|int'],
'ReflectionMethod::getStaticVariables' => ['array'],
'ReflectionMethod::hasReturnType' => ['bool'],
'ReflectionMethod::inNamespace' => ['bool'],
'ReflectionMethod::invoke' => ['mixed', 'object'=>'?object', '...args='=>'mixed'],
'ReflectionMethod::invokeArgs' => ['mixed', 'object'=>'?object', 'args'=>'array'],
'ReflectionMethod::isAbstract' => ['bool'],
'ReflectionMethod::isClosure' => ['bool'],
'ReflectionMethod::isConstructor' => ['bool'],
'ReflectionMethod::isDeprecated' => ['bool'],
'ReflectionMethod::isDestructor' => ['bool'],
'ReflectionMethod::isFinal' => ['bool'],
'ReflectionMethod::isGenerator' => ['bool'],
'ReflectionMethod::isInternal' => ['bool'],
'ReflectionMethod::isPrivate' => ['bool'],
'ReflectionMethod::isProtected' => ['bool'],
'ReflectionMethod::isPublic' => ['bool'],
'ReflectionMethod::isStatic' => ['bool'],
'ReflectionMethod::isUserDefined' => ['bool'],
'ReflectionMethod::isVariadic' => ['bool'],
'ReflectionMethod::returnsReference' => ['bool'],
'ReflectionMethod::setAccessible' => ['void', 'visible'=>'bool'],
'ReflectionNamedType::__clone' => ['void'],
'ReflectionNamedType::__toString' => ['string'],
'ReflectionNamedType::allowsNull' => ['bool'],
'ReflectionNamedType::getName' => ['string'],
'ReflectionNamedType::isBuiltin' => ['bool'],
'ReflectionObject::__clone' => ['void'],
'ReflectionObject::__construct' => ['void', 'argument'=>'object'],
'ReflectionObject::__toString' => ['string'],
'ReflectionObject::export' => ['?string', 'argument'=>'object', 'return='=>'bool'],
'ReflectionObject::getConstant' => ['mixed', 'name'=>'string'],
'ReflectionObject::getConstants' => ['array<string,mixed>'],
'ReflectionObject::getConstructor' => ['?ReflectionMethod'],
'ReflectionObject::getDefaultProperties' => ['array'],
'ReflectionObject::getDocComment' => ['false|string'],
'ReflectionObject::getEndLine' => ['false|int'],
'ReflectionObject::getExtension' => ['?ReflectionExtension'],
'ReflectionObject::getExtensionName' => ['false|string'],
'ReflectionObject::getFileName' => ['false|string'],
'ReflectionObject::getInterfaceNames' => ['class-string[]'],
'ReflectionObject::getInterfaces' => ['array<string,\ReflectionClass>'],
'ReflectionObject::getMethod' => ['ReflectionMethod', 'name'=>'string'],
'ReflectionObject::getMethods' => ['ReflectionMethod[]', 'filter='=>'int'],
'ReflectionObject::getModifiers' => ['int'],
'ReflectionObject::getName' => ['string'],
'ReflectionObject::getNamespaceName' => ['string'],
'ReflectionObject::getParentClass' => ['ReflectionClass|false'],
'ReflectionObject::getProperties' => ['ReflectionProperty[]', 'filter='=>'int'],
'ReflectionObject::getProperty' => ['ReflectionProperty', 'name'=>'string'],
'ReflectionObject::getReflectionConstant' => ['ReflectionClassConstant', 'name'=>'string'],
'ReflectionObject::getReflectionConstants' => ['list<\ReflectionClassConstant>'],
'ReflectionObject::getShortName' => ['string'],
'ReflectionObject::getStartLine' => ['false|int'],
'ReflectionObject::getStaticProperties' => ['ReflectionProperty[]'],
'ReflectionObject::getStaticPropertyValue' => ['mixed', 'name'=>'string', 'default='=>'mixed'],
'ReflectionObject::getTraitAliases' => ['array<string,string>'],
'ReflectionObject::getTraitNames' => ['list<string>'],
'ReflectionObject::getTraits' => ['array<string,\ReflectionClass>'],
'ReflectionObject::hasConstant' => ['bool', 'name'=>'string'],
'ReflectionObject::hasMethod' => ['bool', 'name'=>'string'],
'ReflectionObject::hasProperty' => ['bool', 'name'=>'string'],
'ReflectionObject::implementsInterface' => ['bool', 'interface_name'=>'ReflectionClass|string'],
'ReflectionObject::inNamespace' => ['bool'],
'ReflectionObject::isAbstract' => ['bool'],
'ReflectionObject::isAnonymous' => ['bool'],
'ReflectionObject::isCloneable' => ['bool'],
'ReflectionObject::isFinal' => ['bool'],
'ReflectionObject::isInstance' => ['bool', 'object'=>'object'],
'ReflectionObject::isInstantiable' => ['bool'],
'ReflectionObject::isInterface' => ['bool'],
'ReflectionObject::isInternal' => ['bool'],
'ReflectionObject::isIterable' => ['bool'],
'ReflectionObject::isIterateable' => ['bool'],
'ReflectionObject::isSubclassOf' => ['bool', 'class'=>'ReflectionClass|string'],
'ReflectionObject::isTrait' => ['bool'],
'ReflectionObject::isUserDefined' => ['bool'],
'ReflectionObject::newInstance' => ['object', 'args='=>'mixed', '...args='=>'array'],
'ReflectionObject::newInstanceArgs' => ['object', 'args='=>'array'],
'ReflectionObject::newInstanceWithoutConstructor' => ['object'],
'ReflectionObject::setStaticPropertyValue' => ['void', 'name'=>'string', 'value'=>'string'],
'ReflectionParameter::__clone' => ['void'],
'ReflectionParameter::__construct' => ['void', 'function'=>'', 'parameter'=>''],
'ReflectionParameter::__toString' => ['string'],
'ReflectionParameter::allowsNull' => ['bool'],
'ReflectionParameter::canBePassedByValue' => ['bool'],
'ReflectionParameter::export' => ['?string', 'function'=>'string', 'parameter'=>'string', 'return='=>'bool'],
'ReflectionParameter::getAttributes' => ['list<ReflectionAttribute>', 'name='=>'?string', 'flags='=>'int'],
'ReflectionParameter::getClass' => ['?ReflectionClass'],
'ReflectionParameter::getDeclaringClass' => ['?ReflectionClass'],
'ReflectionParameter::getDeclaringFunction' => ['ReflectionFunctionAbstract'],
'ReflectionParameter::getDefaultValue' => ['mixed'],
'ReflectionParameter::getDefaultValueConstantName' => ['?string'],
'ReflectionParameter::getName' => ['string'],
'ReflectionParameter::getPosition' => ['int'],
'ReflectionParameter::getType' => ['?ReflectionType'],
'ReflectionParameter::hasType' => ['bool'],
'ReflectionParameter::isArray' => ['bool'],
'ReflectionParameter::isCallable' => ['?bool'],
'ReflectionParameter::isDefaultValueAvailable' => ['bool'],
'ReflectionParameter::isDefaultValueConstant' => ['bool'],
'ReflectionParameter::isOptional' => ['bool'],
'ReflectionParameter::isPassedByReference' => ['bool'],
'ReflectionParameter::isVariadic' => ['bool'],
'ReflectionProperty::__clone' => ['void'],
'ReflectionProperty::__construct' => ['void', 'class'=>'', 'name'=>'string'],
'ReflectionProperty::__toString' => ['string'],
'ReflectionProperty::export' => ['?string', 'class'=>'mixed', 'name'=>'string', 'return='=>'bool'],
'ReflectionProperty::getAttributes' => ['list<ReflectionAttribute>', 'name='=>'?string', 'flags='=>'int'],
'ReflectionProperty::getDeclaringClass' => ['ReflectionClass'],
'ReflectionProperty::getDocComment' => ['string|false'],
'ReflectionProperty::getModifiers' => ['int'],
'ReflectionProperty::getName' => ['string'],
'ReflectionProperty::getType' => ['?ReflectionType'],
'ReflectionProperty::getValue' => ['mixed', 'object='=>'object'],
'ReflectionProperty::hasType' => ['bool'],
'ReflectionProperty::isDefault' => ['bool'],
'ReflectionProperty::isPrivate' => ['bool'],
'ReflectionProperty::isProtected' => ['bool'],
'ReflectionProperty::isPublic' => ['bool'],
'ReflectionProperty::isStatic' => ['bool'],
'ReflectionProperty::setAccessible' => ['void', 'visible'=>'bool'],
'ReflectionProperty::setValue' => ['void', 'object'=>'null|object', 'value'=>''],
'ReflectionProperty::setValue\'1' => ['void', 'value'=>''],
'ReflectionType::__clone' => ['void'],
'ReflectionType::__toString' => ['string'],
'ReflectionType::allowsNull' => ['bool'],
'ReflectionUnionType::getTypes' => ['list<ReflectionNamedType>'],
'ReflectionZendExtension::__clone' => ['void'],
'ReflectionZendExtension::__construct' => ['void', 'name'=>'string'],
'ReflectionZendExtension::__toString' => ['string'],
'ReflectionZendExtension::export' => ['?string', 'name'=>'string', 'return='=>'bool'],
'ReflectionZendExtension::getAuthor' => ['string'],
'ReflectionZendExtension::getCopyright' => ['string'],
'ReflectionZendExtension::getName' => ['string'],
'ReflectionZendExtension::getURL' => ['string'],
'ReflectionZendExtension::getVersion' => ['string'],
'Reflector::__toString' => ['string'],
'Reflector::export' => ['?string'],
'RegexIterator::__construct' => ['void', 'iterator'=>'Iterator', 'regex'=>'string', 'mode='=>'int', 'flags='=>'int', 'preg_flags='=>'int'],
'RegexIterator::accept' => ['bool'],
'RegexIterator::current' => ['mixed'],
'RegexIterator::getFlags' => ['int'],
'RegexIterator::getInnerIterator' => ['Iterator'],
'RegexIterator::getMode' => ['int'],
'RegexIterator::getPregFlags' => ['int'],
'RegexIterator::getRegex' => ['string'],
'RegexIterator::key' => ['mixed'],
'RegexIterator::next' => ['void'],
'RegexIterator::rewind' => ['void'],
'RegexIterator::setFlags' => ['void', 'new_flags'=>'int'],
'RegexIterator::setMode' => ['void', 'new_mode'=>'int'],
'RegexIterator::setPregFlags' => ['void', 'new_flags'=>'int'],
'RegexIterator::valid' => ['bool'],
'register_event_handler' => ['bool', 'event_handler_func'=>'string', 'handler_register_name'=>'string', 'event_type_mask'=>'int'],
'register_shutdown_function' => ['void', 'callback'=>'callable', '...args='=>'mixed'],
'register_tick_function' => ['bool', 'callback'=>'callable():void', '...args='=>'mixed'],
'rename' => ['bool', 'from'=>'string', 'to'=>'string', 'context='=>'resource'],
'rename_function' => ['bool', 'original_name'=>'string', 'new_name'=>'string'],
'reset' => ['mixed|false', '&r_array'=>'array|object'],
'ResourceBundle::__construct' => ['void', 'locale'=>'string', 'bundlename'=>'string', 'fallback='=>'bool'],
'ResourceBundle::count' => ['int'],
'ResourceBundle::create' => ['?ResourceBundle', 'locale'=>'string', 'bundlename'=>'string', 'fallback='=>'bool'],
'ResourceBundle::get' => ['', 'index'=>'string|int', 'fallback='=>'bool'],
'ResourceBundle::getErrorCode' => ['int'],
'ResourceBundle::getErrorMessage' => ['string'],
'ResourceBundle::getLocales' => ['array', 'bundlename'=>'string'],
'resourcebundle_count' => ['int', 'bundle'=>'ResourceBundle'],
'resourcebundle_create' => ['?ResourceBundle', 'locale'=>'string', 'bundle'=>'string', 'fallback='=>'bool'],
'resourcebundle_get' => ['mixed|null', 'bundle'=>'ResourceBundle', 'index'=>'string|int', 'fallback='=>'bool'],
'resourcebundle_get_error_code' => ['int', 'bundle'=>'ResourceBundle'],
'resourcebundle_get_error_message' => ['string', 'bundle'=>'ResourceBundle'],
'resourcebundle_locales' => ['array', 'bundle'=>'string'],
'restore_error_handler' => ['true'],
'restore_exception_handler' => ['bool'],
'restore_include_path' => ['void'],
'rewind' => ['bool', 'stream'=>'resource'],
'rewinddir' => ['null|false', 'dir_handle='=>'resource'],
'rmdir' => ['bool', 'directory'=>'string', 'context='=>'resource'],
'round' => ['float', 'num'=>'float', 'precision='=>'int', 'mode='=>'int'],
'rpm_close' => ['bool', 'rpmr'=>'resource'],
'rpm_get_tag' => ['mixed', 'rpmr'=>'resource', 'tagnum'=>'int'],
'rpm_is_valid' => ['bool', 'filename'=>'string'],
'rpm_open' => ['resource|false', 'filename'=>'string'],
'rpm_version' => ['string'],
'rpmaddtag' => ['bool', 'tag'=>'int'],
'rpmdbinfo' => ['array', 'nevr'=>'string', 'full='=>'bool'],
'rpmdbsearch' => ['array', 'pattern'=>'string', 'rpmtag='=>'int', 'rpmmire='=>'int', 'full='=>'bool'],
'rpminfo' => ['array', 'path'=>'string', 'full='=>'bool', 'error='=>'string'],
'rpmvercmp' => ['int', 'evr1'=>'string', 'evr2'=>'string'],
'rrd_create' => ['bool', 'filename'=>'string', 'options'=>'array'],
'rrd_disconnect' => ['void'],
'rrd_error' => ['string'],
'rrd_fetch' => ['array', 'filename'=>'string', 'options'=>'array'],
'rrd_first' => ['int|false', 'file'=>'string', 'raaindex='=>'int'],
'rrd_graph' => ['array|false', 'filename'=>'string', 'options'=>'array'],
'rrd_info' => ['array|false', 'filename'=>'string'],
'rrd_last' => ['int', 'filename'=>'string'],
'rrd_lastupdate' => ['array|false', 'filename'=>'string'],
'rrd_restore' => ['bool', 'xml_file'=>'string', 'rrd_file'=>'string', 'options='=>'array'],
'rrd_tune' => ['bool', 'filename'=>'string', 'options'=>'array'],
'rrd_update' => ['bool', 'filename'=>'string', 'options'=>'array'],
'rrd_version' => ['string'],
'rrd_xport' => ['array|false', 'options'=>'array'],
'rrdc_disconnect' => ['void'],
'RRDCreator::__construct' => ['void', 'path'=>'string', 'starttime='=>'string', 'step='=>'int'],
'RRDCreator::addArchive' => ['void', 'description'=>'string'],
'RRDCreator::addDataSource' => ['void', 'description'=>'string'],
'RRDCreator::save' => ['bool'],
'RRDGraph::__construct' => ['void', 'path'=>'string'],
'RRDGraph::save' => ['array|false'],
'RRDGraph::saveVerbose' => ['array|false'],
'RRDGraph::setOptions' => ['void', 'options'=>'array'],
'RRDUpdater::__construct' => ['void', 'path'=>'string'],
'RRDUpdater::update' => ['bool', 'values'=>'array', 'time='=>'string'],
'rsort' => ['bool', '&rw_array'=>'array', 'flags='=>'int'],
'rtrim' => ['string', 'string'=>'string', 'characters='=>'string'],
'runkit7_constant_add' => ['bool', 'constant_name'=>'string', 'value'=>'mixed', 'new_visibility='=>'int'],
'runkit7_constant_redefine' => ['bool', 'constant_name'=>'string', 'value'=>'mixed', 'new_visibility='=>'?int'],
'runkit7_constant_remove' => ['bool', 'constant_name'=>'string'],
'runkit7_function_add' => ['bool', 'function_name'=>'string', 'argument_list_or_closure'=>'Closure|string', 'code_or_doc_comment='=>'?string', 'return_by_reference='=>'?bool', 'doc_comment='=>'?string', 'return_type='=>'?string', 'is_strict='=>'?bool'],
'runkit7_function_copy' => ['bool', 'source_name'=>'string', 'target_name'=>'string'],
'runkit7_function_redefine' => ['bool', 'function_name'=>'string', 'argument_list_or_closure'=>'Closure|string', 'code_or_doc_comment='=>'?string', 'return_by_reference='=>'?bool', 'doc_comment='=>'?string', 'return_type='=>'?string', 'is_strict='=>'?bool'],
'runkit7_function_remove' => ['bool', 'function_name'=>'string'],
'runkit7_function_rename' => ['bool', 'source_name'=>'string', 'target_name'=>'string'],
'runkit7_import' => ['bool', 'filename'=>'string', 'flags='=>'?int'],
'runkit7_method_add' => ['bool', 'class_name'=>'string', 'method_name'=>'string', 'argument_list_or_closure'=>'Closure|string', 'code_or_flags='=>'int|null|string', 'flags_or_doc_comment='=>'int|null|string', 'doc_comment='=>'?string', 'return_type='=>'?string', 'is_strict='=>'?bool'],
'runkit7_method_copy' => ['bool', 'destination_class'=>'string', 'destination_method'=>'string', 'source_class'=>'string', 'source_method='=>'?string'],
'runkit7_method_redefine' => ['bool', 'class_name'=>'string', 'method_name'=>'string', 'argument_list_or_closure'=>'Closure|string', 'code_or_flags='=>'int|null|string', 'flags_or_doc_comment='=>'int|null|string', 'doc_comment='=>'?string', 'return_type='=>'?string', 'is_strict='=>'?bool'],
'runkit7_method_remove' => ['bool', 'class_name'=>'string', 'method_name'=>'string'],
'runkit7_method_rename' => ['bool', 'class_name'=>'string', 'source_method_name'=>'string', 'source_target_name'=>'string'],
'runkit7_superglobals' => ['array'],
'runkit7_zval_inspect' => ['array', 'value'=>'mixed'],
'runkit_class_adopt' => ['bool', 'classname'=>'string', 'parentname'=>'string'],
'runkit_class_emancipate' => ['bool', 'classname'=>'string'],
'runkit_constant_add' => ['bool', 'constname'=>'string', 'value'=>'mixed'],
'runkit_constant_redefine' => ['bool', 'constname'=>'string', 'newvalue'=>'mixed'],
'runkit_constant_remove' => ['bool', 'constname'=>'string'],
'runkit_function_add' => ['bool', 'funcname'=>'string', 'arglist'=>'string', 'code'=>'string', 'doccomment='=>'?string'],
'runkit_function_add\'1' => ['bool', 'funcname'=>'string', 'closure'=>'Closure', 'doccomment='=>'?string'],
'runkit_function_copy' => ['bool', 'funcname'=>'string', 'targetname'=>'string'],
'runkit_function_redefine' => ['bool', 'funcname'=>'string', 'arglist'=>'string', 'code'=>'string', 'doccomment='=>'?string'],
'runkit_function_redefine\'1' => ['bool', 'funcname'=>'string', 'closure'=>'Closure', 'doccomment='=>'?string'],
'runkit_function_remove' => ['bool', 'funcname'=>'string'],
'runkit_function_rename' => ['bool', 'funcname'=>'string', 'newname'=>'string'],
'runkit_import' => ['bool', 'filename'=>'string', 'flags='=>'int'],
'runkit_lint' => ['bool', 'code'=>'string'],
'runkit_lint_file' => ['bool', 'filename'=>'string'],
'runkit_method_add' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'args'=>'string', 'code'=>'string', 'flags='=>'int', 'doccomment='=>'?string'],
'runkit_method_add\'1' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'closure'=>'Closure', 'flags='=>'int', 'doccomment='=>'?string'],
'runkit_method_copy' => ['bool', 'dclass'=>'string', 'dmethod'=>'string', 'sclass'=>'string', 'smethod='=>'string'],
'runkit_method_redefine' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'args'=>'string', 'code'=>'string', 'flags='=>'int', 'doccomment='=>'?string'],
'runkit_method_redefine\'1' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'closure'=>'Closure', 'flags='=>'int', 'doccomment='=>'?string'],
'runkit_method_remove' => ['bool', 'classname'=>'string', 'methodname'=>'string'],
'runkit_method_rename' => ['bool', 'classname'=>'string', 'methodname'=>'string', 'newname'=>'string'],
'runkit_return_value_used' => ['bool'],
'Runkit_Sandbox::__construct' => ['void', 'options='=>'array'],
'runkit_sandbox_output_handler' => ['mixed', 'sandbox'=>'object', 'callback='=>'mixed'],
'Runkit_Sandbox_Parent' => [''],
'Runkit_Sandbox_Parent::__construct' => ['void'],
'runkit_superglobals' => ['array'],
'runkit_zval_inspect' => ['array', 'value'=>'mixed'],
'RuntimeException::__clone' => ['void'],
'RuntimeException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?RuntimeException'],
'RuntimeException::__toString' => ['string'],
'RuntimeException::getCode' => ['int'],
'RuntimeException::getFile' => ['string'],
'RuntimeException::getLine' => ['int'],
'RuntimeException::getMessage' => ['string'],
'RuntimeException::getPrevious' => ['Throwable|RuntimeException|null'],
'RuntimeException::getTrace' => ['list<array<string,mixed>>'],
'RuntimeException::getTraceAsString' => ['string'],
'SAMConnection::commit' => ['bool'],
'SAMConnection::connect' => ['bool', 'protocol'=>'string', 'properties='=>'array'],
'SAMConnection::disconnect' => ['bool'],
'SAMConnection::errno' => ['int'],
'SAMConnection::error' => ['string'],
'SAMConnection::isConnected' => ['bool'],
'SAMConnection::peek' => ['SAMMessage', 'target'=>'string', 'properties='=>'array'],
'SAMConnection::peekAll' => ['array', 'target'=>'string', 'properties='=>'array'],
'SAMConnection::receive' => ['SAMMessage', 'target'=>'string', 'properties='=>'array'],
'SAMConnection::remove' => ['SAMMessage', 'target'=>'string', 'properties='=>'array'],
'SAMConnection::rollback' => ['bool'],
'SAMConnection::send' => ['string', 'target'=>'string', 'msg'=>'sammessage', 'properties='=>'array'],
'SAMConnection::setDebug' => ['', 'switch'=>'bool'],
'SAMConnection::subscribe' => ['string', 'targettopic'=>'string'],
'SAMConnection::unsubscribe' => ['bool', 'subscriptionid'=>'string', 'targettopic='=>'string'],
'SAMMessage::body' => ['string'],
'SAMMessage::header' => ['object'],
'sapi_windows_cp_conv' => ['string', 'in_codepage'=>'int|string', 'out_codepage'=>'int|string', 'subject'=>'string'],
'sapi_windows_cp_get' => ['int'],
'sapi_windows_cp_is_utf8' => ['bool'],
'sapi_windows_cp_set' => ['bool', 'codepage'=>'int'],
'sapi_windows_vt100_support' => ['bool', 'stream'=>'resource', 'enable='=>'bool'],
'Saxon\SaxonProcessor::__construct' => ['void', 'license='=>'bool', 'cwd='=>'string'],
'Saxon\SaxonProcessor::createAtomicValue' => ['Saxon\XdmValue', 'primitive_type_val'=>'bool|float|int|string'],
'Saxon\SaxonProcessor::newSchemaValidator' => ['Saxon\SchemaValidator'],
'Saxon\SaxonProcessor::newXPathProcessor' => ['Saxon\XPathProcessor'],
'Saxon\SaxonProcessor::newXQueryProcessor' => ['Saxon\XQueryProcessor'],
'Saxon\SaxonProcessor::newXsltProcessor' => ['Saxon\XsltProcessor'],
'Saxon\SaxonProcessor::parseXmlFromFile' => ['Saxon\XdmNode', 'fileName'=>'string'],
'Saxon\SaxonProcessor::parseXmlFromString' => ['Saxon\XdmNode', 'value'=>'string'],
'Saxon\SaxonProcessor::registerPHPFunctions' => ['void', 'library'=>'string'],
'Saxon\SaxonProcessor::setConfigurationProperty' => ['void', 'name'=>'string', 'value'=>'string'],
'Saxon\SaxonProcessor::setcwd' => ['void', 'cwd'=>'string'],
'Saxon\SaxonProcessor::setResourceDirectory' => ['void', 'dir'=>'string'],
'Saxon\SaxonProcessor::version' => ['string'],
'Saxon\SchemaValidator::clearParameters' => ['void'],
'Saxon\SchemaValidator::clearProperties' => ['void'],
'Saxon\SchemaValidator::exceptionClear' => ['void'],
'Saxon\SchemaValidator::getErrorCode' => ['string', 'i'=>'int'],
'Saxon\SchemaValidator::getErrorMessage' => ['string', 'i'=>'int'],
'Saxon\SchemaValidator::getExceptionCount' => ['int'],
'Saxon\SchemaValidator::getValidationReport' => ['Saxon\XdmNode'],
'Saxon\SchemaValidator::registerSchemaFromFile' => ['void', 'fileName'=>'string'],
'Saxon\SchemaValidator::registerSchemaFromString' => ['void', 'schemaStr'=>'string'],
'Saxon\SchemaValidator::setOutputFile' => ['void', 'fileName'=>'string'],
'Saxon\SchemaValidator::setParameter' => ['void', 'name'=>'string', 'value'=>'Saxon\XdmValue'],
'Saxon\SchemaValidator::setProperty' => ['void', 'name'=>'string', 'value'=>'string'],
'Saxon\SchemaValidator::setSourceNode' => ['void', 'node'=>'Saxon\XdmNode'],
'Saxon\SchemaValidator::validate' => ['void', 'filename='=>'?string'],
'Saxon\SchemaValidator::validateToNode' => ['Saxon\XdmNode', 'filename='=>'?string'],
'Saxon\XdmAtomicValue::addXdmItem' => ['', 'item'=>'Saxon\XdmItem'],
'Saxon\XdmAtomicValue::getAtomicValue' => ['?Saxon\XdmAtomicValue'],
'Saxon\XdmAtomicValue::getBooleanValue' => ['bool'],
'Saxon\XdmAtomicValue::getDoubleValue' => ['float'],
'Saxon\XdmAtomicValue::getHead' => ['Saxon\XdmItem'],
'Saxon\XdmAtomicValue::getLongValue' => ['int'],
'Saxon\XdmAtomicValue::getNodeValue' => ['?Saxon\XdmNode'],
'Saxon\XdmAtomicValue::getStringValue' => ['string'],
'Saxon\XdmAtomicValue::isAtomic' => ['true'],
'Saxon\XdmAtomicValue::isNode' => ['bool'],
'Saxon\XdmAtomicValue::itemAt' => ['Saxon\XdmItem', 'index'=>'int'],
'Saxon\XdmAtomicValue::size' => ['int'],
'Saxon\XdmItem::addXdmItem' => ['', 'item'=>'Saxon\XdmItem'],
'Saxon\XdmItem::getAtomicValue' => ['?Saxon\XdmAtomicValue'],
'Saxon\XdmItem::getHead' => ['Saxon\XdmItem'],
'Saxon\XdmItem::getNodeValue' => ['?Saxon\XdmNode'],
'Saxon\XdmItem::getStringValue' => ['string'],
'Saxon\XdmItem::isAtomic' => ['bool'],
'Saxon\XdmItem::isNode' => ['bool'],
'Saxon\XdmItem::itemAt' => ['Saxon\XdmItem', 'index'=>'int'],
'Saxon\XdmItem::size' => ['int'],
'Saxon\XdmNode::addXdmItem' => ['', 'item'=>'Saxon\XdmItem'],
'Saxon\XdmNode::getAtomicValue' => ['?Saxon\XdmAtomicValue'],
'Saxon\XdmNode::getAttributeCount' => ['int'],
'Saxon\XdmNode::getAttributeNode' => ['?Saxon\XdmNode', 'index'=>'int'],
'Saxon\XdmNode::getAttributeValue' => ['?string', 'index'=>'int'],
'Saxon\XdmNode::getChildCount' => ['int'],
'Saxon\XdmNode::getChildNode' => ['?Saxon\XdmNode', 'index'=>'int'],
'Saxon\XdmNode::getHead' => ['Saxon\XdmItem'],
'Saxon\XdmNode::getNodeKind' => ['int'],
'Saxon\XdmNode::getNodeName' => ['string'],
'Saxon\XdmNode::getNodeValue' => ['?Saxon\XdmNode'],
'Saxon\XdmNode::getParent' => ['?Saxon\XdmNode'],
'Saxon\XdmNode::getStringValue' => ['string'],
'Saxon\XdmNode::isAtomic' => ['false'],
'Saxon\XdmNode::isNode' => ['bool'],
'Saxon\XdmNode::itemAt' => ['Saxon\XdmItem', 'index'=>'int'],
'Saxon\XdmNode::size' => ['int'],
'Saxon\XdmValue::addXdmItem' => ['', 'item'=>'Saxon\XdmItem'],
'Saxon\XdmValue::getHead' => ['Saxon\XdmItem'],
'Saxon\XdmValue::itemAt' => ['Saxon\XdmItem', 'index'=>'int'],
'Saxon\XdmValue::size' => ['int'],
'Saxon\XPathProcessor::clearParameters' => ['void'],
'Saxon\XPathProcessor::clearProperties' => ['void'],
'Saxon\XPathProcessor::declareNamespace' => ['void', 'prefix'=>'', 'namespace'=>''],
'Saxon\XPathProcessor::effectiveBooleanValue' => ['bool', 'xpathStr'=>'string'],
'Saxon\XPathProcessor::evaluate' => ['Saxon\XdmValue', 'xpathStr'=>'string'],
'Saxon\XPathProcessor::evaluateSingle' => ['Saxon\XdmItem', 'xpathStr'=>'string'],
'Saxon\XPathProcessor::exceptionClear' => ['void'],
'Saxon\XPathProcessor::getErrorCode' => ['string', 'i'=>'int'],
'Saxon\XPathProcessor::getErrorMessage' => ['string', 'i'=>'int'],
'Saxon\XPathProcessor::getExceptionCount' => ['int'],
'Saxon\XPathProcessor::setBaseURI' => ['void', 'uri'=>'string'],
'Saxon\XPathProcessor::setContextFile' => ['void', 'fileName'=>'string'],
'Saxon\XPathProcessor::setContextItem' => ['void', 'item'=>'Saxon\XdmItem'],
'Saxon\XPathProcessor::setParameter' => ['void', 'name'=>'string', 'value'=>'Saxon\XdmValue'],
'Saxon\XPathProcessor::setProperty' => ['void', 'name'=>'string', 'value'=>'string'],
'Saxon\XQueryProcessor::clearParameters' => ['void'],
'Saxon\XQueryProcessor::clearProperties' => ['void'],
'Saxon\XQueryProcessor::declareNamespace' => ['void', 'prefix'=>'string', 'namespace'=>'string'],
'Saxon\XQueryProcessor::exceptionClear' => ['void'],
'Saxon\XQueryProcessor::getErrorCode' => ['string', 'i'=>'int'],
'Saxon\XQueryProcessor::getErrorMessage' => ['string', 'i'=>'int'],
'Saxon\XQueryProcessor::getExceptionCount' => ['int'],
'Saxon\XQueryProcessor::runQueryToFile' => ['void', 'outfilename'=>'string'],
'Saxon\XQueryProcessor::runQueryToString' => ['?string'],
'Saxon\XQueryProcessor::runQueryToValue' => ['?Saxon\XdmValue'],
'Saxon\XQueryProcessor::setContextItem' => ['void', 'object'=>'Saxon\XdmAtomicValue|Saxon\XdmItem|Saxon\XdmNode|Saxon\XdmValue'],
'Saxon\XQueryProcessor::setContextItemFromFile' => ['void', 'fileName'=>'string'],
'Saxon\XQueryProcessor::setParameter' => ['void', 'name'=>'string', 'value'=>'Saxon\XdmValue'],
'Saxon\XQueryProcessor::setProperty' => ['void', 'name'=>'string', 'value'=>'string'],
'Saxon\XQueryProcessor::setQueryBaseURI' => ['void', 'uri'=>'string'],
'Saxon\XQueryProcessor::setQueryContent' => ['void', 'string'=>'string'],
'Saxon\XQueryProcessor::setQueryFile' => ['void', 'filename'=>'string'],
'Saxon\XQueryProcessor::setQueryItem' => ['void', 'item'=>'Saxon\XdmItem'],
'Saxon\XsltProcessor::clearParameters' => ['void'],
'Saxon\XsltProcessor::clearProperties' => ['void'],
'Saxon\XsltProcessor::compileFromFile' => ['void', 'fileName'=>'string'],
'Saxon\XsltProcessor::compileFromString' => ['void', 'string'=>'string'],
'Saxon\XsltProcessor::compileFromValue' => ['void', 'node'=>'Saxon\XdmNode'],
'Saxon\XsltProcessor::exceptionClear' => ['void'],
'Saxon\XsltProcessor::getErrorCode' => ['string', 'i'=>'int'],
'Saxon\XsltProcessor::getErrorMessage' => ['string', 'i'=>'int'],
'Saxon\XsltProcessor::getExceptionCount' => ['int'],
'Saxon\XsltProcessor::setOutputFile' => ['void', 'fileName'=>'string'],
'Saxon\XsltProcessor::setParameter' => ['void', 'name'=>'string', 'value'=>'Saxon\XdmValue'],
'Saxon\XsltProcessor::setProperty' => ['void', 'name'=>'string', 'value'=>'string'],
'Saxon\XsltProcessor::setSourceFromFile' => ['void', 'filename'=>'string'],
'Saxon\XsltProcessor::setSourceFromXdmValue' => ['void', 'value'=>'Saxon\XdmValue'],
'Saxon\XsltProcessor::transformFileToFile' => ['void', 'sourceFileName'=>'string', 'stylesheetFileName'=>'string', 'outputfileName'=>'string'],
'Saxon\XsltProcessor::transformFileToString' => ['?string', 'sourceFileName'=>'string', 'stylesheetFileName'=>'string'],
'Saxon\XsltProcessor::transformFileToValue' => ['Saxon\XdmValue', 'fileName'=>'string'],
'Saxon\XsltProcessor::transformToFile' => ['void'],
'Saxon\XsltProcessor::transformToString' => ['string'],
'Saxon\XsltProcessor::transformToValue' => ['?Saxon\XdmValue'],
'SCA::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'],
'SCA::getService' => ['', 'target'=>'string', 'binding='=>'string', 'config='=>'array'],
'SCA_LocalProxy::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'],
'SCA_SoapProxy::createDataObject' => ['SDO_DataObject', 'type_namespace_uri'=>'string', 'type_name'=>'string'],
'scalebarObj::convertToString' => ['string'],
'scalebarObj::free' => ['void'],
'scalebarObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'scalebarObj::setImageColor' => ['int', 'red'=>'int', 'green'=>'int', 'blue'=>'int'],
'scalebarObj::updateFromString' => ['int', 'snippet'=>'string'],
'scandir' => ['list<string>|false', 'directory'=>'string', 'sorting_order='=>'int', 'context='=>'resource'],
'SDO_DAS_ChangeSummary::beginLogging' => [''],
'SDO_DAS_ChangeSummary::endLogging' => [''],
'SDO_DAS_ChangeSummary::getChangedDataObjects' => ['SDO_List'],
'SDO_DAS_ChangeSummary::getChangeType' => ['int', 'dataobject'=>'sdo_dataobject'],
'SDO_DAS_ChangeSummary::getOldContainer' => ['SDO_DataObject', 'data_object'=>'sdo_dataobject'],
'SDO_DAS_ChangeSummary::getOldValues' => ['SDO_List', 'data_object'=>'sdo_dataobject'],
'SDO_DAS_ChangeSummary::isLogging' => ['bool'],
'SDO_DAS_DataFactory::addPropertyToType' => ['', 'parent_type_namespace_uri'=>'string', 'parent_type_name'=>'string', 'property_name'=>'string', 'type_namespace_uri'=>'string', 'type_name'=>'string', 'options='=>'array'],
'SDO_DAS_DataFactory::addType' => ['', 'type_namespace_uri'=>'string', 'type_name'=>'string', 'options='=>'array'],
'SDO_DAS_DataFactory::getDataFactory' => ['SDO_DAS_DataFactory'],
'SDO_DAS_DataObject::getChangeSummary' => ['SDO_DAS_ChangeSummary'],
'SDO_DAS_Relational::__construct' => ['void', 'database_metadata'=>'array', 'application_root_type='=>'string', 'sdo_containment_references_metadata='=>'array'],
'SDO_DAS_Relational::applyChanges' => ['', 'database_handle'=>'pdo', 'root_data_object'=>'sdodataobject'],
'SDO_DAS_Relational::createRootDataObject' => ['SDODataObject'],
'SDO_DAS_Relational::executePreparedQuery' => ['SDODataObject', 'database_handle'=>'pdo', 'prepared_statement'=>'pdostatement', 'value_list'=>'array', 'column_specifier='=>'array'],
'SDO_DAS_Relational::executeQuery' => ['SDODataObject', 'database_handle'=>'pdo', 'sql_statement'=>'string', 'column_specifier='=>'array'],
'SDO_DAS_Setting::getListIndex' => ['int'],
'SDO_DAS_Setting::getPropertyIndex' => ['int'],
'SDO_DAS_Setting::getPropertyName' => ['string'],
'SDO_DAS_Setting::getValue' => [''],
'SDO_DAS_Setting::isSet' => ['bool'],
'SDO_DAS_XML::addTypes' => ['', 'xsd_file'=>'string'],
'SDO_DAS_XML::create' => ['SDO_DAS_XML', 'xsd_file='=>'mixed', 'key='=>'string'],
'SDO_DAS_XML::createDataObject' => ['SDO_DataObject', 'namespace_uri'=>'string', 'type_name'=>'string'],
'SDO_DAS_XML::createDocument' => ['SDO_DAS_XML_Document', 'document_element_name'=>'string', 'document_element_namespace_uri'=>'string', 'dataobject='=>'sdo_dataobject'],
'SDO_DAS_XML::loadFile' => ['SDO_XMLDocument', 'xml_file'=>'string'],
'SDO_DAS_XML::loadString' => ['SDO_DAS_XML_Document', 'xml_string'=>'string'],
'SDO_DAS_XML::saveFile' => ['', 'xdoc'=>'sdo_xmldocument', 'xml_file'=>'string', 'indent='=>'int'],
'SDO_DAS_XML::saveString' => ['string', 'xdoc'=>'sdo_xmldocument', 'indent='=>'int'],
'SDO_DAS_XML_Document::getRootDataObject' => ['SDO_DataObject'],
'SDO_DAS_XML_Document::getRootElementName' => ['string'],
'SDO_DAS_XML_Document::getRootElementURI' => ['string'],
'SDO_DAS_XML_Document::setEncoding' => ['', 'encoding'=>'string'],
'SDO_DAS_XML_Document::setXMLDeclaration' => ['', 'xmldeclatation'=>'bool'],
'SDO_DAS_XML_Document::setXMLVersion' => ['', 'xmlversion'=>'string'],
'SDO_DataFactory::create' => ['void', 'type_namespace_uri'=>'string', 'type_name'=>'string'],
'SDO_DataObject::clear' => ['void'],
'SDO_DataObject::createDataObject' => ['SDO_DataObject', 'identifier'=>''],
'SDO_DataObject::getContainer' => ['SDO_DataObject'],
'SDO_DataObject::getSequence' => ['SDO_Sequence'],
'SDO_DataObject::getTypeName' => ['string'],
'SDO_DataObject::getTypeNamespaceURI' => ['string'],
'SDO_Exception::getCause' => [''],
'SDO_List::insert' => ['void', 'value'=>'mixed', 'index='=>'int'],
'SDO_Model_Property::getContainingType' => ['SDO_Model_Type'],
'SDO_Model_Property::getDefault' => [''],
'SDO_Model_Property::getName' => ['string'],
'SDO_Model_Property::getType' => ['SDO_Model_Type'],
'SDO_Model_Property::isContainment' => ['bool'],
'SDO_Model_Property::isMany' => ['bool'],
'SDO_Model_ReflectionDataObject::__construct' => ['void', 'data_object'=>'sdo_dataobject'],
'SDO_Model_ReflectionDataObject::export' => ['mixed', 'rdo'=>'sdo_model_reflectiondataobject', 'return='=>'bool'],
'SDO_Model_ReflectionDataObject::getContainmentProperty' => ['SDO_Model_Property'],
'SDO_Model_ReflectionDataObject::getInstanceProperties' => ['array'],
'SDO_Model_ReflectionDataObject::getType' => ['SDO_Model_Type'],
'SDO_Model_Type::getBaseType' => ['SDO_Model_Type'],
'SDO_Model_Type::getName' => ['string'],
'SDO_Model_Type::getNamespaceURI' => ['string'],
'SDO_Model_Type::getProperties' => ['array'],
'SDO_Model_Type::getProperty' => ['SDO_Model_Property', 'identifier'=>''],
'SDO_Model_Type::isAbstractType' => ['bool'],
'SDO_Model_Type::isDataType' => ['bool'],
'SDO_Model_Type::isInstance' => ['bool', 'data_object'=>'sdo_dataobject'],
'SDO_Model_Type::isOpenType' => ['bool'],
'SDO_Model_Type::isSequencedType' => ['bool'],
'SDO_Sequence::getProperty' => ['SDO_Model_Property', 'sequence_index'=>'int'],
'SDO_Sequence::insert' => ['void', 'value'=>'mixed', 'sequenceindex='=>'int', 'propertyidentifier='=>'mixed'],
'SDO_Sequence::move' => ['void', 'toindex'=>'int', 'fromindex'=>'int'],
'SeasLog::__destruct' => ['void'],
'SeasLog::alert' => ['bool', 'message'=>'string', 'content='=>'array', 'logger='=>'string'],
'SeasLog::analyzerCount' => ['mixed', 'level'=>'string', 'log_path='=>'string', 'key_word='=>'string'],
'SeasLog::analyzerDetail' => ['mixed', 'level'=>'string', 'log_path='=>'string', 'key_word='=>'string', 'start='=>'int', 'limit='=>'int', 'order='=>'int'],
'SeasLog::closeLoggerStream' => ['bool', 'model'=>'int', 'logger'=>'string'],
'SeasLog::critical' => ['bool', 'message'=>'string', 'content='=>'array', 'logger='=>'string'],
'SeasLog::debug' => ['bool', 'message'=>'string', 'content='=>'array', 'logger='=>'string'],
'SeasLog::emergency' => ['bool', 'message'=>'string', 'content='=>'array', 'logger='=>'string'],
'SeasLog::error' => ['bool', 'message'=>'string', 'content='=>'array', 'logger='=>'string'],
'SeasLog::flushBuffer' => ['bool'],
'SeasLog::getBasePath' => ['string'],
'SeasLog::getBuffer' => ['array'],
'SeasLog::getBufferEnabled' => ['bool'],
'SeasLog::getDatetimeFormat' => ['string'],
'SeasLog::getLastLogger' => ['string'],
'SeasLog::getRequestID' => ['string'],
'SeasLog::getRequestVariable' => ['bool', 'key'=>'int'],
'SeasLog::info' => ['bool', 'message'=>'string', 'content='=>'array', 'logger='=>'string'],
'SeasLog::log' => ['bool', 'level'=>'string', 'message='=>'string', 'content='=>'array', 'logger='=>'string'],
'SeasLog::notice' => ['bool', 'message'=>'string', 'content='=>'array', 'logger='=>'string'],
'SeasLog::setBasePath' => ['bool', 'base_path'=>'string'],
'SeasLog::setDatetimeFormat' => ['bool', 'format'=>'string'],
'SeasLog::setLogger' => ['bool', 'logger'=>'string'],
'SeasLog::setRequestID' => ['bool', 'request_id'=>'string'],
'SeasLog::setRequestVariable' => ['bool', 'key'=>'int', 'value'=>'string'],
'SeasLog::warning' => ['bool', 'message'=>'string', 'content='=>'array', 'logger='=>'string'],
'seaslog_get_author' => ['string'],
'seaslog_get_version' => ['string'],
'SeekableIterator::__construct' => ['void'],
'SeekableIterator::current' => ['mixed'],
'SeekableIterator::key' => ['int|string'],
'SeekableIterator::next' => ['void'],
'SeekableIterator::rewind' => ['void'],
'SeekableIterator::seek' => ['void', 'position'=>'int'],
'SeekableIterator::valid' => ['bool'],
'sem_acquire' => ['bool', 'semaphore'=>'resource', 'non_blocking='=>'bool'],
'sem_get' => ['resource|false', 'key'=>'int', 'max_acquire='=>'int', 'permissions='=>'int', 'auto_release='=>'int'],
'sem_release' => ['bool', 'semaphore'=>'resource'],
'sem_remove' => ['bool', 'semaphore'=>'resource'],
'Serializable::__construct' => ['void'],
'Serializable::serialize' => ['?string'],
'Serializable::unserialize' => ['void', 'serialized'=>'string'],
'serialize' => ['string', 'value'=>'mixed'],
'ServerRequest::withInput' => ['ServerRequest', 'input'=>'mixed'],
'ServerRequest::withoutParams' => ['ServerRequest', 'params'=>'int|string'],
'ServerRequest::withParam' => ['ServerRequest', 'key'=>'int|string', 'value'=>'mixed'],
'ServerRequest::withParams' => ['ServerRequest', 'params'=>'mixed'],
'ServerRequest::withUrl' => ['ServerRequest', 'url'=>'array'],
'ServerResponse::addHeader' => ['void', 'label'=>'string', 'value'=>'string'],
'ServerResponse::date' => ['string', 'date'=>'string|DateTimeInterface'],
'ServerResponse::getHeader' => ['string', 'label'=>'string'],
'ServerResponse::getHeaders' => ['string[]'],
'ServerResponse::getStatus' => ['int'],
'ServerResponse::getVersion' => ['string'],
'ServerResponse::setHeader' => ['void', 'label'=>'string', 'value'=>'string'],
'ServerResponse::setStatus' => ['void', 'status'=>'int'],
'ServerResponse::setVersion' => ['void', 'version'=>'string'],
'session_abort' => ['bool'],
'session_cache_expire' => ['int', 'value='=>'int'],
'session_cache_limiter' => ['string', 'value='=>'string'],
'session_commit' => ['bool'],
'session_create_id' => ['string', 'prefix='=>'string'],
'session_decode' => ['bool', 'data'=>'string'],
'session_destroy' => ['bool'],
'session_encode' => ['string'],
'session_gc' => ['int|false'],
'session_get_cookie_params' => ['array'],
'session_id' => ['string|false', 'id='=>'string'],
'session_is_registered' => ['bool', 'name'=>'string'],
'session_module_name' => ['string', 'module='=>'string'],
'session_name' => ['string|false', 'name='=>'string'],
'session_pgsql_add_error' => ['bool', 'error_level'=>'int', 'error_message='=>'string'],
'session_pgsql_get_error' => ['array', 'with_error_message='=>'bool'],
'session_pgsql_get_field' => ['string'],
'session_pgsql_reset' => ['bool'],
'session_pgsql_set_field' => ['bool', 'value'=>'string'],
'session_pgsql_status' => ['array'],
'session_regenerate_id' => ['bool', 'delete_old_session='=>'bool'],
'session_register' => ['bool', 'name'=>'mixed', '...args='=>'mixed'],
'session_register_shutdown' => ['void'],
'session_reset' => ['bool'],
'session_save_path' => ['string', 'path='=>'string'],
'session_set_cookie_params' => ['bool', 'lifetime'=>'int', 'path='=>'?string', 'domain='=>'?string', 'secure='=>'?bool', 'httponly='=>'?bool'],
'session_set_cookie_params\'1' => ['bool', 'options'=>'array{lifetime?:int,path?:string,domain?:?string,secure?:bool,httponly?:bool}'],
'session_set_save_handler' => ['bool', 'open'=>'callable(string,string):bool', 'close'=>'callable():bool', 'read'=>'callable(string):string', 'write'=>'callable(string,string):bool', 'destroy'=>'callable(string):bool', 'gc'=>'callable(string):bool', 'create_sid='=>'callable():string', 'validate_sid='=>'callable(string):bool', 'update_timestamp='=>'callable(string):bool'],
'session_set_save_handler\'1' => ['bool', 'open'=>'SessionHandlerInterface', 'close='=>'bool'],
'session_start' => ['bool', 'options='=>'array'],
'session_status' => ['int'],
'session_unregister' => ['bool', 'name'=>'string'],
'session_unset' => ['bool'],
'session_write_close' => ['bool'],
'SessionHandler::close' => ['bool'],
'SessionHandler::create_sid' => ['char'],
'SessionHandler::destroy' => ['bool', 'id'=>'string'],
'SessionHandler::gc' => ['bool', 'maxlifetime'=>'int'],
'SessionHandler::open' => ['bool', 'save_path'=>'string', 'session_name'=>'string'],
'SessionHandler::read' => ['string', 'id'=>'string'],
'SessionHandler::updateTimestamp' => ['bool', 'session_id'=>'string', 'session_data'=>'string'],
'SessionHandler::validateId' => ['bool', 'session_id'=>'string'],
'SessionHandler::write' => ['bool', 'id'=>'string', 'data'=>'string'],
'SessionHandlerInterface::close' => ['bool'],
'SessionHandlerInterface::destroy' => ['bool', 'id'=>'string'],
'SessionHandlerInterface::gc' => ['int|false', 'max_lifetime'=>'int'],
'SessionHandlerInterface::open' => ['bool', 'path'=>'string', 'name'=>'string'],
'SessionHandlerInterface::read' => ['string|false', 'id'=>'string'],
'SessionHandlerInterface::write' => ['bool', 'id'=>'string', 'data'=>'string'],
'SessionIdInterface::create_sid' => ['string'],
'SessionUpdateTimestampHandler::updateTimestamp' => ['bool', 'id'=>'string', 'data'=>'string'],
'SessionUpdateTimestampHandler::validateId' => ['char', 'id'=>'string'],
'SessionUpdateTimestampHandlerInterface::updateTimestamp' => ['bool', 'key'=>'string', 'value'=>'string'],
'SessionUpdateTimestampHandlerInterface::validateId' => ['bool', 'key'=>'string'],
'set_error_handler' => ['null|callable(int,string,string=,int=,array=):bool', 'callback'=>'null|callable(int,string,string=,int=,array=):bool', 'error_levels='=>'int'],
'set_exception_handler' => ['null|callable(Throwable):void', 'callback'=>'null|callable(Throwable):void'],
'set_file_buffer' => ['int', 'stream'=>'resource', 'size'=>'int'],
'set_include_path' => ['string|false', 'include_path'=>'string'],
'set_magic_quotes_runtime' => ['bool', 'new_setting'=>'bool'],
'set_time_limit' => ['bool', 'seconds'=>'int'],
'setcookie' => ['bool', 'name'=>'string', 'value='=>'string', 'expires='=>'int', 'path='=>'string', 'domain='=>'string', 'secure='=>'bool', 'httponly='=>'bool', 'samesite='=>'string', 'url_encode='=>'int'],
'setcookie\'1' => ['bool', 'name'=>'string', 'value='=>'string', 'options='=>'array'],
'setLeftFill' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'setLine' => ['void', 'width'=>'int', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'setlocale' => ['string|false', 'category'=>'int', 'locales'=>'string|0|null', '...rest='=>'string'],
'setlocale\'1' => ['string|false', 'category'=>'int', 'locales'=>'?array'],
'setproctitle' => ['void', 'title'=>'string'],
'setrawcookie' => ['bool', 'name'=>'string', 'value='=>'string', 'expires='=>'int', 'path='=>'string', 'domain='=>'string', 'secure='=>'bool', 'httponly='=>'bool'],
'setrawcookie\'1' => ['bool', 'name'=>'string', 'value='=>'string', 'options='=>'array'],
'setRightFill' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'setthreadtitle' => ['bool', 'title'=>'string'],
'settype' => ['bool', '&rw_var'=>'mixed', 'type'=>'string'],
'sha1' => ['string', 'string'=>'string', 'binary='=>'bool'],
'sha1_file' => ['string|false', 'filename'=>'string', 'binary='=>'bool'],
'sha256' => ['string', 'string'=>'string', 'raw_output='=>'bool'],
'sha256_file' => ['string', 'filename'=>'string', 'raw_output='=>'bool'],
'shapefileObj::__construct' => ['void', 'filename'=>'string', 'type'=>'int'],
'shapefileObj::addPoint' => ['int', 'point'=>'pointObj'],
'shapefileObj::addShape' => ['int', 'shape'=>'shapeObj'],
'shapefileObj::free' => ['void'],
'shapefileObj::getExtent' => ['rectObj', 'i'=>'int'],
'shapefileObj::getPoint' => ['shapeObj', 'i'=>'int'],
'shapefileObj::getShape' => ['shapeObj', 'i'=>'int'],
'shapefileObj::getTransformed' => ['shapeObj', 'map'=>'mapObj', 'i'=>'int'],
'shapefileObj::ms_newShapefileObj' => ['shapefileObj', 'filename'=>'string', 'type'=>'int'],
'shapeObj::__construct' => ['void', 'type'=>'int'],
'shapeObj::add' => ['int', 'line'=>'lineObj'],
'shapeObj::boundary' => ['shapeObj'],
'shapeObj::contains' => ['bool', 'point'=>'pointObj'],
'shapeObj::containsShape' => ['int', 'shape2'=>'shapeObj'],
'shapeObj::convexhull' => ['shapeObj'],
'shapeObj::crosses' => ['int', 'shape'=>'shapeObj'],
'shapeObj::difference' => ['shapeObj', 'shape'=>'shapeObj'],
'shapeObj::disjoint' => ['int', 'shape'=>'shapeObj'],
'shapeObj::draw' => ['int', 'map'=>'mapObj', 'layer'=>'layerObj', 'img'=>'imageObj'],
'shapeObj::equals' => ['int', 'shape'=>'shapeObj'],
'shapeObj::free' => ['void'],
'shapeObj::getArea' => ['float'],
'shapeObj::getCentroid' => ['pointObj'],
'shapeObj::getLabelPoint' => ['pointObj'],
'shapeObj::getLength' => ['float'],
'shapeObj::getPointUsingMeasure' => ['pointObj', 'm'=>'float'],
'shapeObj::getValue' => ['string', 'layer'=>'layerObj', 'filedname'=>'string'],
'shapeObj::intersection' => ['shapeObj', 'shape'=>'shapeObj'],
'shapeObj::intersects' => ['bool', 'shape'=>'shapeObj'],
'shapeObj::line' => ['lineObj', 'i'=>'int'],
'shapeObj::ms_shapeObjFromWkt' => ['shapeObj', 'wkt'=>'string'],
'shapeObj::overlaps' => ['int', 'shape'=>'shapeObj'],
'shapeObj::project' => ['int', 'in'=>'projectionObj', 'out'=>'projectionObj'],
'shapeObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'shapeObj::setBounds' => ['int'],
'shapeObj::simplify' => ['shapeObj|null', 'tolerance'=>'float'],
'shapeObj::symdifference' => ['shapeObj', 'shape'=>'shapeObj'],
'shapeObj::topologyPreservingSimplify' => ['shapeObj|null', 'tolerance'=>'float'],
'shapeObj::touches' => ['int', 'shape'=>'shapeObj'],
'shapeObj::toWkt' => ['string'],
'shapeObj::union' => ['shapeObj', 'shape'=>'shapeObj'],
'shapeObj::within' => ['int', 'shape2'=>'shapeObj'],
'shell_exec' => ['string|false|null', 'command'=>'string'],
'shm_attach' => ['resource', 'key'=>'int', 'size='=>'int', 'permissions='=>'int'],
'shm_detach' => ['bool', 'shm'=>'resource'],
'shm_get_var' => ['mixed', 'shm'=>'resource', 'key'=>'int'],
'shm_has_var' => ['bool', 'shm'=>'resource', 'key'=>'int'],
'shm_put_var' => ['bool', 'shm'=>'resource', 'key'=>'int', 'value'=>'mixed'],
'shm_remove' => ['bool', 'shm'=>'resource'],
'shm_remove_var' => ['bool', 'shm'=>'resource', 'key'=>'int'],
'shmop_close' => ['void', 'shmop'=>'resource'],
'shmop_delete' => ['bool', 'shmop'=>'resource'],
'shmop_open' => ['resource|false', 'key'=>'int', 'mode'=>'string', 'permissions'=>'int', 'size'=>'int'],
'shmop_read' => ['string|false', 'shmop'=>'resource', 'offset'=>'int', 'size'=>'int'],
'shmop_size' => ['int', 'shmop'=>'resource'],
'shmop_write' => ['int|false', 'shmop'=>'resource', 'data'=>'string', 'offset'=>'int'],
'show_source' => ['string|bool', 'filename'=>'string', 'return='=>'bool'],
'shuffle' => ['bool', '&rw_array'=>'array'],
'signeurlpaiement' => ['string', 'clent'=>'string', 'data'=>'string'],
'similar_text' => ['int', 'string1'=>'string', 'string2'=>'string', '&w_percent='=>'float'],
'simplexml_import_dom' => ['SimpleXMLElement|false', 'node'=>'DOMNode', 'class_name='=>'string'],
'simplexml_load_file' => ['SimpleXMLElement|false', 'filename'=>'string', 'class_name='=>'string', 'options='=>'int', 'namespace_or_prefix='=>'string', 'is_prefix='=>'bool'],
'simplexml_load_string' => ['SimpleXMLElement|false', 'data'=>'string', 'class_name='=>'string', 'options='=>'int', 'namespace_or_prefix='=>'string', 'is_prefix='=>'bool'],
'SimpleXMLElement::__construct' => ['void', 'data'=>'string', 'options='=>'int', 'data_is_url='=>'bool', 'ns='=>'string', 'is_prefix='=>'bool'],
'SimpleXMLElement::__get' => ['SimpleXMLElement', 'name'=>'string'],
'SimpleXMLElement::__toString' => ['string'],
'SimpleXMLElement::addAttribute' => ['void', 'name'=>'string', 'value='=>'string', 'ns='=>'string'],
'SimpleXMLElement::addChild' => ['SimpleXMLElement', 'name'=>'string', 'value='=>'string', 'ns='=>'string'],
'SimpleXMLElement::asXML' => ['bool', 'filename'=>'string'],
'SimpleXMLElement::asXML\'1' => ['string|false'],
'SimpleXMLElement::attributes' => ['?SimpleXMLElement', 'ns='=>'string', 'is_prefix='=>'bool'],
'SimpleXMLElement::children' => ['SimpleXMLElement', 'ns='=>'string', 'is_prefix='=>'bool'],
'SimpleXMLElement::count' => ['int'],
'SimpleXMLElement::getDocNamespaces' => ['string[]', 'recursive='=>'bool', 'from_root='=>'bool'],
'SimpleXMLElement::getName' => ['string'],
'SimpleXMLElement::getNamespaces' => ['string[]', 'recursive='=>'bool'],
'SimpleXMLElement::offsetExists' => ['bool', 'offset'=>'int|string'],
'SimpleXMLElement::offsetGet' => ['SimpleXMLElement', 'offset'=>'int|string'],
'SimpleXMLElement::offsetSet' => ['void', 'offset'=>'int|string', 'value'=>'mixed'],
'SimpleXMLElement::offsetUnset' => ['void', 'offset'=>'int|string'],
'SimpleXMLElement::registerXPathNamespace' => ['bool', 'prefix'=>'string', 'ns'=>'string'],
'SimpleXMLElement::saveXML' => ['mixed', 'filename='=>'string'],
'SimpleXMLElement::xpath' => ['SimpleXMLElement[]|false', 'path'=>'string'],
'sin' => ['float', 'num'=>'float'],
'sinh' => ['float', 'num'=>'float'],
'sizeof' => ['int', 'value'=>'Countable|array', 'mode='=>'int'],
'sleep' => ['int|false', 'seconds'=>'0|positive-int'],
'snmp2_get' => ['string|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp2_getnext' => ['string|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp2_real_walk' => ['array|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp2_set' => ['bool', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'type'=>'string', 'value'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp2_walk' => ['array|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp3_get' => ['string|false', 'hostname'=>'string', 'security_name'=>'string', 'security_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'privacy_protocol'=>'string', 'privacy_passphrase'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp3_getnext' => ['string|false', 'hostname'=>'string', 'security_name'=>'string', 'security_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'privacy_protocol'=>'string', 'privacy_passphrase'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp3_real_walk' => ['array|false', 'hostname'=>'string', 'security_name'=>'string', 'security_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'privacy_protocol'=>'string', 'privacy_passphrase'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp3_set' => ['bool', 'hostname'=>'string', 'security_name'=>'string', 'security_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'privacy_protocol'=>'string', 'privacy_passphrase'=>'string', 'object_id'=>'string', 'type'=>'string', 'value'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmp3_walk' => ['array|false', 'hostname'=>'string', 'security_name'=>'string', 'security_level'=>'string', 'auth_protocol'=>'string', 'auth_passphrase'=>'string', 'privacy_protocol'=>'string', 'privacy_passphrase'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'SNMP::__construct' => ['void', 'version'=>'int', 'hostname'=>'string', 'community'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'SNMP::close' => ['bool'],
'SNMP::get' => ['array|string|false', 'objectId'=>'string|array', 'preserveKeys='=>'bool'],
'SNMP::getErrno' => ['int'],
'SNMP::getError' => ['string'],
'SNMP::getnext' => ['string|array|false', 'objectId'=>'string|array'],
'SNMP::set' => ['bool', 'objectId'=>'string|array', 'type'=>'string|array', 'value'=>'mixed'],
'SNMP::setSecurity' => ['bool', 'securityLevel'=>'string', 'authProtocol='=>'string', 'authPassphrase='=>'string', 'privacyProtocol='=>'string', 'privacyPassphrase='=>'string', 'contextName='=>'string', 'contextEngineId='=>'string'],
'SNMP::walk' => ['array|false', 'objectId'=>'string', 'suffixAsKey='=>'bool', 'maxRepetitions='=>'int', 'nonRepeaters='=>'int'],
'snmp_get_quick_print' => ['bool'],
'snmp_get_valueretrieval' => ['int'],
'snmp_read_mib' => ['bool', 'filename'=>'string'],
'snmp_set_enum_print' => ['bool', 'enable'=>'int'],
'snmp_set_oid_numeric_print' => ['void', 'format'=>'int'],
'snmp_set_oid_output_format' => ['bool', 'format'=>'int'],
'snmp_set_quick_print' => ['bool', 'enable'=>'bool'],
'snmp_set_valueretrieval' => ['bool', 'method='=>'int'],
'snmpget' => ['string|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmpgetnext' => ['string|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmprealwalk' => ['array|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmpset' => ['bool', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'type'=>'string', 'value'=>'mixed', 'timeout='=>'int', 'retries='=>'int'],
'snmpwalk' => ['array|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'snmpwalkoid' => ['array|false', 'hostname'=>'string', 'community'=>'string', 'object_id'=>'string', 'timeout='=>'int', 'retries='=>'int'],
'SoapClient::__call' => ['', 'function_name'=>'string', 'arguments'=>'array'],
'SoapClient::__construct' => ['void', 'wsdl'=>'mixed', 'options='=>'array|null'],
'SoapClient::__doRequest' => ['?string', 'request'=>'string', 'location'=>'string', 'action'=>'string', 'version'=>'int', 'one_way='=>'bool'],
'SoapClient::__getCookies' => ['array'],
'SoapClient::__getFunctions' => ['array'],
'SoapClient::__getLastRequest' => ['string'],
'SoapClient::__getLastRequestHeaders' => ['string'],
'SoapClient::__getLastResponse' => ['string'],
'SoapClient::__getLastResponseHeaders' => ['string'],
'SoapClient::__getTypes' => ['array'],
'SoapClient::__setCookie' => ['', 'name'=>'string', 'value='=>'string'],
'SoapClient::__setLocation' => ['string', 'new_location='=>'string'],
'SoapClient::__setSoapHeaders' => ['bool', 'soapheaders='=>''],
'SoapClient::__soapCall' => ['', 'function_name'=>'string', 'arguments'=>'array', 'options='=>'array', 'input_headers='=>'SoapHeader|array', '&w_output_headers='=>'array'],
'SoapClient::SoapClient' => ['object', 'wsdl'=>'mixed', 'options='=>'array|null'],
'SoapFault::__clone' => ['void'],
'SoapFault::__construct' => ['void', 'faultcode'=>'string', 'faultstring'=>'string', 'faultactor='=>'string', 'detail='=>'string', 'faultname='=>'string', 'headerfault='=>'string'],
'SoapFault::__toString' => ['string'],
'SoapFault::__wakeup' => ['void'],
'SoapFault::getCode' => ['int'],
'SoapFault::getFile' => ['string'],
'SoapFault::getLine' => ['int'],
'SoapFault::getMessage' => ['string'],
'SoapFault::getPrevious' => ['?Exception|?Throwable'],
'SoapFault::getTrace' => ['list<array<string,mixed>>'],
'SoapFault::getTraceAsString' => ['string'],
'SoapFault::SoapFault' => ['object', 'faultcode'=>'string', 'faultstring'=>'string', 'faultactor='=>'string', 'detail='=>'string', 'faultname='=>'string', 'headerfault='=>'string'],
'SoapHeader::__construct' => ['void', 'namespace'=>'string', 'name'=>'string', 'data='=>'mixed', 'mustunderstand='=>'bool', 'actor='=>'string'],
'SoapHeader::SoapHeader' => ['object', 'namespace'=>'string', 'name'=>'string', 'data='=>'mixed', 'mustunderstand='=>'bool', 'actor='=>'string'],
'SoapParam::__construct' => ['void', 'data'=>'mixed', 'name'=>'string'],
'SoapParam::SoapParam' => ['object', 'data'=>'mixed', 'name'=>'string'],
'SoapServer::__construct' => ['void', 'wsdl'=>'?string', 'options='=>'array'],
'SoapServer::addFunction' => ['void', 'functions'=>'mixed'],
'SoapServer::addSoapHeader' => ['void', 'object'=>'SoapHeader'],
'SoapServer::fault' => ['void', 'code'=>'string', 'string'=>'string', 'actor='=>'string', 'details='=>'string', 'name='=>'string'],
'SoapServer::getFunctions' => ['array'],
'SoapServer::handle' => ['void', 'soap_request='=>'string'],
'SoapServer::setClass' => ['void', 'class_name'=>'string', '...args='=>'mixed'],
'SoapServer::setObject' => ['void', 'object'=>'object'],
'SoapServer::setPersistence' => ['void', 'mode'=>'int'],
'SoapServer::SoapServer' => ['object', 'wsdl'=>'?string', 'options='=>'array'],
'SoapVar::__construct' => ['void', 'data'=>'mixed', 'encoding'=>'int', 'type_name='=>'string|null', 'type_namespace='=>'string|null', 'node_name='=>'string|null', 'node_namespace='=>'string|null'],
'SoapVar::SoapVar' => ['object', 'data'=>'mixed', 'encoding'=>'int', 'type_name='=>'string|null', 'type_namespace='=>'string|null', 'node_name='=>'string|null', 'node_namespace='=>'string|null'],
'socket_accept' => ['Socket|false', 'socket'=>'Socket'],
'socket_addrinfo_bind' => ['Socket|false', 'address'=>'AddressInfo'],
'socket_addrinfo_connect' => ['Socket|false', 'address'=>'AddressInfo'],
'socket_addrinfo_explain' => ['array', 'address'=>'AddressInfo'],
'socket_addrinfo_lookup' => ['false|AddressInfo[]', 'host='=>'string|null', 'service='=>'mixed', 'hints='=>'array'],
'socket_bind' => ['bool', 'socket'=>'Socket', 'addr'=>'string', 'port='=>'int'],
'socket_clear_error' => ['void', 'socket='=>'Socket'],
'socket_close' => ['void', 'socket'=>'Socket'],
'socket_cmsg_space' => ['int', 'level'=>'int', 'type'=>'int'],
'socket_connect' => ['bool', 'socket'=>'Socket', 'addr'=>'string', 'port='=>'int'],
'socket_create' => ['Socket|false', 'domain'=>'int', 'type'=>'int', 'protocol'=>'int'],
'socket_create_listen' => ['Socket|false', 'port'=>'int', 'backlog='=>'int'],
'socket_create_pair' => ['bool', 'domain'=>'int', 'type'=>'int', 'protocol'=>'int', '&w_fd'=>'Socket[]'],
'socket_export_stream' => ['resource|false', 'socket'=>'Socket'],
'socket_get_option' => ['mixed|false', 'socket'=>'Socket', 'level'=>'int', 'optname'=>'int'],
'socket_get_status' => ['array', 'stream'=>'Socket'],
'socket_getopt' => ['mixed', 'socket'=>'Socket', 'level'=>'int', 'optname'=>'int'],
'socket_getpeername' => ['bool', 'socket'=>'Socket', '&w_addr'=>'string', '&w_port='=>'int'],
'socket_getsockname' => ['bool', 'socket'=>'Socket', '&w_addr'=>'string', '&w_port='=>'int'],
'socket_import_stream' => ['Socket|false|null', 'stream'=>'resource'],
'socket_last_error' => ['int', 'socket='=>'Socket'],
'socket_listen' => ['bool', 'socket'=>'Socket', 'backlog='=>'int'],
'socket_read' => ['string|false', 'socket'=>'Socket', 'length'=>'int', 'type='=>'int'],
'socket_recv' => ['int|false', 'socket'=>'Socket', '&w_buf'=>'string', 'length'=>'int', 'flags'=>'int'],
'socket_recvfrom' => ['int|false', 'socket'=>'Socket', '&w_buf'=>'string', 'length'=>'int', 'flags'=>'int', '&w_name'=>'string', '&w_port='=>'int'],
'socket_recvmsg' => ['int|false', 'socket'=>'Socket', '&w_message'=>'string', 'flags='=>'int'],
'socket_select' => ['int|false', '&rw_read_fds'=>'Socket[]|null', '&rw_write_fds'=>'Socket[]|null', '&rw_except_fds'=>'Socket[]|null', 'tv_sec'=>'int|null', 'tv_usec='=>'int'],
'socket_send' => ['int|false', 'socket'=>'Socket', 'buf'=>'string', 'length'=>'int', 'flags'=>'int'],
'socket_sendmsg' => ['int|false', 'socket'=>'Socket', 'message'=>'array', 'flags'=>'int'],
'socket_sendto' => ['int|false', 'socket'=>'Socket', 'buf'=>'string', 'length'=>'int', 'flags'=>'int', 'addr'=>'string', 'port='=>'int'],
'socket_set_block' => ['bool', 'socket'=>'Socket'],
'socket_set_blocking' => ['bool', 'socket'=>'Socket', 'mode'=>'int'],
'socket_set_nonblock' => ['bool', 'socket'=>'Socket'],
'socket_set_option' => ['bool', 'socket'=>'Socket', 'level'=>'int', 'optname'=>'int', 'optval'=>'int|string|array'],
'socket_set_timeout' => ['bool', 'stream'=>'resource', 'seconds'=>'int', 'microseconds='=>'int'],
'socket_setopt' => ['void', 'socket'=>'Socket', 'level'=>'int', 'optname'=>'int', 'optval'=>'int|string|array'],
'socket_shutdown' => ['bool', 'socket'=>'Socket', 'how='=>'int'],
'socket_strerror' => ['string', 'errno'=>'int'],
'socket_write' => ['int|false', 'socket'=>'Socket', 'data'=>'string', 'length='=>'int|null'],
'socket_wsaprotocol_info_export' => ['string|false', 'socket'=>'Socket', 'process_id'=>'int'],
'socket_wsaprotocol_info_import' => ['Socket|false', 'info_id'=>'string'],
'socket_wsaprotocol_info_release' => ['bool', 'info_id'=>'string'],
'sodium_add' => ['void', '&rw_string1'=>'string', 'string2'=>'string'],
'sodium_base642bin' => ['string', 'string'=>'string', 'id'=>'int', 'ignore='=>'string'],
'sodium_bin2base64' => ['string', 'string'=>'string', 'id'=>'int'],
'sodium_bin2hex' => ['string', 'string'=>'string'],
'sodium_compare' => ['int', 'string1'=>'string', 'string2'=>'string'],
'sodium_crypto_aead_aes256gcm_decrypt' => ['string|false', 'ciphertext'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_aes256gcm_encrypt' => ['string', 'message'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_aes256gcm_is_available' => ['bool'],
'sodium_crypto_aead_aes256gcm_keygen' => ['string'],
'sodium_crypto_aead_chacha20poly1305_decrypt' => ['string|false', 'ciphertext'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_chacha20poly1305_encrypt' => ['string|false', 'message'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_chacha20poly1305_ietf_decrypt' => ['string|false', 'ciphertext'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_chacha20poly1305_ietf_encrypt' => ['string|false', 'message'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_chacha20poly1305_ietf_keygen' => ['string'],
'sodium_crypto_aead_chacha20poly1305_keygen' => ['string'],
'sodium_crypto_aead_xchacha20poly1305_ietf_decrypt' => ['string|false', 'ciphertext'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_xchacha20poly1305_ietf_encrypt' => ['string|false', 'message'=>'string', 'additional_data'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_aead_xchacha20poly1305_ietf_keygen' => ['string'],
'sodium_crypto_auth' => ['string', 'message'=>'string', 'key'=>'string'],
'sodium_crypto_auth_keygen' => ['string'],
'sodium_crypto_auth_verify' => ['bool', 'mac'=>'string', 'message'=>'string', 'key'=>'string'],
'sodium_crypto_box' => ['string', 'message'=>'string', 'nonce'=>'string', 'key_pair'=>'string'],
'sodium_crypto_box_keypair' => ['string'],
'sodium_crypto_box_keypair_from_secretkey_and_publickey' => ['string', 'secret_key'=>'string', 'public_key'=>'string'],
'sodium_crypto_box_open' => ['string|false', 'ciphertext'=>'string', 'nonce'=>'string', 'key_pair'=>'string'],
'sodium_crypto_box_publickey' => ['string', 'key_pair'=>'string'],
'sodium_crypto_box_publickey_from_secretkey' => ['string', 'secret_key'=>'string'],
'sodium_crypto_box_seal' => ['string', 'message'=>'string', 'public_key'=>'string'],
'sodium_crypto_box_seal_open' => ['string|false', 'ciphertext'=>'string', 'key_pair'=>'string'],
'sodium_crypto_box_secretkey' => ['string', 'key_pair'=>'string'],
'sodium_crypto_box_seed_keypair' => ['string', 'seed'=>'string'],
'sodium_crypto_generichash' => ['string', 'message'=>'string', 'key='=>'?string', 'length='=>'?int'],
'sodium_crypto_generichash_final' => ['string', '&state'=>'string', 'length='=>'?int'],
'sodium_crypto_generichash_init' => ['string', 'key='=>'?string', 'length='=>'?int'],
'sodium_crypto_generichash_keygen' => ['string'],
'sodium_crypto_generichash_update' => ['bool', '&rw_state'=>'string', 'string'=>'string'],
'sodium_crypto_kdf_derive_from_key' => ['string', 'subkey_length'=>'int', 'subkey_id'=>'int', 'context'=>'string', 'key'=>'string'],
'sodium_crypto_kdf_keygen' => ['string'],
'sodium_crypto_kx_client_session_keys' => ['array<int,string>', 'client_keypair'=>'string', 'server_key'=>'string'],
'sodium_crypto_kx_keypair' => ['string'],
'sodium_crypto_kx_publickey' => ['string', 'key_pair'=>'string'],
'sodium_crypto_kx_secretkey' => ['string', 'key_pair'=>'string'],
'sodium_crypto_kx_seed_keypair' => ['string', 'seed'=>'string'],
'sodium_crypto_kx_server_session_keys' => ['array<int,string>', 'server_key_pair'=>'string', 'client_key'=>'string'],
'sodium_crypto_pwhash' => ['string', 'length'=>'int', 'password'=>'string', 'salt'=>'string', 'opslimit'=>'int', 'memlimit'=>'int', 'algo='=>'int'],
'sodium_crypto_pwhash_scryptsalsa208sha256' => ['string', 'length'=>'int', 'password'=>'string', 'salt'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'],
'sodium_crypto_pwhash_scryptsalsa208sha256_str' => ['string', 'password'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'],
'sodium_crypto_pwhash_scryptsalsa208sha256_str_verify' => ['bool', 'hash'=>'string', 'password'=>'string'],
'sodium_crypto_pwhash_str' => ['string', 'password'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'],
'sodium_crypto_pwhash_str_needs_rehash' => ['bool', 'password'=>'string', 'opslimit'=>'int', 'memlimit'=>'int'],
'sodium_crypto_pwhash_str_verify' => ['bool', 'hash'=>'string', 'password'=>'string'],
'sodium_crypto_scalarmult' => ['string', 'n'=>'string', 'p'=>'string'],
'sodium_crypto_scalarmult_base' => ['string', 'secret_key'=>'string'],
'sodium_crypto_secretbox' => ['string', 'message'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_secretbox_keygen' => ['string'],
'sodium_crypto_secretbox_open' => ['string|false', 'ciphertext'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_secretstream_xchacha20poly1305_init_pull' => ['string', 'header'=>'string', 'key'=>'string'],
'sodium_crypto_secretstream_xchacha20poly1305_init_push' => ['array', 'key'=>'string'],
'sodium_crypto_secretstream_xchacha20poly1305_keygen' => ['string'],
'sodium_crypto_secretstream_xchacha20poly1305_pull' => ['array', '&r_state'=>'string', 'ciphertext'=>'string', 'additional_data='=>'string'],
'sodium_crypto_secretstream_xchacha20poly1305_push' => ['string', '&w_state'=>'string', 'message'=>'string', 'additional_data='=>'string', 'tag='=>'int'],
'sodium_crypto_secretstream_xchacha20poly1305_rekey' => ['void', 'state'=>'string'],
'sodium_crypto_shorthash' => ['string', 'message'=>'string', 'key'=>'string'],
'sodium_crypto_shorthash_keygen' => ['string'],
'sodium_crypto_sign' => ['string', 'message'=>'string', 'secret_key'=>'string'],
'sodium_crypto_sign_detached' => ['string', 'message'=>'string', 'secret_key'=>'string'],
'sodium_crypto_sign_ed25519_pk_to_curve25519' => ['string', 'public_key'=>'string'],
'sodium_crypto_sign_ed25519_sk_to_curve25519' => ['string', 'secret_key'=>'string'],
'sodium_crypto_sign_keypair' => ['string'],
'sodium_crypto_sign_keypair_from_secretkey_and_publickey' => ['string', 'secret_key'=>'string', 'public_key'=>'string'],
'sodium_crypto_sign_open' => ['string|false', 'signed_message'=>'string', 'public_key'=>'string'],
'sodium_crypto_sign_publickey' => ['string', 'key_pair'=>'string'],
'sodium_crypto_sign_publickey_from_secretkey' => ['string', 'secret_key'=>'string'],
'sodium_crypto_sign_secretkey' => ['string', 'key_pair'=>'string'],
'sodium_crypto_sign_seed_keypair' => ['string', 'seed'=>'string'],
'sodium_crypto_sign_verify_detached' => ['bool', 'signature'=>'string', 'message'=>'string', 'public_key'=>'string'],
'sodium_crypto_stream' => ['string', 'length'=>'int', 'nonce'=>'string', 'key'=>'string'],
'sodium_crypto_stream_keygen' => ['string'],
'sodium_crypto_stream_xor' => ['string', 'message'=>'string', 'nonce'=>'string', 'key'=>'string'],
'sodium_hex2bin' => ['string', 'string'=>'string', 'ignore='=>'string'],
'sodium_increment' => ['void', '&rw_string'=>'string'],
'sodium_memcmp' => ['int', 'string1'=>'string', 'string2'=>'string'],
'sodium_memzero' => ['void', '&w_string'=>'string'],
'sodium_pad' => ['string', 'string'=>'string', 'block_size'=>'int'],
'sodium_unpad' => ['string', 'string'=>'string', 'block_size'=>'int'],
'solid_fetch_prev' => ['bool', 'result_id'=>''],
'solr_get_version' => ['string|false'],
'SolrClient::__construct' => ['void', 'clientOptions'=>'array'],
'SolrClient::__destruct' => ['void'],
'SolrClient::addDocument' => ['SolrUpdateResponse', 'doc'=>'SolrInputDocument', 'allowdups='=>'bool', 'commitwithin='=>'int'],
'SolrClient::addDocuments' => ['SolrUpdateResponse', 'docs'=>'array', 'allowdups='=>'bool', 'commitwithin='=>'int'],
'SolrClient::commit' => ['SolrUpdateResponse', 'maxsegments='=>'int', 'waitflush='=>'bool', 'waitsearcher='=>'bool'],
'SolrClient::deleteById' => ['SolrUpdateResponse', 'id'=>'string'],
'SolrClient::deleteByIds' => ['SolrUpdateResponse', 'ids'=>'array'],
'SolrClient::deleteByQueries' => ['SolrUpdateResponse', 'queries'=>'array'],
'SolrClient::deleteByQuery' => ['SolrUpdateResponse', 'query'=>'string'],
'SolrClient::getById' => ['SolrQueryResponse', 'id'=>'string'],
'SolrClient::getByIds' => ['SolrQueryResponse', 'ids'=>'array'],
'SolrClient::getDebug' => ['string'],
'SolrClient::getOptions' => ['array'],
'SolrClient::optimize' => ['SolrUpdateResponse', 'maxsegments='=>'int', 'waitflush='=>'bool', 'waitsearcher='=>'bool'],
'SolrClient::ping' => ['SolrPingResponse'],
'SolrClient::query' => ['SolrQueryResponse', 'query'=>'SolrParams'],
'SolrClient::request' => ['SolrUpdateResponse', 'raw_request'=>'string'],
'SolrClient::rollback' => ['SolrUpdateResponse'],
'SolrClient::setResponseWriter' => ['void', 'responsewriter'=>'string'],
'SolrClient::setServlet' => ['bool', 'type'=>'int', 'value'=>'string'],
'SolrClient::system' => ['SolrGenericResponse'],
'SolrClient::threads' => ['SolrGenericResponse'],
'SolrClientException::__clone' => ['void'],
'SolrClientException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'SolrClientException::__toString' => ['string'],
'SolrClientException::__wakeup' => ['void'],
'SolrClientException::getCode' => ['int'],
'SolrClientException::getFile' => ['string'],
'SolrClientException::getInternalInfo' => ['array'],
'SolrClientException::getLine' => ['int'],
'SolrClientException::getMessage' => ['string'],
'SolrClientException::getPrevious' => ['?Exception|?Throwable'],
'SolrClientException::getTrace' => ['list<array<string,mixed>>'],
'SolrClientException::getTraceAsString' => ['string'],
'SolrCollapseFunction::__construct' => ['void', 'field'=>'string'],
'SolrCollapseFunction::__toString' => ['string'],
'SolrCollapseFunction::getField' => ['string'],
'SolrCollapseFunction::getHint' => ['string'],
'SolrCollapseFunction::getMax' => ['string'],
'SolrCollapseFunction::getMin' => ['string'],
'SolrCollapseFunction::getNullPolicy' => ['string'],
'SolrCollapseFunction::getSize' => ['int'],
'SolrCollapseFunction::setField' => ['SolrCollapseFunction', 'fieldName'=>'string'],
'SolrCollapseFunction::setHint' => ['SolrCollapseFunction', 'hint'=>'string'],
'SolrCollapseFunction::setMax' => ['SolrCollapseFunction', 'max'=>'string'],
'SolrCollapseFunction::setMin' => ['SolrCollapseFunction', 'min'=>'string'],
'SolrCollapseFunction::setNullPolicy' => ['SolrCollapseFunction', 'nullPolicy'=>'string'],
'SolrCollapseFunction::setSize' => ['SolrCollapseFunction', 'size'=>'int'],
'SolrDisMaxQuery::__construct' => ['void', 'q='=>'string'],
'SolrDisMaxQuery::__destruct' => ['void'],
'SolrDisMaxQuery::add' => ['SolrParams', 'name'=>'string', 'value'=>'string'],
'SolrDisMaxQuery::addBigramPhraseField' => ['SolrDisMaxQuery', 'field'=>'string', 'boost'=>'string', 'slop='=>'string'],
'SolrDisMaxQuery::addBoostQuery' => ['SolrDisMaxQuery', 'field'=>'string', 'value'=>'string', 'boost='=>'string'],
'SolrDisMaxQuery::addExpandFilterQuery' => ['SolrQuery', 'fq'=>'string'],
'SolrDisMaxQuery::addExpandSortField' => ['SolrQuery', 'field'=>'string', 'order'=>'string'],
'SolrDisMaxQuery::addFacetDateField' => ['SolrQuery', 'dateField'=>'string'],
'SolrDisMaxQuery::addFacetDateOther' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::addFacetField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::addFacetQuery' => ['SolrQuery', 'facetQuery'=>'string'],
'SolrDisMaxQuery::addField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::addFilterQuery' => ['SolrQuery', 'fq'=>'string'],
'SolrDisMaxQuery::addGroupField' => ['SolrQuery', 'value'=>'string'],
'SolrDisMaxQuery::addGroupFunction' => ['SolrQuery', 'value'=>'string'],
'SolrDisMaxQuery::addGroupQuery' => ['SolrQuery', 'value'=>'string'],
'SolrDisMaxQuery::addGroupSortField' => ['SolrQuery', 'field'=>'string', 'order'=>'int'],
'SolrDisMaxQuery::addHighlightField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::addMltField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::addMltQueryField' => ['SolrQuery', 'field'=>'string', 'boost'=>'float'],
'SolrDisMaxQuery::addParam' => ['SolrParams', 'name'=>'string', 'value'=>'string'],
'SolrDisMaxQuery::addPhraseField' => ['SolrDisMaxQuery', 'field'=>'string', 'boost'=>'string', 'slop='=>'string'],
'SolrDisMaxQuery::addQueryField' => ['SolrDisMaxQuery', 'field'=>'string', 'boost='=>'string'],
'SolrDisMaxQuery::addSortField' => ['SolrQuery', 'field'=>'string', 'order='=>'int'],
'SolrDisMaxQuery::addStatsFacet' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::addStatsField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::addTrigramPhraseField' => ['SolrDisMaxQuery', 'field'=>'string', 'boost'=>'string', 'slop='=>'string'],
'SolrDisMaxQuery::addUserField' => ['SolrDisMaxQuery', 'field'=>'string'],
'SolrDisMaxQuery::collapse' => ['SolrQuery', 'collapseFunction'=>'SolrCollapseFunction'],
'SolrDisMaxQuery::get' => ['mixed', 'param_name'=>'string'],
'SolrDisMaxQuery::getExpand' => ['bool'],
'SolrDisMaxQuery::getExpandFilterQueries' => ['array'],
'SolrDisMaxQuery::getExpandQuery' => ['array'],
'SolrDisMaxQuery::getExpandRows' => ['int'],
'SolrDisMaxQuery::getExpandSortFields' => ['array'],
'SolrDisMaxQuery::getFacet' => ['bool'],
'SolrDisMaxQuery::getFacetDateEnd' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetDateFields' => ['array'],
'SolrDisMaxQuery::getFacetDateGap' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetDateHardEnd' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetDateOther' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetDateStart' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetFields' => ['array'],
'SolrDisMaxQuery::getFacetLimit' => ['int', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetMethod' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetMinCount' => ['int', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetMissing' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetOffset' => ['int', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetPrefix' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getFacetQueries' => ['string'],
'SolrDisMaxQuery::getFacetSort' => ['int', 'field_override'=>'string'],
'SolrDisMaxQuery::getFields' => ['string'],
'SolrDisMaxQuery::getFilterQueries' => ['string'],
'SolrDisMaxQuery::getGroup' => ['bool'],
'SolrDisMaxQuery::getGroupCachePercent' => ['int'],
'SolrDisMaxQuery::getGroupFacet' => ['bool'],
'SolrDisMaxQuery::getGroupFields' => ['array'],
'SolrDisMaxQuery::getGroupFormat' => ['string'],
'SolrDisMaxQuery::getGroupFunctions' => ['array'],
'SolrDisMaxQuery::getGroupLimit' => ['int'],
'SolrDisMaxQuery::getGroupMain' => ['bool'],
'SolrDisMaxQuery::getGroupNGroups' => ['bool'],
'SolrDisMaxQuery::getGroupOffset' => ['bool'],
'SolrDisMaxQuery::getGroupQueries' => ['array'],
'SolrDisMaxQuery::getGroupSortFields' => ['array'],
'SolrDisMaxQuery::getGroupTruncate' => ['bool'],
'SolrDisMaxQuery::getHighlight' => ['bool'],
'SolrDisMaxQuery::getHighlightAlternateField' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightFields' => ['array'],
'SolrDisMaxQuery::getHighlightFormatter' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightFragmenter' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightFragsize' => ['int', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightHighlightMultiTerm' => ['bool'],
'SolrDisMaxQuery::getHighlightMaxAlternateFieldLength' => ['int', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightMaxAnalyzedChars' => ['int'],
'SolrDisMaxQuery::getHighlightMergeContiguous' => ['bool', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightRegexMaxAnalyzedChars' => ['int'],
'SolrDisMaxQuery::getHighlightRegexPattern' => ['string'],
'SolrDisMaxQuery::getHighlightRegexSlop' => ['float'],
'SolrDisMaxQuery::getHighlightRequireFieldMatch' => ['bool'],
'SolrDisMaxQuery::getHighlightSimplePost' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightSimplePre' => ['string', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightSnippets' => ['int', 'field_override'=>'string'],
'SolrDisMaxQuery::getHighlightUsePhraseHighlighter' => ['bool'],
'SolrDisMaxQuery::getMlt' => ['bool'],
'SolrDisMaxQuery::getMltBoost' => ['bool'],
'SolrDisMaxQuery::getMltCount' => ['int'],
'SolrDisMaxQuery::getMltFields' => ['array'],
'SolrDisMaxQuery::getMltMaxNumQueryTerms' => ['int'],
'SolrDisMaxQuery::getMltMaxNumTokens' => ['int'],
'SolrDisMaxQuery::getMltMaxWordLength' => ['int'],
'SolrDisMaxQuery::getMltMinDocFrequency' => ['int'],
'SolrDisMaxQuery::getMltMinTermFrequency' => ['int'],
'SolrDisMaxQuery::getMltMinWordLength' => ['int'],
'SolrDisMaxQuery::getMltQueryFields' => ['array'],
'SolrDisMaxQuery::getParam' => ['mixed', 'param_name'=>'string'],
'SolrDisMaxQuery::getParams' => ['array'],
'SolrDisMaxQuery::getPreparedParams' => ['array'],
'SolrDisMaxQuery::getQuery' => ['string'],
'SolrDisMaxQuery::getRows' => ['int'],
'SolrDisMaxQuery::getSortFields' => ['array'],
'SolrDisMaxQuery::getStart' => ['int'],
'SolrDisMaxQuery::getStats' => ['bool'],
'SolrDisMaxQuery::getStatsFacets' => ['array'],
'SolrDisMaxQuery::getStatsFields' => ['array'],
'SolrDisMaxQuery::getTerms' => ['bool'],
'SolrDisMaxQuery::getTermsField' => ['string'],
'SolrDisMaxQuery::getTermsIncludeLowerBound' => ['bool'],
'SolrDisMaxQuery::getTermsIncludeUpperBound' => ['bool'],
'SolrDisMaxQuery::getTermsLimit' => ['int'],
'SolrDisMaxQuery::getTermsLowerBound' => ['string'],
'SolrDisMaxQuery::getTermsMaxCount' => ['int'],
'SolrDisMaxQuery::getTermsMinCount' => ['int'],
'SolrDisMaxQuery::getTermsPrefix' => ['string'],
'SolrDisMaxQuery::getTermsReturnRaw' => ['bool'],
'SolrDisMaxQuery::getTermsSort' => ['int'],
'SolrDisMaxQuery::getTermsUpperBound' => ['string'],
'SolrDisMaxQuery::getTimeAllowed' => ['int'],
'SolrDisMaxQuery::removeBigramPhraseField' => ['SolrDisMaxQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeBoostQuery' => ['SolrDisMaxQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeExpandFilterQuery' => ['SolrQuery', 'fq'=>'string'],
'SolrDisMaxQuery::removeExpandSortField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeFacetDateField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeFacetDateOther' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::removeFacetField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeFacetQuery' => ['SolrQuery', 'value'=>'string'],
'SolrDisMaxQuery::removeField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeFilterQuery' => ['SolrQuery', 'fq'=>'string'],
'SolrDisMaxQuery::removeHighlightField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeMltField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeMltQueryField' => ['SolrQuery', 'queryField'=>'string'],
'SolrDisMaxQuery::removePhraseField' => ['SolrDisMaxQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeQueryField' => ['SolrDisMaxQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeSortField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeStatsFacet' => ['SolrQuery', 'value'=>'string'],
'SolrDisMaxQuery::removeStatsField' => ['SolrQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeTrigramPhraseField' => ['SolrDisMaxQuery', 'field'=>'string'],
'SolrDisMaxQuery::removeUserField' => ['SolrDisMaxQuery', 'field'=>'string'],
'SolrDisMaxQuery::serialize' => ['string'],
'SolrDisMaxQuery::set' => ['SolrParams', 'name'=>'string', 'value'=>''],
'SolrDisMaxQuery::setBigramPhraseFields' => ['SolrDisMaxQuery', 'fields'=>'string'],
'SolrDisMaxQuery::setBigramPhraseSlop' => ['SolrDisMaxQuery', 'slop'=>'string'],
'SolrDisMaxQuery::setBoostFunction' => ['SolrDisMaxQuery', 'function'=>'string'],
'SolrDisMaxQuery::setBoostQuery' => ['SolrDisMaxQuery', 'q'=>'string'],
'SolrDisMaxQuery::setEchoHandler' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setEchoParams' => ['SolrQuery', 'type'=>'string'],
'SolrDisMaxQuery::setExpand' => ['SolrQuery', 'value'=>'bool'],
'SolrDisMaxQuery::setExpandQuery' => ['SolrQuery', 'q'=>'string'],
'SolrDisMaxQuery::setExpandRows' => ['SolrQuery', 'value'=>'int'],
'SolrDisMaxQuery::setExplainOther' => ['SolrQuery', 'query'=>'string'],
'SolrDisMaxQuery::setFacet' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setFacetDateEnd' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetDateGap' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetDateHardEnd' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetDateStart' => ['SolrQuery', 'value'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetEnumCacheMinDefaultFrequency' => ['SolrQuery', 'frequency'=>'int', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetLimit' => ['SolrQuery', 'limit'=>'int', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetMethod' => ['SolrQuery', 'method'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetMinCount' => ['SolrQuery', 'mincount'=>'int', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetMissing' => ['SolrQuery', 'flag'=>'bool', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetOffset' => ['SolrQuery', 'offset'=>'int', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetPrefix' => ['SolrQuery', 'prefix'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setFacetSort' => ['SolrQuery', 'facetSort'=>'int', 'field_override'=>'string'],
'SolrDisMaxQuery::setGroup' => ['SolrQuery', 'value'=>'bool'],
'SolrDisMaxQuery::setGroupCachePercent' => ['SolrQuery', 'percent'=>'int'],
'SolrDisMaxQuery::setGroupFacet' => ['SolrQuery', 'value'=>'bool'],
'SolrDisMaxQuery::setGroupFormat' => ['SolrQuery', 'value'=>'string'],
'SolrDisMaxQuery::setGroupLimit' => ['SolrQuery', 'value'=>'int'],
'SolrDisMaxQuery::setGroupMain' => ['SolrQuery', 'value'=>'string'],
'SolrDisMaxQuery::setGroupNGroups' => ['SolrQuery', 'value'=>'bool'],
'SolrDisMaxQuery::setGroupOffset' => ['SolrQuery', 'value'=>'int'],
'SolrDisMaxQuery::setGroupTruncate' => ['SolrQuery', 'value'=>'bool'],
'SolrDisMaxQuery::setHighlight' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setHighlightAlternateField' => ['SolrQuery', 'field'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightFormatter' => ['SolrQuery', 'formatter'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightFragmenter' => ['SolrQuery', 'fragmenter'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightFragsize' => ['SolrQuery', 'size'=>'int', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightHighlightMultiTerm' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setHighlightMaxAlternateFieldLength' => ['SolrQuery', 'fieldLength'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightMaxAnalyzedChars' => ['SolrQuery', 'value'=>'int'],
'SolrDisMaxQuery::setHighlightMergeContiguous' => ['SolrQuery', 'flag'=>'bool', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightRegexMaxAnalyzedChars' => ['SolrQuery', 'maxAnalyzedChars'=>'int'],
'SolrDisMaxQuery::setHighlightRegexPattern' => ['SolrQuery', 'value'=>'string'],
'SolrDisMaxQuery::setHighlightRegexSlop' => ['SolrQuery', 'factor'=>'float'],
'SolrDisMaxQuery::setHighlightRequireFieldMatch' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setHighlightSimplePost' => ['SolrQuery', 'simplePost'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightSimplePre' => ['SolrQuery', 'simplePre'=>'string', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightSnippets' => ['SolrQuery', 'value'=>'int', 'field_override'=>'string'],
'SolrDisMaxQuery::setHighlightUsePhraseHighlighter' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setMinimumMatch' => ['SolrDisMaxQuery', 'value'=>'string'],
'SolrDisMaxQuery::setMlt' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setMltBoost' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setMltCount' => ['SolrQuery', 'count'=>'int'],
'SolrDisMaxQuery::setMltMaxNumQueryTerms' => ['SolrQuery', 'value'=>'int'],
'SolrDisMaxQuery::setMltMaxNumTokens' => ['SolrQuery', 'value'=>'int'],
'SolrDisMaxQuery::setMltMaxWordLength' => ['SolrQuery', 'maxWordLength'=>'int'],
'SolrDisMaxQuery::setMltMinDocFrequency' => ['SolrQuery', 'minDocFrequency'=>'int'],
'SolrDisMaxQuery::setMltMinTermFrequency' => ['SolrQuery', 'minTermFrequency'=>'int'],
'SolrDisMaxQuery::setMltMinWordLength' => ['SolrQuery', 'minWordLength'=>'int'],
'SolrDisMaxQuery::setOmitHeader' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setParam' => ['SolrParams', 'name'=>'string', 'value'=>''],
'SolrDisMaxQuery::setPhraseFields' => ['SolrDisMaxQuery', 'fields'=>'string'],
'SolrDisMaxQuery::setPhraseSlop' => ['SolrDisMaxQuery', 'slop'=>'string'],
'SolrDisMaxQuery::setQuery' => ['SolrQuery', 'query'=>'string'],
'SolrDisMaxQuery::setQueryAlt' => ['SolrDisMaxQuery', 'q'=>'string'],
'SolrDisMaxQuery::setQueryPhraseSlop' => ['SolrDisMaxQuery', 'slop'=>'string'],
'SolrDisMaxQuery::setRows' => ['SolrQuery', 'rows'=>'int'],
'SolrDisMaxQuery::setShowDebugInfo' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setStart' => ['SolrQuery', 'start'=>'int'],
'SolrDisMaxQuery::setStats' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setTerms' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setTermsField' => ['SolrQuery', 'fieldname'=>'string'],
'SolrDisMaxQuery::setTermsIncludeLowerBound' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setTermsIncludeUpperBound' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setTermsLimit' => ['SolrQuery', 'limit'=>'int'],
'SolrDisMaxQuery::setTermsLowerBound' => ['SolrQuery', 'lowerBound'=>'string'],
'SolrDisMaxQuery::setTermsMaxCount' => ['SolrQuery', 'frequency'=>'int'],
'SolrDisMaxQuery::setTermsMinCount' => ['SolrQuery', 'frequency'=>'int'],
'SolrDisMaxQuery::setTermsPrefix' => ['SolrQuery', 'prefix'=>'string'],
'SolrDisMaxQuery::setTermsReturnRaw' => ['SolrQuery', 'flag'=>'bool'],
'SolrDisMaxQuery::setTermsSort' => ['SolrQuery', 'sortType'=>'int'],
'SolrDisMaxQuery::setTermsUpperBound' => ['SolrQuery', 'upperBound'=>'string'],
'SolrDisMaxQuery::setTieBreaker' => ['SolrDisMaxQuery', 'tieBreaker'=>'string'],
'SolrDisMaxQuery::setTimeAllowed' => ['SolrQuery', 'timeAllowed'=>'int'],
'SolrDisMaxQuery::setTrigramPhraseFields' => ['SolrDisMaxQuery', 'fields'=>'string'],
'SolrDisMaxQuery::setTrigramPhraseSlop' => ['SolrDisMaxQuery', 'slop'=>'string'],
'SolrDisMaxQuery::setUserFields' => ['SolrDisMaxQuery', 'fields'=>'string'],
'SolrDisMaxQuery::toString' => ['string', 'url_encode='=>'bool'],
'SolrDisMaxQuery::unserialize' => ['void', 'serialized'=>'string'],
'SolrDisMaxQuery::useDisMaxQueryParser' => ['SolrDisMaxQuery'],
'SolrDisMaxQuery::useEDisMaxQueryParser' => ['SolrDisMaxQuery'],
'SolrDocument::__clone' => ['void'],
'SolrDocument::__construct' => ['void'],
'SolrDocument::__destruct' => ['void'],
'SolrDocument::__get' => ['SolrDocumentField', 'fieldname'=>'string'],
'SolrDocument::__isset' => ['bool', 'fieldname'=>'string'],
'SolrDocument::__set' => ['bool', 'fieldname'=>'string', 'fieldvalue'=>'string'],
'SolrDocument::__unset' => ['bool', 'fieldname'=>'string'],
'SolrDocument::addField' => ['bool', 'fieldname'=>'string', 'fieldvalue'=>'string'],
'SolrDocument::clear' => ['bool'],
'SolrDocument::current' => ['SolrDocumentField'],
'SolrDocument::deleteField' => ['bool', 'fieldname'=>'string'],
'SolrDocument::fieldExists' => ['bool', 'fieldname'=>'string'],
'SolrDocument::getChildDocuments' => ['SolrInputDocument[]'],
'SolrDocument::getChildDocumentsCount' => ['int'],
'SolrDocument::getField' => ['SolrDocumentField|false', 'fieldname'=>'string'],
'SolrDocument::getFieldCount' => ['int|false'],
'SolrDocument::getFieldNames' => ['array|false'],
'SolrDocument::getInputDocument' => ['SolrInputDocument'],
'SolrDocument::hasChildDocuments' => ['bool'],
'SolrDocument::key' => ['string'],
'SolrDocument::merge' => ['bool', 'sourcedoc'=>'solrdocument', 'overwrite='=>'bool'],
'SolrDocument::next' => ['void'],
'SolrDocument::offsetExists' => ['bool', 'fieldname'=>'string'],
'SolrDocument::offsetGet' => ['SolrDocumentField', 'fieldname'=>'string'],
'SolrDocument::offsetSet' => ['void', 'fieldname'=>'string', 'fieldvalue'=>'string'],
'SolrDocument::offsetUnset' => ['void', 'fieldname'=>'string'],
'SolrDocument::reset' => ['bool'],
'SolrDocument::rewind' => ['void'],
'SolrDocument::serialize' => ['string'],
'SolrDocument::sort' => ['bool', 'sortorderby'=>'int', 'sortdirection='=>'int'],
'SolrDocument::toArray' => ['array'],
'SolrDocument::unserialize' => ['void', 'serialized'=>'string'],
'SolrDocument::valid' => ['bool'],
'SolrDocumentField::__construct' => ['void'],
'SolrDocumentField::__destruct' => ['void'],
'SolrException::__clone' => ['void'],
'SolrException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'SolrException::__toString' => ['string'],
'SolrException::__wakeup' => ['void'],
'SolrException::getCode' => ['int'],
'SolrException::getFile' => ['string'],
'SolrException::getInternalInfo' => ['array'],
'SolrException::getLine' => ['int'],
'SolrException::getMessage' => ['string'],
'SolrException::getPrevious' => ['Exception|Throwable'],
'SolrException::getTrace' => ['list<array<string,mixed>>'],
'SolrException::getTraceAsString' => ['string'],
'SolrGenericResponse::__construct' => ['void'],
'SolrGenericResponse::__destruct' => ['void'],
'SolrGenericResponse::getDigestedResponse' => ['string'],
'SolrGenericResponse::getHttpStatus' => ['int'],
'SolrGenericResponse::getHttpStatusMessage' => ['string'],
'SolrGenericResponse::getRawRequest' => ['string'],
'SolrGenericResponse::getRawRequestHeaders' => ['string'],
'SolrGenericResponse::getRawResponse' => ['string'],
'SolrGenericResponse::getRawResponseHeaders' => ['string'],
'SolrGenericResponse::getRequestUrl' => ['string'],
'SolrGenericResponse::getResponse' => ['SolrObject'],
'SolrGenericResponse::setParseMode' => ['bool', 'parser_mode='=>'int'],
'SolrGenericResponse::success' => ['bool'],
'SolrIllegalArgumentException::__clone' => ['void'],
'SolrIllegalArgumentException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'SolrIllegalArgumentException::__toString' => ['string'],
'SolrIllegalArgumentException::__wakeup' => ['void'],
'SolrIllegalArgumentException::getCode' => ['int'],
'SolrIllegalArgumentException::getFile' => ['string'],
'SolrIllegalArgumentException::getInternalInfo' => ['array'],
'SolrIllegalArgumentException::getLine' => ['int'],
'SolrIllegalArgumentException::getMessage' => ['string'],
'SolrIllegalArgumentException::getPrevious' => ['Exception|Throwable'],
'SolrIllegalArgumentException::getTrace' => ['list<array<string,mixed>>'],
'SolrIllegalArgumentException::getTraceAsString' => ['string'],
'SolrIllegalOperationException::__clone' => ['void'],
'SolrIllegalOperationException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'SolrIllegalOperationException::__toString' => ['string'],
'SolrIllegalOperationException::__wakeup' => ['void'],
'SolrIllegalOperationException::getCode' => ['int'],
'SolrIllegalOperationException::getFile' => ['string'],
'SolrIllegalOperationException::getInternalInfo' => ['array'],
'SolrIllegalOperationException::getLine' => ['int'],
'SolrIllegalOperationException::getMessage' => ['string'],
'SolrIllegalOperationException::getPrevious' => ['Exception|Throwable'],
'SolrIllegalOperationException::getTrace' => ['list<array<string,mixed>>'],
'SolrIllegalOperationException::getTraceAsString' => ['string'],
'SolrInputDocument::__clone' => ['void'],
'SolrInputDocument::__construct' => ['void'],
'SolrInputDocument::__destruct' => ['void'],
'SolrInputDocument::addChildDocument' => ['void', 'child'=>'SolrInputDocument'],
'SolrInputDocument::addChildDocuments' => ['void', 'docs'=>'array'],
'SolrInputDocument::addField' => ['bool', 'fieldname'=>'string', 'fieldvalue'=>'string', 'fieldboostvalue='=>'float'],
'SolrInputDocument::clear' => ['bool'],
'SolrInputDocument::deleteField' => ['bool', 'fieldname'=>'string'],
'SolrInputDocument::fieldExists' => ['bool', 'fieldname'=>'string'],
'SolrInputDocument::getBoost' => ['float|false'],
'SolrInputDocument::getChildDocuments' => ['SolrInputDocument[]'],
'SolrInputDocument::getChildDocumentsCount' => ['int'],
'SolrInputDocument::getField' => ['SolrDocumentField|false', 'fieldname'=>'string'],
'SolrInputDocument::getFieldBoost' => ['float|false', 'fieldname'=>'string'],
'SolrInputDocument::getFieldCount' => ['int|false'],
'SolrInputDocument::getFieldNames' => ['array|false'],
'SolrInputDocument::hasChildDocuments' => ['bool'],
'SolrInputDocument::merge' => ['bool', 'sourcedoc'=>'SolrInputDocument', 'overwrite='=>'bool'],
'SolrInputDocument::reset' => ['bool'],
'SolrInputDocument::setBoost' => ['bool', 'documentboostvalue'=>'float'],
'SolrInputDocument::setFieldBoost' => ['bool', 'fieldname'=>'string', 'fieldboostvalue'=>'float'],
'SolrInputDocument::sort' => ['bool', 'sortorderby'=>'int', 'sortdirection='=>'int'],
'SolrInputDocument::toArray' => ['array|false'],
'SolrModifiableParams::__construct' => ['void'],
'SolrModifiableParams::__destruct' => ['void'],
'SolrModifiableParams::add' => ['SolrParams', 'name'=>'string', 'value'=>'string'],
'SolrModifiableParams::addParam' => ['SolrParams', 'name'=>'string', 'value'=>'string'],
'SolrModifiableParams::get' => ['mixed', 'param_name'=>'string'],
'SolrModifiableParams::getParam' => ['mixed', 'param_name'=>'string'],
'SolrModifiableParams::getParams' => ['array'],
'SolrModifiableParams::getPreparedParams' => ['array'],
'SolrModifiableParams::serialize' => ['string'],
'SolrModifiableParams::set' => ['SolrParams', 'name'=>'string', 'value'=>''],
'SolrModifiableParams::setParam' => ['SolrParams', 'name'=>'string', 'value'=>''],
'SolrModifiableParams::toString' => ['string', 'url_encode='=>'bool'],
'SolrModifiableParams::unserialize' => ['void', 'serialized'=>'string'],
'SolrObject::__construct' => ['void'],
'SolrObject::__destruct' => ['void'],
'SolrObject::getPropertyNames' => ['array'],
'SolrObject::offsetExists' => ['bool', 'property_name'=>'string'],
'SolrObject::offsetGet' => ['SolrDocumentField', 'property_name'=>'string'],
'SolrObject::offsetSet' => ['void', 'property_name'=>'string', 'property_value'=>'string'],
'SolrObject::offsetUnset' => ['void', 'property_name'=>'string'],
'SolrParams::__construct' => ['void'],
'SolrParams::add' => ['SolrParams|false', 'name'=>'string', 'value'=>'string'],
'SolrParams::addParam' => ['SolrParams|false', 'name'=>'string', 'value'=>'string'],
'SolrParams::get' => ['mixed', 'param_name'=>'string'],
'SolrParams::getParam' => ['mixed', 'param_name='=>'string'],
'SolrParams::getParams' => ['array'],
'SolrParams::getPreparedParams' => ['array'],
'SolrParams::serialize' => ['string'],
'SolrParams::set' => ['SolrParams|false', 'name'=>'string', 'value'=>'string'],
'SolrParams::setParam' => ['SolrParams|false', 'name'=>'string', 'value'=>'string'],
'SolrParams::toString' => ['string|false', 'url_encode='=>'bool'],
'SolrParams::unserialize' => ['void', 'serialized'=>'string'],
'SolrPingResponse::__construct' => ['void'],
'SolrPingResponse::__destruct' => ['void'],
'SolrPingResponse::getDigestedResponse' => ['string'],
'SolrPingResponse::getHttpStatus' => ['int'],
'SolrPingResponse::getHttpStatusMessage' => ['string'],
'SolrPingResponse::getRawRequest' => ['string'],
'SolrPingResponse::getRawRequestHeaders' => ['string'],
'SolrPingResponse::getRawResponse' => ['string'],
'SolrPingResponse::getRawResponseHeaders' => ['string'],
'SolrPingResponse::getRequestUrl' => ['string'],
'SolrPingResponse::getResponse' => ['string'],
'SolrPingResponse::setParseMode' => ['bool', 'parser_mode='=>'int'],
'SolrPingResponse::success' => ['bool'],
'SolrQuery::__construct' => ['void', 'q='=>'string'],
'SolrQuery::__destruct' => ['void'],
'SolrQuery::add' => ['SolrParams', 'name'=>'string', 'value'=>'string'],
'SolrQuery::addExpandFilterQuery' => ['SolrQuery', 'fq'=>'string'],
'SolrQuery::addExpandSortField' => ['SolrQuery', 'field'=>'string', 'order='=>'string'],
'SolrQuery::addFacetDateField' => ['SolrQuery', 'datefield'=>'string'],
'SolrQuery::addFacetDateOther' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'],
'SolrQuery::addFacetField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::addFacetQuery' => ['SolrQuery', 'facetquery'=>'string'],
'SolrQuery::addField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::addFilterQuery' => ['SolrQuery', 'fq'=>'string'],
'SolrQuery::addGroupField' => ['SolrQuery', 'value'=>'string'],
'SolrQuery::addGroupFunction' => ['SolrQuery', 'value'=>'string'],
'SolrQuery::addGroupQuery' => ['SolrQuery', 'value'=>'string'],
'SolrQuery::addGroupSortField' => ['SolrQuery', 'field'=>'string', 'order='=>'int'],
'SolrQuery::addHighlightField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::addMltField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::addMltQueryField' => ['SolrQuery', 'field'=>'string', 'boost'=>'float'],
'SolrQuery::addParam' => ['SolrParams', 'name'=>'string', 'value'=>'string'],
'SolrQuery::addSortField' => ['SolrQuery', 'field'=>'string', 'order='=>'int'],
'SolrQuery::addStatsFacet' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::addStatsField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::collapse' => ['SolrQuery', 'collapseFunction'=>'SolrCollapseFunction'],
'SolrQuery::get' => ['mixed', 'param_name'=>'string'],
'SolrQuery::getExpand' => ['bool'],
'SolrQuery::getExpandFilterQueries' => ['array'],
'SolrQuery::getExpandQuery' => ['array'],
'SolrQuery::getExpandRows' => ['int'],
'SolrQuery::getExpandSortFields' => ['array'],
'SolrQuery::getFacet' => ['?bool'],
'SolrQuery::getFacetDateEnd' => ['?string', 'field_override='=>'string'],
'SolrQuery::getFacetDateFields' => ['array'],
'SolrQuery::getFacetDateGap' => ['?string', 'field_override='=>'string'],
'SolrQuery::getFacetDateHardEnd' => ['?string', 'field_override='=>'string'],
'SolrQuery::getFacetDateOther' => ['?string', 'field_override='=>'string'],
'SolrQuery::getFacetDateStart' => ['?string', 'field_override='=>'string'],
'SolrQuery::getFacetFields' => ['array'],
'SolrQuery::getFacetLimit' => ['?int', 'field_override='=>'string'],
'SolrQuery::getFacetMethod' => ['?string', 'field_override='=>'string'],
'SolrQuery::getFacetMinCount' => ['?int', 'field_override='=>'string'],
'SolrQuery::getFacetMissing' => ['?bool', 'field_override='=>'string'],
'SolrQuery::getFacetOffset' => ['?int', 'field_override='=>'string'],
'SolrQuery::getFacetPrefix' => ['?string', 'field_override='=>'string'],
'SolrQuery::getFacetQueries' => ['?array'],
'SolrQuery::getFacetSort' => ['int', 'field_override='=>'string'],
'SolrQuery::getFields' => ['?array'],
'SolrQuery::getFilterQueries' => ['?array'],
'SolrQuery::getGroup' => ['bool'],
'SolrQuery::getGroupCachePercent' => ['int'],
'SolrQuery::getGroupFacet' => ['bool'],
'SolrQuery::getGroupFields' => ['array'],
'SolrQuery::getGroupFormat' => ['string'],
'SolrQuery::getGroupFunctions' => ['array'],
'SolrQuery::getGroupLimit' => ['int'],
'SolrQuery::getGroupMain' => ['bool'],
'SolrQuery::getGroupNGroups' => ['bool'],
'SolrQuery::getGroupOffset' => ['int'],
'SolrQuery::getGroupQueries' => ['array'],
'SolrQuery::getGroupSortFields' => ['array'],
'SolrQuery::getGroupTruncate' => ['bool'],
'SolrQuery::getHighlight' => ['bool'],
'SolrQuery::getHighlightAlternateField' => ['?string', 'field_override='=>'string'],
'SolrQuery::getHighlightFields' => ['?array'],
'SolrQuery::getHighlightFormatter' => ['?string', 'field_override='=>'string'],
'SolrQuery::getHighlightFragmenter' => ['?string', 'field_override='=>'string'],
'SolrQuery::getHighlightFragsize' => ['?int', 'field_override='=>'string'],
'SolrQuery::getHighlightHighlightMultiTerm' => ['?bool'],
'SolrQuery::getHighlightMaxAlternateFieldLength' => ['?int', 'field_override='=>'string'],
'SolrQuery::getHighlightMaxAnalyzedChars' => ['?int'],
'SolrQuery::getHighlightMergeContiguous' => ['?bool', 'field_override='=>'string'],
'SolrQuery::getHighlightRegexMaxAnalyzedChars' => ['?int'],
'SolrQuery::getHighlightRegexPattern' => ['?string'],
'SolrQuery::getHighlightRegexSlop' => ['?float'],
'SolrQuery::getHighlightRequireFieldMatch' => ['?bool'],
'SolrQuery::getHighlightSimplePost' => ['?string', 'field_override='=>'string'],
'SolrQuery::getHighlightSimplePre' => ['?string', 'field_override='=>'string'],
'SolrQuery::getHighlightSnippets' => ['?int', 'field_override='=>'string'],
'SolrQuery::getHighlightUsePhraseHighlighter' => ['?bool'],
'SolrQuery::getMlt' => ['?bool'],
'SolrQuery::getMltBoost' => ['?bool'],
'SolrQuery::getMltCount' => ['?int'],
'SolrQuery::getMltFields' => ['?array'],
'SolrQuery::getMltMaxNumQueryTerms' => ['?int'],
'SolrQuery::getMltMaxNumTokens' => ['?int'],
'SolrQuery::getMltMaxWordLength' => ['?int'],
'SolrQuery::getMltMinDocFrequency' => ['?int'],
'SolrQuery::getMltMinTermFrequency' => ['?int'],
'SolrQuery::getMltMinWordLength' => ['?int'],
'SolrQuery::getMltQueryFields' => ['?array'],
'SolrQuery::getParam' => ['?mixed', 'param_name'=>'string'],
'SolrQuery::getParams' => ['?array'],
'SolrQuery::getPreparedParams' => ['?array'],
'SolrQuery::getQuery' => ['?string'],
'SolrQuery::getRows' => ['?int'],
'SolrQuery::getSortFields' => ['?array'],
'SolrQuery::getStart' => ['?int'],
'SolrQuery::getStats' => ['?bool'],
'SolrQuery::getStatsFacets' => ['?array'],
'SolrQuery::getStatsFields' => ['?array'],
'SolrQuery::getTerms' => ['?bool'],
'SolrQuery::getTermsField' => ['?string'],
'SolrQuery::getTermsIncludeLowerBound' => ['?bool'],
'SolrQuery::getTermsIncludeUpperBound' => ['?bool'],
'SolrQuery::getTermsLimit' => ['?int'],
'SolrQuery::getTermsLowerBound' => ['?string'],
'SolrQuery::getTermsMaxCount' => ['?int'],
'SolrQuery::getTermsMinCount' => ['?int'],
'SolrQuery::getTermsPrefix' => ['?string'],
'SolrQuery::getTermsReturnRaw' => ['?bool'],
'SolrQuery::getTermsSort' => ['?int'],
'SolrQuery::getTermsUpperBound' => ['?string'],
'SolrQuery::getTimeAllowed' => ['?int'],
'SolrQuery::removeExpandFilterQuery' => ['SolrQuery', 'fq'=>'string'],
'SolrQuery::removeExpandSortField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::removeFacetDateField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::removeFacetDateOther' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'],
'SolrQuery::removeFacetField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::removeFacetQuery' => ['SolrQuery', 'value'=>'string'],
'SolrQuery::removeField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::removeFilterQuery' => ['SolrQuery', 'fq'=>'string'],
'SolrQuery::removeHighlightField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::removeMltField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::removeMltQueryField' => ['SolrQuery', 'queryfield'=>'string'],
'SolrQuery::removeSortField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::removeStatsFacet' => ['SolrQuery', 'value'=>'string'],
'SolrQuery::removeStatsField' => ['SolrQuery', 'field'=>'string'],
'SolrQuery::serialize' => ['string'],
'SolrQuery::set' => ['SolrParams', 'name'=>'string', 'value'=>''],
'SolrQuery::setEchoHandler' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setEchoParams' => ['SolrQuery', 'type'=>'string'],
'SolrQuery::setExpand' => ['SolrQuery', 'value'=>'bool'],
'SolrQuery::setExpandQuery' => ['SolrQuery', 'q'=>'string'],
'SolrQuery::setExpandRows' => ['SolrQuery', 'value'=>'int'],
'SolrQuery::setExplainOther' => ['SolrQuery', 'query'=>'string'],
'SolrQuery::setFacet' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setFacetDateEnd' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'],
'SolrQuery::setFacetDateGap' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'],
'SolrQuery::setFacetDateHardEnd' => ['SolrQuery', 'value'=>'bool', 'field_override='=>'string'],
'SolrQuery::setFacetDateStart' => ['SolrQuery', 'value'=>'string', 'field_override='=>'string'],
'SolrQuery::setFacetEnumCacheMinDefaultFrequency' => ['SolrQuery', 'frequency'=>'int', 'field_override='=>'string'],
'SolrQuery::setFacetLimit' => ['SolrQuery', 'limit'=>'int', 'field_override='=>'string'],
'SolrQuery::setFacetMethod' => ['SolrQuery', 'method'=>'string', 'field_override='=>'string'],
'SolrQuery::setFacetMinCount' => ['SolrQuery', 'mincount'=>'int', 'field_override='=>'string'],
'SolrQuery::setFacetMissing' => ['SolrQuery', 'flag'=>'bool', 'field_override='=>'string'],
'SolrQuery::setFacetOffset' => ['SolrQuery', 'offset'=>'int', 'field_override='=>'string'],
'SolrQuery::setFacetPrefix' => ['SolrQuery', 'prefix'=>'string', 'field_override='=>'string'],
'SolrQuery::setFacetSort' => ['SolrQuery', 'facetsort'=>'int', 'field_override='=>'string'],
'SolrQuery::setGroup' => ['SolrQuery', 'value'=>'bool'],
'SolrQuery::setGroupCachePercent' => ['SolrQuery', 'percent'=>'int'],
'SolrQuery::setGroupFacet' => ['SolrQuery', 'value'=>'bool'],
'SolrQuery::setGroupFormat' => ['SolrQuery', 'value'=>'string'],
'SolrQuery::setGroupLimit' => ['SolrQuery', 'value'=>'int'],
'SolrQuery::setGroupMain' => ['SolrQuery', 'value'=>'string'],
'SolrQuery::setGroupNGroups' => ['SolrQuery', 'value'=>'bool'],
'SolrQuery::setGroupOffset' => ['SolrQuery', 'value'=>'int'],
'SolrQuery::setGroupTruncate' => ['SolrQuery', 'value'=>'bool'],
'SolrQuery::setHighlight' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setHighlightAlternateField' => ['SolrQuery', 'field'=>'string', 'field_override='=>'string'],
'SolrQuery::setHighlightFormatter' => ['SolrQuery', 'formatter'=>'string', 'field_override='=>'string'],
'SolrQuery::setHighlightFragmenter' => ['SolrQuery', 'fragmenter'=>'string', 'field_override='=>'string'],
'SolrQuery::setHighlightFragsize' => ['SolrQuery', 'size'=>'int', 'field_override='=>'string'],
'SolrQuery::setHighlightHighlightMultiTerm' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setHighlightMaxAlternateFieldLength' => ['SolrQuery', 'fieldlength'=>'int', 'field_override='=>'string'],
'SolrQuery::setHighlightMaxAnalyzedChars' => ['SolrQuery', 'value'=>'int'],
'SolrQuery::setHighlightMergeContiguous' => ['SolrQuery', 'flag'=>'bool', 'field_override='=>'string'],
'SolrQuery::setHighlightRegexMaxAnalyzedChars' => ['SolrQuery', 'maxanalyzedchars'=>'int'],
'SolrQuery::setHighlightRegexPattern' => ['SolrQuery', 'value'=>'string'],
'SolrQuery::setHighlightRegexSlop' => ['SolrQuery', 'factor'=>'float'],
'SolrQuery::setHighlightRequireFieldMatch' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setHighlightSimplePost' => ['SolrQuery', 'simplepost'=>'string', 'field_override='=>'string'],
'SolrQuery::setHighlightSimplePre' => ['SolrQuery', 'simplepre'=>'string', 'field_override='=>'string'],
'SolrQuery::setHighlightSnippets' => ['SolrQuery', 'value'=>'int', 'field_override='=>'string'],
'SolrQuery::setHighlightUsePhraseHighlighter' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setMlt' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setMltBoost' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setMltCount' => ['SolrQuery', 'count'=>'int'],
'SolrQuery::setMltMaxNumQueryTerms' => ['SolrQuery', 'value'=>'int'],
'SolrQuery::setMltMaxNumTokens' => ['SolrQuery', 'value'=>'int'],
'SolrQuery::setMltMaxWordLength' => ['SolrQuery', 'maxwordlength'=>'int'],
'SolrQuery::setMltMinDocFrequency' => ['SolrQuery', 'mindocfrequency'=>'int'],
'SolrQuery::setMltMinTermFrequency' => ['SolrQuery', 'mintermfrequency'=>'int'],
'SolrQuery::setMltMinWordLength' => ['SolrQuery', 'minwordlength'=>'int'],
'SolrQuery::setOmitHeader' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setParam' => ['SolrParams', 'name'=>'string', 'value'=>''],
'SolrQuery::setQuery' => ['SolrQuery', 'query'=>'string'],
'SolrQuery::setRows' => ['SolrQuery', 'rows'=>'int'],
'SolrQuery::setShowDebugInfo' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setStart' => ['SolrQuery', 'start'=>'int'],
'SolrQuery::setStats' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setTerms' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setTermsField' => ['SolrQuery', 'fieldname'=>'string'],
'SolrQuery::setTermsIncludeLowerBound' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setTermsIncludeUpperBound' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setTermsLimit' => ['SolrQuery', 'limit'=>'int'],
'SolrQuery::setTermsLowerBound' => ['SolrQuery', 'lowerbound'=>'string'],
'SolrQuery::setTermsMaxCount' => ['SolrQuery', 'frequency'=>'int'],
'SolrQuery::setTermsMinCount' => ['SolrQuery', 'frequency'=>'int'],
'SolrQuery::setTermsPrefix' => ['SolrQuery', 'prefix'=>'string'],
'SolrQuery::setTermsReturnRaw' => ['SolrQuery', 'flag'=>'bool'],
'SolrQuery::setTermsSort' => ['SolrQuery', 'sorttype'=>'int'],
'SolrQuery::setTermsUpperBound' => ['SolrQuery', 'upperbound'=>'string'],
'SolrQuery::setTimeAllowed' => ['SolrQuery', 'timeallowed'=>'int'],
'SolrQuery::toString' => ['string', 'url_encode='=>'bool'],
'SolrQuery::unserialize' => ['void', 'serialized'=>'string'],
'SolrQueryResponse::__construct' => ['void'],
'SolrQueryResponse::__destruct' => ['void'],
'SolrQueryResponse::getDigestedResponse' => ['string'],
'SolrQueryResponse::getHttpStatus' => ['int'],
'SolrQueryResponse::getHttpStatusMessage' => ['string'],
'SolrQueryResponse::getRawRequest' => ['string'],
'SolrQueryResponse::getRawRequestHeaders' => ['string'],
'SolrQueryResponse::getRawResponse' => ['string'],
'SolrQueryResponse::getRawResponseHeaders' => ['string'],
'SolrQueryResponse::getRequestUrl' => ['string'],
'SolrQueryResponse::getResponse' => ['SolrObject'],
'SolrQueryResponse::setParseMode' => ['bool', 'parser_mode='=>'int'],
'SolrQueryResponse::success' => ['bool'],
'SolrResponse::getDigestedResponse' => ['string'],
'SolrResponse::getHttpStatus' => ['int'],
'SolrResponse::getHttpStatusMessage' => ['string'],
'SolrResponse::getRawRequest' => ['string'],
'SolrResponse::getRawRequestHeaders' => ['string'],
'SolrResponse::getRawResponse' => ['string'],
'SolrResponse::getRawResponseHeaders' => ['string'],
'SolrResponse::getRequestUrl' => ['string'],
'SolrResponse::getResponse' => ['SolrObject'],
'SolrResponse::setParseMode' => ['bool', 'parser_mode='=>'int'],
'SolrResponse::success' => ['bool'],
'SolrServerException::__clone' => ['void'],
'SolrServerException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'SolrServerException::__toString' => ['string'],
'SolrServerException::__wakeup' => ['void'],
'SolrServerException::getCode' => ['int'],
'SolrServerException::getFile' => ['string'],
'SolrServerException::getInternalInfo' => ['array'],
'SolrServerException::getLine' => ['int'],
'SolrServerException::getMessage' => ['string'],
'SolrServerException::getPrevious' => ['Exception|Throwable'],
'SolrServerException::getTrace' => ['list<array<string,mixed>>'],
'SolrServerException::getTraceAsString' => ['string'],
'SolrUpdateResponse::__construct' => ['void'],
'SolrUpdateResponse::__destruct' => ['void'],
'SolrUpdateResponse::getDigestedResponse' => ['string'],
'SolrUpdateResponse::getHttpStatus' => ['int'],
'SolrUpdateResponse::getHttpStatusMessage' => ['string'],
'SolrUpdateResponse::getRawRequest' => ['string'],
'SolrUpdateResponse::getRawRequestHeaders' => ['string'],
'SolrUpdateResponse::getRawResponse' => ['string'],
'SolrUpdateResponse::getRawResponseHeaders' => ['string'],
'SolrUpdateResponse::getRequestUrl' => ['string'],
'SolrUpdateResponse::getResponse' => ['SolrObject'],
'SolrUpdateResponse::setParseMode' => ['bool', 'parser_mode='=>'int'],
'SolrUpdateResponse::success' => ['bool'],
'SolrUtils::digestXmlResponse' => ['SolrObject', 'xmlresponse'=>'string', 'parse_mode='=>'int'],
'SolrUtils::escapeQueryChars' => ['string|false', 'string'=>'string'],
'SolrUtils::getSolrVersion' => ['string'],
'SolrUtils::queryPhrase' => ['string', 'string'=>'string'],
'sort' => ['bool', '&rw_array'=>'array', 'flags='=>'int'],
'soundex' => ['string', 'string'=>'string'],
'SphinxClient::__construct' => ['void'],
'SphinxClient::addQuery' => ['int', 'query'=>'string', 'index='=>'string', 'comment='=>'string'],
'SphinxClient::buildExcerpts' => ['array', 'docs'=>'array', 'index'=>'string', 'words'=>'string', 'opts='=>'array'],
'SphinxClient::buildKeywords' => ['array', 'query'=>'string', 'index'=>'string', 'hits'=>'bool'],
'SphinxClient::close' => ['bool'],
'SphinxClient::escapeString' => ['string', 'string'=>'string'],
'SphinxClient::getLastError' => ['string'],
'SphinxClient::getLastWarning' => ['string'],
'SphinxClient::open' => ['bool'],
'SphinxClient::query' => ['array', 'query'=>'string', 'index='=>'string', 'comment='=>'string'],
'SphinxClient::resetFilters' => ['void'],
'SphinxClient::resetGroupBy' => ['void'],
'SphinxClient::runQueries' => ['array'],
'SphinxClient::setArrayResult' => ['bool', 'array_result'=>'bool'],
'SphinxClient::setConnectTimeout' => ['bool', 'timeout'=>'float'],
'SphinxClient::setFieldWeights' => ['bool', 'weights'=>'array'],
'SphinxClient::setFilter' => ['bool', 'attribute'=>'string', 'values'=>'array', 'exclude='=>'bool'],
'SphinxClient::setFilterFloatRange' => ['bool', 'attribute'=>'string', 'min'=>'float', 'max'=>'float', 'exclude='=>'bool'],
'SphinxClient::setFilterRange' => ['bool', 'attribute'=>'string', 'min'=>'int', 'max'=>'int', 'exclude='=>'bool'],
'SphinxClient::setGeoAnchor' => ['bool', 'attrlat'=>'string', 'attrlong'=>'string', 'latitude'=>'float', 'longitude'=>'float'],
'SphinxClient::setGroupBy' => ['bool', 'attribute'=>'string', 'func'=>'int', 'groupsort='=>'string'],
'SphinxClient::setGroupDistinct' => ['bool', 'attribute'=>'string'],
'SphinxClient::setIDRange' => ['bool', 'min'=>'int', 'max'=>'int'],
'SphinxClient::setIndexWeights' => ['bool', 'weights'=>'array'],
'SphinxClient::setLimits' => ['bool', 'offset'=>'int', 'limit'=>'int', 'max_matches='=>'int', 'cutoff='=>'int'],
'SphinxClient::setMatchMode' => ['bool', 'mode'=>'int'],
'SphinxClient::setMaxQueryTime' => ['bool', 'qtime'=>'int'],
'SphinxClient::setOverride' => ['bool', 'attribute'=>'string', 'type'=>'int', 'values'=>'array'],
'SphinxClient::setRankingMode' => ['bool', 'ranker'=>'int'],
'SphinxClient::setRetries' => ['bool', 'count'=>'int', 'delay='=>'int'],
'SphinxClient::setSelect' => ['bool', 'clause'=>'string'],
'SphinxClient::setServer' => ['bool', 'server'=>'string', 'port'=>'int'],
'SphinxClient::setSortMode' => ['bool', 'mode'=>'int', 'sortby='=>'string'],
'SphinxClient::status' => ['array'],
'SphinxClient::updateAttributes' => ['int', 'index'=>'string', 'attributes'=>'array', 'values'=>'array', 'mva='=>'bool'],
'spl_autoload' => ['void', 'class'=>'string', 'file_extensions='=>'string'],
'spl_autoload_call' => ['void', 'class'=>'string'],
'spl_autoload_extensions' => ['string', 'file_extensions='=>'string'],
'spl_autoload_functions' => ['false|list<callable(string):void>'],
'spl_autoload_register' => ['bool', 'callback='=>'callable(string):void', 'throw='=>'bool', 'prepend='=>'bool'],
'spl_autoload_unregister' => ['bool', 'callback'=>'callable(string):void'],
'spl_classes' => ['array'],
'spl_object_hash' => ['string', 'object'=>'object'],
'spl_object_id' => ['int', 'object'=>'object'],
'SplDoublyLinkedList::__construct' => ['void'],
'SplDoublyLinkedList::add' => ['void', 'index'=>'mixed', 'newval'=>'mixed'],
'SplDoublyLinkedList::bottom' => ['mixed'],
'SplDoublyLinkedList::count' => ['int'],
'SplDoublyLinkedList::current' => ['mixed'],
'SplDoublyLinkedList::getIteratorMode' => ['int'],
'SplDoublyLinkedList::isEmpty' => ['bool'],
'SplDoublyLinkedList::key' => ['mixed'],
'SplDoublyLinkedList::next' => ['void'],
'SplDoublyLinkedList::offsetExists' => ['bool', 'index'=>'mixed'],
'SplDoublyLinkedList::offsetGet' => ['mixed', 'index'=>'mixed'],
'SplDoublyLinkedList::offsetSet' => ['void', 'index'=>'mixed', 'newval'=>'mixed'],
'SplDoublyLinkedList::offsetUnset' => ['void', 'index'=>'mixed'],
'SplDoublyLinkedList::pop' => ['mixed'],
'SplDoublyLinkedList::prev' => ['void'],
'SplDoublyLinkedList::push' => ['void', 'value'=>'mixed'],
'SplDoublyLinkedList::rewind' => ['void'],
'SplDoublyLinkedList::serialize' => ['string'],
'SplDoublyLinkedList::setIteratorMode' => ['void', 'flags'=>'int'],
'SplDoublyLinkedList::shift' => ['mixed'],
'SplDoublyLinkedList::top' => ['mixed'],
'SplDoublyLinkedList::unserialize' => ['void', 'serialized'=>'string'],
'SplDoublyLinkedList::unshift' => ['bool', 'value'=>'mixed'],
'SplDoublyLinkedList::valid' => ['bool'],
'SplEnum::__construct' => ['void', 'initial_value='=>'mixed', 'strict='=>'bool'],
'SplEnum::getConstList' => ['array', 'include_default='=>'bool'],
'SplFileInfo::__construct' => ['void', 'file_name'=>'string'],
'SplFileInfo::__toString' => ['string'],
'SplFileInfo::__wakeup' => ['void'],
'SplFileInfo::getATime' => ['int'],
'SplFileInfo::getBasename' => ['string', 'suffix='=>'string'],
'SplFileInfo::getCTime' => ['int'],
'SplFileInfo::getExtension' => ['string'],
'SplFileInfo::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplFileInfo::getFilename' => ['string'],
'SplFileInfo::getGroup' => ['int'],
'SplFileInfo::getInode' => ['int'],
'SplFileInfo::getLinkTarget' => ['string'],
'SplFileInfo::getMTime' => ['int'],
'SplFileInfo::getOwner' => ['int'],
'SplFileInfo::getPath' => ['string'],
'SplFileInfo::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplFileInfo::getPathname' => ['string'],
'SplFileInfo::getPerms' => ['int'],
'SplFileInfo::getRealPath' => ['string|false'],
'SplFileInfo::getSize' => ['int'],
'SplFileInfo::getType' => ['string'],
'SplFileInfo::isDir' => ['bool'],
'SplFileInfo::isExecutable' => ['bool'],
'SplFileInfo::isFile' => ['bool'],
'SplFileInfo::isLink' => ['bool'],
'SplFileInfo::isReadable' => ['bool'],
'SplFileInfo::isWritable' => ['bool'],
'SplFileInfo::openFile' => ['SplFileObject', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
'SplFileInfo::setFileClass' => ['void', 'class_name='=>'string'],
'SplFileInfo::setInfoClass' => ['void', 'class_name='=>'string'],
'SplFileObject::__construct' => ['void', 'filename'=>'string', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>''],
'SplFileObject::__toString' => ['string'],
'SplFileObject::current' => ['string|array|false'],
'SplFileObject::eof' => ['bool'],
'SplFileObject::fflush' => ['bool'],
'SplFileObject::fgetc' => ['string|false'],
'SplFileObject::fgetcsv' => ['list<string>|array{0: null}|false|null', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'SplFileObject::fgets' => ['string|false'],
'SplFileObject::flock' => ['bool', 'operation'=>'int', '&w_wouldblock='=>'int'],
'SplFileObject::fpassthru' => ['int|false'],
'SplFileObject::fputcsv' => ['int|false', 'fields'=>'array<array-key, null|scalar|Stringable>', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'SplFileObject::fread' => ['string|false', 'length'=>'int'],
'SplFileObject::fscanf' => ['array|int', 'format'=>'string', '&...w_vars='=>'string|int|float'],
'SplFileObject::fseek' => ['int', 'pos'=>'int', 'whence='=>'int'],
'SplFileObject::fstat' => ['array|false'],
'SplFileObject::ftell' => ['int|false'],
'SplFileObject::ftruncate' => ['bool', 'size'=>'int'],
'SplFileObject::fwrite' => ['int', 'string'=>'string', 'length='=>'int'],
'SplFileObject::getATime' => ['int'],
'SplFileObject::getBasename' => ['string', 'suffix='=>'string'],
'SplFileObject::getChildren' => ['null'],
'SplFileObject::getCsvControl' => ['array'],
'SplFileObject::getCTime' => ['int'],
'SplFileObject::getCurrentLine' => ['string|false'],
'SplFileObject::getExtension' => ['string'],
'SplFileObject::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplFileObject::getFilename' => ['string'],
'SplFileObject::getFlags' => ['int'],
'SplFileObject::getGroup' => ['int'],
'SplFileObject::getInode' => ['int'],
'SplFileObject::getLinkTarget' => ['string'],
'SplFileObject::getMaxLineLen' => ['int'],
'SplFileObject::getMTime' => ['int'],
'SplFileObject::getOwner' => ['int'],
'SplFileObject::getPath' => ['string'],
'SplFileObject::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplFileObject::getPathname' => ['string'],
'SplFileObject::getPerms' => ['int'],
'SplFileObject::getRealPath' => ['false|string'],
'SplFileObject::getSize' => ['int'],
'SplFileObject::getType' => ['string'],
'SplFileObject::hasChildren' => ['false'],
'SplFileObject::isDir' => ['bool'],
'SplFileObject::isExecutable' => ['bool'],
'SplFileObject::isFile' => ['bool'],
'SplFileObject::isLink' => ['bool'],
'SplFileObject::isReadable' => ['bool'],
'SplFileObject::isWritable' => ['bool'],
'SplFileObject::key' => ['int'],
'SplFileObject::next' => ['void'],
'SplFileObject::openFile' => ['SplFileObject', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
'SplFileObject::rewind' => ['void'],
'SplFileObject::seek' => ['void', 'line_pos'=>'int'],
'SplFileObject::setCsvControl' => ['void', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'SplFileObject::setFileClass' => ['void', 'class_name='=>'string'],
'SplFileObject::setFlags' => ['void', 'flags'=>'int'],
'SplFileObject::setInfoClass' => ['void', 'class_name='=>'string'],
'SplFileObject::setMaxLineLen' => ['void', 'max_len'=>'int'],
'SplFileObject::valid' => ['bool'],
'SplFixedArray::__construct' => ['void', 'size='=>'int'],
'SplFixedArray::__wakeup' => ['void'],
'SplFixedArray::count' => ['int'],
'SplFixedArray::current' => ['mixed'],
'SplFixedArray::fromArray' => ['SplFixedArray', 'data'=>'array', 'save_indexes='=>'bool'],
'SplFixedArray::getSize' => ['int'],
'SplFixedArray::key' => ['int'],
'SplFixedArray::next' => ['void'],
'SplFixedArray::offsetExists' => ['bool', 'index'=>'int'],
'SplFixedArray::offsetGet' => ['mixed', 'index'=>'int'],
'SplFixedArray::offsetSet' => ['void', 'index'=>'int', 'newval'=>'mixed'],
'SplFixedArray::offsetUnset' => ['void', 'index'=>'int'],
'SplFixedArray::rewind' => ['void'],
'SplFixedArray::setSize' => ['bool', 'size'=>'int'],
'SplFixedArray::toArray' => ['array'],
'SplFixedArray::valid' => ['bool'],
'SplHeap::__construct' => ['void'],
'SplHeap::compare' => ['int', 'value1'=>'mixed', 'value2'=>'mixed'],
'SplHeap::count' => ['int'],
'SplHeap::current' => ['mixed'],
'SplHeap::extract' => ['mixed'],
'SplHeap::insert' => ['bool', 'value'=>'mixed'],
'SplHeap::isCorrupted' => ['bool'],
'SplHeap::isEmpty' => ['bool'],
'SplHeap::key' => ['int'],
'SplHeap::next' => ['void'],
'SplHeap::recoverFromCorruption' => ['int'],
'SplHeap::rewind' => ['void'],
'SplHeap::top' => ['mixed'],
'SplHeap::valid' => ['bool'],
'SplMaxHeap::__construct' => ['void'],
'SplMaxHeap::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'],
'SplMinHeap::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'],
'SplMinHeap::count' => ['int'],
'SplMinHeap::current' => ['mixed'],
'SplMinHeap::extract' => ['mixed'],
'SplMinHeap::insert' => ['void', 'value'=>'mixed'],
'SplMinHeap::isCorrupted' => ['int'],
'SplMinHeap::isEmpty' => ['bool'],
'SplMinHeap::key' => ['mixed'],
'SplMinHeap::next' => ['void'],
'SplMinHeap::recoverFromCorruption' => ['void'],
'SplMinHeap::rewind' => ['void'],
'SplMinHeap::top' => ['mixed'],
'SplMinHeap::valid' => ['bool'],
'SplObjectStorage::__construct' => ['void'],
'SplObjectStorage::addAll' => ['void', 'os'=>'splobjectstorage'],
'SplObjectStorage::attach' => ['void', 'object'=>'object', 'inf='=>'mixed'],
'SplObjectStorage::contains' => ['bool', 'object'=>'object'],
'SplObjectStorage::count' => ['int'],
'SplObjectStorage::current' => ['object'],
'SplObjectStorage::detach' => ['void', 'object'=>'object'],
'SplObjectStorage::getHash' => ['string', 'object'=>'object'],
'SplObjectStorage::getInfo' => ['mixed'],
'SplObjectStorage::key' => ['int'],
'SplObjectStorage::next' => ['void'],
'SplObjectStorage::offsetExists' => ['bool', 'object'=>'object'],
'SplObjectStorage::offsetGet' => ['mixed', 'object'=>'object'],
'SplObjectStorage::offsetSet' => ['object', 'object'=>'object', 'data='=>'mixed'],
'SplObjectStorage::offsetUnset' => ['object', 'object'=>'object'],
'SplObjectStorage::removeAll' => ['void', 'os'=>'splobjectstorage'],
'SplObjectStorage::removeAllExcept' => ['void', 'os'=>'splobjectstorage'],
'SplObjectStorage::rewind' => ['void'],
'SplObjectStorage::serialize' => ['string'],
'SplObjectStorage::setInfo' => ['void', 'inf'=>'mixed'],
'SplObjectStorage::unserialize' => ['void', 'serialized'=>'string'],
'SplObjectStorage::valid' => ['bool'],
'SplObserver::update' => ['void', 'subject'=>'SplSubject'],
'SplPriorityQueue::__construct' => ['void'],
'SplPriorityQueue::compare' => ['int', 'a'=>'mixed', 'b'=>'mixed'],
'SplPriorityQueue::count' => ['int'],
'SplPriorityQueue::current' => ['mixed'],
'SplPriorityQueue::extract' => ['mixed'],
'SplPriorityQueue::getExtractFlags' => ['int'],
'SplPriorityQueue::insert' => ['bool', 'value'=>'mixed', 'priority'=>'mixed'],
'SplPriorityQueue::isCorrupted' => ['bool'],
'SplPriorityQueue::isEmpty' => ['bool'],
'SplPriorityQueue::key' => ['mixed'],
'SplPriorityQueue::next' => ['void'],
'SplPriorityQueue::recoverFromCorruption' => ['void'],
'SplPriorityQueue::rewind' => ['void'],
'SplPriorityQueue::setExtractFlags' => ['void', 'flags'=>'int'],
'SplPriorityQueue::top' => ['mixed'],
'SplPriorityQueue::valid' => ['bool'],
'SplQueue::dequeue' => ['mixed'],
'SplQueue::enqueue' => ['void', 'value'=>'mixed'],
'SplQueue::getIteratorMode' => ['int'],
'SplQueue::isEmpty' => ['bool'],
'SplQueue::key' => ['mixed'],
'SplQueue::next' => ['void'],
'SplQueue::offsetExists' => ['bool', 'index'=>'mixed'],
'SplQueue::offsetGet' => ['mixed', 'index'=>'mixed'],
'SplQueue::offsetSet' => ['void', 'index'=>'mixed', 'newval'=>'mixed'],
'SplQueue::offsetUnset' => ['void', 'index'=>'mixed'],
'SplQueue::pop' => ['mixed'],
'SplQueue::prev' => ['void'],
'SplQueue::push' => ['void', 'value'=>'mixed'],
'SplQueue::rewind' => ['void'],
'SplQueue::serialize' => ['string'],
'SplQueue::setIteratorMode' => ['void', 'mode'=>'int'],
'SplQueue::shift' => ['mixed'],
'SplQueue::top' => ['mixed'],
'SplQueue::unserialize' => ['void', 'serialized'=>'string'],
'SplQueue::unshift' => ['bool', 'value'=>'mixed'],
'SplQueue::valid' => ['bool'],
'SplStack::__construct' => ['void'],
'SplStack::add' => ['void', 'index'=>'mixed', 'newval'=>'mixed'],
'SplStack::bottom' => ['mixed'],
'SplStack::count' => ['int'],
'SplStack::current' => ['mixed'],
'SplStack::getIteratorMode' => ['int'],
'SplStack::isEmpty' => ['bool'],
'SplStack::key' => ['mixed'],
'SplStack::next' => ['void'],
'SplStack::offsetExists' => ['bool', 'index'=>'mixed'],
'SplStack::offsetGet' => ['mixed', 'index'=>'mixed'],
'SplStack::offsetSet' => ['void', 'index'=>'mixed', 'newval'=>'mixed'],
'SplStack::offsetUnset' => ['void', 'index'=>'mixed'],
'SplStack::pop' => ['mixed'],
'SplStack::prev' => ['void'],
'SplStack::push' => ['void', 'value'=>'mixed'],
'SplStack::rewind' => ['void'],
'SplStack::serialize' => ['string'],
'SplStack::setIteratorMode' => ['void', 'mode'=>'int'],
'SplStack::shift' => ['mixed'],
'SplStack::top' => ['mixed'],
'SplStack::unserialize' => ['void', 'serialized'=>'string'],
'SplStack::unshift' => ['bool', 'value'=>'mixed'],
'SplStack::valid' => ['bool'],
'SplSubject::attach' => ['void', 'observer'=>'SplObserver'],
'SplSubject::detach' => ['void', 'observer'=>'SplObserver'],
'SplSubject::notify' => ['void'],
'SplTempFileObject::__construct' => ['void', 'max_memory='=>'int'],
'SplTempFileObject::__toString' => ['string'],
'SplTempFileObject::_bad_state_ex' => [''],
'SplTempFileObject::current' => ['array|false|string'],
'SplTempFileObject::eof' => ['bool'],
'SplTempFileObject::fflush' => ['bool'],
'SplTempFileObject::fgetc' => ['false|string'],
'SplTempFileObject::fgetcsv' => ['list<string>|array{0: null}|false|null', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'SplTempFileObject::fgets' => ['string'],
'SplTempFileObject::fgetss' => ['string', 'allowable_tags='=>'string'],
'SplTempFileObject::flock' => ['bool', 'operation'=>'int', '&wouldblock='=>'int'],
'SplTempFileObject::fpassthru' => ['int|false'],
'SplTempFileObject::fputcsv' => ['false|int', 'fields'=>'array<array-key, null|scalar|Stringable>', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'SplTempFileObject::fread' => ['false|string', 'length'=>'int'],
'SplTempFileObject::fscanf' => ['bool', 'format'=>'string', '&...w_vars='=>'array<int,float>|array<int,int>|array<int,string>'],
'SplTempFileObject::fseek' => ['int', 'pos'=>'int', 'whence='=>'int'],
'SplTempFileObject::fstat' => ['array|false'],
'SplTempFileObject::ftell' => ['int'],
'SplTempFileObject::ftruncate' => ['bool', 'size'=>'int'],
'SplTempFileObject::fwrite' => ['int', 'string'=>'string', 'length='=>'int'],
'SplTempFileObject::getATime' => ['int'],
'SplTempFileObject::getBasename' => ['string', 'suffix='=>'string'],
'SplTempFileObject::getChildren' => ['null'],
'SplTempFileObject::getCsvControl' => ['array'],
'SplTempFileObject::getCTime' => ['int'],
'SplTempFileObject::getCurrentLine' => ['string'],
'SplTempFileObject::getExtension' => ['string'],
'SplTempFileObject::getFileInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplTempFileObject::getFilename' => ['string'],
'SplTempFileObject::getFlags' => ['int'],
'SplTempFileObject::getGroup' => ['int'],
'SplTempFileObject::getInode' => ['int'],
'SplTempFileObject::getLinkTarget' => ['string'],
'SplTempFileObject::getMaxLineLen' => ['int'],
'SplTempFileObject::getMTime' => ['int'],
'SplTempFileObject::getOwner' => ['int'],
'SplTempFileObject::getPath' => ['string'],
'SplTempFileObject::getPathInfo' => ['SplFileInfo', 'class_name='=>'string'],
'SplTempFileObject::getPathname' => ['string'],
'SplTempFileObject::getPerms' => ['int'],
'SplTempFileObject::getRealPath' => ['string'],
'SplTempFileObject::getSize' => ['int'],
'SplTempFileObject::getType' => ['string'],
'SplTempFileObject::hasChildren' => ['bool'],
'SplTempFileObject::isDir' => ['bool'],
'SplTempFileObject::isExecutable' => ['bool'],
'SplTempFileObject::isFile' => ['bool'],
'SplTempFileObject::isLink' => ['bool'],
'SplTempFileObject::isReadable' => ['bool'],
'SplTempFileObject::isWritable' => ['bool'],
'SplTempFileObject::key' => ['int'],
'SplTempFileObject::next' => ['void'],
'SplTempFileObject::openFile' => ['SplFileObject', 'mode='=>'string', 'use_include_path='=>'bool', 'context='=>'resource'],
'SplTempFileObject::rewind' => ['void'],
'SplTempFileObject::seek' => ['void', 'line_pos'=>'int'],
'SplTempFileObject::setCsvControl' => ['void', 'delimiter='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'SplTempFileObject::setFileClass' => ['void', 'class_name='=>'string'],
'SplTempFileObject::setFlags' => ['void', 'flags'=>'int'],
'SplTempFileObject::setInfoClass' => ['void', 'class_name='=>'string'],
'SplTempFileObject::setMaxLineLen' => ['void', 'max_len'=>'int'],
'SplTempFileObject::valid' => ['bool'],
'SplType::__construct' => ['void', 'initial_value='=>'mixed', 'strict='=>'bool'],
'Spoofchecker::__construct' => ['void'],
'Spoofchecker::areConfusable' => ['bool', 's1'=>'string', 's2'=>'string', '&w_error='=>'string'],
'Spoofchecker::isSuspicious' => ['bool', 'text'=>'string', '&w_error='=>'string'],
'Spoofchecker::setAllowedLocales' => ['void', 'locale_list'=>'string'],
'Spoofchecker::setChecks' => ['void', 'checks'=>'long'],
'Spoofchecker::setRestrictionLevel' => ['void', 'restriction_level'=>'int'],
'sprintf' => ['string', 'format'=>'string', '...values='=>'string|int|float'],
'SQLite3::__construct' => ['void', 'filename'=>'string', 'flags='=>'int', 'encryptionKey='=>'?string'],
'SQLite3::busyTimeout' => ['bool', 'milliseconds'=>'int'],
'SQLite3::changes' => ['int'],
'SQLite3::close' => ['bool'],
'SQLite3::createAggregate' => ['bool', 'name'=>'string', 'stepCallback'=>'callable', 'finalCallback'=>'callable', 'argCount='=>'int'],
'SQLite3::createCollation' => ['bool', 'name'=>'string', 'callback'=>'callable'],
'SQLite3::createFunction' => ['bool', 'name'=>'string', 'callback'=>'callable', 'argCount='=>'int', 'flags='=>'int'],
'SQLite3::enableExceptions' => ['bool', 'enable='=>'bool'],
'SQLite3::escapeString' => ['string', 'string'=>'string'],
'SQLite3::exec' => ['bool', 'query'=>'string'],
'SQLite3::lastErrorCode' => ['int'],
'SQLite3::lastErrorMsg' => ['string'],
'SQLite3::lastInsertRowID' => ['int'],
'SQLite3::loadExtension' => ['bool', 'name'=>'string'],
'SQLite3::open' => ['void', 'filename'=>'string', 'flags='=>'int', 'encryptionKey='=>'?string'],
'SQLite3::openBlob' => ['resource|false', 'table'=>'string', 'column'=>'string', 'rowid'=>'int', 'database='=>'string', 'flags='=>'int'],
'SQLite3::prepare' => ['SQLite3Stmt|false', 'query'=>'string'],
'SQLite3::query' => ['SQLite3Result|false', 'query'=>'string'],
'SQLite3::querySingle' => ['array|int|string|bool|float|null|false', 'query'=>'string', 'entireRow='=>'bool'],
'SQLite3::version' => ['array'],
'SQLite3Result::__construct' => ['void'],
'SQLite3Result::columnName' => ['string', 'column'=>'int'],
'SQLite3Result::columnType' => ['int', 'column'=>'int'],
'SQLite3Result::fetchArray' => ['array|false', 'mode='=>'int'],
'SQLite3Result::finalize' => ['bool'],
'SQLite3Result::numColumns' => ['int'],
'SQLite3Result::reset' => ['bool'],
'SQLite3Stmt::__construct' => ['void', 'sqlite3'=>'sqlite3', 'query'=>'string'],
'SQLite3Stmt::bindParam' => ['bool', 'param'=>'string|int', '&rw_var'=>'mixed', 'type='=>'int'],
'SQLite3Stmt::bindValue' => ['bool', 'param'=>'string|int', 'value'=>'mixed', 'type='=>'int'],
'SQLite3Stmt::clear' => ['bool'],
'SQLite3Stmt::close' => ['bool'],
'SQLite3Stmt::execute' => ['false|SQLite3Result'],
'SQLite3Stmt::getSQL' => ['string', 'expand='=>'bool'],
'SQLite3Stmt::paramCount' => ['int'],
'SQLite3Stmt::readOnly' => ['bool'],
'SQLite3Stmt::reset' => ['bool'],
'sqlite_array_query' => ['array|false', 'dbhandle'=>'resource', 'query'=>'string', 'result_type='=>'int', 'decode_binary='=>'bool'],
'sqlite_busy_timeout' => ['void', 'dbhandle'=>'resource', 'milliseconds'=>'int'],
'sqlite_changes' => ['int', 'dbhandle'=>'resource'],
'sqlite_close' => ['void', 'dbhandle'=>'resource'],
'sqlite_column' => ['mixed', 'result'=>'resource', 'index_or_name'=>'mixed', 'decode_binary='=>'bool'],
'sqlite_create_aggregate' => ['void', 'dbhandle'=>'resource', 'function_name'=>'string', 'step_func'=>'callable', 'finalize_func'=>'callable', 'num_args='=>'int'],
'sqlite_create_function' => ['void', 'dbhandle'=>'resource', 'function_name'=>'string', 'callback'=>'callable', 'num_args='=>'int'],
'sqlite_current' => ['array|false', 'result'=>'resource', 'result_type='=>'int', 'decode_binary='=>'bool'],
'sqlite_error_string' => ['string', 'error_code'=>'int'],
'sqlite_escape_string' => ['string', 'item'=>'string'],
'sqlite_exec' => ['bool', 'dbhandle'=>'resource', 'query'=>'string', 'error_msg='=>'string'],
'sqlite_factory' => ['SQLiteDatabase', 'filename'=>'string', 'mode='=>'int', 'error_message='=>'string'],
'sqlite_fetch_all' => ['array', 'result'=>'resource', 'result_type='=>'int', 'decode_binary='=>'bool'],
'sqlite_fetch_array' => ['array|false', 'result'=>'resource', 'result_type='=>'int', 'decode_binary='=>'bool'],
'sqlite_fetch_column_types' => ['array|false', 'table_name'=>'string', 'dbhandle'=>'resource', 'result_type='=>'int'],
'sqlite_fetch_object' => ['object', 'result'=>'resource', 'class_name='=>'string', 'ctor_params='=>'array', 'decode_binary='=>'bool'],
'sqlite_fetch_single' => ['string', 'result'=>'resource', 'decode_binary='=>'bool'],
'sqlite_fetch_string' => ['string', 'result'=>'resource', 'decode_binary'=>'bool'],
'sqlite_field_name' => ['string', 'result'=>'resource', 'field_index'=>'int'],
'sqlite_has_more' => ['bool', 'result'=>'resource'],
'sqlite_has_prev' => ['bool', 'result'=>'resource'],
'sqlite_key' => ['int', 'result'=>'resource'],
'sqlite_last_error' => ['int', 'dbhandle'=>'resource'],
'sqlite_last_insert_rowid' => ['int', 'dbhandle'=>'resource'],
'sqlite_libencoding' => ['string'],
'sqlite_libversion' => ['string'],
'sqlite_next' => ['bool', 'result'=>'resource'],
'sqlite_num_fields' => ['int', 'result'=>'resource'],
'sqlite_num_rows' => ['int', 'result'=>'resource'],
'sqlite_open' => ['resource|false', 'filename'=>'string', 'mode='=>'int', 'error_message='=>'string'],
'sqlite_popen' => ['resource|false', 'filename'=>'string', 'mode='=>'int', 'error_message='=>'string'],
'sqlite_prev' => ['bool', 'result'=>'resource'],
'sqlite_query' => ['resource|false', 'dbhandle'=>'resource', 'query'=>'resource|string', 'result_type='=>'int', 'error_msg='=>'string'],
'sqlite_rewind' => ['bool', 'result'=>'resource'],
'sqlite_seek' => ['bool', 'result'=>'resource', 'rownum'=>'int'],
'sqlite_single_query' => ['array', 'db'=>'resource', 'query'=>'string', 'first_row_only='=>'bool', 'decode_binary='=>'bool'],
'sqlite_udf_decode_binary' => ['string', 'data'=>'string'],
'sqlite_udf_encode_binary' => ['string', 'data'=>'string'],
'sqlite_unbuffered_query' => ['SQLiteUnbuffered|false', 'dbhandle'=>'resource', 'query'=>'string', 'result_type='=>'int', 'error_msg='=>'string'],
'sqlite_valid' => ['bool', 'result'=>'resource'],
'SQLiteDatabase::__construct' => ['void', 'filename'=>'', 'mode='=>'int|mixed', '&error_message'=>''],
'SQLiteDatabase::arrayQuery' => ['array', 'query'=>'string', 'result_type='=>'int', 'decode_binary='=>'bool'],
'SQLiteDatabase::busyTimeout' => ['int', 'milliseconds'=>'int'],
'SQLiteDatabase::changes' => ['int'],
'SQLiteDatabase::createAggregate' => ['', 'function_name'=>'string', 'step_func'=>'callable', 'finalize_func'=>'callable', 'num_args='=>'int'],
'SQLiteDatabase::createFunction' => ['', 'function_name'=>'string', 'callback'=>'callable', 'num_args='=>'int'],
'SQLiteDatabase::exec' => ['bool', 'query'=>'string', 'error_msg='=>'string'],
'SQLiteDatabase::fetchColumnTypes' => ['array', 'table_name'=>'string', 'result_type='=>'int'],
'SQLiteDatabase::lastError' => ['int'],
'SQLiteDatabase::lastInsertRowid' => ['int'],
'SQLiteDatabase::query' => ['SQLiteResult|false', 'query'=>'string', 'result_type='=>'int', 'error_msg='=>'string'],
'SQLiteDatabase::queryExec' => ['bool', 'query'=>'string', '&w_error_msg='=>'string'],
'SQLiteDatabase::singleQuery' => ['array', 'query'=>'string', 'first_row_only='=>'bool', 'decode_binary='=>'bool'],
'SQLiteDatabase::unbufferedQuery' => ['SQLiteUnbuffered|false', 'query'=>'string', 'result_type='=>'int', 'error_msg='=>'string'],
'SQLiteException::__clone' => ['void'],
'SQLiteException::__construct' => ['void', 'message'=>'', 'code'=>'', 'previous'=>''],
'SQLiteException::__toString' => ['string'],
'SQLiteException::__wakeup' => ['void'],
'SQLiteException::getCode' => ['int'],
'SQLiteException::getFile' => ['string'],
'SQLiteException::getLine' => ['int'],
'SQLiteException::getMessage' => ['string'],
'SQLiteException::getPrevious' => ['RuntimeException|Throwable|null'],
'SQLiteException::getTrace' => ['list<array<string,mixed>>'],
'SQLiteException::getTraceAsString' => ['string'],
'SQLiteResult::__construct' => ['void'],
'SQLiteResult::column' => ['mixed', 'index_or_name'=>'', 'decode_binary='=>'bool'],
'SQLiteResult::count' => ['int'],
'SQLiteResult::current' => ['array', 'result_type='=>'int', 'decode_binary='=>'bool'],
'SQLiteResult::fetch' => ['array', 'result_type='=>'int', 'decode_binary='=>'bool'],
'SQLiteResult::fetchAll' => ['array', 'result_type='=>'int', 'decode_binary='=>'bool'],
'SQLiteResult::fetchObject' => ['object', 'class_name='=>'string', 'ctor_params='=>'array', 'decode_binary='=>'bool'],
'SQLiteResult::fetchSingle' => ['string', 'decode_binary='=>'bool'],
'SQLiteResult::fieldName' => ['string', 'field_index'=>'int'],
'SQLiteResult::hasPrev' => ['bool'],
'SQLiteResult::key' => ['mixed|null'],
'SQLiteResult::next' => ['bool'],
'SQLiteResult::numFields' => ['int'],
'SQLiteResult::numRows' => ['int'],
'SQLiteResult::prev' => ['bool'],
'SQLiteResult::rewind' => ['bool'],
'SQLiteResult::seek' => ['bool', 'rownum'=>'int'],
'SQLiteResult::valid' => ['bool'],
'SQLiteUnbuffered::column' => ['void', 'index_or_name'=>'', 'decode_binary='=>'bool'],
'SQLiteUnbuffered::current' => ['array', 'result_type='=>'int', 'decode_binary='=>'bool'],
'SQLiteUnbuffered::fetch' => ['array', 'result_type='=>'int', 'decode_binary='=>'bool'],
'SQLiteUnbuffered::fetchAll' => ['array', 'result_type='=>'int', 'decode_binary='=>'bool'],
'SQLiteUnbuffered::fetchObject' => ['object', 'class_name='=>'string', 'ctor_params='=>'array', 'decode_binary='=>'bool'],
'SQLiteUnbuffered::fetchSingle' => ['string', 'decode_binary='=>'bool'],
'SQLiteUnbuffered::fieldName' => ['string', 'field_index'=>'int'],
'SQLiteUnbuffered::next' => ['bool'],
'SQLiteUnbuffered::numFields' => ['int'],
'SQLiteUnbuffered::valid' => ['bool'],
'sqlsrv_begin_transaction' => ['bool', 'conn'=>'resource'],
'sqlsrv_cancel' => ['bool', 'stmt'=>'resource'],
'sqlsrv_client_info' => ['array|false', 'conn'=>'resource'],
'sqlsrv_close' => ['bool', 'conn'=>'?resource'],
'sqlsrv_commit' => ['bool', 'conn'=>'resource'],
'sqlsrv_configure' => ['bool', 'setting'=>'string', 'value'=>'mixed'],
'sqlsrv_connect' => ['resource|false', 'serverName'=>'string', 'connectionInfo='=>'array'],
'sqlsrv_errors' => ['?array', 'errorsOrWarnings='=>'int'],
'sqlsrv_execute' => ['bool', 'stmt'=>'resource'],
'sqlsrv_fetch' => ['?bool', 'stmt'=>'resource', 'row='=>'int', 'offset='=>'int'],
'sqlsrv_fetch_array' => ['array|null|false', 'stmt'=>'resource', 'fetchType='=>'int', 'row='=>'int', 'offset='=>'int'],
'sqlsrv_fetch_object' => ['object|null|false', 'stmt'=>'resource', 'className='=>'string', 'ctorParams='=>'array', 'row='=>'int', 'offset='=>'int'],
'sqlsrv_field_metadata' => ['array|false', 'stmt'=>'resource'],
'sqlsrv_free_stmt' => ['bool', 'stmt'=>'resource'],
'sqlsrv_get_config' => ['mixed', 'setting'=>'string'],
'sqlsrv_get_field' => ['mixed', 'stmt'=>'resource', 'fieldIndex'=>'int', 'getAsType='=>'int'],
'sqlsrv_has_rows' => ['bool', 'stmt'=>'resource'],
'sqlsrv_next_result' => ['?bool', 'stmt'=>'resource'],
'sqlsrv_num_fields' => ['int|false', 'stmt'=>'resource'],
'sqlsrv_num_rows' => ['int|false', 'stmt'=>'resource'],
'sqlsrv_prepare' => ['resource|false', 'conn'=>'resource', 'sql'=>'string', 'params='=>'array', 'options='=>'array'],
'sqlsrv_query' => ['resource|false', 'conn'=>'resource', 'sql'=>'string', 'params='=>'array', 'options='=>'array'],
'sqlsrv_rollback' => ['bool', 'conn'=>'resource'],
'sqlsrv_rows_affected' => ['int|false', 'stmt'=>'resource'],
'sqlsrv_send_stream_data' => ['bool', 'stmt'=>'resource'],
'sqlsrv_server_info' => ['array', 'conn'=>'resource'],
'sqrt' => ['float', 'num'=>'float'],
'srand' => ['void', 'seed='=>'int', 'mode='=>'int'],
'sscanf' => ['list<float|int|string|null>|int|null', 'string'=>'string', 'format'=>'string', '&...w_vars='=>'string|int|float|null'],
'ssdeep_fuzzy_compare' => ['int', 'signature1'=>'string', 'signature2'=>'string'],
'ssdeep_fuzzy_hash' => ['string', 'to_hash'=>'string'],
'ssdeep_fuzzy_hash_filename' => ['string', 'file_name'=>'string'],
'ssh2_auth_agent' => ['bool', 'session'=>'resource', 'username'=>'string'],
'ssh2_auth_hostbased_file' => ['bool', 'session'=>'resource', 'username'=>'string', 'hostname'=>'string', 'pubkeyfile'=>'string', 'privkeyfile'=>'string', 'passphrase='=>'string', 'local_username='=>'string'],
'ssh2_auth_none' => ['bool|string[]', 'session'=>'resource', 'username'=>'string'],
'ssh2_auth_password' => ['bool', 'session'=>'resource', 'username'=>'string', 'password'=>'string'],
'ssh2_auth_pubkey_file' => ['bool', 'session'=>'resource', 'username'=>'string', 'pubkeyfile'=>'string', 'privkeyfile'=>'string', 'passphrase='=>'string'],
'ssh2_connect' => ['resource|false', 'host'=>'string', 'port='=>'int', 'methods='=>'array', 'callbacks='=>'array'],
'ssh2_disconnect' => ['bool', 'session'=>'resource'],
'ssh2_exec' => ['resource|false', 'session'=>'resource', 'command'=>'string', 'pty='=>'string', 'env='=>'array', 'width='=>'int', 'height='=>'int', 'width_height_type='=>'int'],
'ssh2_fetch_stream' => ['resource|false', 'channel'=>'resource', 'streamid'=>'int'],
'ssh2_fingerprint' => ['string|false', 'session'=>'resource', 'flags='=>'int'],
'ssh2_forward_accept' => ['resource|false', 'session'=>'resource'],
'ssh2_forward_listen' => ['resource|false', 'session'=>'resource', 'port'=>'int', 'host='=>'string', 'max_connections='=>'string'],
'ssh2_methods_negotiated' => ['array|false', 'session'=>'resource'],
'ssh2_poll' => ['int', '&polldes'=>'array', 'timeout='=>'int'],
'ssh2_publickey_add' => ['bool', 'pkey'=>'resource', 'algoname'=>'string', 'blob'=>'string', 'overwrite='=>'bool', 'attributes='=>'array'],
'ssh2_publickey_init' => ['resource|false', 'session'=>'resource'],
'ssh2_publickey_list' => ['array|false', 'pkey'=>'resource'],
'ssh2_publickey_remove' => ['bool', 'pkey'=>'resource', 'algoname'=>'string', 'blob'=>'string'],
'ssh2_scp_recv' => ['bool', 'session'=>'resource', 'remote_file'=>'string', 'local_file'=>'string'],
'ssh2_scp_send' => ['bool', 'session'=>'resource', 'local_file'=>'string', 'remote_file'=>'string', 'create_mode='=>'int'],
'ssh2_sftp' => ['resource|false', 'session'=>'resource'],
'ssh2_sftp_chmod' => ['bool', 'sftp'=>'resource', 'filename'=>'string', 'mode'=>'int'],
'ssh2_sftp_lstat' => ['array|false', 'sftp'=>'resource', 'path'=>'string'],
'ssh2_sftp_mkdir' => ['bool', 'sftp'=>'resource', 'dirname'=>'string', 'mode='=>'int', 'recursive='=>'bool'],
'ssh2_sftp_readlink' => ['string|false', 'sftp'=>'resource', 'link'=>'string'],
'ssh2_sftp_realpath' => ['string|false', 'sftp'=>'resource', 'filename'=>'string'],
'ssh2_sftp_rename' => ['bool', 'sftp'=>'resource', 'from'=>'string', 'to'=>'string'],
'ssh2_sftp_rmdir' => ['bool', 'sftp'=>'resource', 'dirname'=>'string'],
'ssh2_sftp_stat' => ['array|false', 'sftp'=>'resource', 'path'=>'string'],
'ssh2_sftp_symlink' => ['bool', 'sftp'=>'resource', 'target'=>'string', 'link'=>'string'],
'ssh2_sftp_unlink' => ['bool', 'sftp'=>'resource', 'filename'=>'string'],
'ssh2_shell' => ['resource|false', 'session'=>'resource', 'term_type='=>'string', 'env='=>'array', 'width='=>'int', 'height='=>'int', 'width_height_type='=>'int'],
'ssh2_tunnel' => ['resource|false', 'session'=>'resource', 'host'=>'string', 'port'=>'int'],
'stat' => ['array|false', 'filename'=>'string'],
'stats_absolute_deviation' => ['float', 'a'=>'array'],
'stats_cdf_beta' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_binomial' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_cauchy' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_chisquare' => ['float', 'par1'=>'float', 'par2'=>'float', 'which'=>'int'],
'stats_cdf_exponential' => ['float', 'par1'=>'float', 'par2'=>'float', 'which'=>'int'],
'stats_cdf_f' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_gamma' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_laplace' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_logistic' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_negative_binomial' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_noncentral_chisquare' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_noncentral_f' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'par4'=>'float', 'which'=>'int'],
'stats_cdf_noncentral_t' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_normal' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_poisson' => ['float', 'par1'=>'float', 'par2'=>'float', 'which'=>'int'],
'stats_cdf_t' => ['float', 'par1'=>'float', 'par2'=>'float', 'which'=>'int'],
'stats_cdf_uniform' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_cdf_weibull' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_covariance' => ['float', 'a'=>'array', 'b'=>'array'],
'stats_den_uniform' => ['float', 'x'=>'float', 'a'=>'float', 'b'=>'float'],
'stats_dens_beta' => ['float', 'x'=>'float', 'a'=>'float', 'b'=>'float'],
'stats_dens_cauchy' => ['float', 'x'=>'float', 'ave'=>'float', 'stdev'=>'float'],
'stats_dens_chisquare' => ['float', 'x'=>'float', 'dfr'=>'float'],
'stats_dens_exponential' => ['float', 'x'=>'float', 'scale'=>'float'],
'stats_dens_f' => ['float', 'x'=>'float', 'dfr1'=>'float', 'dfr2'=>'float'],
'stats_dens_gamma' => ['float', 'x'=>'float', 'shape'=>'float', 'scale'=>'float'],
'stats_dens_laplace' => ['float', 'x'=>'float', 'ave'=>'float', 'stdev'=>'float'],
'stats_dens_logistic' => ['float', 'x'=>'float', 'ave'=>'float', 'stdev'=>'float'],
'stats_dens_negative_binomial' => ['float', 'x'=>'float', 'n'=>'float', 'pi'=>'float'],
'stats_dens_normal' => ['float', 'x'=>'float', 'ave'=>'float', 'stdev'=>'float'],
'stats_dens_pmf_binomial' => ['float', 'x'=>'float', 'n'=>'float', 'pi'=>'float'],
'stats_dens_pmf_hypergeometric' => ['float', 'n1'=>'float', 'n2'=>'float', 'N1'=>'float', 'N2'=>'float'],
'stats_dens_pmf_negative_binomial' => ['float', 'x'=>'float', 'n'=>'float', 'pi'=>'float'],
'stats_dens_pmf_poisson' => ['float', 'x'=>'float', 'lb'=>'float'],
'stats_dens_t' => ['float', 'x'=>'float', 'dfr'=>'float'],
'stats_dens_uniform' => ['float', 'x'=>'float', 'a'=>'float', 'b'=>'float'],
'stats_dens_weibull' => ['float', 'x'=>'float', 'a'=>'float', 'b'=>'float'],
'stats_harmonic_mean' => ['float', 'a'=>'array'],
'stats_kurtosis' => ['float', 'a'=>'array'],
'stats_rand_gen_beta' => ['float', 'a'=>'float', 'b'=>'float'],
'stats_rand_gen_chisquare' => ['float', 'df'=>'float'],
'stats_rand_gen_exponential' => ['float', 'av'=>'float'],
'stats_rand_gen_f' => ['float', 'dfn'=>'float', 'dfd'=>'float'],
'stats_rand_gen_funiform' => ['float', 'low'=>'float', 'high'=>'float'],
'stats_rand_gen_gamma' => ['float', 'a'=>'float', 'r'=>'float'],
'stats_rand_gen_ibinomial' => ['int', 'n'=>'int', 'pp'=>'float'],
'stats_rand_gen_ibinomial_negative' => ['int', 'n'=>'int', 'p'=>'float'],
'stats_rand_gen_int' => ['int'],
'stats_rand_gen_ipoisson' => ['int', 'mu'=>'float'],
'stats_rand_gen_iuniform' => ['int', 'low'=>'int', 'high'=>'int'],
'stats_rand_gen_noncenral_chisquare' => ['float', 'df'=>'float', 'xnonc'=>'float'],
'stats_rand_gen_noncentral_chisquare' => ['float', 'df'=>'float', 'xnonc'=>'float'],
'stats_rand_gen_noncentral_f' => ['float', 'dfn'=>'float', 'dfd'=>'float', 'xnonc'=>'float'],
'stats_rand_gen_noncentral_t' => ['float', 'df'=>'float', 'xnonc'=>'float'],
'stats_rand_gen_normal' => ['float', 'av'=>'float', 'sd'=>'float'],
'stats_rand_gen_t' => ['float', 'df'=>'float'],
'stats_rand_get_seeds' => ['array'],
'stats_rand_phrase_to_seeds' => ['array', 'phrase'=>'string'],
'stats_rand_ranf' => ['float'],
'stats_rand_setall' => ['void', 'iseed1'=>'int', 'iseed2'=>'int'],
'stats_skew' => ['float', 'a'=>'array'],
'stats_standard_deviation' => ['float', 'a'=>'array', 'sample='=>'bool'],
'stats_stat_binomial_coef' => ['float', 'x'=>'int', 'n'=>'int'],
'stats_stat_correlation' => ['float', 'array1'=>'array', 'array2'=>'array'],
'stats_stat_factorial' => ['float', 'n'=>'int'],
'stats_stat_gennch' => ['float', 'n'=>'int'],
'stats_stat_independent_t' => ['float', 'array1'=>'array', 'array2'=>'array'],
'stats_stat_innerproduct' => ['float', 'array1'=>'array', 'array2'=>'array'],
'stats_stat_noncentral_t' => ['float', 'par1'=>'float', 'par2'=>'float', 'par3'=>'float', 'which'=>'int'],
'stats_stat_paired_t' => ['float', 'array1'=>'array', 'array2'=>'array'],
'stats_stat_percentile' => ['float', 'arr'=>'array', 'perc'=>'float'],
'stats_stat_powersum' => ['float', 'arr'=>'array', 'power'=>'float'],
'stats_variance' => ['float', 'a'=>'array', 'sample='=>'bool'],
'Stomp::__construct' => ['void', 'broker='=>'string', 'username='=>'string', 'password='=>'string', 'headers='=>'array'],
'Stomp::__destruct' => ['bool', 'link'=>''],
'Stomp::abort' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''],
'Stomp::ack' => ['bool', 'msg'=>'', 'headers='=>'array', 'link='=>''],
'Stomp::begin' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''],
'Stomp::commit' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''],
'Stomp::error' => ['string', 'link'=>''],
'Stomp::getReadTimeout' => ['array', 'link'=>''],
'Stomp::getSessionId' => ['string', 'link'=>''],
'Stomp::hasFrame' => ['bool', 'link'=>''],
'Stomp::readFrame' => ['array', 'class_name='=>'string', 'link='=>''],
'Stomp::send' => ['bool', 'destination'=>'string', 'msg'=>'', 'headers='=>'array', 'link='=>''],
'Stomp::setReadTimeout' => ['', 'seconds'=>'int', 'microseconds='=>'int', 'link='=>''],
'Stomp::subscribe' => ['bool', 'destination'=>'string', 'headers='=>'array', 'link='=>''],
'Stomp::unsubscribe' => ['bool', 'destination'=>'string', 'headers='=>'array', 'link='=>''],
'stomp_abort' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''],
'stomp_ack' => ['bool', 'msg'=>'', 'headers='=>'array', 'link='=>''],
'stomp_begin' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''],
'stomp_close' => ['bool', 'link'=>''],
'stomp_commit' => ['bool', 'transaction_id'=>'string', 'headers='=>'array', 'link='=>''],
'stomp_connect' => ['resource', 'broker='=>'string', 'username='=>'string', 'password='=>'string', 'headers='=>'array'],
'stomp_connect_error' => ['string'],
'stomp_error' => ['string', 'link'=>''],
'stomp_get_read_timeout' => ['array', 'link'=>''],
'stomp_get_session_id' => ['string', 'link'=>''],
'stomp_has_frame' => ['bool', 'link'=>''],
'stomp_read_frame' => ['array', 'class_name='=>'string', 'link='=>''],
'stomp_send' => ['bool', 'destination'=>'string', 'msg'=>'', 'headers='=>'array', 'link='=>''],
'stomp_set_read_timeout' => ['', 'seconds'=>'int', 'microseconds='=>'int', 'link='=>''],
'stomp_subscribe' => ['bool', 'destination'=>'string', 'headers='=>'array', 'link='=>''],
'stomp_unsubscribe' => ['bool', 'destination'=>'string', 'headers='=>'array', 'link='=>''],
'stomp_version' => ['string'],
'StompException::getDetails' => ['string'],
'StompFrame::__construct' => ['void', 'command='=>'string', 'headers='=>'array', 'body='=>'string'],
'str_contains' => ['bool', 'haystack'=>'string', 'needle'=>'string'],
'str_ends_with' => ['bool', 'haystack'=>'string', 'needle'=>'string'],
'str_getcsv' => ['non-empty-list<?string>', 'string'=>'string', 'separator='=>'string', 'enclosure='=>'string', 'escape='=>'string'],
'str_ireplace' => ['string|string[]', 'search'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', '&w_count='=>'int'],
'str_pad' => ['string', 'string'=>'string', 'length'=>'int', 'pad_string='=>'string', 'pad_type='=>'int'],
'str_repeat' => ['string', 'string'=>'string', 'times'=>'int'],
'str_replace' => ['string|string[]', 'search'=>'string|array', 'replace'=>'string|array', 'subject'=>'string|array', '&w_count='=>'int'],
'str_rot13' => ['string', 'string'=>'string'],
'str_shuffle' => ['string', 'string'=>'string'],
'str_split' => ['non-empty-list<string>', 'string'=>'string', 'length='=>'positive-int'],
'str_starts_with' => ['bool', 'haystack'=>'string', 'needle'=>'string'],
'str_word_count' => ['array<int, string>|int', 'string'=>'string', 'format='=>'int', 'characters='=>'string'],
'strcasecmp' => ['int', 'string1'=>'string', 'string2'=>'string'],
'strchr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool'],
'strcmp' => ['int', 'string1'=>'string', 'string2'=>'string'],
'strcoll' => ['int', 'string1'=>'string', 'string2'=>'string'],
'strcspn' => ['int', 'string'=>'string', 'characters'=>'string', 'offset='=>'int', 'length='=>'int'],
'stream_bucket_append' => ['void', 'brigade'=>'resource', 'bucket'=>'object'],
'stream_bucket_make_writeable' => ['object', 'brigade'=>'resource'],
'stream_bucket_new' => ['object|false', 'stream'=>'resource', 'buffer'=>'string'],
'stream_bucket_prepend' => ['void', 'brigade'=>'resource', 'bucket'=>'object'],
'stream_context_create' => ['resource', 'options='=>'array', 'params='=>'array'],
'stream_context_get_default' => ['resource', 'options='=>'array'],
'stream_context_get_options' => ['array', 'stream_or_context'=>'resource'],
'stream_context_get_params' => ['array', 'context'=>'resource'],
'stream_context_set_default' => ['resource', 'options'=>'array'],
'stream_context_set_option' => ['bool', 'context'=>'', 'wrapper_or_options'=>'string', 'option_name'=>'string', 'value'=>''],
'stream_context_set_option\'1' => ['bool', 'context'=>'', 'wrapper_or_options'=>'array'],
'stream_context_set_params' => ['bool', 'context'=>'resource', 'params'=>'array'],
'stream_copy_to_stream' => ['int|false', 'from'=>'resource', 'to'=>'resource', 'length='=>'int', 'offset='=>'int'],
'stream_encoding' => ['bool', 'stream'=>'resource', 'encoding='=>'string'],
'stream_filter_append' => ['resource|false', 'stream'=>'resource', 'filter_name'=>'string', 'mode='=>'int', 'params='=>'mixed'],
'stream_filter_prepend' => ['resource|false', 'stream'=>'resource', 'filter_name'=>'string', 'mode='=>'int', 'params='=>'mixed'],
'stream_filter_register' => ['bool', 'filter_name'=>'string', 'class'=>'string'],
'stream_filter_remove' => ['bool', 'stream_filter'=>'resource'],
'stream_get_contents' => ['string|false', 'stream'=>'resource', 'length='=>'int', 'offset='=>'int'],
'stream_get_filters' => ['array'],
'stream_get_line' => ['string|false', 'stream'=>'resource', 'length'=>'int', 'ending='=>'string'],
'stream_get_meta_data' => ['array{timed_out:bool,blocked:bool,eof:bool,unread_bytes:int,stream_type:string,wrapper_type:string,wrapper_data:mixed,mode:string,seekable:bool,uri:string,mediatype:string,crypto?:array{protocol:string,cipher_name:string,cipher_bits:int,cipher_version:string}}', 'stream'=>'resource'],
'stream_get_transports' => ['list<string>'],
'stream_get_wrappers' => ['list<string>'],
'stream_is_local' => ['bool', 'stream'=>'resource|string'],
'stream_isatty' => ['bool', 'stream'=>'resource'],
'stream_notification_callback' => ['callback', 'notification_code'=>'int', 'severity'=>'int', 'message'=>'string', 'message_code'=>'int', 'bytes_transferred'=>'int', 'bytes_max'=>'int'],
'stream_register_wrapper' => ['bool', 'protocol'=>'string', 'class'=>'string', 'flags='=>'int'],
'stream_resolve_include_path' => ['string|false', 'filename'=>'string'],
'stream_select' => ['int|false', '&rw_read'=>'resource[]', '&rw_write'=>'?resource[]', '&rw_except'=>'?resource[]', 'seconds'=>'?int', 'microseconds='=>'?int'],
'stream_set_blocking' => ['bool', 'stream'=>'resource', 'enable'=>'bool'],
'stream_set_chunk_size' => ['int|false', 'stream'=>'resource', 'size'=>'int'],
'stream_set_read_buffer' => ['int', 'stream'=>'resource', 'size'=>'int'],
'stream_set_timeout' => ['bool', 'stream'=>'resource', 'seconds'=>'int', 'microseconds='=>'int'],
'stream_set_write_buffer' => ['int', 'stream'=>'resource', 'size'=>'int'],
'stream_socket_accept' => ['resource|false', 'socket'=>'resource', 'timeout='=>'float', '&w_peer_name='=>'string'],
'stream_socket_client' => ['resource|false', 'address'=>'string', '&w_error_code='=>'int', '&w_error_message='=>'string', 'timeout='=>'float', 'flags='=>'int', 'context='=>'resource'],
'stream_socket_enable_crypto' => ['int|bool', 'stream'=>'resource', 'enable'=>'bool', 'crypto_method='=>'int', 'session_stream='=>'resource'],
'stream_socket_get_name' => ['string', 'socket'=>'resource', 'remote'=>'bool'],
'stream_socket_pair' => ['resource[]|false', 'domain'=>'int', 'type'=>'int', 'protocol'=>'int'],
'stream_socket_recvfrom' => ['string', 'socket'=>'resource', 'length'=>'int', 'flags='=>'int', '&w_address='=>'string'],
'stream_socket_sendto' => ['int', 'socket'=>'resource', 'data'=>'string', 'flags='=>'int', 'address='=>'string'],
'stream_socket_server' => ['resource|false', 'address'=>'string', '&w_error_code='=>'int', '&w_error_message='=>'string', 'flags='=>'int', 'context='=>'resource'],
'stream_socket_shutdown' => ['bool', 'stream'=>'resource', 'mode'=>'int'],
'stream_supports_lock' => ['bool', 'stream'=>'resource'],
'stream_wrapper_register' => ['bool', 'protocol'=>'string', 'class'=>'string', 'flags='=>'int'],
'stream_wrapper_restore' => ['bool', 'protocol'=>'string'],
'stream_wrapper_unregister' => ['bool', 'protocol'=>'string'],
'streamWrapper::__construct' => ['void'],
'streamWrapper::__destruct' => ['void'],
'streamWrapper::dir_closedir' => ['bool'],
'streamWrapper::dir_opendir' => ['bool', 'path'=>'string', 'options'=>'int'],
'streamWrapper::dir_readdir' => ['string'],
'streamWrapper::dir_rewinddir' => ['bool'],
'streamWrapper::mkdir' => ['bool', 'path'=>'string', 'mode'=>'int', 'options'=>'int'],
'streamWrapper::rename' => ['bool', 'path_from'=>'string', 'path_to'=>'string'],
'streamWrapper::rmdir' => ['bool', 'path'=>'string', 'options'=>'int'],
'streamWrapper::stream_cast' => ['resource', 'cast_as'=>'int'],
'streamWrapper::stream_close' => ['void'],
'streamWrapper::stream_eof' => ['bool'],
'streamWrapper::stream_flush' => ['bool'],
'streamWrapper::stream_lock' => ['bool', 'operation'=>'mode'],
'streamWrapper::stream_metadata' => ['bool', 'path'=>'string', 'option'=>'int', 'value'=>'mixed'],
'streamWrapper::stream_open' => ['bool', 'path'=>'string', 'mode'=>'string', 'options'=>'int', 'opened_path'=>'string'],
'streamWrapper::stream_read' => ['string', 'count'=>'int'],
'streamWrapper::stream_seek' => ['bool', 'offset'=>'int', 'whence'=>'int'],
'streamWrapper::stream_set_option' => ['bool', 'option'=>'int', 'arg1'=>'int', 'arg2'=>'int'],
'streamWrapper::stream_stat' => ['array'],
'streamWrapper::stream_tell' => ['int'],
'streamWrapper::stream_truncate' => ['bool', 'new_size'=>'int'],
'streamWrapper::stream_write' => ['int', 'data'=>'string'],
'streamWrapper::unlink' => ['bool', 'path'=>'string'],
'streamWrapper::url_stat' => ['array', 'path'=>'string', 'flags'=>'int'],
'strftime' => ['string', 'format'=>'string', 'timestamp='=>'int'],
'strip_tags' => ['string', 'string'=>'string', 'allowed_tags='=>'string'],
'stripcslashes' => ['string', 'string'=>'string'],
'stripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'stripslashes' => ['string', 'string'=>'string'],
'stristr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool'],
'strlen' => ['int', 'string'=>'string'],
'strnatcasecmp' => ['int', 'string1'=>'string', 'string2'=>'string'],
'strnatcmp' => ['int', 'string1'=>'string', 'string2'=>'string'],
'strncasecmp' => ['int', 'string1'=>'string', 'string2'=>'string', 'length'=>'int'],
'strncmp' => ['int', 'string1'=>'string', 'string2'=>'string', 'length'=>'int'],
'strpbrk' => ['string|false', 'string'=>'string', 'characters'=>'string'],
'strpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'strptime' => ['array|false', 'timestamp'=>'string', 'format'=>'string'],
'strrchr' => ['string|false', 'haystack'=>'string', 'needle'=>'string'],
'strrev' => ['string', 'string'=>'string'],
'strripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'strrpos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'strspn' => ['int', 'string'=>'string', 'characters'=>'string', 'offset='=>'int', 'length='=>'int'],
'strstr' => ['string|false', 'haystack'=>'string', 'needle'=>'string', 'before_needle='=>'bool'],
'strtok' => ['string|false', 'string'=>'string', 'token'=>'string'],
'strtok\'1' => ['string|false', 'string'=>'string'],
'strtolower' => ['lowercase-string', 'string'=>'string'],
'strtotime' => ['int|false', 'datetime'=>'string', 'baseTimestamp='=>'int'],
'strtoupper' => ['string', 'string'=>'string'],
'strtr' => ['string', 'string'=>'string', 'from'=>'string', 'to'=>'string'],
'strtr\'1' => ['string', 'string'=>'string', 'from'=>'array'],
'strval' => ['string', 'value'=>'mixed'],
'styleObj::__construct' => ['void', 'label'=>'labelObj', 'style'=>'styleObj'],
'styleObj::convertToString' => ['string'],
'styleObj::free' => ['void'],
'styleObj::getBinding' => ['string', 'stylebinding'=>'mixed'],
'styleObj::getGeomTransform' => ['string'],
'styleObj::ms_newStyleObj' => ['styleObj', 'class'=>'classObj', 'style'=>'styleObj'],
'styleObj::removeBinding' => ['int', 'stylebinding'=>'mixed'],
'styleObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'styleObj::setBinding' => ['int', 'stylebinding'=>'mixed', 'value'=>'string'],
'styleObj::setGeomTransform' => ['int', 'value'=>'string'],
'styleObj::updateFromString' => ['int', 'snippet'=>'string'],
'substr' => ['string|false', 'string'=>'string', 'offset'=>'int', 'length='=>'int'],
'substr_compare' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset'=>'int', 'length='=>'int', 'case_insensitive='=>'bool'],
'substr_count' => ['int', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int', 'length='=>'int'],
'substr_replace' => ['string|string[]', 'string'=>'string|string[]', 'replace'=>'mixed', 'offset'=>'mixed', 'length='=>'mixed'],
'suhosin_encrypt_cookie' => ['string|false', 'name'=>'string', 'value'=>'string'],
'suhosin_get_raw_cookies' => ['array'],
'SVM::__construct' => ['void'],
'svm::crossvalidate' => ['float', 'problem'=>'array', 'number_of_folds'=>'int'],
'SVM::getOptions' => ['array'],
'SVM::setOptions' => ['bool', 'params'=>'array'],
'svm::train' => ['SVMModel', 'problem'=>'array', 'weights='=>'array'],
'SVMModel::__construct' => ['void', 'filename='=>'string'],
'SVMModel::checkProbabilityModel' => ['bool'],
'SVMModel::getLabels' => ['array'],
'SVMModel::getNrClass' => ['int'],
'SVMModel::getSvmType' => ['int'],
'SVMModel::getSvrProbability' => ['float'],
'SVMModel::load' => ['bool', 'filename'=>'string'],
'SVMModel::predict' => ['float', 'data'=>'array'],
'SVMModel::predict_probability' => ['float', 'data'=>'array'],
'SVMModel::save' => ['bool', 'filename'=>'string'],
'svn_add' => ['bool', 'path'=>'string', 'recursive='=>'bool', 'force='=>'bool'],
'svn_auth_get_parameter' => ['?string', 'key'=>'string'],
'svn_auth_set_parameter' => ['void', 'key'=>'string', 'value'=>'string'],
'svn_blame' => ['array', 'repository_url'=>'string', 'revision_no='=>'int'],
'svn_cat' => ['string', 'repos_url'=>'string', 'revision_no='=>'int'],
'svn_checkout' => ['bool', 'repos'=>'string', 'targetpath'=>'string', 'revision='=>'int', 'flags='=>'int'],
'svn_cleanup' => ['bool', 'workingdir'=>'string'],
'svn_client_version' => ['string'],
'svn_commit' => ['array', 'log'=>'string', 'targets'=>'array', 'dontrecurse='=>'bool'],
'svn_delete' => ['bool', 'path'=>'string', 'force='=>'bool'],
'svn_diff' => ['array', 'path1'=>'string', 'rev1'=>'int', 'path2'=>'string', 'rev2'=>'int'],
'svn_export' => ['bool', 'frompath'=>'string', 'topath'=>'string', 'working_copy='=>'bool', 'revision_no='=>'int'],
'svn_fs_abort_txn' => ['bool', 'txn'=>'resource'],
'svn_fs_apply_text' => ['resource', 'root'=>'resource', 'path'=>'string'],
'svn_fs_begin_txn2' => ['resource', 'repos'=>'resource', 'rev'=>'int'],
'svn_fs_change_node_prop' => ['bool', 'root'=>'resource', 'path'=>'string', 'name'=>'string', 'value'=>'string'],
'svn_fs_check_path' => ['int', 'fsroot'=>'resource', 'path'=>'string'],
'svn_fs_contents_changed' => ['bool', 'root1'=>'resource', 'path1'=>'string', 'root2'=>'resource', 'path2'=>'string'],
'svn_fs_copy' => ['bool', 'from_root'=>'resource', 'from_path'=>'string', 'to_root'=>'resource', 'to_path'=>'string'],
'svn_fs_delete' => ['bool', 'root'=>'resource', 'path'=>'string'],
'svn_fs_dir_entries' => ['array', 'fsroot'=>'resource', 'path'=>'string'],
'svn_fs_file_contents' => ['resource', 'fsroot'=>'resource', 'path'=>'string'],
'svn_fs_file_length' => ['int', 'fsroot'=>'resource', 'path'=>'string'],
'svn_fs_is_dir' => ['bool', 'root'=>'resource', 'path'=>'string'],
'svn_fs_is_file' => ['bool', 'root'=>'resource', 'path'=>'string'],
'svn_fs_make_dir' => ['bool', 'root'=>'resource', 'path'=>'string'],
'svn_fs_make_file' => ['bool', 'root'=>'resource', 'path'=>'string'],
'svn_fs_node_created_rev' => ['int', 'fsroot'=>'resource', 'path'=>'string'],
'svn_fs_node_prop' => ['string', 'fsroot'=>'resource', 'path'=>'string', 'propname'=>'string'],
'svn_fs_props_changed' => ['bool', 'root1'=>'resource', 'path1'=>'string', 'root2'=>'resource', 'path2'=>'string'],
'svn_fs_revision_prop' => ['string', 'fs'=>'resource', 'revnum'=>'int', 'propname'=>'string'],
'svn_fs_revision_root' => ['resource', 'fs'=>'resource', 'revnum'=>'int'],
'svn_fs_txn_root' => ['resource', 'txn'=>'resource'],
'svn_fs_youngest_rev' => ['int', 'fs'=>'resource'],
'svn_import' => ['bool', 'path'=>'string', 'url'=>'string', 'nonrecursive'=>'bool'],
'svn_log' => ['array', 'repos_url'=>'string', 'start_revision='=>'int', 'end_revision='=>'int', 'limit='=>'int', 'flags='=>'int'],
'svn_ls' => ['array', 'repos_url'=>'string', 'revision_no='=>'int', 'recurse='=>'bool', 'peg='=>'bool'],
'svn_mkdir' => ['bool', 'path'=>'string', 'log_message='=>'string'],
'svn_move' => ['mixed', 'src_path'=>'string', 'dst_path'=>'string', 'force='=>'bool'],
'svn_propget' => ['mixed', 'path'=>'string', 'property_name'=>'string', 'recurse='=>'bool', 'revision'=>'int'],
'svn_proplist' => ['mixed', 'path'=>'string', 'recurse='=>'bool', 'revision'=>'int'],
'svn_repos_create' => ['resource', 'path'=>'string', 'config='=>'array', 'fsconfig='=>'array'],
'svn_repos_fs' => ['resource', 'repos'=>'resource'],
'svn_repos_fs_begin_txn_for_commit' => ['resource', 'repos'=>'resource', 'rev'=>'int', 'author'=>'string', 'log_msg'=>'string'],
'svn_repos_fs_commit_txn' => ['int', 'txn'=>'resource'],
'svn_repos_hotcopy' => ['bool', 'repospath'=>'string', 'destpath'=>'string', 'cleanlogs'=>'bool'],
'svn_repos_open' => ['resource', 'path'=>'string'],
'svn_repos_recover' => ['bool', 'path'=>'string'],
'svn_revert' => ['bool', 'path'=>'string', 'recursive='=>'bool'],
'svn_status' => ['array', 'path'=>'string', 'flags='=>'int'],
'svn_update' => ['int|false', 'path'=>'string', 'revno='=>'int', 'recurse='=>'bool'],
'swf_actiongeturl' => ['', 'url'=>'string', 'target'=>'string'],
'swf_actiongotoframe' => ['', 'framenumber'=>'int'],
'swf_actiongotolabel' => ['', 'label'=>'string'],
'swf_actionnextframe' => [''],
'swf_actionplay' => [''],
'swf_actionprevframe' => [''],
'swf_actionsettarget' => ['', 'target'=>'string'],
'swf_actionstop' => [''],
'swf_actiontogglequality' => [''],
'swf_actionwaitforframe' => ['', 'framenumber'=>'int', 'skipcount'=>'int'],
'swf_addbuttonrecord' => ['', 'states'=>'int', 'shapeid'=>'int', 'depth'=>'int'],
'swf_addcolor' => ['', 'r'=>'float', 'g'=>'float', 'b'=>'float', 'a'=>'float'],
'swf_closefile' => ['', 'return_file='=>'int'],
'swf_definebitmap' => ['', 'objid'=>'int', 'image_name'=>'string'],
'swf_definefont' => ['', 'fontid'=>'int', 'fontname'=>'string'],
'swf_defineline' => ['', 'objid'=>'int', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'width'=>'float'],
'swf_definepoly' => ['', 'objid'=>'int', 'coords'=>'array', 'npoints'=>'int', 'width'=>'float'],
'swf_definerect' => ['', 'objid'=>'int', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'width'=>'float'],
'swf_definetext' => ['', 'objid'=>'int', 'string'=>'string', 'docenter'=>'int'],
'swf_endbutton' => [''],
'swf_enddoaction' => [''],
'swf_endshape' => [''],
'swf_endsymbol' => [''],
'swf_fontsize' => ['', 'size'=>'float'],
'swf_fontslant' => ['', 'slant'=>'float'],
'swf_fonttracking' => ['', 'tracking'=>'float'],
'swf_getbitmapinfo' => ['array', 'bitmapid'=>'int'],
'swf_getfontinfo' => ['array'],
'swf_getframe' => ['int'],
'swf_labelframe' => ['', 'name'=>'string'],
'swf_lookat' => ['', 'view_x'=>'float', 'view_y'=>'float', 'view_z'=>'float', 'reference_x'=>'float', 'reference_y'=>'float', 'reference_z'=>'float', 'twist'=>'float'],
'swf_modifyobject' => ['', 'depth'=>'int', 'how'=>'int'],
'swf_mulcolor' => ['', 'r'=>'float', 'g'=>'float', 'b'=>'float', 'a'=>'float'],
'swf_nextid' => ['int'],
'swf_oncondition' => ['', 'transition'=>'int'],
'swf_openfile' => ['', 'filename'=>'string', 'width'=>'float', 'height'=>'float', 'framerate'=>'float', 'r'=>'float', 'g'=>'float', 'b'=>'float'],
'swf_ortho' => ['', 'xmin'=>'float', 'xmax'=>'float', 'ymin'=>'float', 'ymax'=>'float', 'zmin'=>'float', 'zmax'=>'float'],
'swf_ortho2' => ['', 'xmin'=>'float', 'xmax'=>'float', 'ymin'=>'float', 'ymax'=>'float'],
'swf_perspective' => ['', 'fovy'=>'float', 'aspect'=>'float', 'near'=>'float', 'far'=>'float'],
'swf_placeobject' => ['', 'objid'=>'int', 'depth'=>'int'],
'swf_polarview' => ['', 'dist'=>'float', 'azimuth'=>'float', 'incidence'=>'float', 'twist'=>'float'],
'swf_popmatrix' => [''],
'swf_posround' => ['', 'round'=>'int'],
'swf_pushmatrix' => [''],
'swf_removeobject' => ['', 'depth'=>'int'],
'swf_rotate' => ['', 'angle'=>'float', 'axis'=>'string'],
'swf_scale' => ['', 'x'=>'float', 'y'=>'float', 'z'=>'float'],
'swf_setfont' => ['', 'fontid'=>'int'],
'swf_setframe' => ['', 'framenumber'=>'int'],
'swf_shapearc' => ['', 'x'=>'float', 'y'=>'float', 'r'=>'float', 'ang1'=>'float', 'ang2'=>'float'],
'swf_shapecurveto' => ['', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float'],
'swf_shapecurveto3' => ['', 'x1'=>'float', 'y1'=>'float', 'x2'=>'float', 'y2'=>'float', 'x3'=>'float', 'y3'=>'float'],
'swf_shapefillbitmapclip' => ['', 'bitmapid'=>'int'],
'swf_shapefillbitmaptile' => ['', 'bitmapid'=>'int'],
'swf_shapefilloff' => [''],
'swf_shapefillsolid' => ['', 'r'=>'float', 'g'=>'float', 'b'=>'float', 'a'=>'float'],
'swf_shapelinesolid' => ['', 'r'=>'float', 'g'=>'float', 'b'=>'float', 'a'=>'float', 'width'=>'float'],
'swf_shapelineto' => ['', 'x'=>'float', 'y'=>'float'],
'swf_shapemoveto' => ['', 'x'=>'float', 'y'=>'float'],
'swf_showframe' => [''],
'swf_startbutton' => ['', 'objid'=>'int', 'type'=>'int'],
'swf_startdoaction' => [''],
'swf_startshape' => ['', 'objid'=>'int'],
'swf_startsymbol' => ['', 'objid'=>'int'],
'swf_textwidth' => ['float', 'string'=>'string'],
'swf_translate' => ['', 'x'=>'float', 'y'=>'float', 'z'=>'float'],
'swf_viewport' => ['', 'xmin'=>'float', 'xmax'=>'float', 'ymin'=>'float', 'ymax'=>'float'],
'SWFAction::__construct' => ['void', 'script'=>'string'],
'SWFBitmap::__construct' => ['void', 'file'=>'', 'alphafile='=>''],
'SWFBitmap::getHeight' => ['float'],
'SWFBitmap::getWidth' => ['float'],
'SWFButton::__construct' => ['void'],
'SWFButton::addAction' => ['void', 'action'=>'swfaction', 'flags'=>'int'],
'SWFButton::addASound' => ['SWFSoundInstance', 'sound'=>'swfsound', 'flags'=>'int'],
'SWFButton::addShape' => ['void', 'shape'=>'swfshape', 'flags'=>'int'],
'SWFButton::setAction' => ['void', 'action'=>'swfaction'],
'SWFButton::setDown' => ['void', 'shape'=>'swfshape'],
'SWFButton::setHit' => ['void', 'shape'=>'swfshape'],
'SWFButton::setMenu' => ['void', 'flag'=>'int'],
'SWFButton::setOver' => ['void', 'shape'=>'swfshape'],
'SWFButton::setUp' => ['void', 'shape'=>'swfshape'],
'SWFDisplayItem::addAction' => ['void', 'action'=>'swfaction', 'flags'=>'int'],
'SWFDisplayItem::addColor' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'SWFDisplayItem::endMask' => ['void'],
'SWFDisplayItem::getRot' => ['float'],
'SWFDisplayItem::getX' => ['float'],
'SWFDisplayItem::getXScale' => ['float'],
'SWFDisplayItem::getXSkew' => ['float'],
'SWFDisplayItem::getY' => ['float'],
'SWFDisplayItem::getYScale' => ['float'],
'SWFDisplayItem::getYSkew' => ['float'],
'SWFDisplayItem::move' => ['void', 'dx'=>'float', 'dy'=>'float'],
'SWFDisplayItem::moveTo' => ['void', 'x'=>'float', 'y'=>'float'],
'SWFDisplayItem::multColor' => ['void', 'red'=>'float', 'green'=>'float', 'blue'=>'float', 'a='=>'float'],
'SWFDisplayItem::remove' => ['void'],
'SWFDisplayItem::rotate' => ['void', 'angle'=>'float'],
'SWFDisplayItem::rotateTo' => ['void', 'angle'=>'float'],
'SWFDisplayItem::scale' => ['void', 'dx'=>'float', 'dy'=>'float'],
'SWFDisplayItem::scaleTo' => ['void', 'x'=>'float', 'y='=>'float'],
'SWFDisplayItem::setDepth' => ['void', 'depth'=>'int'],
'SWFDisplayItem::setMaskLevel' => ['void', 'level'=>'int'],
'SWFDisplayItem::setMatrix' => ['void', 'a'=>'float', 'b'=>'float', 'c'=>'float', 'd'=>'float', 'x'=>'float', 'y'=>'float'],
'SWFDisplayItem::setName' => ['void', 'name'=>'string'],
'SWFDisplayItem::setRatio' => ['void', 'ratio'=>'float'],
'SWFDisplayItem::skewX' => ['void', 'ddegrees'=>'float'],
'SWFDisplayItem::skewXTo' => ['void', 'degrees'=>'float'],
'SWFDisplayItem::skewY' => ['void', 'ddegrees'=>'float'],
'SWFDisplayItem::skewYTo' => ['void', 'degrees'=>'float'],
'SWFFill::moveTo' => ['void', 'x'=>'float', 'y'=>'float'],
'SWFFill::rotateTo' => ['void', 'angle'=>'float'],
'SWFFill::scaleTo' => ['void', 'x'=>'float', 'y='=>'float'],
'SWFFill::skewXTo' => ['void', 'x'=>'float'],
'SWFFill::skewYTo' => ['void', 'y'=>'float'],
'SWFFont::__construct' => ['void', 'filename'=>'string'],
'SWFFont::getAscent' => ['float'],
'SWFFont::getDescent' => ['float'],
'SWFFont::getLeading' => ['float'],
'SWFFont::getShape' => ['string', 'code'=>'int'],
'SWFFont::getUTF8Width' => ['float', 'string'=>'string'],
'SWFFont::getWidth' => ['float', 'string'=>'string'],
'SWFFontChar::addChars' => ['void', 'char'=>'string'],
'SWFFontChar::addUTF8Chars' => ['void', 'char'=>'string'],
'SWFGradient::__construct' => ['void'],
'SWFGradient::addEntry' => ['void', 'ratio'=>'float', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha='=>'int'],
'SWFMorph::__construct' => ['void'],
'SWFMorph::getShape1' => ['SWFShape'],
'SWFMorph::getShape2' => ['SWFShape'],
'SWFMovie::__construct' => ['void', 'version='=>'int'],
'SWFMovie::add' => ['mixed', 'instance'=>'object'],
'SWFMovie::addExport' => ['void', 'char'=>'swfcharacter', 'name'=>'string'],
'SWFMovie::addFont' => ['mixed', 'font'=>'swffont'],
'SWFMovie::importChar' => ['SWFSprite', 'libswf'=>'string', 'name'=>'string'],
'SWFMovie::importFont' => ['SWFFontChar', 'libswf'=>'string', 'name'=>'string'],
'SWFMovie::labelFrame' => ['void', 'label'=>'string'],
'SWFMovie::namedAnchor' => [''],
'SWFMovie::nextFrame' => ['void'],
'SWFMovie::output' => ['int', 'compression='=>'int'],
'SWFMovie::protect' => [''],
'SWFMovie::remove' => ['void', 'instance'=>'object'],
'SWFMovie::save' => ['int', 'filename'=>'string', 'compression='=>'int'],
'SWFMovie::saveToFile' => ['int', 'x'=>'resource', 'compression='=>'int'],
'SWFMovie::setbackground' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int'],
'SWFMovie::setDimension' => ['void', 'width'=>'float', 'height'=>'float'],
'SWFMovie::setFrames' => ['void', 'number'=>'int'],
'SWFMovie::setRate' => ['void', 'rate'=>'float'],
'SWFMovie::startSound' => ['SWFSoundInstance', 'sound'=>'swfsound'],
'SWFMovie::stopSound' => ['void', 'sound'=>'swfsound'],
'SWFMovie::streamMP3' => ['int', 'mp3file'=>'mixed', 'skip='=>'float'],
'SWFMovie::writeExports' => ['void'],
'SWFPrebuiltClip::__construct' => ['void', 'file'=>''],
'SWFShape::__construct' => ['void'],
'SWFShape::addFill' => ['SWFFill', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'alpha='=>'int', 'bitmap='=>'swfbitmap', 'flags='=>'int', 'gradient='=>'swfgradient'],
'SWFShape::addFill\'1' => ['SWFFill', 'bitmap'=>'SWFBitmap', 'flags='=>'int'],
'SWFShape::addFill\'2' => ['SWFFill', 'gradient'=>'SWFGradient', 'flags='=>'int'],
'SWFShape::drawArc' => ['void', 'r'=>'float', 'startangle'=>'float', 'endangle'=>'float'],
'SWFShape::drawCircle' => ['void', 'r'=>'float'],
'SWFShape::drawCubic' => ['int', 'bx'=>'float', 'by'=>'float', 'cx'=>'float', 'cy'=>'float', 'dx'=>'float', 'dy'=>'float'],
'SWFShape::drawCubicTo' => ['int', 'bx'=>'float', 'by'=>'float', 'cx'=>'float', 'cy'=>'float', 'dx'=>'float', 'dy'=>'float'],
'SWFShape::drawCurve' => ['int', 'controldx'=>'float', 'controldy'=>'float', 'anchordx'=>'float', 'anchordy'=>'float', 'targetdx='=>'float', 'targetdy='=>'float'],
'SWFShape::drawCurveTo' => ['int', 'controlx'=>'float', 'controly'=>'float', 'anchorx'=>'float', 'anchory'=>'float', 'targetx='=>'float', 'targety='=>'float'],
'SWFShape::drawGlyph' => ['void', 'font'=>'swffont', 'character'=>'string', 'size='=>'int'],
'SWFShape::drawLine' => ['void', 'dx'=>'float', 'dy'=>'float'],
'SWFShape::drawLineTo' => ['void', 'x'=>'float', 'y'=>'float'],
'SWFShape::movePen' => ['void', 'dx'=>'float', 'dy'=>'float'],
'SWFShape::movePenTo' => ['void', 'x'=>'float', 'y'=>'float'],
'SWFShape::setLeftFill' => ['', 'fill'=>'swfgradient', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'SWFShape::setLine' => ['', 'shape'=>'swfshape', 'width'=>'int', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'SWFShape::setRightFill' => ['', 'fill'=>'swfgradient', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'SWFSound' => ['SWFSound', 'filename'=>'string', 'flags='=>'int'],
'SWFSound::__construct' => ['void', 'filename'=>'string', 'flags='=>'int'],
'SWFSoundInstance::loopCount' => ['void', 'point'=>'int'],
'SWFSoundInstance::loopInPoint' => ['void', 'point'=>'int'],
'SWFSoundInstance::loopOutPoint' => ['void', 'point'=>'int'],
'SWFSoundInstance::noMultiple' => ['void'],
'SWFSprite::__construct' => ['void'],
'SWFSprite::add' => ['void', 'object'=>'object'],
'SWFSprite::labelFrame' => ['void', 'label'=>'string'],
'SWFSprite::nextFrame' => ['void'],
'SWFSprite::remove' => ['void', 'object'=>'object'],
'SWFSprite::setFrames' => ['void', 'number'=>'int'],
'SWFSprite::startSound' => ['SWFSoundInstance', 'sount'=>'swfsound'],
'SWFSprite::stopSound' => ['void', 'sount'=>'swfsound'],
'SWFText::__construct' => ['void'],
'SWFText::addString' => ['void', 'string'=>'string'],
'SWFText::addUTF8String' => ['void', 'text'=>'string'],
'SWFText::getAscent' => ['float'],
'SWFText::getDescent' => ['float'],
'SWFText::getLeading' => ['float'],
'SWFText::getUTF8Width' => ['float', 'string'=>'string'],
'SWFText::getWidth' => ['float', 'string'=>'string'],
'SWFText::moveTo' => ['void', 'x'=>'float', 'y'=>'float'],
'SWFText::setColor' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'SWFText::setFont' => ['void', 'font'=>'swffont'],
'SWFText::setHeight' => ['void', 'height'=>'float'],
'SWFText::setSpacing' => ['void', 'spacing'=>'float'],
'SWFTextField::__construct' => ['void', 'flags='=>'int'],
'SWFTextField::addChars' => ['void', 'chars'=>'string'],
'SWFTextField::addString' => ['void', 'string'=>'string'],
'SWFTextField::align' => ['void', 'alignement'=>'int'],
'SWFTextField::setBounds' => ['void', 'width'=>'float', 'height'=>'float'],
'SWFTextField::setColor' => ['void', 'red'=>'int', 'green'=>'int', 'blue'=>'int', 'a='=>'int'],
'SWFTextField::setFont' => ['void', 'font'=>'swffont'],
'SWFTextField::setHeight' => ['void', 'height'=>'float'],
'SWFTextField::setIndentation' => ['void', 'width'=>'float'],
'SWFTextField::setLeftMargin' => ['void', 'width'=>'float'],
'SWFTextField::setLineSpacing' => ['void', 'height'=>'float'],
'SWFTextField::setMargins' => ['void', 'left'=>'float', 'right'=>'float'],
'SWFTextField::setName' => ['void', 'name'=>'string'],
'SWFTextField::setPadding' => ['void', 'padding'=>'float'],
'SWFTextField::setRightMargin' => ['void', 'width'=>'float'],
'SWFVideoStream::__construct' => ['void', 'file='=>'string'],
'SWFVideoStream::getNumFrames' => ['int'],
'SWFVideoStream::setDimension' => ['void', 'x'=>'int', 'y'=>'int'],
'Swish::__construct' => ['void', 'index_names'=>'string'],
'Swish::getMetaList' => ['array', 'index_name'=>'string'],
'Swish::getPropertyList' => ['array', 'index_name'=>'string'],
'Swish::prepare' => ['object', 'query='=>'string'],
'Swish::query' => ['object', 'query'=>'string'],
'SwishResult::getMetaList' => ['array'],
'SwishResult::stem' => ['array', 'word'=>'string'],
'SwishResults::getParsedWords' => ['array', 'index_name'=>'string'],
'SwishResults::getRemovedStopwords' => ['array', 'index_name'=>'string'],
'SwishResults::nextResult' => ['object'],
'SwishResults::seekResult' => ['int', 'position'=>'int'],
'SwishSearch::execute' => ['object', 'query='=>'string'],
'SwishSearch::resetLimit' => [''],
'SwishSearch::setLimit' => ['', 'property'=>'string', 'low'=>'string', 'high'=>'string'],
'SwishSearch::setPhraseDelimiter' => ['', 'delimiter'=>'string'],
'SwishSearch::setSort' => ['', 'sort'=>'string'],
'SwishSearch::setStructure' => ['', 'structure'=>'int'],
'swoole\async::dnsLookup' => ['void', 'hostname'=>'string', 'callback'=>'callable'],
'swoole\async::read' => ['bool', 'filename'=>'string', 'callback'=>'callable', 'chunk_size='=>'integer', 'offset='=>'integer'],
'swoole\async::readFile' => ['void', 'filename'=>'string', 'callback'=>'callable'],
'swoole\async::set' => ['void', 'settings'=>'array'],
'swoole\async::write' => ['void', 'filename'=>'string', 'content'=>'string', 'offset='=>'integer', 'callback='=>'callable'],
'swoole\async::writeFile' => ['void', 'filename'=>'string', 'content'=>'string', 'callback='=>'callable', 'flags='=>'string'],
'swoole\atomic::add' => ['integer', 'add_value='=>'integer'],
'swoole\atomic::cmpset' => ['integer', 'cmp_value'=>'integer', 'new_value'=>'integer'],
'swoole\atomic::get' => ['integer'],
'swoole\atomic::set' => ['integer', 'value'=>'integer'],
'swoole\atomic::sub' => ['integer', 'sub_value='=>'integer'],
'swoole\buffer::__destruct' => ['void'],
'swoole\buffer::__toString' => ['string'],
'swoole\buffer::append' => ['integer', 'data'=>'string'],
'swoole\buffer::clear' => ['void'],
'swoole\buffer::expand' => ['integer', 'size'=>'integer'],
'swoole\buffer::read' => ['string', 'offset'=>'integer', 'length'=>'integer'],
'swoole\buffer::recycle' => ['void'],
'swoole\buffer::substr' => ['string', 'offset'=>'integer', 'length='=>'integer', 'remove='=>'bool'],
'swoole\buffer::write' => ['void', 'offset'=>'integer', 'data'=>'string'],
'swoole\channel::__destruct' => ['void'],
'swoole\channel::pop' => ['mixed'],
'swoole\channel::push' => ['bool', 'data'=>'string'],
'swoole\channel::stats' => ['array'],
'swoole\client::__destruct' => ['void'],
'swoole\client::close' => ['bool', 'force='=>'bool'],
'swoole\client::connect' => ['bool', 'host'=>'string', 'port='=>'integer', 'timeout='=>'integer', 'flag='=>'integer'],
'swoole\client::getpeername' => ['array'],
'swoole\client::getsockname' => ['array'],
'swoole\client::isConnected' => ['bool'],
'swoole\client::on' => ['void', 'event'=>'string', 'callback'=>'callable'],
'swoole\client::pause' => ['void'],
'swoole\client::pipe' => ['void', 'socket'=>'string'],
'swoole\client::recv' => ['void', 'size='=>'string', 'flag='=>'string'],
'swoole\client::resume' => ['void'],
'swoole\client::send' => ['integer', 'data'=>'string', 'flag='=>'string'],
'swoole\client::sendfile' => ['bool', 'filename'=>'string', 'offset='=>'int'],
'swoole\client::sendto' => ['bool', 'ip'=>'string', 'port'=>'integer', 'data'=>'string'],
'swoole\client::set' => ['void', 'settings'=>'array'],
'swoole\client::sleep' => ['void'],
'swoole\client::wakeup' => ['void'],
'swoole\connection\iterator::count' => ['int'],
'swoole\connection\iterator::current' => ['Connection'],
'swoole\connection\iterator::key' => ['int'],
'swoole\connection\iterator::next' => ['Connection'],
'swoole\connection\iterator::offsetExists' => ['bool', 'index'=>'int'],
'swoole\connection\iterator::offsetGet' => ['Connection', 'index'=>'string'],
'swoole\connection\iterator::offsetSet' => ['void', 'offset'=>'int', 'connection'=>'mixed'],
'swoole\connection\iterator::offsetUnset' => ['void', 'offset'=>'int'],
'swoole\connection\iterator::rewind' => ['void'],
'swoole\connection\iterator::valid' => ['bool'],
'swoole\coroutine::call_user_func' => ['mixed', 'callback'=>'callable', 'parameter='=>'mixed', '...args='=>'mixed'],
'swoole\coroutine::call_user_func_array' => ['mixed', 'callback'=>'callable', 'param_array'=>'array'],
'swoole\coroutine::cli_wait' => ['ReturnType'],
'swoole\coroutine::create' => ['ReturnType'],
'swoole\coroutine::getuid' => ['ReturnType'],
'swoole\coroutine::resume' => ['ReturnType'],
'swoole\coroutine::suspend' => ['ReturnType'],
'swoole\coroutine\client::__destruct' => ['ReturnType'],
'swoole\coroutine\client::close' => ['ReturnType'],
'swoole\coroutine\client::connect' => ['ReturnType'],
'swoole\coroutine\client::getpeername' => ['ReturnType'],
'swoole\coroutine\client::getsockname' => ['ReturnType'],
'swoole\coroutine\client::isConnected' => ['ReturnType'],
'swoole\coroutine\client::recv' => ['ReturnType'],
'swoole\coroutine\client::send' => ['ReturnType'],
'swoole\coroutine\client::sendfile' => ['ReturnType'],
'swoole\coroutine\client::sendto' => ['ReturnType'],
'swoole\coroutine\client::set' => ['ReturnType'],
'swoole\coroutine\http\client::__destruct' => ['ReturnType'],
'swoole\coroutine\http\client::addFile' => ['ReturnType'],
'swoole\coroutine\http\client::close' => ['ReturnType'],
'swoole\coroutine\http\client::execute' => ['ReturnType'],
'swoole\coroutine\http\client::get' => ['ReturnType'],
'swoole\coroutine\http\client::getDefer' => ['ReturnType'],
'swoole\coroutine\http\client::isConnected' => ['ReturnType'],
'swoole\coroutine\http\client::post' => ['ReturnType'],
'swoole\coroutine\http\client::recv' => ['ReturnType'],
'swoole\coroutine\http\client::set' => ['ReturnType'],
'swoole\coroutine\http\client::setCookies' => ['ReturnType'],
'swoole\coroutine\http\client::setData' => ['ReturnType'],
'swoole\coroutine\http\client::setDefer' => ['ReturnType'],
'swoole\coroutine\http\client::setHeaders' => ['ReturnType'],
'swoole\coroutine\http\client::setMethod' => ['ReturnType'],
'swoole\coroutine\mysql::__destruct' => ['ReturnType'],
'swoole\coroutine\mysql::close' => ['ReturnType'],
'swoole\coroutine\mysql::connect' => ['ReturnType'],
'swoole\coroutine\mysql::getDefer' => ['ReturnType'],
'swoole\coroutine\mysql::query' => ['ReturnType'],
'swoole\coroutine\mysql::recv' => ['ReturnType'],
'swoole\coroutine\mysql::setDefer' => ['ReturnType'],
'swoole\event::add' => ['bool', 'fd'=>'int', 'read_callback'=>'callable', 'write_callback='=>'callable', 'events='=>'string'],
'swoole\event::defer' => ['void', 'callback'=>'mixed'],
'swoole\event::del' => ['bool', 'fd'=>'string'],
'swoole\event::exit' => ['void'],
'swoole\event::set' => ['bool', 'fd'=>'int', 'read_callback='=>'string', 'write_callback='=>'string', 'events='=>'string'],
'swoole\event::wait' => ['void'],
'swoole\event::write' => ['void', 'fd'=>'string', 'data'=>'string'],
'swoole\http\client::__destruct' => ['void'],
'swoole\http\client::addFile' => ['void', 'path'=>'string', 'name'=>'string', 'type='=>'string', 'filename='=>'string', 'offset='=>'string'],
'swoole\http\client::close' => ['void'],
'swoole\http\client::download' => ['void', 'path'=>'string', 'file'=>'string', 'callback'=>'callable', 'offset='=>'integer'],
'swoole\http\client::execute' => ['void', 'path'=>'string', 'callback'=>'string'],
'swoole\http\client::get' => ['void', 'path'=>'string', 'callback'=>'callable'],
'swoole\http\client::isConnected' => ['bool'],
'swoole\http\client::on' => ['void', 'event_name'=>'string', 'callback'=>'callable'],
'swoole\http\client::post' => ['void', 'path'=>'string', 'data'=>'string', 'callback'=>'callable'],
'swoole\http\client::push' => ['void', 'data'=>'string', 'opcode='=>'string', 'finish='=>'string'],
'swoole\http\client::set' => ['void', 'settings'=>'array'],
'swoole\http\client::setCookies' => ['void', 'cookies'=>'array'],
'swoole\http\client::setData' => ['ReturnType', 'data'=>'string'],
'swoole\http\client::setHeaders' => ['void', 'headers'=>'array'],
'swoole\http\client::setMethod' => ['void', 'method'=>'string'],
'swoole\http\client::upgrade' => ['void', 'path'=>'string', 'callback'=>'string'],
'swoole\http\request::__destruct' => ['void'],
'swoole\http\request::rawcontent' => ['string'],
'swoole\http\response::__destruct' => ['void'],
'swoole\http\response::cookie' => ['string', 'name'=>'string', 'value='=>'string', 'expires='=>'string', 'path='=>'string', 'domain='=>'string', 'secure='=>'string', 'httponly='=>'string'],
'swoole\http\response::end' => ['void', 'content='=>'string'],
'swoole\http\response::gzip' => ['ReturnType', 'compress_level='=>'string'],
'swoole\http\response::header' => ['void', 'key'=>'string', 'value'=>'string', 'ucwords='=>'string'],
'swoole\http\response::initHeader' => ['ReturnType'],
'swoole\http\response::rawcookie' => ['ReturnType', 'name'=>'string', 'value='=>'string', 'expires='=>'string', 'path='=>'string', 'domain='=>'string', 'secure='=>'string', 'httponly='=>'string'],
'swoole\http\response::sendfile' => ['ReturnType', 'filename'=>'string', 'offset='=>'int'],
'swoole\http\response::status' => ['ReturnType', 'http_code'=>'string'],
'swoole\http\response::write' => ['void', 'content'=>'string'],
'swoole\http\server::on' => ['void', 'event_name'=>'string', 'callback'=>'callable'],
'swoole\http\server::start' => ['void'],
'swoole\lock::__destruct' => ['void'],
'swoole\lock::lock' => ['void'],
'swoole\lock::lock_read' => ['void'],
'swoole\lock::trylock' => ['void'],
'swoole\lock::trylock_read' => ['void'],
'swoole\lock::unlock' => ['void'],
'swoole\mmap::open' => ['ReturnType', 'filename'=>'string', 'size='=>'string', 'offset='=>'string'],
'swoole\mysql::__destruct' => ['void'],
'swoole\mysql::close' => ['void'],
'swoole\mysql::connect' => ['void', 'server_config'=>'array', 'callback'=>'callable'],
'swoole\mysql::getBuffer' => ['ReturnType'],
'swoole\mysql::on' => ['void', 'event_name'=>'string', 'callback'=>'callable'],
'swoole\mysql::query' => ['ReturnType', 'sql'=>'string', 'callback'=>'callable'],
'swoole\process::__destruct' => ['void'],
'swoole\process::alarm' => ['void', 'interval_usec'=>'integer'],
'swoole\process::close' => ['void'],
'swoole\process::daemon' => ['void', 'nochdir='=>'bool', 'noclose='=>'bool'],
'swoole\process::exec' => ['ReturnType', 'exec_file'=>'string', 'args'=>'string'],
'swoole\process::exit' => ['void', 'exit_code='=>'string'],
'swoole\process::freeQueue' => ['void'],
'swoole\process::kill' => ['void', 'pid'=>'integer', 'signal_no='=>'string'],
'swoole\process::name' => ['void', 'process_name'=>'string'],
'swoole\process::pop' => ['mixed', 'maxsize='=>'integer'],
'swoole\process::push' => ['bool', 'data'=>'string'],
'swoole\process::read' => ['string', 'maxsize='=>'integer'],
'swoole\process::signal' => ['void', 'signal_no'=>'string', 'callback'=>'callable'],
'swoole\process::start' => ['void'],
'swoole\process::statQueue' => ['array'],
'swoole\process::useQueue' => ['bool', 'key'=>'integer', 'mode='=>'integer'],
'swoole\process::wait' => ['array', 'blocking='=>'bool'],
'swoole\process::write' => ['integer', 'data'=>'string'],
'swoole\redis\server::format' => ['ReturnType', 'type'=>'string', 'value='=>'string'],
'swoole\redis\server::setHandler' => ['ReturnType', 'command'=>'string', 'callback'=>'string', 'number_of_string_param='=>'string', 'type_of_array_param='=>'string'],
'swoole\redis\server::start' => ['ReturnType'],
'swoole\serialize::pack' => ['ReturnType', 'data'=>'string', 'is_fast='=>'int'],
'swoole\serialize::unpack' => ['ReturnType', 'data'=>'string', 'args='=>'string'],
'swoole\server::addlistener' => ['void', 'host'=>'string', 'port'=>'integer', 'socket_type'=>'string'],
'swoole\server::addProcess' => ['bool', 'process'=>'swoole_process'],
'swoole\server::after' => ['ReturnType', 'after_time_ms'=>'integer', 'callback'=>'callable', 'param='=>'string'],
'swoole\server::bind' => ['bool', 'fd'=>'integer', 'uid'=>'integer'],
'swoole\server::close' => ['bool', 'fd'=>'integer', 'reset='=>'bool'],
'swoole\server::confirm' => ['bool', 'fd'=>'integer'],
'swoole\server::connection_info' => ['array', 'fd'=>'integer', 'reactor_id='=>'integer'],
'swoole\server::connection_list' => ['array', 'start_fd'=>'integer', 'pagesize='=>'integer'],
'swoole\server::defer' => ['void', 'callback'=>'callable'],
'swoole\server::exist' => ['bool', 'fd'=>'integer'],
'swoole\server::finish' => ['void', 'data'=>'string'],
'swoole\server::getClientInfo' => ['ReturnType', 'fd'=>'integer', 'reactor_id='=>'integer'],
'swoole\server::getClientList' => ['array', 'start_fd'=>'integer', 'pagesize='=>'integer'],
'swoole\server::getLastError' => ['integer'],
'swoole\server::heartbeat' => ['mixed', 'if_close_connection'=>'bool'],
'swoole\server::listen' => ['bool', 'host'=>'string', 'port'=>'integer', 'socket_type'=>'string'],
'swoole\server::on' => ['void', 'event_name'=>'string', 'callback'=>'callable'],
'swoole\server::pause' => ['void', 'fd'=>'integer'],
'swoole\server::protect' => ['void', 'fd'=>'integer', 'is_protected='=>'bool'],
'swoole\server::reload' => ['bool'],
'swoole\server::resume' => ['void', 'fd'=>'integer'],
'swoole\server::send' => ['bool', 'fd'=>'integer', 'data'=>'string', 'reactor_id='=>'integer'],
'swoole\server::sendfile' => ['bool', 'fd'=>'integer', 'filename'=>'string', 'offset='=>'integer'],
'swoole\server::sendMessage' => ['bool', 'worker_id'=>'integer', 'data'=>'string'],
'swoole\server::sendto' => ['bool', 'ip'=>'string', 'port'=>'integer', 'data'=>'string', 'server_socket='=>'string'],
'swoole\server::sendwait' => ['bool', 'fd'=>'integer', 'data'=>'string'],
'swoole\server::set' => ['ReturnType', 'settings'=>'array'],
'swoole\server::shutdown' => ['void'],
'swoole\server::start' => ['void'],
'swoole\server::stats' => ['array'],
'swoole\server::stop' => ['bool', 'worker_id='=>'integer'],
'swoole\server::task' => ['mixed', 'data'=>'string', 'dst_worker_id='=>'integer', 'callback='=>'callable'],
'swoole\server::taskwait' => ['void', 'data'=>'string', 'timeout='=>'float', 'worker_id='=>'integer'],
'swoole\server::taskWaitMulti' => ['void', 'tasks'=>'array', 'timeout_ms='=>'double'],
'swoole\server::tick' => ['void', 'interval_ms'=>'integer', 'callback'=>'callable'],
'swoole\server\port::__destruct' => ['void'],
'swoole\server\port::on' => ['ReturnType', 'event_name'=>'string', 'callback'=>'callable'],
'swoole\server\port::set' => ['void', 'settings'=>'array'],
'swoole\table::column' => ['ReturnType', 'name'=>'string', 'type'=>'string', 'size='=>'integer'],
'swoole\table::count' => ['integer'],
'swoole\table::create' => ['void'],
'swoole\table::current' => ['array'],
'swoole\table::decr' => ['ReturnType', 'key'=>'string', 'column'=>'string', 'decrby='=>'integer'],
'swoole\table::del' => ['void', 'key'=>'string'],
'swoole\table::destroy' => ['void'],
'swoole\table::exist' => ['bool', 'key'=>'string'],
'swoole\table::get' => ['integer', 'row_key'=>'string', 'column_key'=>'string'],
'swoole\table::incr' => ['void', 'key'=>'string', 'column'=>'string', 'incrby='=>'integer'],
'swoole\table::key' => ['string'],
'swoole\table::next' => ['ReturnType'],
'swoole\table::rewind' => ['void'],
'swoole\table::set' => ['VOID', 'key'=>'string', 'value'=>'array'],
'swoole\table::valid' => ['bool'],
'swoole\timer::after' => ['void', 'after_time_ms'=>'int', 'callback'=>'callable'],
'swoole\timer::clear' => ['void', 'timer_id'=>'integer'],
'swoole\timer::exists' => ['bool', 'timer_id'=>'integer'],
'swoole\timer::tick' => ['void', 'interval_ms'=>'integer', 'callback'=>'callable', 'param='=>'string'],
'swoole\websocket\server::exist' => ['bool', 'fd'=>'integer'],
'swoole\websocket\server::on' => ['ReturnType', 'event_name'=>'string', 'callback'=>'callable'],
'swoole\websocket\server::pack' => ['binary', 'data'=>'string', 'opcode='=>'string', 'finish='=>'string', 'mask='=>'string'],
'swoole\websocket\server::push' => ['void', 'fd'=>'string', 'data'=>'string', 'opcode='=>'string', 'finish='=>'string'],
'swoole\websocket\server::unpack' => ['string', 'data'=>'binary'],
'swoole_async_dns_lookup' => ['bool', 'hostname'=>'string', 'callback'=>'callable'],
'swoole_async_read' => ['bool', 'filename'=>'string', 'callback'=>'callable', 'chunk_size='=>'int', 'offset='=>'int'],
'swoole_async_readfile' => ['bool', 'filename'=>'string', 'callback'=>'string'],
'swoole_async_set' => ['void', 'settings'=>'array'],
'swoole_async_write' => ['bool', 'filename'=>'string', 'content'=>'string', 'offset='=>'int', 'callback='=>'callable'],
'swoole_async_writefile' => ['bool', 'filename'=>'string', 'content'=>'string', 'callback='=>'callable', 'flags='=>'int'],
'swoole_client_select' => ['int', 'read_array'=>'array', 'write_array'=>'array', 'error_array'=>'array', 'timeout='=>'float'],
'swoole_cpu_num' => ['int'],
'swoole_errno' => ['int'],
'swoole_event_add' => ['int', 'fd'=>'int', 'read_callback='=>'callable', 'write_callback='=>'callable', 'events='=>'int'],
'swoole_event_defer' => ['bool', 'callback'=>'callable'],
'swoole_event_del' => ['bool', 'fd'=>'int'],
'swoole_event_exit' => ['void'],
'swoole_event_set' => ['bool', 'fd'=>'int', 'read_callback='=>'callable', 'write_callback='=>'callable', 'events='=>'int'],
'swoole_event_wait' => ['void'],
'swoole_event_write' => ['bool', 'fd'=>'int', 'data'=>'string'],
'swoole_get_local_ip' => ['array'],
'swoole_last_error' => ['int'],
'swoole_load_module' => ['mixed', 'filename'=>'string'],
'swoole_select' => ['int', 'read_array'=>'array', 'write_array'=>'array', 'error_array'=>'array', 'timeout='=>'float'],
'swoole_set_process_name' => ['void', 'process_name'=>'string', 'size='=>'int'],
'swoole_strerror' => ['string', 'errno'=>'int', 'error_type='=>'int'],
'swoole_timer_after' => ['int', 'ms'=>'int', 'callback'=>'callable', 'param='=>'mixed'],
'swoole_timer_exists' => ['bool', 'timer_id'=>'int'],
'swoole_timer_tick' => ['int', 'ms'=>'int', 'callback'=>'callable', 'param='=>'mixed'],
'swoole_version' => ['string'],
'symbolObj::__construct' => ['void', 'map'=>'mapObj', 'symbolname'=>'string'],
'symbolObj::free' => ['void'],
'symbolObj::getPatternArray' => ['array'],
'symbolObj::getPointsArray' => ['array'],
'symbolObj::ms_newSymbolObj' => ['int', 'map'=>'mapObj', 'symbolname'=>'string'],
'symbolObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'symbolObj::setImagePath' => ['int', 'filename'=>'string'],
'symbolObj::setPattern' => ['int', 'int'=>'array'],
'symbolObj::setPoints' => ['int', 'double'=>'array'],
'symlink' => ['bool', 'target'=>'string', 'link'=>'string'],
'SyncEvent::__construct' => ['void', 'name='=>'string', 'manual='=>'bool'],
'SyncEvent::fire' => ['bool'],
'SyncEvent::reset' => ['bool'],
'SyncEvent::wait' => ['bool', 'wait='=>'int'],
'SyncMutex::__construct' => ['void', 'name='=>'string'],
'SyncMutex::lock' => ['bool', 'wait='=>'int'],
'SyncMutex::unlock' => ['bool', 'all='=>'bool'],
'SyncReaderWriter::__construct' => ['void', 'name='=>'string', 'autounlock='=>'bool'],
'SyncReaderWriter::readlock' => ['bool', 'wait='=>'int'],
'SyncReaderWriter::readunlock' => ['bool'],
'SyncReaderWriter::writelock' => ['bool', 'wait='=>'int'],
'SyncReaderWriter::writeunlock' => ['bool'],
'SyncSemaphore::__construct' => ['void', 'name='=>'string', 'initialval='=>'int', 'autounlock='=>'bool'],
'SyncSemaphore::lock' => ['bool', 'wait='=>'int'],
'SyncSemaphore::unlock' => ['bool', '&w_prevcount='=>'int'],
'SyncSharedMemory::__construct' => ['void', 'name'=>'string', 'size'=>'int'],
'SyncSharedMemory::first' => ['bool'],
'SyncSharedMemory::read' => ['string', 'start='=>'int', 'length='=>'int'],
'SyncSharedMemory::size' => ['int'],
'SyncSharedMemory::write' => ['int', 'string='=>'string', 'start='=>'int'],
'sys_get_temp_dir' => ['string'],
'sys_getloadavg' => ['array'],
'syslog' => ['bool', 'priority'=>'int', 'message'=>'string'],
'system' => ['string|false', 'command'=>'string', '&w_result_code='=>'int'],
'taint' => ['bool', '&rw_string'=>'string', '&...w_other_strings='=>'string'],
'tan' => ['float', 'num'=>'float'],
'tanh' => ['float', 'num'=>'float'],
'tcpwrap_check' => ['bool', 'daemon'=>'string', 'address'=>'string', 'user='=>'string', 'nodns='=>'bool'],
'tempnam' => ['string|false', 'directory'=>'string', 'prefix'=>'string'],
'textdomain' => ['string', 'domain'=>'string'],
'Thread::__construct' => ['void'],
'Thread::addRef' => ['void'],
'Thread::chunk' => ['array', 'size'=>'int', 'preserve'=>'bool'],
'Thread::count' => ['int'],
'Thread::delRef' => ['void'],
'Thread::detach' => ['void'],
'Thread::extend' => ['bool', 'class'=>'string'],
'Thread::getCreatorId' => ['int'],
'Thread::getCurrentThread' => ['Thread'],
'Thread::getCurrentThreadId' => ['int'],
'Thread::getRefCount' => ['int'],
'Thread::getTerminationInfo' => ['array'],
'Thread::getThreadId' => ['int'],
'Thread::globally' => ['mixed'],
'Thread::isGarbage' => ['bool'],
'Thread::isJoined' => ['bool'],
'Thread::isRunning' => ['bool'],
'Thread::isStarted' => ['bool'],
'Thread::isTerminated' => ['bool'],
'Thread::isWaiting' => ['bool'],
'Thread::join' => ['bool'],
'Thread::kill' => ['void'],
'Thread::lock' => ['bool'],
'Thread::merge' => ['bool', 'from'=>'', 'overwrite='=>'mixed'],
'Thread::notify' => ['bool'],
'Thread::notifyOne' => ['bool'],
'Thread::offsetExists' => ['bool', 'offset'=>'mixed'],
'Thread::offsetGet' => ['mixed', 'offset'=>'mixed'],
'Thread::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'],
'Thread::offsetUnset' => ['void', 'offset'=>'mixed'],
'Thread::pop' => ['bool'],
'Thread::run' => ['void'],
'Thread::setGarbage' => ['void'],
'Thread::shift' => ['bool'],
'Thread::start' => ['bool', 'options='=>'int'],
'Thread::synchronized' => ['mixed', 'block'=>'Closure', '_='=>'mixed'],
'Thread::unlock' => ['bool'],
'Thread::wait' => ['bool', 'timeout='=>'int'],
'Threaded::__construct' => ['void'],
'Threaded::addRef' => ['void'],
'Threaded::chunk' => ['array', 'size'=>'int', 'preserve'=>'bool'],
'Threaded::count' => ['int'],
'Threaded::delRef' => ['void'],
'Threaded::extend' => ['bool', 'class'=>'string'],
'Threaded::from' => ['Threaded', 'run'=>'Closure', 'construct='=>'Closure', 'args='=>'array'],
'Threaded::getRefCount' => ['int'],
'Threaded::getTerminationInfo' => ['array'],
'Threaded::isGarbage' => ['bool'],
'Threaded::isRunning' => ['bool'],
'Threaded::isTerminated' => ['bool'],
'Threaded::isWaiting' => ['bool'],
'Threaded::lock' => ['bool'],
'Threaded::merge' => ['bool', 'from'=>'mixed', 'overwrite='=>'bool'],
'Threaded::notify' => ['bool'],
'Threaded::notifyOne' => ['bool'],
'Threaded::offsetExists' => ['bool', 'offset'=>'mixed'],
'Threaded::offsetGet' => ['mixed', 'offset'=>'mixed'],
'Threaded::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'],
'Threaded::offsetUnset' => ['void', 'offset'=>'mixed'],
'Threaded::pop' => ['bool'],
'Threaded::run' => ['void'],
'Threaded::setGarbage' => ['void'],
'Threaded::shift' => ['mixed'],
'Threaded::synchronized' => ['mixed', 'block'=>'Closure', '...args='=>'mixed'],
'Threaded::unlock' => ['bool'],
'Threaded::wait' => ['bool', 'timeout='=>'int'],
'Throwable::__toString' => ['string'],
'Throwable::getCode' => ['int|string'],
'Throwable::getFile' => ['string'],
'Throwable::getLine' => ['int'],
'Throwable::getMessage' => ['string'],
'Throwable::getPrevious' => ['?Throwable'],
'Throwable::getTrace' => ['list<array<string,mixed>>'],
'Throwable::getTraceAsString' => ['string'],
'tidy::__construct' => ['void', 'filename='=>'string', 'config='=>'', 'encoding='=>'string', 'useIncludePath='=>'bool'],
'tidy::body' => ['tidyNode'],
'tidy::cleanRepair' => ['bool'],
'tidy::diagnose' => ['bool'],
'tidy::getConfig' => ['array'],
'tidy::getHtmlVer' => ['int'],
'tidy::getOpt' => ['mixed', 'option'=>'string'],
'tidy::getOptDoc' => ['string', 'option'=>'string'],
'tidy::getRelease' => ['string'],
'tidy::getStatus' => ['int'],
'tidy::head' => ['tidyNode'],
'tidy::html' => ['tidyNode'],
'tidy::htmlver' => ['int'],
'tidy::isXhtml' => ['bool'],
'tidy::isXml' => ['bool'],
'tidy::parseFile' => ['bool', 'filename'=>'string', 'config='=>'', 'encoding='=>'string', 'useIncludePath='=>'bool'],
'tidy::parseString' => ['bool', 'string'=>'string', 'config='=>'', 'encoding='=>'string'],
'tidy::repairFile' => ['string', 'filename'=>'string', 'config='=>'', 'encoding='=>'string', 'useIncludePath='=>'bool'],
'tidy::repairString' => ['string', 'string'=>'string', 'config='=>'', 'encoding='=>'string'],
'tidy::root' => ['tidyNode'],
'tidy_access_count' => ['int', 'tidy'=>'tidy'],
'tidy_clean_repair' => ['bool', 'tidy'=>'tidy'],
'tidy_config_count' => ['int', 'tidy'=>'tidy'],
'tidy_diagnose' => ['bool', 'tidy'=>'tidy'],
'tidy_error_count' => ['int', 'tidy'=>'tidy'],
'tidy_get_body' => ['tidyNode', 'tidy'=>'tidy'],
'tidy_get_config' => ['array', 'tidy'=>'tidy'],
'tidy_get_error_buffer' => ['string', 'tidy'=>'tidy'],
'tidy_get_head' => ['tidyNode', 'tidy'=>'tidy'],
'tidy_get_html' => ['tidyNode', 'tidy'=>'tidy'],
'tidy_get_html_ver' => ['int', 'tidy'=>'tidy'],
'tidy_get_opt_doc' => ['string', 'tidy'=>'tidy', 'option'=>'string'],
'tidy_get_output' => ['string', 'tidy'=>'tidy'],
'tidy_get_release' => ['string'],
'tidy_get_root' => ['tidyNode', 'tidy'=>'tidy'],
'tidy_get_status' => ['int', 'tidy'=>'tidy'],
'tidy_getopt' => ['mixed', 'tidy'=>'string', 'option'=>'tidy'],
'tidy_is_xhtml' => ['bool', 'tidy'=>'tidy'],
'tidy_is_xml' => ['bool', 'tidy'=>'tidy'],
'tidy_load_config' => ['void', 'filename'=>'string', 'encoding'=>'string'],
'tidy_parse_file' => ['tidy', 'filename'=>'string', 'config='=>'', 'encoding='=>'string', 'useIncludePath='=>'bool'],
'tidy_parse_string' => ['tidy', 'string'=>'string', 'config='=>'', 'encoding='=>'string'],
'tidy_repair_file' => ['string', 'filename'=>'string', 'config='=>'', 'encoding='=>'string', 'useIncludePath='=>'bool'],
'tidy_repair_string' => ['string', 'string'=>'string', 'config='=>'', 'encoding='=>'string'],
'tidy_reset_config' => ['bool'],
'tidy_save_config' => ['bool', 'filename'=>'string'],
'tidy_set_encoding' => ['bool', 'encoding'=>'string'],
'tidy_setopt' => ['bool', 'option'=>'string', 'value'=>'mixed'],
'tidy_warning_count' => ['int', 'tidy'=>'tidy'],
'tidyNode::__construct' => ['void'],
'tidyNode::getParent' => ['tidyNode'],
'tidyNode::hasChildren' => ['bool'],
'tidyNode::hasSiblings' => ['bool'],
'tidyNode::isAsp' => ['bool'],
'tidyNode::isComment' => ['bool'],
'tidyNode::isHtml' => ['bool'],
'tidyNode::isJste' => ['bool'],
'tidyNode::isPhp' => ['bool'],
'tidyNode::isText' => ['bool'],
'time' => ['positive-int'],
'time_nanosleep' => ['array{0:0|positive-int,1:0|positive-int}|bool', 'seconds'=>'positive-int', 'nanoseconds'=>'positive-int'],
'time_sleep_until' => ['bool', 'timestamp'=>'float'],
'timezone_abbreviations_list' => ['array<string, list<array{dst: bool, offset: int, timezone_id: string|null}>>|false'],
'timezone_identifiers_list' => ['list<string>', 'timezoneGroup='=>'int', 'countryCode='=>'?string'],
'timezone_location_get' => ['array|false', 'object'=>'DateTimeZone'],
'timezone_name_from_abbr' => ['string|false', 'abbr'=>'string', 'utcOffset='=>'int', 'isDST='=>'int'],
'timezone_name_get' => ['string', 'object'=>'DateTimeZone'],
'timezone_offset_get' => ['int|false', 'object'=>'DateTimeZone', 'datetime'=>'DateTimeInterface'],
'timezone_open' => ['DateTimeZone|false', 'timezone'=>'string'],
'timezone_transitions_get' => ['list<array{ts: int, time: string, offset: int, isdst: bool, abbr: string}>|false', 'object'=>'DateTimeZone', 'timestampBegin='=>'int', 'timestampEnd='=>'int'],
'timezone_version_get' => ['string'],
'tmpfile' => ['resource|false'],
'token_get_all' => ['list<string|array{0:int,1:string,2:int}>', 'code'=>'string', 'flags='=>'int'],
'token_name' => ['string', 'id'=>'int'],
'TokyoTyrant::__construct' => ['void', 'host='=>'string', 'port='=>'int', 'options='=>'array'],
'TokyoTyrant::add' => ['int|float', 'key'=>'string', 'increment'=>'float', 'type='=>'int'],
'TokyoTyrant::connect' => ['TokyoTyrant', 'host'=>'string', 'port='=>'int', 'options='=>'array'],
'TokyoTyrant::connectUri' => ['TokyoTyrant', 'uri'=>'string'],
'TokyoTyrant::copy' => ['TokyoTyrant', 'path'=>'string'],
'TokyoTyrant::ext' => ['string', 'name'=>'string', 'options'=>'int', 'key'=>'string', 'value'=>'string'],
'TokyoTyrant::fwmKeys' => ['array', 'prefix'=>'string', 'max_recs'=>'int'],
'TokyoTyrant::get' => ['array', 'keys'=>'mixed'],
'TokyoTyrant::getIterator' => ['TokyoTyrantIterator'],
'TokyoTyrant::num' => ['int'],
'TokyoTyrant::out' => ['string', 'keys'=>'mixed'],
'TokyoTyrant::put' => ['TokyoTyrant', 'keys'=>'mixed', 'value='=>'string'],
'TokyoTyrant::putCat' => ['TokyoTyrant', 'keys'=>'mixed', 'value='=>'string'],
'TokyoTyrant::putKeep' => ['TokyoTyrant', 'keys'=>'mixed', 'value='=>'string'],
'TokyoTyrant::putNr' => ['TokyoTyrant', 'keys'=>'mixed', 'value='=>'string'],
'TokyoTyrant::putShl' => ['mixed', 'key'=>'string', 'value'=>'string', 'width'=>'int'],
'TokyoTyrant::restore' => ['mixed', 'log_dir'=>'string', 'timestamp'=>'int', 'check_consistency='=>'bool'],
'TokyoTyrant::setMaster' => ['mixed', 'host'=>'string', 'port'=>'int', 'timestamp'=>'int', 'check_consistency='=>'bool'],
'TokyoTyrant::size' => ['int', 'key'=>'string'],
'TokyoTyrant::stat' => ['array'],
'TokyoTyrant::sync' => ['mixed'],
'TokyoTyrant::tune' => ['TokyoTyrant', 'timeout'=>'float', 'options='=>'int'],
'TokyoTyrant::vanish' => ['mixed'],
'TokyoTyrantIterator::__construct' => ['void', 'object'=>'mixed'],
'TokyoTyrantIterator::current' => ['mixed'],
'TokyoTyrantIterator::key' => ['mixed'],
'TokyoTyrantIterator::next' => ['mixed'],
'TokyoTyrantIterator::rewind' => ['void'],
'TokyoTyrantIterator::valid' => ['bool'],
'TokyoTyrantQuery::__construct' => ['void', 'table'=>'TokyoTyrantTable'],
'TokyoTyrantQuery::addCond' => ['mixed', 'name'=>'string', 'op'=>'int', 'expr'=>'string'],
'TokyoTyrantQuery::count' => ['int'],
'TokyoTyrantQuery::current' => ['array'],
'TokyoTyrantQuery::hint' => ['string'],
'TokyoTyrantQuery::key' => ['string'],
'TokyoTyrantQuery::metaSearch' => ['array', 'queries'=>'array', 'type'=>'int'],
'TokyoTyrantQuery::next' => ['array'],
'TokyoTyrantQuery::out' => ['TokyoTyrantQuery'],
'TokyoTyrantQuery::rewind' => ['bool'],
'TokyoTyrantQuery::search' => ['array'],
'TokyoTyrantQuery::setLimit' => ['mixed', 'max='=>'int', 'skip='=>'int'],
'TokyoTyrantQuery::setOrder' => ['mixed', 'name'=>'string', 'type'=>'int'],
'TokyoTyrantQuery::valid' => ['bool'],
'TokyoTyrantTable::add' => ['void', 'key'=>'string', 'increment'=>'mixed', 'type='=>'string'],
'TokyoTyrantTable::genUid' => ['int'],
'TokyoTyrantTable::get' => ['array', 'keys'=>'mixed'],
'TokyoTyrantTable::getIterator' => ['TokyoTyrantIterator'],
'TokyoTyrantTable::getQuery' => ['TokyoTyrantQuery'],
'TokyoTyrantTable::out' => ['void', 'keys'=>'mixed'],
'TokyoTyrantTable::put' => ['int', 'key'=>'string', 'columns'=>'array'],
'TokyoTyrantTable::putCat' => ['void', 'key'=>'string', 'columns'=>'array'],
'TokyoTyrantTable::putKeep' => ['void', 'key'=>'string', 'columns'=>'array'],
'TokyoTyrantTable::putNr' => ['void', 'keys'=>'mixed', 'value='=>'string'],
'TokyoTyrantTable::putShl' => ['void', 'key'=>'string', 'value'=>'string', 'width'=>'int'],
'TokyoTyrantTable::setIndex' => ['mixed', 'column'=>'string', 'type'=>'int'],
'touch' => ['bool', 'filename'=>'string', 'mtime='=>'int', 'atime='=>'int'],
'trader_acos' => ['array', 'real'=>'array'],
'trader_ad' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'volume'=>'array'],
'trader_add' => ['array', 'real0'=>'array', 'real1'=>'array'],
'trader_adosc' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'volume'=>'array', 'fastPeriod='=>'int', 'slowPeriod='=>'int'],
'trader_adx' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_adxr' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_apo' => ['array', 'real'=>'array', 'fastPeriod='=>'int', 'slowPeriod='=>'int', 'mAType='=>'int'],
'trader_aroon' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'],
'trader_aroonosc' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'],
'trader_asin' => ['array', 'real'=>'array'],
'trader_atan' => ['array', 'real'=>'array'],
'trader_atr' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_avgprice' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_bbands' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'nbDevUp='=>'float', 'nbDevDn='=>'float', 'mAType='=>'int'],
'trader_beta' => ['array', 'real0'=>'array', 'real1'=>'array', 'timePeriod='=>'int'],
'trader_bop' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cci' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_cdl2crows' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdl3blackcrows' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdl3inside' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdl3linestrike' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdl3outside' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdl3starsinsouth' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdl3whitesoldiers' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlabandonedbaby' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'],
'trader_cdladvanceblock' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlbelthold' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlbreakaway' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlclosingmarubozu' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlconcealbabyswall' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlcounterattack' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdldarkcloudcover' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'],
'trader_cdldoji' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdldojistar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdldragonflydoji' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlengulfing' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdleveningdojistar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'],
'trader_cdleveningstar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'],
'trader_cdlgapsidesidewhite' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlgravestonedoji' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlhammer' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlhangingman' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlharami' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlharamicross' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlhighwave' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlhikkake' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlhikkakemod' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlhomingpigeon' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlidentical3crows' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlinneck' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlinvertedhammer' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlkicking' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlkickingbylength' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlladderbottom' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdllongleggeddoji' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdllongline' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlmarubozu' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlmatchinglow' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlmathold' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'],
'trader_cdlmorningdojistar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'],
'trader_cdlmorningstar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'penetration='=>'float'],
'trader_cdlonneck' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlpiercing' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlrickshawman' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlrisefall3methods' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlseparatinglines' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlshootingstar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlshortline' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlspinningtop' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlstalledpattern' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlsticksandwich' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdltakuri' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdltasukigap' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlthrusting' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdltristar' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlunique3river' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlupsidegap2crows' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_cdlxsidegap3methods' => ['array', 'open'=>'array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_ceil' => ['array', 'real'=>'array'],
'trader_cmo' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_correl' => ['array', 'real0'=>'array', 'real1'=>'array', 'timePeriod='=>'int'],
'trader_cos' => ['array', 'real'=>'array'],
'trader_cosh' => ['array', 'real'=>'array'],
'trader_dema' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_div' => ['array', 'real0'=>'array', 'real1'=>'array'],
'trader_dx' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_ema' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_errno' => ['int'],
'trader_exp' => ['array', 'real'=>'array'],
'trader_floor' => ['array', 'real'=>'array'],
'trader_get_compat' => ['int'],
'trader_get_unstable_period' => ['int', 'functionId'=>'int'],
'trader_ht_dcperiod' => ['array', 'real'=>'array'],
'trader_ht_dcphase' => ['array', 'real'=>'array'],
'trader_ht_phasor' => ['array', 'real'=>'array'],
'trader_ht_sine' => ['array', 'real'=>'array'],
'trader_ht_trendline' => ['array', 'real'=>'array'],
'trader_ht_trendmode' => ['array', 'real'=>'array'],
'trader_kama' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_linearreg' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_linearreg_angle' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_linearreg_intercept' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_linearreg_slope' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_ln' => ['array', 'real'=>'array'],
'trader_log10' => ['array', 'real'=>'array'],
'trader_ma' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'mAType='=>'int'],
'trader_macd' => ['array', 'real'=>'array', 'fastPeriod='=>'int', 'slowPeriod='=>'int', 'signalPeriod='=>'int'],
'trader_macdext' => ['array', 'real'=>'array', 'fastPeriod='=>'int', 'fastMAType='=>'int', 'slowPeriod='=>'int', 'slowMAType='=>'int', 'signalPeriod='=>'int', 'signalMAType='=>'int'],
'trader_macdfix' => ['array', 'real'=>'array', 'signalPeriod='=>'int'],
'trader_mama' => ['array', 'real'=>'array', 'fastLimit='=>'float', 'slowLimit='=>'float'],
'trader_mavp' => ['array', 'real'=>'array', 'periods'=>'array', 'minPeriod='=>'int', 'maxPeriod='=>'int', 'mAType='=>'int'],
'trader_max' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_maxindex' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_medprice' => ['array', 'high'=>'array', 'low'=>'array'],
'trader_mfi' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'volume'=>'array', 'timePeriod='=>'int'],
'trader_midpoint' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_midprice' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'],
'trader_min' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_minindex' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_minmax' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_minmaxindex' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_minus_di' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_minus_dm' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'],
'trader_mom' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_mult' => ['array', 'real0'=>'array', 'real1'=>'array'],
'trader_natr' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_obv' => ['array', 'real'=>'array', 'volume'=>'array'],
'trader_plus_di' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_plus_dm' => ['array', 'high'=>'array', 'low'=>'array', 'timePeriod='=>'int'],
'trader_ppo' => ['array', 'real'=>'array', 'fastPeriod='=>'int', 'slowPeriod='=>'int', 'mAType='=>'int'],
'trader_roc' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_rocp' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_rocr' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_rocr100' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_rsi' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_sar' => ['array', 'high'=>'array', 'low'=>'array', 'acceleration='=>'float', 'maximum='=>'float'],
'trader_sarext' => ['array', 'high'=>'array', 'low'=>'array', 'startValue='=>'float', 'offsetOnReverse='=>'float', 'accelerationInitLong='=>'float', 'accelerationLong='=>'float', 'accelerationMaxLong='=>'float', 'accelerationInitShort='=>'float', 'accelerationShort='=>'float', 'accelerationMaxShort='=>'float'],
'trader_set_compat' => ['void', 'compatId'=>'int'],
'trader_set_unstable_period' => ['void', 'functionId'=>'int', 'timePeriod'=>'int'],
'trader_sin' => ['array', 'real'=>'array'],
'trader_sinh' => ['array', 'real'=>'array'],
'trader_sma' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_sqrt' => ['array', 'real'=>'array'],
'trader_stddev' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'nbDev='=>'float'],
'trader_stoch' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'fastK_Period='=>'int', 'slowK_Period='=>'int', 'slowK_MAType='=>'int', 'slowD_Period='=>'int', 'slowD_MAType='=>'int'],
'trader_stochf' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'fastK_Period='=>'int', 'fastD_Period='=>'int', 'fastD_MAType='=>'int'],
'trader_stochrsi' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'fastK_Period='=>'int', 'fastD_Period='=>'int', 'fastD_MAType='=>'int'],
'trader_sub' => ['array', 'real0'=>'array', 'real1'=>'array'],
'trader_sum' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_t3' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'vFactor='=>'float'],
'trader_tan' => ['array', 'real'=>'array'],
'trader_tanh' => ['array', 'real'=>'array'],
'trader_tema' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_trange' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_trima' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_trix' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_tsf' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trader_typprice' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_ultosc' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod1='=>'int', 'timePeriod2='=>'int', 'timePeriod3='=>'int'],
'trader_var' => ['array', 'real'=>'array', 'timePeriod='=>'int', 'nbDev='=>'float'],
'trader_wclprice' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array'],
'trader_willr' => ['array', 'high'=>'array', 'low'=>'array', 'close'=>'array', 'timePeriod='=>'int'],
'trader_wma' => ['array', 'real'=>'array', 'timePeriod='=>'int'],
'trait_exists' => ['?bool', 'trait'=>'string', 'autoload='=>'bool'],
'Transliterator::create' => ['?Transliterator', 'id'=>'string', 'direction='=>'int'],
'Transliterator::createFromRules' => ['?Transliterator', 'rules'=>'string', 'direction='=>'int'],
'Transliterator::createInverse' => ['Transliterator'],
'Transliterator::getErrorCode' => ['int'],
'Transliterator::getErrorMessage' => ['string'],
'Transliterator::listIDs' => ['array'],
'Transliterator::transliterate' => ['string|false', 'subject'=>'string', 'start='=>'int', 'end='=>'int'],
'transliterator_create' => ['?Transliterator', 'id'=>'string', 'direction='=>'int'],
'transliterator_create_from_rules' => ['?Transliterator', 'rules'=>'string', 'direction='=>'int'],
'transliterator_create_inverse' => ['Transliterator', 'transliterator'=>'Transliterator'],
'transliterator_get_error_code' => ['int', 'transliterator'=>'Transliterator'],
'transliterator_get_error_message' => ['string', 'transliterator'=>'Transliterator'],
'transliterator_list_ids' => ['array'],
'transliterator_transliterate' => ['string|false', 'transliterator'=>'Transliterator|string', 'string'=>'string', 'start='=>'int', 'end='=>'int'],
'trigger_error' => ['bool', 'message'=>'string', 'error_level='=>'256|512|1024|16384'],
'trim' => ['string', 'string'=>'string', 'characters='=>'string'],
'TypeError::__clone' => ['void'],
'TypeError::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?TypeError'],
'TypeError::__toString' => ['string'],
'TypeError::getCode' => ['int'],
'TypeError::getFile' => ['string'],
'TypeError::getLine' => ['int'],
'TypeError::getMessage' => ['string'],
'TypeError::getPrevious' => ['Throwable|TypeError|null'],
'TypeError::getTrace' => ['list<array<string,mixed>>'],
'TypeError::getTraceAsString' => ['string'],
'uasort' => ['bool', '&rw_array'=>'array', 'callback'=>'callable(mixed,mixed):int'],
'ucfirst' => ['string', 'string'=>'string'],
'UConverter::__construct' => ['void', 'destination_encoding='=>'string', 'source_encoding='=>'string'],
'UConverter::convert' => ['string', 'string'=>'string', 'reverse='=>'bool'],
'UConverter::fromUCallback' => ['mixed', 'reason'=>'int', 'source'=>'string', 'codePoint'=>'string', '&w_error'=>'int'],
'UConverter::getAliases' => ['array', 'name'=>'string'],
'UConverter::getAvailable' => ['array'],
'UConverter::getDestinationEncoding' => ['string'],
'UConverter::getDestinationType' => ['int'],
'UConverter::getErrorCode' => ['int'],
'UConverter::getErrorMessage' => ['string'],
'UConverter::getSourceEncoding' => ['string'],
'UConverter::getSourceType' => ['int'],
'UConverter::getStandards' => ['array'],
'UConverter::getSubstChars' => ['string'],
'UConverter::reasonText' => ['string', 'reason='=>'int'],
'UConverter::setDestinationEncoding' => ['bool', 'encoding'=>'string'],
'UConverter::setSourceEncoding' => ['bool', 'encoding'=>'string'],
'UConverter::setSubstChars' => ['bool', 'chars'=>'string'],
'UConverter::toUCallback' => ['mixed', 'reason'=>'int', 'source'=>'string', 'codeUnits'=>'string', '&w_error'=>'int'],
'UConverter::transcode' => ['string', 'string'=>'string', 'toEncoding'=>'string', 'fromEncoding'=>'string', 'options='=>'?array'],
'ucwords' => ['string', 'string'=>'string', 'separators='=>'string'],
'udm_add_search_limit' => ['bool', 'agent'=>'resource', 'var'=>'int', 'value'=>'string'],
'udm_alloc_agent' => ['resource', 'dbaddr'=>'string', 'dbmode='=>'string'],
'udm_alloc_agent_array' => ['resource', 'databases'=>'array'],
'udm_api_version' => ['int'],
'udm_cat_list' => ['array', 'agent'=>'resource', 'category'=>'string'],
'udm_cat_path' => ['array', 'agent'=>'resource', 'category'=>'string'],
'udm_check_charset' => ['bool', 'agent'=>'resource', 'charset'=>'string'],
'udm_check_stored' => ['int', 'agent'=>'', 'link'=>'int', 'doc_id'=>'string'],
'udm_clear_search_limits' => ['bool', 'agent'=>'resource'],
'udm_close_stored' => ['int', 'agent'=>'', 'link'=>'int'],
'udm_crc32' => ['int', 'agent'=>'resource', 'string'=>'string'],
'udm_errno' => ['int', 'agent'=>'resource'],
'udm_error' => ['string', 'agent'=>'resource'],
'udm_find' => ['resource', 'agent'=>'resource', 'query'=>'string'],
'udm_free_agent' => ['int', 'agent'=>'resource'],
'udm_free_ispell_data' => ['bool', 'agent'=>'int'],
'udm_free_res' => ['bool', 'res'=>'resource'],
'udm_get_doc_count' => ['int', 'agent'=>'resource'],
'udm_get_res_field' => ['string', 'res'=>'resource', 'row'=>'int', 'field'=>'int'],
'udm_get_res_param' => ['string', 'res'=>'resource', 'param'=>'int'],
'udm_hash32' => ['int', 'agent'=>'resource', 'string'=>'string'],
'udm_load_ispell_data' => ['bool', 'agent'=>'resource', 'var'=>'int', 'val1'=>'string', 'val2'=>'string', 'flag'=>'int'],
'udm_open_stored' => ['int', 'agent'=>'', 'storedaddr'=>'string'],
'udm_set_agent_param' => ['bool', 'agent'=>'resource', 'var'=>'int', 'val'=>'string'],
'ui\area::onDraw' => ['', 'pen'=>'UI\Draw\Pen', 'areaSize'=>'UI\Size', 'clipPoint'=>'UI\Point', 'clipSize'=>'UI\Size'],
'ui\area::onKey' => ['', 'key'=>'string', 'ext'=>'int', 'flags'=>'int'],
'ui\area::onMouse' => ['', 'areaPoint'=>'UI\Point', 'areaSize'=>'UI\Size', 'flags'=>'int'],
'ui\area::redraw' => [''],
'ui\area::scrollTo' => ['', 'point'=>'UI\Point', 'size'=>'UI\Size'],
'ui\area::setSize' => ['', 'size'=>'UI\Size'],
'ui\control::destroy' => [''],
'ui\control::disable' => [''],
'ui\control::enable' => [''],
'ui\control::getParent' => ['UI\Control'],
'ui\control::getTopLevel' => ['int'],
'ui\control::hide' => [''],
'ui\control::isEnabled' => ['bool'],
'ui\control::isVisible' => ['bool'],
'ui\control::setParent' => ['', 'parent'=>'UI\Control'],
'ui\control::show' => [''],
'ui\controls\box::append' => ['int', 'control'=>'Control', 'stretchy='=>'bool'],
'ui\controls\box::delete' => ['bool', 'index'=>'int'],
'ui\controls\box::getOrientation' => ['int'],
'ui\controls\box::isPadded' => ['bool'],
'ui\controls\box::setPadded' => ['', 'padded'=>'bool'],
'ui\controls\button::getText' => ['string'],
'ui\controls\button::onClick' => [''],
'ui\controls\button::setText' => ['', 'text'=>'string'],
'ui\controls\check::getText' => ['string'],
'ui\controls\check::isChecked' => ['bool'],
'ui\controls\check::onToggle' => [''],
'ui\controls\check::setChecked' => ['', 'checked'=>'bool'],
'ui\controls\check::setText' => ['', 'text'=>'string'],
'ui\controls\colorbutton::getColor' => ['UI\Color'],
'ui\controls\colorbutton::onChange' => [''],
'ui\controls\combo::append' => ['', 'text'=>'string'],
'ui\controls\combo::getSelected' => ['int'],
'ui\controls\combo::onSelected' => [''],
'ui\controls\combo::setSelected' => ['', 'index'=>'int'],
'ui\controls\editablecombo::append' => ['', 'text'=>'string'],
'ui\controls\editablecombo::getText' => ['string'],
'ui\controls\editablecombo::onChange' => [''],
'ui\controls\editablecombo::setText' => ['', 'text'=>'string'],
'ui\controls\entry::getText' => ['string'],
'ui\controls\entry::isReadOnly' => ['bool'],
'ui\controls\entry::onChange' => [''],
'ui\controls\entry::setReadOnly' => ['', 'readOnly'=>'bool'],
'ui\controls\entry::setText' => ['', 'text'=>'string'],
'ui\controls\form::append' => ['int', 'label'=>'string', 'control'=>'UI\Control', 'stretchy='=>'bool'],
'ui\controls\form::delete' => ['bool', 'index'=>'int'],
'ui\controls\form::isPadded' => ['bool'],
'ui\controls\form::setPadded' => ['', 'padded'=>'bool'],
'ui\controls\grid::append' => ['', 'control'=>'UI\Control', 'left'=>'int', 'top'=>'int', 'xspan'=>'int', 'yspan'=>'int', 'hexpand'=>'bool', 'halign'=>'int', 'vexpand'=>'bool', 'valign'=>'int'],
'ui\controls\grid::isPadded' => ['bool'],
'ui\controls\grid::setPadded' => ['', 'padding'=>'bool'],
'ui\controls\group::append' => ['', 'control'=>'UI\Control'],
'ui\controls\group::getTitle' => ['string'],
'ui\controls\group::hasMargin' => ['bool'],
'ui\controls\group::setMargin' => ['', 'margin'=>'bool'],
'ui\controls\group::setTitle' => ['', 'title'=>'string'],
'ui\controls\label::getText' => ['string'],
'ui\controls\label::setText' => ['', 'text'=>'string'],
'ui\controls\multilineentry::append' => ['', 'text'=>'string'],
'ui\controls\multilineentry::getText' => ['string'],
'ui\controls\multilineentry::isReadOnly' => ['bool'],
'ui\controls\multilineentry::onChange' => [''],
'ui\controls\multilineentry::setReadOnly' => ['', 'readOnly'=>'bool'],
'ui\controls\multilineentry::setText' => ['', 'text'=>'string'],
'ui\controls\progress::getValue' => ['int'],
'ui\controls\progress::setValue' => ['', 'value'=>'int'],
'ui\controls\radio::append' => ['', 'text'=>'string'],
'ui\controls\radio::getSelected' => ['int'],
'ui\controls\radio::onSelected' => [''],
'ui\controls\radio::setSelected' => ['', 'index'=>'int'],
'ui\controls\slider::getValue' => ['int'],
'ui\controls\slider::onChange' => [''],
'ui\controls\slider::setValue' => ['', 'value'=>'int'],
'ui\controls\spin::getValue' => ['int'],
'ui\controls\spin::onChange' => [''],
'ui\controls\spin::setValue' => ['', 'value'=>'int'],
'ui\controls\tab::append' => ['int', 'name'=>'string', 'control'=>'UI\Control'],
'ui\controls\tab::delete' => ['bool', 'index'=>'int'],
'ui\controls\tab::hasMargin' => ['bool', 'page'=>'int'],
'ui\controls\tab::insertAt' => ['', 'name'=>'string', 'page'=>'int', 'control'=>'UI\Control'],
'ui\controls\tab::pages' => ['int'],
'ui\controls\tab::setMargin' => ['', 'page'=>'int', 'margin'=>'bool'],
'ui\draw\brush::getColor' => ['UI\Draw\Color'],
'ui\draw\brush\gradient::delStop' => ['int', 'index'=>'int'],
'ui\draw\color::getChannel' => ['float', 'channel'=>'int'],
'ui\draw\color::setChannel' => ['void', 'channel'=>'int', 'value'=>'float'],
'ui\draw\matrix::invert' => [''],
'ui\draw\matrix::isInvertible' => ['bool'],
'ui\draw\matrix::multiply' => ['UI\Draw\Matrix', 'matrix'=>'UI\Draw\Matrix'],
'ui\draw\matrix::rotate' => ['', 'point'=>'UI\Point', 'amount'=>'float'],
'ui\draw\matrix::scale' => ['', 'center'=>'UI\Point', 'point'=>'UI\Point'],
'ui\draw\matrix::skew' => ['', 'point'=>'UI\Point', 'amount'=>'UI\Point'],
'ui\draw\matrix::translate' => ['', 'point'=>'UI\Point'],
'ui\draw\path::addRectangle' => ['', 'point'=>'UI\Point', 'size'=>'UI\Size'],
'ui\draw\path::arcTo' => ['', 'point'=>'UI\Point', 'radius'=>'float', 'angle'=>'float', 'sweep'=>'float', 'negative'=>'float'],
'ui\draw\path::bezierTo' => ['', 'point'=>'UI\Point', 'radius'=>'float', 'angle'=>'float', 'sweep'=>'float', 'negative'=>'float'],
'ui\draw\path::closeFigure' => [''],
'ui\draw\path::end' => [''],
'ui\draw\path::lineTo' => ['', 'point'=>'UI\Point', 'radius'=>'float', 'angle'=>'float', 'sweep'=>'float', 'negative'=>'float'],
'ui\draw\path::newFigure' => ['', 'point'=>'UI\Point'],
'ui\draw\path::newFigureWithArc' => ['', 'point'=>'UI\Point', 'radius'=>'float', 'angle'=>'float', 'sweep'=>'float', 'negative'=>'float'],
'ui\draw\pen::clip' => ['', 'path'=>'UI\Draw\Path'],
'ui\draw\pen::restore' => [''],
'ui\draw\pen::save' => [''],
'ui\draw\pen::transform' => ['', 'matrix'=>'UI\Draw\Matrix'],
'ui\draw\pen::write' => ['', 'point'=>'UI\Point', 'layout'=>'UI\Draw\Text\Layout'],
'ui\draw\stroke::getCap' => ['int'],
'ui\draw\stroke::getJoin' => ['int'],
'ui\draw\stroke::getMiterLimit' => ['float'],
'ui\draw\stroke::getThickness' => ['float'],
'ui\draw\stroke::setCap' => ['', 'cap'=>'int'],
'ui\draw\stroke::setJoin' => ['', 'join'=>'int'],
'ui\draw\stroke::setMiterLimit' => ['', 'limit'=>'float'],
'ui\draw\stroke::setThickness' => ['', 'thickness'=>'float'],
'ui\draw\text\font::getAscent' => ['float'],
'ui\draw\text\font::getDescent' => ['float'],
'ui\draw\text\font::getLeading' => ['float'],
'ui\draw\text\font::getUnderlinePosition' => ['float'],
'ui\draw\text\font::getUnderlineThickness' => ['float'],
'ui\draw\text\font\descriptor::getFamily' => ['string'],
'ui\draw\text\font\descriptor::getItalic' => ['int'],
'ui\draw\text\font\descriptor::getSize' => ['float'],
'ui\draw\text\font\descriptor::getStretch' => ['int'],
'ui\draw\text\font\descriptor::getWeight' => ['int'],
'ui\draw\text\font\fontfamilies' => ['array'],
'ui\draw\text\layout::setWidth' => ['', 'width'=>'float'],
'ui\executor::kill' => ['void'],
'ui\executor::onExecute' => ['void'],
'ui\menu::append' => ['UI\MenuItem', 'name'=>'string', 'type='=>'string'],
'ui\menu::appendAbout' => ['UI\MenuItem', 'type='=>'string'],
'ui\menu::appendCheck' => ['UI\MenuItem', 'name'=>'string', 'type='=>'string'],
'ui\menu::appendPreferences' => ['UI\MenuItem', 'type='=>'string'],
'ui\menu::appendQuit' => ['UI\MenuItem', 'type='=>'string'],
'ui\menu::appendSeparator' => [''],
'ui\menuitem::disable' => [''],
'ui\menuitem::enable' => [''],
'ui\menuitem::isChecked' => ['bool'],
'ui\menuitem::onClick' => [''],
'ui\menuitem::setChecked' => ['', 'checked'=>'bool'],
'ui\point::getX' => ['float'],
'ui\point::getY' => ['float'],
'ui\point::setX' => ['', 'point'=>'float'],
'ui\point::setY' => ['', 'point'=>'float'],
'ui\quit' => ['void'],
'ui\run' => ['void', 'flags='=>'int'],
'ui\size::getHeight' => ['float'],
'ui\size::getWidth' => ['float'],
'ui\size::setHeight' => ['', 'size'=>'float'],
'ui\size::setWidth' => ['', 'size'=>'float'],
'ui\window::add' => ['', 'control'=>'UI\Control'],
'ui\window::error' => ['', 'title'=>'string', 'msg'=>'string'],
'ui\window::getSize' => ['UI\Size'],
'ui\window::getTitle' => ['string'],
'ui\window::hasBorders' => ['bool'],
'ui\window::hasMargin' => ['bool'],
'ui\window::isFullScreen' => ['bool'],
'ui\window::msg' => ['', 'title'=>'string', 'msg'=>'string'],
'ui\window::onClosing' => ['int'],
'ui\window::open' => ['string'],
'ui\window::save' => ['string'],
'ui\window::setBorders' => ['', 'borders'=>'bool'],
'ui\window::setFullScreen' => ['', 'full'=>'bool'],
'ui\window::setMargin' => ['', 'margin'=>'bool'],
'ui\window::setSize' => ['', 'size'=>'UI\Size'],
'ui\window::setTitle' => ['', 'title'=>'string'],
'uksort' => ['bool', '&rw_array'=>'array', 'callback'=>'callable(mixed,mixed):int'],
'umask' => ['int', 'mask='=>'int'],
'UnderflowException::__clone' => ['void'],
'UnderflowException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?UnderflowException'],
'UnderflowException::__toString' => ['string'],
'UnderflowException::getCode' => ['int'],
'UnderflowException::getFile' => ['string'],
'UnderflowException::getLine' => ['int'],
'UnderflowException::getMessage' => ['string'],
'UnderflowException::getPrevious' => ['Throwable|UnderflowException|null'],
'UnderflowException::getTrace' => ['list<array<string,mixed>>'],
'UnderflowException::getTraceAsString' => ['string'],
'UnexpectedValueException::__clone' => ['void'],
'UnexpectedValueException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Throwable|?UnexpectedValueException'],
'UnexpectedValueException::__toString' => ['string'],
'UnexpectedValueException::getCode' => ['int'],
'UnexpectedValueException::getFile' => ['string'],
'UnexpectedValueException::getLine' => ['int'],
'UnexpectedValueException::getMessage' => ['string'],
'UnexpectedValueException::getPrevious' => ['Throwable|UnexpectedValueException|null'],
'UnexpectedValueException::getTrace' => ['list<array<string,mixed>>'],
'UnexpectedValueException::getTraceAsString' => ['string'],
'uniqid' => ['string', 'prefix='=>'string', 'more_entropy='=>'bool'],
'unixtojd' => ['int', 'timestamp='=>'int'],
'unlink' => ['bool', 'filename'=>'string', 'context='=>'resource'],
'unpack' => ['array|false', 'format'=>'string', 'string'=>'string', 'offset='=>'int'],
'unregister_tick_function' => ['void', 'callback'=>'callable'],
'unserialize' => ['mixed', 'data'=>'string', 'options='=>'array{allowed_classes?:string[]|bool}'],
'unset' => ['void', 'var='=>'mixed', '...args='=>'mixed'],
'untaint' => ['bool', '&rw_string'=>'string', '&...rw_strings='=>'string'],
'uopz_allow_exit' => ['void', 'allow'=>'bool'],
'uopz_backup' => ['void', 'class'=>'string', 'function'=>'string'],
'uopz_backup\'1' => ['void', 'function'=>'string'],
'uopz_compose' => ['void', 'name'=>'string', 'classes'=>'array', 'methods='=>'array', 'properties='=>'array', 'flags='=>'int'],
'uopz_copy' => ['Closure', 'class'=>'string', 'function'=>'string'],
'uopz_copy\'1' => ['Closure', 'function'=>'string'],
'uopz_delete' => ['void', 'class'=>'string', 'function'=>'string'],
'uopz_delete\'1' => ['void', 'function'=>'string'],
'uopz_extend' => ['bool', 'class'=>'string', 'parent'=>'string'],
'uopz_flags' => ['int', 'class'=>'string', 'function'=>'string', 'flags'=>'int'],
'uopz_flags\'1' => ['int', 'function'=>'string', 'flags'=>'int'],
'uopz_function' => ['void', 'class'=>'string', 'function'=>'string', 'handler'=>'Closure', 'modifiers='=>'int'],
'uopz_function\'1' => ['void', 'function'=>'string', 'handler'=>'Closure', 'modifiers='=>'int'],
'uopz_get_exit_status' => ['?int'],
'uopz_get_hook' => ['?Closure', 'class'=>'string', 'function'=>'string'],
'uopz_get_hook\'1' => ['?Closure', 'function'=>'string'],
'uopz_get_mock' => ['string|object|null', 'class'=>'string'],
'uopz_get_property' => ['mixed', 'class'=>'object|string', 'property'=>'string'],
'uopz_get_return' => ['mixed', 'class='=>'string', 'function='=>'string'],
'uopz_get_static' => ['?array', 'class'=>'string', 'function'=>'string'],
'uopz_implement' => ['bool', 'class'=>'string', 'interface'=>'string'],
'uopz_overload' => ['void', 'opcode'=>'int', 'callable'=>'Callable'],
'uopz_redefine' => ['bool', 'class'=>'string', 'constant'=>'string', 'value'=>'mixed'],
'uopz_redefine\'1' => ['bool', 'constant'=>'string', 'value'=>'mixed'],
'uopz_rename' => ['void', 'class'=>'string', 'function'=>'string', 'rename'=>'string'],
'uopz_rename\'1' => ['void', 'function'=>'string', 'rename'=>'string'],
'uopz_restore' => ['void', 'class'=>'string', 'function'=>'string'],
'uopz_restore\'1' => ['void', 'function'=>'string'],
'uopz_set_hook' => ['bool', 'class'=>'string', 'function'=>'string', 'hook'=>'Closure'],
'uopz_set_hook\'1' => ['bool', 'function'=>'string', 'hook'=>'Closure'],
'uopz_set_mock' => ['void', 'class'=>'string', 'mock'=>'object|string'],
'uopz_set_property' => ['void', 'class'=>'object|string', 'property'=>'string', 'value'=>'mixed'],
'uopz_set_return' => ['bool', 'class'=>'string', 'function'=>'string', 'value'=>'mixed', 'execute='=>'bool'],
'uopz_set_return\'1' => ['bool', 'function'=>'string', 'value'=>'mixed', 'execute='=>'bool'],
'uopz_set_static' => ['void', 'class'=>'string', 'function'=>'string', 'static'=>'array'],
'uopz_undefine' => ['bool', 'class'=>'string', 'constant'=>'string'],
'uopz_undefine\'1' => ['bool', 'constant'=>'string'],
'uopz_unset_hook' => ['bool', 'class'=>'string', 'function'=>'string'],
'uopz_unset_hook\'1' => ['bool', 'function'=>'string'],
'uopz_unset_mock' => ['void', 'class'=>'string'],
'uopz_unset_return' => ['bool', 'class='=>'string', 'function='=>'string'],
'uopz_unset_return\'1' => ['bool', 'function'=>'string'],
'urldecode' => ['string', 'string'=>'string'],
'urlencode' => ['string', 'string'=>'string'],
'use_soap_error_handler' => ['bool', 'enable='=>'bool'],
'user_error' => ['void', 'message'=>'string', 'error_level='=>'int'],
'usleep' => ['void', 'microseconds'=>'positive-int|0'],
'usort' => ['bool', '&rw_array'=>'array', 'callback'=>'callable(mixed,mixed):int'],
'utf8_decode' => ['string', 'string'=>'string'],
'utf8_encode' => ['string', 'string'=>'string'],
'V8Js::__construct' => ['void', 'object_name='=>'string', 'variables='=>'array', 'extensions='=>'array', 'report_uncaught_exceptions='=>'bool', 'snapshot_blob='=>'string'],
'V8Js::clearPendingException' => [''],
'V8Js::compileString' => ['resource', 'script'=>'', 'identifier='=>'string'],
'V8Js::createSnapshot' => ['false|string', 'embed_source'=>'string'],
'V8Js::executeScript' => ['', 'script'=>'resource', 'flags='=>'int', 'time_limit='=>'int', 'memory_limit='=>'int'],
'V8Js::executeString' => ['mixed', 'script'=>'string', 'identifier='=>'string', 'flags='=>'int'],
'V8Js::getExtensions' => ['string[]'],
'V8Js::getPendingException' => ['?V8JsException'],
'V8Js::registerExtension' => ['bool', 'extension_name'=>'string', 'script'=>'string', 'dependencies='=>'array', 'auto_enable='=>'bool'],
'V8Js::setAverageObjectSize' => ['', 'average_object_size'=>'int'],
'V8Js::setMemoryLimit' => ['', 'limit'=>'int'],
'V8Js::setModuleLoader' => ['', 'loader'=>'callable'],
'V8Js::setModuleNormaliser' => ['', 'normaliser'=>'callable'],
'V8Js::setTimeLimit' => ['', 'limit'=>'int'],
'V8JsException::getJsFileName' => ['string'],
'V8JsException::getJsLineNumber' => ['int'],
'V8JsException::getJsSourceLine' => ['int'],
'V8JsException::getJsTrace' => ['string'],
'V8JsScriptException::__clone' => ['void'],
'V8JsScriptException::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'V8JsScriptException::__toString' => ['string'],
'V8JsScriptException::__wakeup' => ['void'],
'V8JsScriptException::getCode' => ['int'],
'V8JsScriptException::getFile' => ['string'],
'V8JsScriptException::getJsEndColumn' => ['int'],
'V8JsScriptException::getJsFileName' => ['string'],
'V8JsScriptException::getJsLineNumber' => ['int'],
'V8JsScriptException::getJsSourceLine' => ['string'],
'V8JsScriptException::getJsStartColumn' => ['int'],
'V8JsScriptException::getJsTrace' => ['string'],
'V8JsScriptException::getLine' => ['int'],
'V8JsScriptException::getMessage' => ['string'],
'V8JsScriptException::getPrevious' => ['Exception|Throwable'],
'V8JsScriptException::getTrace' => ['list<array<string,mixed>>'],
'V8JsScriptException::getTraceAsString' => ['string'],
'var_dump' => ['void', 'value'=>'mixed', '...values='=>'mixed'],
'var_export' => ['?string', 'value'=>'mixed', 'return='=>'bool'],
'VARIANT::__construct' => ['void', 'value='=>'mixed', 'type='=>'int', 'codepage='=>'int'],
'variant_abs' => ['mixed', 'value'=>'mixed'],
'variant_add' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_and' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_cast' => ['VARIANT', 'variant'=>'VARIANT', 'type'=>'int'],
'variant_cat' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_cmp' => ['int', 'left'=>'mixed', 'right'=>'mixed', 'locale_id='=>'int', 'flags='=>'int'],
'variant_date_from_timestamp' => ['VARIANT', 'timestamp'=>'int'],
'variant_date_to_timestamp' => ['int', 'variant'=>'VARIANT'],
'variant_div' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_eqv' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_fix' => ['mixed', 'value'=>'mixed'],
'variant_get_type' => ['int', 'variant'=>'VARIANT'],
'variant_idiv' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_imp' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_int' => ['mixed', 'value'=>'mixed'],
'variant_mod' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_mul' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_neg' => ['mixed', 'value'=>'mixed'],
'variant_not' => ['mixed', 'value'=>'mixed'],
'variant_or' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_pow' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_round' => ['mixed', 'value'=>'mixed', 'decimals'=>'int'],
'variant_set' => ['void', 'variant'=>'object', 'value'=>'mixed'],
'variant_set_type' => ['void', 'variant'=>'object', 'type'=>'int'],
'variant_sub' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'variant_xor' => ['mixed', 'left'=>'mixed', 'right'=>'mixed'],
'VarnishAdmin::__construct' => ['void', 'args='=>'array'],
'VarnishAdmin::auth' => ['bool'],
'VarnishAdmin::ban' => ['int', 'vcl_regex'=>'string'],
'VarnishAdmin::banUrl' => ['int', 'vcl_regex'=>'string'],
'VarnishAdmin::clearPanic' => ['int'],
'VarnishAdmin::connect' => ['bool'],
'VarnishAdmin::disconnect' => ['bool'],
'VarnishAdmin::getPanic' => ['string'],
'VarnishAdmin::getParams' => ['array'],
'VarnishAdmin::isRunning' => ['bool'],
'VarnishAdmin::setCompat' => ['void', 'compat'=>'int'],
'VarnishAdmin::setHost' => ['void', 'host'=>'string'],
'VarnishAdmin::setIdent' => ['void', 'ident'=>'string'],
'VarnishAdmin::setParam' => ['int', 'name'=>'string', 'value'=>'string|int'],
'VarnishAdmin::setPort' => ['void', 'port'=>'int'],
'VarnishAdmin::setSecret' => ['void', 'secret'=>'string'],
'VarnishAdmin::setTimeout' => ['void', 'timeout'=>'int'],
'VarnishAdmin::start' => ['int'],
'VarnishAdmin::stop' => ['int'],
'VarnishLog::__construct' => ['void', 'args='=>'array'],
'VarnishLog::getLine' => ['array'],
'VarnishLog::getTagName' => ['string', 'index'=>'int'],
'VarnishStat::__construct' => ['void', 'args='=>'array'],
'VarnishStat::getSnapshot' => ['array'],
'version_compare' => ['bool', 'version1'=>'string', 'version2'=>'string', 'operator'=>'\'<\'|\'lt\'|\'<=\'|\'le\'|\'>\'|\'gt\'|\'>=\'|\'ge\'|\'==\'|\'=\'|\'eq\'|\'!=\'|\'<>\'|\'ne\''],
'version_compare\'1' => ['int', 'version1'=>'string', 'version2'=>'string'],
'vfprintf' => ['int', 'stream'=>'resource', 'format'=>'string', 'values'=>'array'],
'virtual' => ['bool', 'uri'=>'string'],
'vpopmail_add_alias_domain' => ['bool', 'domain'=>'string', 'aliasdomain'=>'string'],
'vpopmail_add_alias_domain_ex' => ['bool', 'olddomain'=>'string', 'newdomain'=>'string'],
'vpopmail_add_domain' => ['bool', 'domain'=>'string', 'dir'=>'string', 'uid'=>'int', 'gid'=>'int'],
'vpopmail_add_domain_ex' => ['bool', 'domain'=>'string', 'passwd'=>'string', 'quota='=>'string', 'bounce='=>'string', 'apop='=>'bool'],
'vpopmail_add_user' => ['bool', 'user'=>'string', 'domain'=>'string', 'password'=>'string', 'gecos='=>'string', 'apop='=>'bool'],
'vpopmail_alias_add' => ['bool', 'user'=>'string', 'domain'=>'string', 'alias'=>'string'],
'vpopmail_alias_del' => ['bool', 'user'=>'string', 'domain'=>'string'],
'vpopmail_alias_del_domain' => ['bool', 'domain'=>'string'],
'vpopmail_alias_get' => ['array', 'alias'=>'string', 'domain'=>'string'],
'vpopmail_alias_get_all' => ['array', 'domain'=>'string'],
'vpopmail_auth_user' => ['bool', 'user'=>'string', 'domain'=>'string', 'password'=>'string', 'apop='=>'string'],
'vpopmail_del_domain' => ['bool', 'domain'=>'string'],
'vpopmail_del_domain_ex' => ['bool', 'domain'=>'string'],
'vpopmail_del_user' => ['bool', 'user'=>'string', 'domain'=>'string'],
'vpopmail_error' => ['string'],
'vpopmail_passwd' => ['bool', 'user'=>'string', 'domain'=>'string', 'password'=>'string', 'apop='=>'bool'],
'vpopmail_set_user_quota' => ['bool', 'user'=>'string', 'domain'=>'string', 'quota'=>'string'],
'vprintf' => ['int', 'format'=>'string', 'values'=>'array'],
'vsprintf' => ['string', 'format'=>'string', 'values'=>'array'],
'Vtiful\Kernel\Chart::__construct' => ['void', 'handle'=>'resource', 'type'=>'int'],
'Vtiful\Kernel\Chart::axisNameX' => ['Vtiful\Kernel\Chart', 'name'=>'string'],
'Vtiful\Kernel\Chart::axisNameY' => ['Vtiful\Kernel\Chart', 'name'=>'string'],
'Vtiful\Kernel\Chart::legendSetPosition' => ['Vtiful\Kernel\Chart', 'type'=>'int'],
'Vtiful\Kernel\Chart::series' => ['Vtiful\Kernel\Chart', 'value'=>'string', 'categories='=>'string'],
'Vtiful\Kernel\Chart::seriesName' => ['Vtiful\Kernel\Chart', 'value'=>'string'],
'Vtiful\Kernel\Chart::style' => ['Vtiful\Kernel\Chart', 'style'=>'int'],
'Vtiful\Kernel\Chart::title' => ['Vtiful\Kernel\Chart', 'title'=>'string'],
'Vtiful\Kernel\Chart::toResource' => ['resource'],
'Vtiful\Kernel\Excel::__construct' => ['void', 'config'=>'array'],
'Vtiful\Kernel\Excel::activateSheet' => ['bool', 'sheet_name'=>'string'],
'Vtiful\Kernel\Excel::addSheet' => ['Vtiful\Kernel\Excel', 'sheet_name='=>'?string'],
'Vtiful\Kernel\Excel::autoFilter' => ['Vtiful\Kernel\Excel', 'range'=>'string'],
'Vtiful\Kernel\Excel::checkoutSheet' => ['Vtiful\Kernel\Excel', 'sheet_name'=>'string'],
'Vtiful\Kernel\Excel::close' => ['Vtiful\Kernel\Excel'],
'Vtiful\Kernel\Excel::columnIndexFromString' => ['int', 'index'=>'string'],
'Vtiful\Kernel\Excel::constMemory' => ['Vtiful\Kernel\Excel', 'file_name'=>'string', 'sheet_name='=>'?string'],
'Vtiful\Kernel\Excel::data' => ['Vtiful\Kernel\Excel', 'data'=>'array'],
'Vtiful\Kernel\Excel::defaultFormat' => ['Vtiful\Kernel\Excel', 'format_handle'=>'resource'],
'Vtiful\Kernel\Excel::existSheet' => ['bool', 'sheet_name'=>'string'],
'Vtiful\Kernel\Excel::fileName' => ['Vtiful\Kernel\Excel', 'file_name'=>'string', 'sheet_name='=>'?string'],
'Vtiful\Kernel\Excel::freezePanes' => ['Vtiful\Kernel\Excel', 'row'=>'int', 'column'=>'int'],
'Vtiful\Kernel\Excel::getHandle' => ['resource'],
'Vtiful\Kernel\Excel::getSheetData' => ['array|false'],
'Vtiful\Kernel\Excel::gridline' => ['Vtiful\Kernel\Excel', 'option='=>'int'],
'Vtiful\Kernel\Excel::header' => ['Vtiful\Kernel\Excel', 'header'=>'array', 'format_handle='=>'?resource'],
'Vtiful\Kernel\Excel::insertChart' => ['Vtiful\Kernel\Excel', 'row'=>'int', 'column'=>'int', 'chart_resource'=>'resource'],
'Vtiful\Kernel\Excel::insertComment' => ['Vtiful\Kernel\Excel', 'row'=>'int', 'column'=>'int', 'comment'=>'string'],
'Vtiful\Kernel\Excel::insertDate' => ['Vtiful\Kernel\Excel', 'row'=>'int', 'column'=>'int', 'timestamp'=>'int', 'format='=>'?string', 'format_handle='=>'?resource'],
'Vtiful\Kernel\Excel::insertFormula' => ['Vtiful\Kernel\Excel', 'row'=>'int', 'column'=>'int', 'formula'=>'string', 'format_handle='=>'?resource'],
'Vtiful\Kernel\Excel::insertImage' => ['Vtiful\Kernel\Excel', 'row'=>'int', 'column'=>'int', 'image'=>'string', 'width='=>'?float', 'height='=>'?float'],
'Vtiful\Kernel\Excel::insertText' => ['Vtiful\Kernel\Excel', 'row'=>'int', 'column'=>'int', 'data'=>'int|string|double', 'format='=>'?string', 'format_handle='=>'?resource'],
'Vtiful\Kernel\Excel::insertUrl' => ['Vtiful\Kernel\Excel', 'row'=>'int', 'column'=>'int', 'url'=>'string', 'text='=>'?string', 'tool_tip='=>'?string', 'format='=>'?resource'],
'Vtiful\Kernel\Excel::mergeCells' => ['Vtiful\Kernel\Excel', 'range'=>'string', 'data'=>'string', 'format_handle='=>'?resource'],
'Vtiful\Kernel\Excel::nextCellCallback' => ['void', 'fci'=>'callable(int,int,mixed)', 'sheet_name='=>'?string'],
'Vtiful\Kernel\Excel::nextRow' => ['array|false', 'zv_type_t='=>'?array'],
'Vtiful\Kernel\Excel::openFile' => ['Vtiful\Kernel\Excel', 'zs_file_name'=>'string'],
'Vtiful\Kernel\Excel::openSheet' => ['Vtiful\Kernel\Excel', 'zs_sheet_name='=>'?string', 'zl_flag='=>'?int'],
'Vtiful\Kernel\Excel::output' => ['string'],
'Vtiful\Kernel\Excel::protection' => ['Vtiful\Kernel\Excel', 'password='=>'?string'],
'Vtiful\Kernel\Excel::putCSV' => ['bool', 'fp'=>'resource', 'delimiter_str='=>'?string', 'enclosure_str='=>'?string', 'escape_str='=>'?string'],
'Vtiful\Kernel\Excel::putCSVCallback' => ['bool', 'callback'=>'callable(array):array', 'fp'=>'resource', 'delimiter_str='=>'?string', 'enclosure_str='=>'?string', 'escape_str='=>'?string'],
'Vtiful\Kernel\Excel::setColumn' => ['Vtiful\Kernel\Excel', 'range'=>'string', 'width'=>'float', 'format_handle='=>'?resource'],
'Vtiful\Kernel\Excel::setCurrentSheetHide' => ['Vtiful\Kernel\Excel'],
'Vtiful\Kernel\Excel::setCurrentSheetIsFirst' => ['Vtiful\Kernel\Excel'],
'Vtiful\Kernel\Excel::setGlobalType' => ['Vtiful\Kernel\Excel', 'zv_type_t'=>'int'],
'Vtiful\Kernel\Excel::setLandscape' => ['Vtiful\Kernel\Excel'],
'Vtiful\Kernel\Excel::setMargins' => ['Vtiful\Kernel\Excel', 'left='=>'?float', 'right='=>'?float', 'top='=>'?float', 'bottom='=>'?float'],
'Vtiful\Kernel\Excel::setPaper' => ['Vtiful\Kernel\Excel', 'paper'=>'int'],
'Vtiful\Kernel\Excel::setPortrait' => ['Vtiful\Kernel\Excel'],
'Vtiful\Kernel\Excel::setRow' => ['Vtiful\Kernel\Excel', 'range'=>'string', 'height'=>'float', 'format_handle='=>'?resource'],
'Vtiful\Kernel\Excel::setSkipRows' => ['Vtiful\Kernel\Excel', 'zv_skip_t'=>'int'],
'Vtiful\Kernel\Excel::setType' => ['Vtiful\Kernel\Excel', 'zv_type_t'=>'array'],
'Vtiful\Kernel\Excel::sheetList' => ['array'],
'Vtiful\Kernel\Excel::showComment' => ['Vtiful\Kernel\Excel'],
'Vtiful\Kernel\Excel::stringFromColumnIndex' => ['string', 'index'=>'int'],
'Vtiful\Kernel\Excel::timestampFromDateDouble' => ['int', 'index'=>'?float'],
'Vtiful\Kernel\Excel::validation' => ['Vtiful\Kernel\Excel', 'range'=>'string', 'validation_resource'=>'resource'],
'Vtiful\Kernel\Excel::zoom' => ['Vtiful\Kernel\Excel', 'scale'=>'int'],
'Vtiful\Kernel\Format::__construct' => ['void', 'handle'=>'resource'],
'Vtiful\Kernel\Format::align' => ['Vtiful\Kernel\Format', '...style'=>'int'],
'Vtiful\Kernel\Format::background' => ['Vtiful\Kernel\Format', 'color'=>'int', 'pattern='=>'int'],
'Vtiful\Kernel\Format::bold' => ['Vtiful\Kernel\Format'],
'Vtiful\Kernel\Format::border' => ['Vtiful\Kernel\Format', 'style'=>'int'],
'Vtiful\Kernel\Format::font' => ['Vtiful\Kernel\Format', 'font'=>'string'],
'Vtiful\Kernel\Format::fontColor' => ['Vtiful\Kernel\Format', 'color'=>'int'],
'Vtiful\Kernel\Format::fontSize' => ['Vtiful\Kernel\Format', 'size'=>'float'],
'Vtiful\Kernel\Format::italic' => ['Vtiful\Kernel\Format'],
'Vtiful\Kernel\Format::number' => ['Vtiful\Kernel\Format', 'format'=>'string'],
'Vtiful\Kernel\Format::strikeout' => ['Vtiful\Kernel\Format'],
'Vtiful\Kernel\Format::toResource' => ['resource'],
'Vtiful\Kernel\Format::underline' => ['Vtiful\Kernel\Format', 'style'=>'int'],
'Vtiful\Kernel\Format::unlocked' => ['Vtiful\Kernel\Format'],
'Vtiful\Kernel\Format::wrap' => ['Vtiful\Kernel\Format'],
'Vtiful\Kernel\Validation::__construct' => ['void'],
'Vtiful\Kernel\Validation::criteriaType' => ['?Vtiful\Kernel\Validation', 'type'=>'int'],
'Vtiful\Kernel\Validation::maximumFormula' => ['?Vtiful\Kernel\Validation', 'maximum_formula'=>'string'],
'Vtiful\Kernel\Validation::maximumNumber' => ['?Vtiful\Kernel\Validation', 'maximum_number'=>'float'],
'Vtiful\Kernel\Validation::minimumFormula' => ['?Vtiful\Kernel\Validation', 'minimum_formula'=>'string'],
'Vtiful\Kernel\Validation::minimumNumber' => ['?Vtiful\Kernel\Validation', 'minimum_number'=>'float'],
'Vtiful\Kernel\Validation::toResource' => ['resource'],
'Vtiful\Kernel\Validation::validationType' => ['?Vtiful\Kernel\Validation', 'type'=>'int'],
'Vtiful\Kernel\Validation::valueList' => ['?Vtiful\Kernel\Validation', 'value_list'=>'array'],
'Vtiful\Kernel\Validation::valueNumber' => ['?Vtiful\Kernel\Validation', 'value_number'=>'int'],
'w32api_deftype' => ['bool', 'typename'=>'string', 'member1_type'=>'string', 'member1_name'=>'string', '...args='=>'string'],
'w32api_init_dtype' => ['resource', 'typename'=>'string', 'value'=>'', '...args='=>''],
'w32api_invoke_function' => ['', 'funcname'=>'string', 'argument'=>'', '...args='=>''],
'w32api_register_function' => ['bool', 'library'=>'string', 'function_name'=>'string', 'return_type'=>'string'],
'w32api_set_call_method' => ['', 'method'=>'int'],
'wddx_add_vars' => ['bool', 'packet_id'=>'resource', 'var_names'=>'mixed', '...vars='=>'mixed'],
'wddx_deserialize' => ['mixed', 'packet'=>'string'],
'wddx_packet_end' => ['string', 'packet_id'=>'resource'],
'wddx_packet_start' => ['resource|false', 'comment='=>'string'],
'wddx_serialize_value' => ['string|false', 'value'=>'mixed', 'comment='=>'string'],
'wddx_serialize_vars' => ['string|false', 'var_name'=>'mixed', '...vars='=>'mixed'],
'WeakMap::__construct' => ['void'],
'WeakMap::count' => ['int'],
'WeakMap::current' => ['mixed'],
'WeakMap::key' => ['object'],
'WeakMap::next' => ['void'],
'WeakMap::offsetExists' => ['bool', 'object'=>'object'],
'WeakMap::offsetGet' => ['mixed', 'object'=>'object'],
'WeakMap::offsetSet' => ['void', 'object'=>'object', 'value'=>'mixed'],
'WeakMap::offsetUnset' => ['void', 'object'=>'object'],
'WeakMap::rewind' => ['void'],
'WeakMap::valid' => ['bool'],
'Weakref::acquire' => ['bool'],
'Weakref::get' => ['object'],
'Weakref::release' => ['bool'],
'Weakref::valid' => ['bool'],
'webObj::convertToString' => ['string'],
'webObj::free' => ['void'],
'webObj::set' => ['int', 'property_name'=>'string', 'new_value'=>''],
'webObj::updateFromString' => ['int', 'snippet'=>'string'],
'win32_continue_service' => ['int|false', 'servicename'=>'string', 'machine='=>'string'],
'win32_create_service' => ['int|false', 'details'=>'array', 'machine='=>'string'],
'win32_delete_service' => ['int|false', 'servicename'=>'string', 'machine='=>'string'],
'win32_get_last_control_message' => ['int'],
'win32_pause_service' => ['int|false', 'servicename'=>'string', 'machine='=>'string'],
'win32_ps_list_procs' => ['array'],
'win32_ps_stat_mem' => ['array'],
'win32_ps_stat_proc' => ['array', 'pid='=>'int'],
'win32_query_service_status' => ['array|false|int', 'servicename'=>'string', 'machine='=>'string'],
'win32_send_custom_control' => ['int', 'servicename'=>'string', 'control'=>'int', 'machine='=>'string'],
'win32_set_service_exit_code' => ['int', 'exitCode='=>'int'],
'win32_set_service_exit_mode' => ['bool', 'gracefulMode='=>'bool'],
'win32_set_service_status' => ['bool|int', 'status'=>'int', 'checkpoint='=>'int'],
'win32_start_service' => ['int|false', 'servicename'=>'string', 'machine='=>'string'],
'win32_start_service_ctrl_dispatcher' => ['bool|int', 'name'=>'string'],
'win32_stop_service' => ['int|false', 'servicename'=>'string', 'machine='=>'string'],
'wincache_fcache_fileinfo' => ['array|false', 'summaryonly='=>'bool'],
'wincache_fcache_meminfo' => ['array|false'],
'wincache_lock' => ['bool', 'key'=>'string', 'isglobal='=>'bool'],
'wincache_ocache_fileinfo' => ['array|false', 'summaryonly='=>'bool'],
'wincache_ocache_meminfo' => ['array|false'],
'wincache_refresh_if_changed' => ['bool', 'files='=>'array'],
'wincache_rplist_fileinfo' => ['array|false', 'summaryonly='=>'bool'],
'wincache_rplist_meminfo' => ['array|false'],
'wincache_scache_info' => ['array|false', 'summaryonly='=>'bool'],
'wincache_scache_meminfo' => ['array|false'],
'wincache_ucache_add' => ['bool', 'key'=>'string', 'value'=>'mixed', 'ttl='=>'int'],
'wincache_ucache_add\'1' => ['bool', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'],
'wincache_ucache_cas' => ['bool', 'key'=>'string', 'old_value'=>'int', 'new_value'=>'int'],
'wincache_ucache_clear' => ['bool'],
'wincache_ucache_dec' => ['int|false', 'key'=>'string', 'dec_by='=>'int', 'success='=>'bool'],
'wincache_ucache_delete' => ['bool', 'key'=>'mixed'],
'wincache_ucache_exists' => ['bool', 'key'=>'string'],
'wincache_ucache_get' => ['mixed', 'key'=>'mixed', '&w_success='=>'bool'],
'wincache_ucache_inc' => ['int|false', 'key'=>'string', 'inc_by='=>'int', 'success='=>'bool'],
'wincache_ucache_info' => ['array|false', 'summaryonly='=>'bool', 'key='=>'string'],
'wincache_ucache_meminfo' => ['array|false'],
'wincache_ucache_set' => ['bool', 'key'=>'', 'value'=>'', 'ttl='=>'int'],
'wincache_ucache_set\'1' => ['bool', 'values'=>'array', 'unused='=>'', 'ttl='=>'int'],
'wincache_unlock' => ['bool', 'key'=>'string'],
'wkhtmltox\image\converter::convert' => ['?string'],
'wkhtmltox\image\converter::getVersion' => ['string'],
'wkhtmltox\pdf\converter::add' => ['void', 'object'=>'wkhtmltox\PDF\Object'],
'wkhtmltox\pdf\converter::convert' => ['?string'],
'wkhtmltox\pdf\converter::getVersion' => ['string'],
'wordwrap' => ['string', 'string'=>'string', 'width='=>'int', 'break='=>'string', 'cut_long_words='=>'bool'],
'Worker::__construct' => ['void'],
'Worker::addRef' => ['void'],
'Worker::chunk' => ['array', 'size'=>'int', 'preserve'=>'bool'],
'Worker::collect' => ['int', 'collector='=>'Callable'],
'Worker::count' => ['int'],
'Worker::delRef' => ['void'],
'Worker::detach' => ['void'],
'Worker::extend' => ['bool', 'class'=>'string'],
'Worker::getCreatorId' => ['int'],
'Worker::getCurrentThread' => ['Thread'],
'Worker::getCurrentThreadId' => ['int'],
'Worker::getRefCount' => ['int'],
'Worker::getStacked' => ['int'],
'Worker::getTerminationInfo' => ['array'],
'Worker::getThreadId' => ['int'],
'Worker::globally' => ['mixed'],
'Worker::isGarbage' => ['bool'],
'Worker::isJoined' => ['bool'],
'Worker::isRunning' => ['bool'],
'Worker::isShutdown' => ['bool'],
'Worker::isStarted' => ['bool'],
'Worker::isTerminated' => ['bool'],
'Worker::isWaiting' => ['bool'],
'Worker::isWorking' => ['bool'],
'Worker::join' => ['bool'],
'Worker::kill' => ['bool'],
'Worker::lock' => ['bool'],
'Worker::merge' => ['bool', 'from'=>'', 'overwrite='=>'mixed'],
'Worker::notify' => ['bool'],
'Worker::notifyOne' => ['bool'],
'Worker::offsetExists' => ['bool', 'offset'=>'mixed'],
'Worker::offsetGet' => ['mixed', 'offset'=>'mixed'],
'Worker::offsetSet' => ['void', 'offset'=>'mixed', 'value'=>'mixed'],
'Worker::offsetUnset' => ['void', 'offset'=>'mixed'],
'Worker::pop' => ['bool'],
'Worker::run' => ['void'],
'Worker::setGarbage' => ['void'],
'Worker::shift' => ['bool'],
'Worker::shutdown' => ['bool'],
'Worker::stack' => ['int', '&rw_work'=>'Threaded'],
'Worker::start' => ['bool', 'options='=>'int'],
'Worker::synchronized' => ['mixed', 'block'=>'Closure', '_='=>'mixed'],
'Worker::unlock' => ['bool'],
'Worker::unstack' => ['int', '&rw_work='=>'Threaded'],
'Worker::wait' => ['bool', 'timeout='=>'int'],
'xattr_get' => ['string', 'filename'=>'string', 'name'=>'string', 'flags='=>'int'],
'xattr_list' => ['array', 'filename'=>'string', 'flags='=>'int'],
'xattr_remove' => ['bool', 'filename'=>'string', 'name'=>'string', 'flags='=>'int'],
'xattr_set' => ['bool', 'filename'=>'string', 'name'=>'string', 'value'=>'string', 'flags='=>'int'],
'xattr_supported' => ['bool', 'filename'=>'string', 'flags='=>'int'],
'xcache_asm' => ['string', 'filename'=>'string'],
'xcache_clear_cache' => ['void', 'type'=>'int', 'id='=>'int'],
'xcache_coredump' => ['string', 'op_type'=>'int'],
'xcache_count' => ['int', 'type'=>'int'],
'xcache_coverager_decode' => ['array', 'data'=>'string'],
'xcache_coverager_get' => ['array', 'clean='=>'bool'],
'xcache_coverager_start' => ['void', 'clean='=>'bool'],
'xcache_coverager_stop' => ['void', 'clean='=>'bool'],
'xcache_dasm_file' => ['string', 'filename'=>'string'],
'xcache_dasm_string' => ['string', 'code'=>'string'],
'xcache_dec' => ['int', 'name'=>'string', 'value='=>'int|mixed', 'ttl='=>'int'],
'xcache_decode' => ['bool', 'filename'=>'string'],
'xcache_encode' => ['string', 'filename'=>'string'],
'xcache_get' => ['mixed', 'name'=>'string'],
'xcache_get_data_type' => ['string', 'type'=>'int'],
'xcache_get_op_spec' => ['string', 'op_type'=>'int'],
'xcache_get_op_type' => ['string', 'op_type'=>'int'],
'xcache_get_opcode' => ['string', 'opcode'=>'int'],
'xcache_get_opcode_spec' => ['string', 'opcode'=>'int'],
'xcache_inc' => ['int', 'name'=>'string', 'value='=>'int|mixed', 'ttl='=>'int'],
'xcache_info' => ['array', 'type'=>'int', 'id'=>'int'],
'xcache_is_autoglobal' => ['string', 'name'=>'string'],
'xcache_isset' => ['bool', 'name'=>'string'],
'xcache_list' => ['array', 'type'=>'int', 'id'=>'int'],
'xcache_set' => ['bool', 'name'=>'string', 'value'=>'mixed', 'ttl='=>'int'],
'xcache_unset' => ['bool', 'name'=>'string'],
'xcache_unset_by_prefix' => ['bool', 'prefix'=>'string'],
'Xcom::__construct' => ['void', 'fabric_url='=>'string', 'fabric_token='=>'string', 'capability_token='=>'string'],
'Xcom::decode' => ['object', 'avro_msg'=>'string', 'json_schema'=>'string'],
'Xcom::encode' => ['string', 'data'=>'stdClass', 'avro_schema'=>'string'],
'Xcom::getDebugOutput' => ['string'],
'Xcom::getLastResponse' => ['string'],
'Xcom::getLastResponseInfo' => ['array'],
'Xcom::getOnboardingURL' => ['string', 'capability_name'=>'string', 'agreement_url'=>'string'],
'Xcom::send' => ['int', 'topic'=>'string', 'data'=>'mixed', 'json_schema='=>'string', 'http_headers='=>'array'],
'Xcom::sendAsync' => ['int', 'topic'=>'string', 'data'=>'mixed', 'json_schema='=>'string', 'http_headers='=>'array'],
'xdebug_break' => ['bool'],
'xdebug_call_class' => ['string', 'depth='=>'int'],
'xdebug_call_file' => ['string', 'depth='=>'int'],
'xdebug_call_function' => ['string', 'depth='=>'int'],
'xdebug_call_line' => ['int', 'depth='=>'int'],
'xdebug_clear_aggr_profiling_data' => ['bool'],
'xdebug_code_coverage_started' => ['bool'],
'xdebug_debug_zval' => ['void', '...varName'=>'string'],
'xdebug_debug_zval_stdout' => ['void', '...varName'=>'string'],
'xdebug_disable' => ['void'],
'xdebug_dump_aggr_profiling_data' => ['bool'],
'xdebug_dump_superglobals' => ['void'],
'xdebug_enable' => ['void'],
'xdebug_get_code_coverage' => ['array'],
'xdebug_get_collected_errors' => ['string', 'clean='=>'bool'],
'xdebug_get_declared_vars' => ['array'],
'xdebug_get_formatted_function_stack' => [''],
'xdebug_get_function_count' => ['int'],
'xdebug_get_function_stack' => ['array', 'message='=>'string', 'options='=>'int'],
'xdebug_get_headers' => ['array'],
'xdebug_get_monitored_functions' => ['array'],
'xdebug_get_profiler_filename' => ['string|false'],
'xdebug_get_stack_depth' => ['int'],
'xdebug_get_tracefile_name' => ['string'],
'xdebug_is_debugger_active' => ['bool'],
'xdebug_is_enabled' => ['bool'],
'xdebug_memory_usage' => ['int'],
'xdebug_peak_memory_usage' => ['int'],
'xdebug_print_function_stack' => ['array', 'message='=>'string', 'options='=>'int'],
'xdebug_set_filter' => ['void', 'group'=>'int', 'list_type'=>'int', 'configuration'=>'array'],
'xdebug_start_code_coverage' => ['void', 'options='=>'int'],
'xdebug_start_error_collection' => ['void'],
'xdebug_start_function_monitor' => ['void', 'list_of_functions_to_monitor'=>'string[]'],
'xdebug_start_trace' => ['void', 'trace_file'=>'', 'options='=>'int|mixed'],
'xdebug_stop_code_coverage' => ['void', 'cleanup='=>'bool'],
'xdebug_stop_error_collection' => ['void'],
'xdebug_stop_function_monitor' => ['void'],
'xdebug_stop_trace' => ['void'],
'xdebug_time_index' => ['float'],
'xdebug_var_dump' => ['void', '...var'=>''],
'xdiff_file_bdiff' => ['bool', 'old_file'=>'string', 'new_file'=>'string', 'dest'=>'string'],
'xdiff_file_bdiff_size' => ['int', 'file'=>'string'],
'xdiff_file_bpatch' => ['bool', 'file'=>'string', 'patch'=>'string', 'dest'=>'string'],
'xdiff_file_diff' => ['bool', 'old_file'=>'string', 'new_file'=>'string', 'dest'=>'string', 'context='=>'int', 'minimal='=>'bool'],
'xdiff_file_diff_binary' => ['bool', 'old_file'=>'string', 'new_file'=>'string', 'dest'=>'string'],
'xdiff_file_merge3' => ['mixed', 'old_file'=>'string', 'new_file1'=>'string', 'new_file2'=>'string', 'dest'=>'string'],
'xdiff_file_patch' => ['mixed', 'file'=>'string', 'patch'=>'string', 'dest'=>'string', 'flags='=>'int'],
'xdiff_file_patch_binary' => ['bool', 'file'=>'string', 'patch'=>'string', 'dest'=>'string'],
'xdiff_file_rabdiff' => ['bool', 'old_file'=>'string', 'new_file'=>'string', 'dest'=>'string'],
'xdiff_string_bdiff' => ['string', 'old_data'=>'string', 'new_data'=>'string'],
'xdiff_string_bdiff_size' => ['int', 'patch'=>'string'],
'xdiff_string_bpatch' => ['string', 'string'=>'string', 'patch'=>'string'],
'xdiff_string_diff' => ['string', 'old_data'=>'string', 'new_data'=>'string', 'context='=>'int', 'minimal='=>'bool'],
'xdiff_string_diff_binary' => ['string', 'old_data'=>'string', 'new_data'=>'string'],
'xdiff_string_merge3' => ['mixed', 'old_data'=>'string', 'new_data1'=>'string', 'new_data2'=>'string', 'error='=>'string'],
'xdiff_string_patch' => ['string', 'string'=>'string', 'patch'=>'string', 'flags='=>'int', '&w_error='=>'string'],
'xdiff_string_patch_binary' => ['string', 'string'=>'string', 'patch'=>'string'],
'xdiff_string_rabdiff' => ['string', 'old_data'=>'string', 'new_data'=>'string'],
'xhprof_disable' => ['array'],
'xhprof_enable' => ['void', 'flags='=>'int', 'options='=>'array'],
'xhprof_sample_disable' => ['array'],
'xhprof_sample_enable' => ['void'],
'xlswriter_get_author' => ['string'],
'xlswriter_get_version' => ['string'],
'xml_error_string' => ['string', 'error_code'=>'int'],
'xml_get_current_byte_index' => ['int|false', 'parser'=>'XMLParser'],
'xml_get_current_column_number' => ['int|false', 'parser'=>'XMLParser'],
'xml_get_current_line_number' => ['int|false', 'parser'=>'XMLParser'],
'xml_get_error_code' => ['int|false', 'parser'=>'XMLParser'],
'xml_parse' => ['int', 'parser'=>'XMLParser', 'data'=>'string', 'is_final='=>'bool'],
'xml_parse_into_struct' => ['int', 'parser'=>'XMLParser', 'data'=>'string', '&w_values'=>'array', '&w_index='=>'array'],
'xml_parser_create' => ['XMLParser', 'encoding='=>'string'],
'xml_parser_create_ns' => ['XMLParser', 'encoding='=>'string', 'separator='=>'string'],
'xml_parser_free' => ['bool', 'parser'=>'XMLParser'],
'xml_parser_get_option' => ['mixed|false', 'parser'=>'XMLParser', 'option'=>'int'],
'xml_parser_set_option' => ['bool', 'parser'=>'XMLParser', 'option'=>'int', 'value'=>'mixed'],
'xml_set_character_data_handler' => ['bool', 'parser'=>'XMLParser', 'handler'=>'callable'],
'xml_set_default_handler' => ['bool', 'parser'=>'XMLParser', 'handler'=>'callable'],
'xml_set_element_handler' => ['bool', 'parser'=>'XMLParser', 'start_handler'=>'callable', 'end_handler'=>'callable'],
'xml_set_end_namespace_decl_handler' => ['bool', 'parser'=>'XMLParser', 'handler'=>'callable'],
'xml_set_external_entity_ref_handler' => ['bool', 'parser'=>'XMLParser', 'handler'=>'callable'],
'xml_set_notation_decl_handler' => ['bool', 'parser'=>'XMLParser', 'handler'=>'callable'],
'xml_set_object' => ['bool', 'parser'=>'XMLParser', 'object'=>'object'],
'xml_set_processing_instruction_handler' => ['bool', 'parser'=>'XMLParser', 'handler'=>'callable'],
'xml_set_start_namespace_decl_handler' => ['bool', 'parser'=>'XMLParser', 'handler'=>'callable'],
'xml_set_unparsed_entity_decl_handler' => ['bool', 'parser'=>'XMLParser', 'handler'=>'callable'],
'XMLDiff\Base::__construct' => ['void', 'nsname'=>'string'],
'XMLDiff\Base::diff' => ['mixed', 'from'=>'mixed', 'to'=>'mixed'],
'XMLDiff\Base::merge' => ['mixed', 'src'=>'mixed', 'diff'=>'mixed'],
'XMLDiff\DOM::diff' => ['DOMDocument', 'from'=>'DOMDocument', 'to'=>'DOMDocument'],
'XMLDiff\DOM::merge' => ['DOMDocument', 'src'=>'DOMDocument', 'diff'=>'DOMDocument'],
'XMLDiff\File::diff' => ['string', 'from'=>'string', 'to'=>'string'],
'XMLDiff\File::merge' => ['string', 'src'=>'string', 'diff'=>'string'],
'XMLDiff\Memory::diff' => ['string', 'from'=>'string', 'to'=>'string'],
'XMLDiff\Memory::merge' => ['string', 'src'=>'string', 'diff'=>'string'],
'XMLReader::close' => ['bool'],
'XMLReader::expand' => ['DOMNode|false', 'basenode='=>'DOMNode'],
'XMLReader::getAttribute' => ['?string', 'name'=>'string'],
'XMLReader::getAttributeNo' => ['?string', 'index'=>'int'],
'XMLReader::getAttributeNs' => ['?string', 'name'=>'string', 'namespaceuri'=>'string'],
'XMLReader::getParserProperty' => ['bool', 'property'=>'int'],
'XMLReader::isValid' => ['bool'],
'XMLReader::lookupNamespace' => ['?string', 'prefix'=>'string'],
'XMLReader::moveToAttribute' => ['bool', 'name'=>'string'],
'XMLReader::moveToAttributeNo' => ['bool', 'index'=>'int'],
'XMLReader::moveToAttributeNs' => ['bool', 'localname'=>'string', 'namespaceuri'=>'string'],
'XMLReader::moveToElement' => ['bool'],
'XMLReader::moveToFirstAttribute' => ['bool'],
'XMLReader::moveToNextAttribute' => ['bool'],
'XMLReader::next' => ['bool', 'localname='=>'string'],
'XMLReader::open' => ['bool', 'uri'=>'string', 'encoding='=>'?string', 'options='=>'int'],
'XMLReader::read' => ['bool'],
'XMLReader::readInnerXML' => ['string'],
'XMLReader::readOuterXML' => ['string'],
'XMLReader::readString' => ['string'],
'XMLReader::setParserProperty' => ['bool', 'property'=>'int', 'value'=>'bool'],
'XMLReader::setRelaxNGSchema' => ['bool', 'filename'=>'string'],
'XMLReader::setRelaxNGSchemaSource' => ['bool', 'source'=>'string'],
'XMLReader::setSchema' => ['bool', 'filename'=>'string'],
'XMLReader::XML' => ['bool', 'source'=>'string', 'encoding='=>'?string', 'options='=>'int'],
'xmlrpc_decode' => ['mixed', 'xml'=>'string', 'encoding='=>'string'],
'xmlrpc_decode_request' => ['?array', 'xml'=>'string', '&w_method'=>'string', 'encoding='=>'string'],
'xmlrpc_encode' => ['string', 'value'=>'mixed'],
'xmlrpc_encode_request' => ['string', 'method'=>'string', 'params'=>'mixed', 'output_options='=>'array'],
'xmlrpc_get_type' => ['string', 'value'=>'mixed'],
'xmlrpc_is_fault' => ['bool', 'arg'=>'array'],
'xmlrpc_parse_method_descriptions' => ['array', 'xml'=>'string'],
'xmlrpc_server_add_introspection_data' => ['int', 'server'=>'resource', 'desc'=>'array'],
'xmlrpc_server_call_method' => ['string', 'server'=>'resource', 'xml'=>'string', 'user_data'=>'mixed', 'output_options='=>'array'],
'xmlrpc_server_create' => ['resource'],
'xmlrpc_server_destroy' => ['int', 'server'=>'resource'],
'xmlrpc_server_register_introspection_callback' => ['bool', 'server'=>'resource', 'function'=>'string'],
'xmlrpc_server_register_method' => ['bool', 'server'=>'resource', 'method_name'=>'string', 'function'=>'string'],
'xmlrpc_set_type' => ['bool', '&rw_value'=>'string|DateTime', 'type'=>'string'],
'XMLWriter::endAttribute' => ['bool'],
'XMLWriter::endCdata' => ['bool'],
'XMLWriter::endComment' => ['bool'],
'XMLWriter::endDocument' => ['bool'],
'XMLWriter::endDtd' => ['bool'],
'XMLWriter::endDtdAttlist' => ['bool'],
'XMLWriter::endDtdElement' => ['bool'],
'XMLWriter::endDtdEntity' => ['bool'],
'XMLWriter::endElement' => ['bool'],
'XMLWriter::endPi' => ['bool'],
'XMLWriter::flush' => ['string|int', 'empty='=>'bool'],
'XMLWriter::fullEndElement' => ['bool'],
'XMLWriter::openMemory' => ['bool'],
'XMLWriter::openUri' => ['bool', 'uri'=>'string'],
'XMLWriter::outputMemory' => ['string', 'flush='=>'bool'],
'XMLWriter::setIndent' => ['bool', 'enable'=>'bool'],
'XMLWriter::setIndentString' => ['bool', 'indentation'=>'string'],
'XMLWriter::startAttribute' => ['bool', 'name'=>'string'],
'XMLWriter::startAttributeNs' => ['bool', 'prefix'=>'?string', 'name'=>'string', 'namespace'=>'?string'],
'XMLWriter::startCdata' => ['bool'],
'XMLWriter::startComment' => ['bool'],
'XMLWriter::startDocument' => ['bool', 'version='=>'?string', 'encoding='=>'?string', 'standalone='=>'?string'],
'XMLWriter::startDtd' => ['bool', 'qualifiedName'=>'string', 'publicId='=>'?string', 'systemId='=>'?string'],
'XMLWriter::startDtdAttlist' => ['bool', 'name'=>'string'],
'XMLWriter::startDtdElement' => ['bool', 'qualifiedName'=>'string'],
'XMLWriter::startDtdEntity' => ['bool', 'name'=>'string', 'isParam'=>'bool'],
'XMLWriter::startElement' => ['bool', 'name'=>'string'],
'XMLWriter::startElementNs' => ['bool', 'prefix'=>'?string', 'name'=>'string', 'namespace'=>'?string'],
'XMLWriter::startPi' => ['bool', 'target'=>'string'],
'XMLWriter::text' => ['bool', 'content'=>'string'],
'XMLWriter::writeAttribute' => ['bool', 'name'=>'string', 'value'=>'string'],
'XMLWriter::writeAttributeNs' => ['bool', 'prefix'=>'?string', 'name'=>'string', 'namespace'=>'?string', 'value'=>'string'],
'XMLWriter::writeCdata' => ['bool', 'content'=>'string'],
'XMLWriter::writeComment' => ['bool', 'content'=>'string'],
'XMLWriter::writeDtd' => ['bool', 'name'=>'string', 'publicId='=>'?string', 'systemId='=>'?string', 'content='=>'?string'],
'XMLWriter::writeDtdAttlist' => ['bool', 'name'=>'string', 'content'=>'string'],
'XMLWriter::writeDtdElement' => ['bool', 'name'=>'string', 'content'=>'string'],
'XMLWriter::writeDtdEntity' => ['bool', 'name'=>'string', 'content'=>'string', 'isParam='=>'bool', 'publicId='=>'?string', 'systemId='=>'?string', 'notationData='=>'?string'],
'XMLWriter::writeElement' => ['bool', 'name'=>'string', 'content='=>'?string'],
'XMLWriter::writeElementNs' => ['bool', 'prefix'=>'?string', 'name'=>'string', 'namespace'=>'?string', 'content='=>'?string'],
'XMLWriter::writePi' => ['bool', 'target'=>'string', 'content'=>'string'],
'XMLWriter::writeRaw' => ['bool', 'content'=>'string'],
'xmlwriter_end_attribute' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_cdata' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_comment' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_document' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_dtd' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_dtd_attlist' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_dtd_element' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_dtd_entity' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_element' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_end_pi' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_flush' => ['string|int', 'writer'=>'XMLWriter', 'empty='=>'bool'],
'xmlwriter_full_end_element' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_open_memory' => ['XMLWriter|false'],
'xmlwriter_open_uri' => ['XMLWriter|false', 'uri'=>'string'],
'xmlwriter_output_memory' => ['string', 'writer'=>'XMLWriter', 'flush='=>'bool'],
'xmlwriter_set_indent' => ['bool', 'writer'=>'XMLWriter', 'enable'=>'bool'],
'xmlwriter_set_indent_string' => ['bool', 'writer'=>'XMLWriter', 'indentation'=>'string'],
'xmlwriter_start_attribute' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string'],
'xmlwriter_start_attribute_ns' => ['bool', 'writer'=>'XMLWriter', 'prefix'=>'?string', 'name'=>'string', 'namespace'=>'?string'],
'xmlwriter_start_cdata' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_start_comment' => ['bool', 'writer'=>'XMLWriter'],
'xmlwriter_start_document' => ['bool', 'writer'=>'XMLWriter', 'version='=>'?string', 'encoding='=>'?string', 'standalone='=>'?string'],
'xmlwriter_start_dtd' => ['bool', 'writer'=>'XMLWriter', 'qualifiedName'=>'string', 'publicId='=>'?string', 'systemId='=>'?string'],
'xmlwriter_start_dtd_attlist' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string'],
'xmlwriter_start_dtd_element' => ['bool', 'writer'=>'XMLWriter', 'qualifiedName'=>'string'],
'xmlwriter_start_dtd_entity' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string', 'isParam'=>'bool'],
'xmlwriter_start_element' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string'],
'xmlwriter_start_element_ns' => ['bool', 'writer'=>'XMLWriter', 'prefix'=>'?string', 'name'=>'string', 'namespace'=>'?string'],
'xmlwriter_start_pi' => ['bool', 'writer'=>'XMLWriter', 'target'=>'string'],
'xmlwriter_text' => ['bool', 'writer'=>'XMLWriter', 'content'=>'string'],
'xmlwriter_write_attribute' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string', 'value'=>'string'],
'xmlwriter_write_attribute_ns' => ['bool', 'writer'=>'XMLWriter', 'prefix'=>'?string', 'name'=>'string', 'namespace'=>'?string', 'value'=>'string'],
'xmlwriter_write_cdata' => ['bool', 'writer'=>'XMLWriter', 'content'=>'string'],
'xmlwriter_write_comment' => ['bool', 'writer'=>'XMLWriter', 'content'=>'string'],
'xmlwriter_write_dtd' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string', 'publicId='=>'?string', 'systemId='=>'?string', 'content='=>'?string'],
'xmlwriter_write_dtd_attlist' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string', 'content'=>'string'],
'xmlwriter_write_dtd_element' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string', 'content'=>'string'],
'xmlwriter_write_dtd_entity' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string', 'content'=>'string', 'isParam='=>'bool', 'publicId='=>'?string', 'systemId='=>'?string', 'notationData='=>'?string'],
'xmlwriter_write_element' => ['bool', 'writer'=>'XMLWriter', 'name'=>'string', 'content='=>'?string'],
'xmlwriter_write_element_ns' => ['bool', 'writer'=>'XMLWriter', 'prefix'=>'?string', 'name'=>'string', 'namespace'=>'?string', 'content='=>'?string'],
'xmlwriter_write_pi' => ['bool', 'writer'=>'XMLWriter', 'target'=>'string', 'content'=>'string'],
'xmlwriter_write_raw' => ['bool', 'writer'=>'XMLWriter', 'content'=>'string'],
'xpath_new_context' => ['XPathContext', 'dom_document'=>'DOMDocument'],
'xpath_register_ns' => ['bool', 'xpath_context'=>'xpathcontext', 'prefix'=>'string', 'uri'=>'string'],
'xpath_register_ns_auto' => ['bool', 'xpath_context'=>'xpathcontext', 'context_node='=>'object'],
'xptr_new_context' => ['XPathContext'],
'xsl_xsltprocessor_get_parameter' => ['string', 'namespace'=>'string', 'name'=>'string'],
'xsl_xsltprocessor_get_security_prefs' => ['int'],
'xsl_xsltprocessor_has_exslt_support' => ['bool'],
'xsl_xsltprocessor_register_php_functions' => ['', 'restrict'=>''],
'xsl_xsltprocessor_remove_parameter' => ['bool', 'namespace'=>'string', 'name'=>'string'],
'xsl_xsltprocessor_set_parameter' => ['bool', 'namespace'=>'string', 'name'=>'', 'value'=>'string'],
'xsl_xsltprocessor_set_profiling' => ['bool', 'filename'=>'string'],
'xsl_xsltprocessor_set_security_prefs' => ['int', 'securityprefs'=>'int'],
'xsl_xsltprocessor_transform_to_uri' => ['int', 'doc'=>'DOMDocument', 'uri'=>'string'],
'xsl_xsltprocessor_transform_to_xml' => ['string', 'doc'=>'DOMDocument'],
'xslt_backend_info' => ['string'],
'xslt_backend_name' => ['string'],
'xslt_backend_version' => ['string'],
'xslt_create' => ['resource'],
'xslt_errno' => ['int', 'xh'=>''],
'xslt_error' => ['string', 'xh'=>''],
'xslt_free' => ['', 'xh'=>''],
'xslt_getopt' => ['int', 'processor'=>''],
'xslt_process' => ['', 'xh'=>'', 'xmlcontainer'=>'string', 'xslcontainer'=>'string', 'resultcontainer='=>'string', 'arguments='=>'array', 'parameters='=>'array'],
'xslt_set_base' => ['', 'xh'=>'', 'uri'=>'string'],
'xslt_set_encoding' => ['', 'xh'=>'', 'encoding'=>'string'],
'xslt_set_error_handler' => ['', 'xh'=>'', 'handler'=>''],
'xslt_set_log' => ['', 'xh'=>'', 'log='=>''],
'xslt_set_object' => ['bool', 'processor'=>'', 'object'=>'object'],
'xslt_set_sax_handler' => ['', 'xh'=>'', 'handlers'=>'array'],
'xslt_set_sax_handlers' => ['', 'processor'=>'', 'handlers'=>'array'],
'xslt_set_scheme_handler' => ['', 'xh'=>'', 'handlers'=>'array'],
'xslt_set_scheme_handlers' => ['', 'xh'=>'', 'handlers'=>'array'],
'xslt_setopt' => ['', 'processor'=>'', 'newmask'=>'int'],
'XSLTProcessor::getParameter' => ['string|false', 'namespace'=>'string', 'name'=>'string'],
'XsltProcessor::getSecurityPrefs' => ['int'],
'XSLTProcessor::hasExsltSupport' => ['bool'],
'XSLTProcessor::importStylesheet' => ['bool', 'stylesheet'=>'object'],
'XSLTProcessor::registerPHPFunctions' => ['void', 'functions='=>'mixed'],
'XSLTProcessor::removeParameter' => ['bool', 'namespace'=>'string', 'name'=>'string'],
'XSLTProcessor::setParameter' => ['bool', 'namespace'=>'string', 'name'=>'string', 'value'=>'string'],
'XSLTProcessor::setParameter\'1' => ['bool', 'namespace'=>'string', 'options'=>'array'],
'XSLTProcessor::setProfiling' => ['bool', 'filename'=>'string'],
'XsltProcessor::setSecurityPrefs' => ['int', 'preferences'=>'int'],
'XSLTProcessor::transformToDoc' => ['DOMDocument|false', 'document'=>'DOMNode'],
'XSLTProcessor::transformToURI' => ['int', 'document'=>'DOMDocument', 'uri'=>'string'],
'XSLTProcessor::transformToXML' => ['string|false', 'document'=>'DOMDocument'],
'yac::__construct' => ['void', 'prefix='=>'string'],
'yac::__get' => ['mixed', 'key'=>'string'],
'yac::__set' => ['mixed', 'key'=>'string', 'value'=>'mixed'],
'yac::delete' => ['bool', 'keys'=>'string|array', 'ttl='=>'int'],
'yac::dump' => ['mixed', 'num'=>'int'],
'yac::flush' => ['bool'],
'yac::get' => ['mixed', 'key'=>'string|array', 'cas='=>'int'],
'yac::info' => ['array'],
'Yaconf::get' => ['mixed', 'name'=>'string', 'default_value='=>'mixed'],
'Yaconf::has' => ['bool', 'name'=>'string'],
'Yaf\Action_Abstract::__clone' => ['void'],
'Yaf\Action_Abstract::__construct' => ['void', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract', 'view'=>'Yaf\View_Interface', 'invokeArgs='=>'?array'],
'Yaf\Action_Abstract::display' => ['bool', 'tpl'=>'string', 'parameters='=>'?array'],
'Yaf\Action_Abstract::execute' => ['mixed'],
'Yaf\Action_Abstract::forward' => ['bool', 'module'=>'string', 'controller='=>'string', 'action='=>'string', 'parameters='=>'?array'],
'Yaf\Action_Abstract::getController' => ['Yaf\Controller_Abstract'],
'Yaf\Action_Abstract::getInvokeArg' => ['mixed|null', 'name'=>'string'],
'Yaf\Action_Abstract::getInvokeArgs' => ['array'],
'Yaf\Action_Abstract::getModuleName' => ['string'],
'Yaf\Action_Abstract::getRequest' => ['Yaf\Request_Abstract'],
'Yaf\Action_Abstract::getResponse' => ['Yaf\Response_Abstract'],
'Yaf\Action_Abstract::getView' => ['Yaf\View_Interface'],
'Yaf\Action_Abstract::getViewpath' => ['string'],
'Yaf\Action_Abstract::init' => [''],
'Yaf\Action_Abstract::initView' => ['Yaf\Response_Abstract', 'options='=>'?array'],
'Yaf\Action_Abstract::redirect' => ['bool', 'url'=>'string'],
'Yaf\Action_Abstract::render' => ['string', 'tpl'=>'string', 'parameters='=>'?array'],
'Yaf\Action_Abstract::setViewpath' => ['bool', 'view_directory'=>'string'],
'Yaf\Application::__clone' => ['void'],
'Yaf\Application::__construct' => ['void', 'config'=>'array|string', 'envrion='=>'string'],
'Yaf\Application::__destruct' => ['void'],
'Yaf\Application::__sleep' => ['string[]'],
'Yaf\Application::__wakeup' => ['void'],
'Yaf\Application::app' => ['?Yaf\Application'],
'Yaf\Application::bootstrap' => ['Yaf\Application', 'bootstrap='=>'?Yaf\Bootstrap_Abstract'],
'Yaf\Application::clearLastError' => ['void'],
'Yaf\Application::environ' => ['string'],
'Yaf\Application::execute' => ['void', 'entry'=>'callable', '_='=>'string'],
'Yaf\Application::getAppDirectory' => ['string'],
'Yaf\Application::getConfig' => ['Yaf\Config_Abstract'],
'Yaf\Application::getDispatcher' => ['Yaf\Dispatcher'],
'Yaf\Application::getLastErrorMsg' => ['string'],
'Yaf\Application::getLastErrorNo' => ['int'],
'Yaf\Application::getModules' => ['array'],
'Yaf\Application::run' => ['void'],
'Yaf\Application::setAppDirectory' => ['Yaf\Application', 'directory'=>'string'],
'Yaf\Config\Ini::__construct' => ['void', 'config_file'=>'string', 'section='=>'string'],
'Yaf\Config\Ini::__get' => ['', 'name='=>'mixed'],
'Yaf\Config\Ini::__isset' => ['', 'name'=>'string'],
'Yaf\Config\Ini::__set' => ['void', 'name'=>'', 'value'=>''],
'Yaf\Config\Ini::count' => ['int'],
'Yaf\Config\Ini::current' => ['mixed'],
'Yaf\Config\Ini::get' => ['mixed', 'name='=>'mixed'],
'Yaf\Config\Ini::key' => ['int|string'],
'Yaf\Config\Ini::next' => ['void'],
'Yaf\Config\Ini::offsetExists' => ['bool', 'name'=>'mixed'],
'Yaf\Config\Ini::offsetGet' => ['mixed', 'name'=>'mixed'],
'Yaf\Config\Ini::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'],
'Yaf\Config\Ini::offsetUnset' => ['void', 'name'=>'mixed'],
'Yaf\Config\Ini::readonly' => ['bool'],
'Yaf\Config\Ini::rewind' => ['void'],
'Yaf\Config\Ini::set' => ['Yaf\Config_Abstract', 'name'=>'string', 'value'=>'mixed'],
'Yaf\Config\Ini::toArray' => ['array'],
'Yaf\Config\Ini::valid' => ['bool'],
'Yaf\Config\Simple::__construct' => ['void', 'array'=>'array', 'readonly='=>'string'],
'Yaf\Config\Simple::__get' => ['', 'name='=>'mixed'],
'Yaf\Config\Simple::__isset' => ['', 'name'=>'string'],
'Yaf\Config\Simple::__set' => ['void', 'name'=>'', 'value'=>''],
'Yaf\Config\Simple::count' => ['int'],
'Yaf\Config\Simple::current' => ['mixed'],
'Yaf\Config\Simple::get' => ['mixed', 'name='=>'mixed'],
'Yaf\Config\Simple::key' => ['int|string'],
'Yaf\Config\Simple::next' => ['void'],
'Yaf\Config\Simple::offsetExists' => ['bool', 'name'=>'mixed'],
'Yaf\Config\Simple::offsetGet' => ['mixed', 'name'=>'mixed'],
'Yaf\Config\Simple::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'],
'Yaf\Config\Simple::offsetUnset' => ['void', 'name'=>'mixed'],
'Yaf\Config\Simple::readonly' => ['bool'],
'Yaf\Config\Simple::rewind' => ['void'],
'Yaf\Config\Simple::set' => ['Yaf\Config_Abstract', 'name'=>'string', 'value'=>'mixed'],
'Yaf\Config\Simple::toArray' => ['array'],
'Yaf\Config\Simple::valid' => ['bool'],
'Yaf\Config_Abstract::__construct' => ['void'],
'Yaf\Config_Abstract::get' => ['mixed', 'name='=>'string'],
'Yaf\Config_Abstract::readonly' => ['bool'],
'Yaf\Config_Abstract::set' => ['Yaf\Config_Abstract', 'name'=>'string', 'value'=>'mixed'],
'Yaf\Config_Abstract::toArray' => ['array'],
'Yaf\Controller_Abstract::__clone' => ['void'],
'Yaf\Controller_Abstract::__construct' => ['void', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract', 'view'=>'Yaf\View_Interface', 'invokeArgs='=>'?array'],
'Yaf\Controller_Abstract::display' => ['bool', 'tpl'=>'string', 'parameters='=>'?array'],
'Yaf\Controller_Abstract::forward' => ['bool', 'module'=>'string', 'controller='=>'string', 'action='=>'string', 'parameters='=>'?array'],
'Yaf\Controller_Abstract::getInvokeArg' => ['mixed|null', 'name'=>'string'],
'Yaf\Controller_Abstract::getInvokeArgs' => ['array'],
'Yaf\Controller_Abstract::getModuleName' => ['string'],
'Yaf\Controller_Abstract::getRequest' => ['Yaf\Request_Abstract'],
'Yaf\Controller_Abstract::getResponse' => ['Yaf\Response_Abstract'],
'Yaf\Controller_Abstract::getView' => ['Yaf\View_Interface'],
'Yaf\Controller_Abstract::getViewpath' => ['string'],
'Yaf\Controller_Abstract::init' => [''],
'Yaf\Controller_Abstract::initView' => ['Yaf\Response_Abstract', 'options='=>'?array'],
'Yaf\Controller_Abstract::redirect' => ['bool', 'url'=>'string'],
'Yaf\Controller_Abstract::render' => ['string', 'tpl'=>'string', 'parameters='=>'?array'],
'Yaf\Controller_Abstract::setViewpath' => ['bool', 'view_directory'=>'string'],
'Yaf\Dispatcher::__clone' => ['void'],
'Yaf\Dispatcher::__construct' => ['void'],
'Yaf\Dispatcher::__sleep' => ['list<string>'],
'Yaf\Dispatcher::__wakeup' => ['void'],
'Yaf\Dispatcher::autoRender' => ['Yaf\Dispatcher', 'flag='=>'bool'],
'Yaf\Dispatcher::catchException' => ['Yaf\Dispatcher', 'flag='=>'bool'],
'Yaf\Dispatcher::disableView' => ['bool'],
'Yaf\Dispatcher::dispatch' => ['Yaf\Response_Abstract', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Dispatcher::enableView' => ['Yaf\Dispatcher'],
'Yaf\Dispatcher::flushInstantly' => ['Yaf\Dispatcher', 'flag='=>'bool'],
'Yaf\Dispatcher::getApplication' => ['Yaf\Application'],
'Yaf\Dispatcher::getInstance' => ['Yaf\Dispatcher'],
'Yaf\Dispatcher::getRequest' => ['Yaf\Request_Abstract'],
'Yaf\Dispatcher::getRouter' => ['Yaf\Router'],
'Yaf\Dispatcher::initView' => ['Yaf\View_Interface', 'templates_dir'=>'string', 'options='=>'?array'],
'Yaf\Dispatcher::registerPlugin' => ['Yaf\Dispatcher', 'plugin'=>'Yaf\Plugin_Abstract'],
'Yaf\Dispatcher::returnResponse' => ['Yaf\Dispatcher', 'flag'=>'bool'],
'Yaf\Dispatcher::setDefaultAction' => ['Yaf\Dispatcher', 'action'=>'string'],
'Yaf\Dispatcher::setDefaultController' => ['Yaf\Dispatcher', 'controller'=>'string'],
'Yaf\Dispatcher::setDefaultModule' => ['Yaf\Dispatcher', 'module'=>'string'],
'Yaf\Dispatcher::setErrorHandler' => ['Yaf\Dispatcher', 'callback'=>'callable', 'error_types'=>'int'],
'Yaf\Dispatcher::setRequest' => ['Yaf\Dispatcher', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Dispatcher::setView' => ['Yaf\Dispatcher', 'view'=>'Yaf\View_Interface'],
'Yaf\Dispatcher::throwException' => ['Yaf\Dispatcher', 'flag='=>'bool'],
'Yaf\Loader::__clone' => ['void'],
'Yaf\Loader::__construct' => ['void'],
'Yaf\Loader::__sleep' => ['list<string>'],
'Yaf\Loader::__wakeup' => ['void'],
'Yaf\Loader::autoload' => ['bool', 'class_name'=>'string'],
'Yaf\Loader::clearLocalNamespace' => [''],
'Yaf\Loader::getInstance' => ['Yaf\Loader', 'local_library_path='=>'string', 'global_library_path='=>'string'],
'Yaf\Loader::getLibraryPath' => ['string', 'is_global='=>'bool'],
'Yaf\Loader::getLocalNamespace' => ['string'],
'Yaf\Loader::import' => ['bool', 'file'=>'string'],
'Yaf\Loader::isLocalName' => ['bool', 'class_name'=>'string'],
'Yaf\Loader::registerLocalNamespace' => ['bool', 'name_prefix'=>'string|string[]'],
'Yaf\Loader::setLibraryPath' => ['Yaf\Loader', 'directory'=>'string', 'global='=>'bool'],
'Yaf\Plugin_Abstract::dispatchLoopShutdown' => ['bool', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract'],
'Yaf\Plugin_Abstract::dispatchLoopStartup' => ['bool', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract'],
'Yaf\Plugin_Abstract::postDispatch' => ['bool', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract'],
'Yaf\Plugin_Abstract::preDispatch' => ['bool', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract'],
'Yaf\Plugin_Abstract::preResponse' => ['bool', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract'],
'Yaf\Plugin_Abstract::routerShutdown' => ['bool', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract'],
'Yaf\Plugin_Abstract::routerStartup' => ['bool', 'request'=>'Yaf\Request_Abstract', 'response'=>'Yaf\Response_Abstract'],
'Yaf\Registry::__clone' => ['void'],
'Yaf\Registry::__construct' => ['void'],
'Yaf\Registry::del' => ['bool|void', 'name'=>'string'],
'Yaf\Registry::get' => ['mixed', 'name'=>'string'],
'Yaf\Registry::has' => ['bool', 'name'=>'string'],
'Yaf\Registry::set' => ['bool', 'name'=>'string', 'value'=>'mixed'],
'Yaf\Request\Http::__clone' => ['void'],
'Yaf\Request\Http::__construct' => ['void', 'request_uri'=>'string', 'base_uri'=>'string'],
'Yaf\Request\Http::get' => ['mixed', 'name'=>'string', 'default='=>'string'],
'Yaf\Request\Http::getActionName' => ['string'],
'Yaf\Request\Http::getBaseUri' => ['string'],
'Yaf\Request\Http::getControllerName' => ['string'],
'Yaf\Request\Http::getCookie' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Http::getEnv' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Http::getException' => ['Yaf\Exception'],
'Yaf\Request\Http::getFiles' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Http::getLanguage' => ['string'],
'Yaf\Request\Http::getMethod' => ['string'],
'Yaf\Request\Http::getModuleName' => ['string'],
'Yaf\Request\Http::getParam' => ['mixed', 'name'=>'string', 'default='=>'mixed'],
'Yaf\Request\Http::getParams' => ['array'],
'Yaf\Request\Http::getPost' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Http::getQuery' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Http::getRequest' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Http::getRequestUri' => ['string'],
'Yaf\Request\Http::getServer' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Http::isCli' => ['bool'],
'Yaf\Request\Http::isDispatched' => ['bool'],
'Yaf\Request\Http::isGet' => ['bool'],
'Yaf\Request\Http::isHead' => ['bool'],
'Yaf\Request\Http::isOptions' => ['bool'],
'Yaf\Request\Http::isPost' => ['bool'],
'Yaf\Request\Http::isPut' => ['bool'],
'Yaf\Request\Http::isRouted' => ['bool'],
'Yaf\Request\Http::isXmlHttpRequest' => ['bool'],
'Yaf\Request\Http::setActionName' => ['Yaf\Request_Abstract|bool', 'action'=>'string'],
'Yaf\Request\Http::setBaseUri' => ['bool', 'uri'=>'string'],
'Yaf\Request\Http::setControllerName' => ['Yaf\Request_Abstract|bool', 'controller'=>'string'],
'Yaf\Request\Http::setDispatched' => ['bool'],
'Yaf\Request\Http::setModuleName' => ['Yaf\Request_Abstract|bool', 'module'=>'string'],
'Yaf\Request\Http::setParam' => ['Yaf\Request_Abstract|bool', 'name'=>'array|string', 'value='=>'string'],
'Yaf\Request\Http::setRequestUri' => ['', 'uri'=>'string'],
'Yaf\Request\Http::setRouted' => ['Yaf\Request_Abstract|bool'],
'Yaf\Request\Simple::__clone' => ['void'],
'Yaf\Request\Simple::__construct' => ['void', 'method'=>'string', 'controller'=>'string', 'action'=>'string', 'params='=>'string'],
'Yaf\Request\Simple::get' => ['mixed', 'name'=>'string', 'default='=>'string'],
'Yaf\Request\Simple::getActionName' => ['string'],
'Yaf\Request\Simple::getBaseUri' => ['string'],
'Yaf\Request\Simple::getControllerName' => ['string'],
'Yaf\Request\Simple::getCookie' => ['mixed', 'name='=>'string', 'default='=>'string'],
'Yaf\Request\Simple::getEnv' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Simple::getException' => ['Yaf\Exception'],
'Yaf\Request\Simple::getFiles' => ['array', 'name='=>'mixed', 'default='=>'null'],
'Yaf\Request\Simple::getLanguage' => ['string'],
'Yaf\Request\Simple::getMethod' => ['string'],
'Yaf\Request\Simple::getModuleName' => ['string'],
'Yaf\Request\Simple::getParam' => ['mixed', 'name'=>'string', 'default='=>'mixed'],
'Yaf\Request\Simple::getParams' => ['array'],
'Yaf\Request\Simple::getPost' => ['mixed', 'name='=>'string', 'default='=>'string'],
'Yaf\Request\Simple::getQuery' => ['mixed', 'name='=>'string', 'default='=>'string'],
'Yaf\Request\Simple::getRequest' => ['mixed', 'name='=>'string', 'default='=>'string'],
'Yaf\Request\Simple::getRequestUri' => ['string'],
'Yaf\Request\Simple::getServer' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request\Simple::isCli' => ['bool'],
'Yaf\Request\Simple::isDispatched' => ['bool'],
'Yaf\Request\Simple::isGet' => ['bool'],
'Yaf\Request\Simple::isHead' => ['bool'],
'Yaf\Request\Simple::isOptions' => ['bool'],
'Yaf\Request\Simple::isPost' => ['bool'],
'Yaf\Request\Simple::isPut' => ['bool'],
'Yaf\Request\Simple::isRouted' => ['bool'],
'Yaf\Request\Simple::isXmlHttpRequest' => ['bool'],
'Yaf\Request\Simple::setActionName' => ['Yaf\Request_Abstract|bool', 'action'=>'string'],
'Yaf\Request\Simple::setBaseUri' => ['bool', 'uri'=>'string'],
'Yaf\Request\Simple::setControllerName' => ['Yaf\Request_Abstract|bool', 'controller'=>'string'],
'Yaf\Request\Simple::setDispatched' => ['bool'],
'Yaf\Request\Simple::setModuleName' => ['Yaf\Request_Abstract|bool', 'module'=>'string'],
'Yaf\Request\Simple::setParam' => ['Yaf\Request_Abstract|bool', 'name'=>'array|string', 'value='=>'string'],
'Yaf\Request\Simple::setRequestUri' => ['', 'uri'=>'string'],
'Yaf\Request\Simple::setRouted' => ['Yaf\Request_Abstract|bool'],
'Yaf\Request_Abstract::getActionName' => ['string'],
'Yaf\Request_Abstract::getBaseUri' => ['string'],
'Yaf\Request_Abstract::getControllerName' => ['string'],
'Yaf\Request_Abstract::getEnv' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request_Abstract::getException' => ['Yaf\Exception'],
'Yaf\Request_Abstract::getLanguage' => ['string'],
'Yaf\Request_Abstract::getMethod' => ['string'],
'Yaf\Request_Abstract::getModuleName' => ['string'],
'Yaf\Request_Abstract::getParam' => ['mixed', 'name'=>'string', 'default='=>'mixed'],
'Yaf\Request_Abstract::getParams' => ['array'],
'Yaf\Request_Abstract::getRequestUri' => ['string'],
'Yaf\Request_Abstract::getServer' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf\Request_Abstract::isCli' => ['bool'],
'Yaf\Request_Abstract::isDispatched' => ['bool'],
'Yaf\Request_Abstract::isGet' => ['bool'],
'Yaf\Request_Abstract::isHead' => ['bool'],
'Yaf\Request_Abstract::isOptions' => ['bool'],
'Yaf\Request_Abstract::isPost' => ['bool'],
'Yaf\Request_Abstract::isPut' => ['bool'],
'Yaf\Request_Abstract::isRouted' => ['bool'],
'Yaf\Request_Abstract::isXmlHttpRequest' => ['bool'],
'Yaf\Request_Abstract::setActionName' => ['Yaf\Request_Abstract|bool', 'action'=>'string'],
'Yaf\Request_Abstract::setBaseUri' => ['bool', 'uri'=>'string'],
'Yaf\Request_Abstract::setControllerName' => ['Yaf\Request_Abstract|bool', 'controller'=>'string'],
'Yaf\Request_Abstract::setDispatched' => ['bool'],
'Yaf\Request_Abstract::setModuleName' => ['Yaf\Request_Abstract|bool', 'module'=>'string'],
'Yaf\Request_Abstract::setParam' => ['Yaf\Request_Abstract|bool', 'name'=>'array|string', 'value='=>'string'],
'Yaf\Request_Abstract::setRequestUri' => ['', 'uri'=>'string'],
'Yaf\Request_Abstract::setRouted' => ['Yaf\Request_Abstract|bool'],
'Yaf\Response\Cli::__clone' => ['void'],
'Yaf\Response\Cli::__construct' => ['void'],
'Yaf\Response\Cli::__destruct' => ['void'],
'Yaf\Response\Cli::__toString' => ['string'],
'Yaf\Response\Cli::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Response\Cli::clearBody' => ['bool', 'key='=>'string'],
'Yaf\Response\Cli::getBody' => ['mixed', 'key='=>'?string'],
'Yaf\Response\Cli::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Response\Cli::setBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Response\Http::__clone' => ['void'],
'Yaf\Response\Http::__construct' => ['void'],
'Yaf\Response\Http::__destruct' => ['void'],
'Yaf\Response\Http::__toString' => ['string'],
'Yaf\Response\Http::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Response\Http::clearBody' => ['bool', 'key='=>'string'],
'Yaf\Response\Http::clearHeaders' => ['Yaf\Response_Abstract|false', 'name='=>'string'],
'Yaf\Response\Http::getBody' => ['mixed', 'key='=>'?string'],
'Yaf\Response\Http::getHeader' => ['mixed', 'name='=>'string'],
'Yaf\Response\Http::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Response\Http::response' => ['bool'],
'Yaf\Response\Http::setAllHeaders' => ['bool', 'headers'=>'array'],
'Yaf\Response\Http::setBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Response\Http::setHeader' => ['bool', 'name'=>'string', 'value'=>'string', 'replace='=>'bool', 'response_code='=>'int'],
'Yaf\Response\Http::setRedirect' => ['bool', 'url'=>'string'],
'Yaf\Response_Abstract::__clone' => ['void'],
'Yaf\Response_Abstract::__construct' => ['void'],
'Yaf\Response_Abstract::__destruct' => ['void'],
'Yaf\Response_Abstract::__toString' => ['void'],
'Yaf\Response_Abstract::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Response_Abstract::clearBody' => ['bool', 'key='=>'string'],
'Yaf\Response_Abstract::getBody' => ['mixed', 'key='=>'?string'],
'Yaf\Response_Abstract::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Response_Abstract::setBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf\Route\Map::__construct' => ['void', 'controller_prefer='=>'bool', 'delimiter='=>'string'],
'Yaf\Route\Map::assemble' => ['bool', 'info'=>'array', 'query='=>'?array'],
'Yaf\Route\Map::route' => ['bool', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Route\Regex::__construct' => ['void', 'match'=>'string', 'route'=>'array', 'map='=>'?array', 'verify='=>'?array', 'reverse='=>'string'],
'Yaf\Route\Regex::addConfig' => ['Yaf\Router|bool', 'config'=>'Yaf\Config_Abstract'],
'Yaf\Route\Regex::addRoute' => ['Yaf\Router|bool', 'name'=>'string', 'route'=>'Yaf\Route_Interface'],
'Yaf\Route\Regex::assemble' => ['bool', 'info'=>'array', 'query='=>'?array'],
'Yaf\Route\Regex::getCurrentRoute' => ['string'],
'Yaf\Route\Regex::getRoute' => ['Yaf\Route_Interface', 'name'=>'string'],
'Yaf\Route\Regex::getRoutes' => ['Yaf\Route_Interface[]'],
'Yaf\Route\Regex::route' => ['bool', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Route\Rewrite::__construct' => ['void', 'match'=>'string', 'route'=>'array', 'verify='=>'?array', 'reverse='=>'string'],
'Yaf\Route\Rewrite::addConfig' => ['Yaf\Router|bool', 'config'=>'Yaf\Config_Abstract'],
'Yaf\Route\Rewrite::addRoute' => ['Yaf\Router|bool', 'name'=>'string', 'route'=>'Yaf\Route_Interface'],
'Yaf\Route\Rewrite::assemble' => ['bool', 'info'=>'array', 'query='=>'?array'],
'Yaf\Route\Rewrite::getCurrentRoute' => ['string'],
'Yaf\Route\Rewrite::getRoute' => ['Yaf\Route_Interface', 'name'=>'string'],
'Yaf\Route\Rewrite::getRoutes' => ['Yaf\Route_Interface[]'],
'Yaf\Route\Rewrite::route' => ['bool', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Route\Simple::__construct' => ['void', 'module_name'=>'string', 'controller_name'=>'string', 'action_name'=>'string'],
'Yaf\Route\Simple::assemble' => ['bool', 'info'=>'array', 'query='=>'?array'],
'Yaf\Route\Simple::route' => ['bool', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Route\Supervar::__construct' => ['void', 'supervar_name'=>'string'],
'Yaf\Route\Supervar::assemble' => ['bool', 'info'=>'array', 'query='=>'?array'],
'Yaf\Route\Supervar::route' => ['bool', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Route_Interface::__construct' => ['Yaf\Route_Interface'],
'Yaf\Route_Interface::assemble' => ['bool', 'info'=>'array', 'query='=>'?array'],
'Yaf\Route_Interface::route' => ['bool', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Route_Static::assemble' => ['bool', 'info'=>'array', 'query='=>'?array'],
'Yaf\Route_Static::match' => ['bool', 'uri'=>'string'],
'Yaf\Route_Static::route' => ['bool', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Router::__construct' => ['void'],
'Yaf\Router::addConfig' => ['Yaf\Router|false', 'config'=>'Yaf\Config_Abstract'],
'Yaf\Router::addRoute' => ['Yaf\Router|false', 'name'=>'string', 'route'=>'Yaf\Route_Interface'],
'Yaf\Router::getCurrentRoute' => ['string'],
'Yaf\Router::getRoute' => ['Yaf\Route_Interface', 'name'=>'string'],
'Yaf\Router::getRoutes' => ['Yaf\Route_Interface[]'],
'Yaf\Router::route' => ['Yaf\Router|false', 'request'=>'Yaf\Request_Abstract'],
'Yaf\Session::__clone' => ['void'],
'Yaf\Session::__construct' => ['void'],
'Yaf\Session::__get' => ['void', 'name'=>''],
'Yaf\Session::__isset' => ['void', 'name'=>''],
'Yaf\Session::__set' => ['void', 'name'=>'', 'value'=>''],
'Yaf\Session::__sleep' => ['list<string>'],
'Yaf\Session::__unset' => ['void', 'name'=>''],
'Yaf\Session::__wakeup' => ['void'],
'Yaf\Session::count' => ['int'],
'Yaf\Session::current' => ['mixed'],
'Yaf\Session::del' => ['Yaf\Session|false', 'name'=>'string'],
'Yaf\Session::get' => ['mixed', 'name'=>'string'],
'Yaf\Session::getInstance' => ['Yaf\Session'],
'Yaf\Session::has' => ['bool', 'name'=>'string'],
'Yaf\Session::key' => ['int|string'],
'Yaf\Session::next' => ['void'],
'Yaf\Session::offsetExists' => ['bool', 'name'=>'mixed'],
'Yaf\Session::offsetGet' => ['mixed', 'name'=>'mixed'],
'Yaf\Session::offsetSet' => ['void', 'name'=>'mixed', 'value'=>'mixed'],
'Yaf\Session::offsetUnset' => ['void', 'name'=>'mixed'],
'Yaf\Session::rewind' => ['void'],
'Yaf\Session::set' => ['Yaf\Session|false', 'name'=>'string', 'value'=>'mixed'],
'Yaf\Session::start' => ['Yaf\Session'],
'Yaf\Session::valid' => ['bool'],
'Yaf\View\Simple::__construct' => ['void', 'template_dir'=>'string', 'options='=>'?array'],
'Yaf\View\Simple::__get' => ['mixed', 'name='=>'null'],
'Yaf\View\Simple::__isset' => ['', 'name'=>'string'],
'Yaf\View\Simple::__set' => ['void', 'name'=>'string', 'value='=>'mixed'],
'Yaf\View\Simple::assign' => ['Yaf\View\Simple', 'name'=>'array|string', 'value='=>'mixed'],
'Yaf\View\Simple::assignRef' => ['Yaf\View\Simple', 'name'=>'string', '&value'=>'mixed'],
'Yaf\View\Simple::clear' => ['Yaf\View\Simple', 'name='=>'string'],
'Yaf\View\Simple::display' => ['bool', 'tpl'=>'string', 'tpl_vars='=>'?array'],
'Yaf\View\Simple::eval' => ['bool|void', 'tpl_str'=>'string', 'vars='=>'?array'],
'Yaf\View\Simple::getScriptPath' => ['string'],
'Yaf\View\Simple::render' => ['string|void', 'tpl'=>'string', 'tpl_vars='=>'?array'],
'Yaf\View\Simple::setScriptPath' => ['Yaf\View\Simple', 'template_dir'=>'string'],
'Yaf\View_Interface::assign' => ['bool', 'name'=>'array|string', 'value'=>'mixed'],
'Yaf\View_Interface::display' => ['bool', 'tpl'=>'string', 'tpl_vars='=>'?array'],
'Yaf\View_Interface::getScriptPath' => ['string'],
'Yaf\View_Interface::render' => ['string', 'tpl'=>'string', 'tpl_vars='=>'?array'],
'Yaf\View_Interface::setScriptPath' => ['void', 'template_dir'=>'string'],
'Yaf_Action_Abstract::__clone' => ['void'],
'Yaf_Action_Abstract::__construct' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract', 'view'=>'Yaf_View_Interface', 'invokeArgs='=>'?array'],
'Yaf_Action_Abstract::display' => ['bool', 'tpl'=>'string', 'parameters='=>'?array'],
'Yaf_Action_Abstract::execute' => ['mixed', 'arg='=>'mixed', '...args='=>'mixed'],
'Yaf_Action_Abstract::forward' => ['bool', 'module'=>'string', 'controller='=>'string', 'action='=>'string', 'parameters='=>'?array'],
'Yaf_Action_Abstract::getController' => ['Yaf_Controller_Abstract'],
'Yaf_Action_Abstract::getControllerName' => ['string'],
'Yaf_Action_Abstract::getInvokeArg' => ['mixed|null', 'name'=>'string'],
'Yaf_Action_Abstract::getInvokeArgs' => ['array'],
'Yaf_Action_Abstract::getModuleName' => ['string'],
'Yaf_Action_Abstract::getRequest' => ['Yaf_Request_Abstract'],
'Yaf_Action_Abstract::getResponse' => ['Yaf_Response_Abstract'],
'Yaf_Action_Abstract::getView' => ['Yaf_View_Interface'],
'Yaf_Action_Abstract::getViewpath' => ['string'],
'Yaf_Action_Abstract::init' => [''],
'Yaf_Action_Abstract::initView' => ['Yaf_Response_Abstract', 'options='=>'?array'],
'Yaf_Action_Abstract::redirect' => ['bool', 'url'=>'string'],
'Yaf_Action_Abstract::render' => ['string', 'tpl'=>'string', 'parameters='=>'?array'],
'Yaf_Action_Abstract::setViewpath' => ['bool', 'view_directory'=>'string'],
'Yaf_Application::__clone' => ['void'],
'Yaf_Application::__construct' => ['void', 'config'=>'mixed', 'envrion='=>'string'],
'Yaf_Application::__destruct' => ['void'],
'Yaf_Application::__sleep' => ['list<string>'],
'Yaf_Application::__wakeup' => ['void'],
'Yaf_Application::app' => ['?Yaf_Application'],
'Yaf_Application::bootstrap' => ['Yaf_Application', 'bootstrap='=>'Yaf_Bootstrap_Abstract'],
'Yaf_Application::clearLastError' => ['Yaf_Application'],
'Yaf_Application::environ' => ['string'],
'Yaf_Application::execute' => ['void', 'entry'=>'callable', '...args'=>'string'],
'Yaf_Application::getAppDirectory' => ['Yaf_Application'],
'Yaf_Application::getConfig' => ['Yaf_Config_Abstract'],
'Yaf_Application::getDispatcher' => ['Yaf_Dispatcher'],
'Yaf_Application::getLastErrorMsg' => ['string'],
'Yaf_Application::getLastErrorNo' => ['int'],
'Yaf_Application::getModules' => ['array'],
'Yaf_Application::run' => ['void'],
'Yaf_Application::setAppDirectory' => ['Yaf_Application', 'directory'=>'string'],
'Yaf_Config_Abstract::__construct' => ['void'],
'Yaf_Config_Abstract::get' => ['mixed', 'name'=>'string', 'value'=>'mixed'],
'Yaf_Config_Abstract::readonly' => ['bool'],
'Yaf_Config_Abstract::set' => ['Yaf_Config_Abstract'],
'Yaf_Config_Abstract::toArray' => ['array'],
'Yaf_Config_Ini::__construct' => ['void', 'config_file'=>'string', 'section='=>'string'],
'Yaf_Config_Ini::__get' => ['void', 'name='=>'string'],
'Yaf_Config_Ini::__isset' => ['void', 'name'=>'string'],
'Yaf_Config_Ini::__set' => ['void', 'name'=>'string', 'value'=>'mixed'],
'Yaf_Config_Ini::count' => ['void'],
'Yaf_Config_Ini::current' => ['void'],
'Yaf_Config_Ini::get' => ['mixed', 'name='=>'mixed'],
'Yaf_Config_Ini::key' => ['void'],
'Yaf_Config_Ini::next' => ['void'],
'Yaf_Config_Ini::offsetExists' => ['void', 'name'=>'string'],
'Yaf_Config_Ini::offsetGet' => ['void', 'name'=>'string'],
'Yaf_Config_Ini::offsetSet' => ['void', 'name'=>'string', 'value'=>'string'],
'Yaf_Config_Ini::offsetUnset' => ['void', 'name'=>'string'],
'Yaf_Config_Ini::readonly' => ['void'],
'Yaf_Config_Ini::rewind' => ['void'],
'Yaf_Config_Ini::set' => ['Yaf_Config_Abstract', 'name'=>'string', 'value'=>'mixed'],
'Yaf_Config_Ini::toArray' => ['array'],
'Yaf_Config_Ini::valid' => ['void'],
'Yaf_Config_Simple::__construct' => ['void', 'config_file'=>'string', 'section='=>'string'],
'Yaf_Config_Simple::__get' => ['void', 'name='=>'string'],
'Yaf_Config_Simple::__isset' => ['void', 'name'=>'string'],
'Yaf_Config_Simple::__set' => ['void', 'name'=>'string', 'value'=>'string'],
'Yaf_Config_Simple::count' => ['void'],
'Yaf_Config_Simple::current' => ['void'],
'Yaf_Config_Simple::get' => ['mixed', 'name='=>'mixed'],
'Yaf_Config_Simple::key' => ['void'],
'Yaf_Config_Simple::next' => ['void'],
'Yaf_Config_Simple::offsetExists' => ['void', 'name'=>'string'],
'Yaf_Config_Simple::offsetGet' => ['void', 'name'=>'string'],
'Yaf_Config_Simple::offsetSet' => ['void', 'name'=>'string', 'value'=>'string'],
'Yaf_Config_Simple::offsetUnset' => ['void', 'name'=>'string'],
'Yaf_Config_Simple::readonly' => ['void'],
'Yaf_Config_Simple::rewind' => ['void'],
'Yaf_Config_Simple::set' => ['Yaf_Config_Abstract', 'name'=>'string', 'value'=>'mixed'],
'Yaf_Config_Simple::toArray' => ['array'],
'Yaf_Config_Simple::valid' => ['void'],
'Yaf_Controller_Abstract::__clone' => ['void'],
'Yaf_Controller_Abstract::__construct' => ['void'],
'Yaf_Controller_Abstract::display' => ['bool', 'tpl'=>'string', 'parameters='=>'array'],
'Yaf_Controller_Abstract::forward' => ['void', 'action'=>'string', 'parameters='=>'array'],
'Yaf_Controller_Abstract::forward\'1' => ['void', 'controller'=>'string', 'action'=>'string', 'parameters='=>'array'],
'Yaf_Controller_Abstract::forward\'2' => ['void', 'module'=>'string', 'controller'=>'string', 'action'=>'string', 'parameters='=>'array'],
'Yaf_Controller_Abstract::getInvokeArg' => ['void', 'name'=>'string'],
'Yaf_Controller_Abstract::getInvokeArgs' => ['void'],
'Yaf_Controller_Abstract::getModuleName' => ['string'],
'Yaf_Controller_Abstract::getName' => ['string'],
'Yaf_Controller_Abstract::getRequest' => ['Yaf_Request_Abstract'],
'Yaf_Controller_Abstract::getResponse' => ['Yaf_Response_Abstract'],
'Yaf_Controller_Abstract::getView' => ['Yaf_View_Interface'],
'Yaf_Controller_Abstract::getViewpath' => ['void'],
'Yaf_Controller_Abstract::init' => ['void'],
'Yaf_Controller_Abstract::initView' => ['void', 'options='=>'array'],
'Yaf_Controller_Abstract::redirect' => ['bool', 'url'=>'string'],
'Yaf_Controller_Abstract::render' => ['string', 'tpl'=>'string', 'parameters='=>'array'],
'Yaf_Controller_Abstract::setViewpath' => ['void', 'view_directory'=>'string'],
'Yaf_Dispatcher::__clone' => ['void'],
'Yaf_Dispatcher::__construct' => ['void'],
'Yaf_Dispatcher::__sleep' => ['list<string>'],
'Yaf_Dispatcher::__wakeup' => ['void'],
'Yaf_Dispatcher::autoRender' => ['Yaf_Dispatcher', 'flag='=>'bool'],
'Yaf_Dispatcher::catchException' => ['Yaf_Dispatcher', 'flag='=>'bool'],
'Yaf_Dispatcher::disableView' => ['bool'],
'Yaf_Dispatcher::dispatch' => ['Yaf_Response_Abstract', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Dispatcher::enableView' => ['Yaf_Dispatcher'],
'Yaf_Dispatcher::flushInstantly' => ['Yaf_Dispatcher', 'flag='=>'bool'],
'Yaf_Dispatcher::getApplication' => ['Yaf_Application'],
'Yaf_Dispatcher::getDefaultAction' => ['string'],
'Yaf_Dispatcher::getDefaultController' => ['string'],
'Yaf_Dispatcher::getDefaultModule' => ['string'],
'Yaf_Dispatcher::getInstance' => ['Yaf_Dispatcher'],
'Yaf_Dispatcher::getRequest' => ['Yaf_Request_Abstract'],
'Yaf_Dispatcher::getRouter' => ['Yaf_Router'],
'Yaf_Dispatcher::initView' => ['Yaf_View_Interface', 'templates_dir'=>'string', 'options='=>'array'],
'Yaf_Dispatcher::registerPlugin' => ['Yaf_Dispatcher', 'plugin'=>'Yaf_Plugin_Abstract'],
'Yaf_Dispatcher::returnResponse' => ['Yaf_Dispatcher', 'flag'=>'bool'],
'Yaf_Dispatcher::setDefaultAction' => ['Yaf_Dispatcher', 'action'=>'string'],
'Yaf_Dispatcher::setDefaultController' => ['Yaf_Dispatcher', 'controller'=>'string'],
'Yaf_Dispatcher::setDefaultModule' => ['Yaf_Dispatcher', 'module'=>'string'],
'Yaf_Dispatcher::setErrorHandler' => ['Yaf_Dispatcher', 'callback'=>'callable', 'error_types'=>'int'],
'Yaf_Dispatcher::setRequest' => ['Yaf_Dispatcher', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Dispatcher::setView' => ['Yaf_Dispatcher', 'view'=>'Yaf_View_Interface'],
'Yaf_Dispatcher::throwException' => ['Yaf_Dispatcher', 'flag='=>'bool'],
'Yaf_Exception::__construct' => ['void'],
'Yaf_Exception::getPrevious' => ['void'],
'Yaf_Loader::__clone' => ['void'],
'Yaf_Loader::__construct' => ['void'],
'Yaf_Loader::__sleep' => ['list<string>'],
'Yaf_Loader::__wakeup' => ['void'],
'Yaf_Loader::autoload' => ['void'],
'Yaf_Loader::clearLocalNamespace' => ['void'],
'Yaf_Loader::getInstance' => ['Yaf_Loader'],
'Yaf_Loader::getLibraryPath' => ['Yaf_Loader', 'is_global='=>'bool'],
'Yaf_Loader::getLocalNamespace' => ['void'],
'Yaf_Loader::getNamespacePath' => ['string', 'namespaces'=>'string'],
'Yaf_Loader::import' => ['bool'],
'Yaf_Loader::isLocalName' => ['bool'],
'Yaf_Loader::registerLocalNamespace' => ['void', 'prefix'=>'mixed'],
'Yaf_Loader::registerNamespace' => ['bool', 'namespaces'=>'string|array', 'path='=>'string'],
'Yaf_Loader::setLibraryPath' => ['Yaf_Loader', 'directory'=>'string', 'is_global='=>'bool'],
'Yaf_Plugin_Abstract::dispatchLoopShutdown' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'],
'Yaf_Plugin_Abstract::dispatchLoopStartup' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'],
'Yaf_Plugin_Abstract::postDispatch' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'],
'Yaf_Plugin_Abstract::preDispatch' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'],
'Yaf_Plugin_Abstract::preResponse' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'],
'Yaf_Plugin_Abstract::routerShutdown' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'],
'Yaf_Plugin_Abstract::routerStartup' => ['void', 'request'=>'Yaf_Request_Abstract', 'response'=>'Yaf_Response_Abstract'],
'Yaf_Registry::__clone' => ['void'],
'Yaf_Registry::__construct' => ['void'],
'Yaf_Registry::del' => ['void', 'name'=>'string'],
'Yaf_Registry::get' => ['mixed', 'name'=>'string'],
'Yaf_Registry::has' => ['bool', 'name'=>'string'],
'Yaf_Registry::set' => ['bool', 'name'=>'string', 'value'=>'string'],
'Yaf_Request_Abstract::clearParams' => ['bool'],
'Yaf_Request_Abstract::getActionName' => ['void'],
'Yaf_Request_Abstract::getBaseUri' => ['void'],
'Yaf_Request_Abstract::getControllerName' => ['void'],
'Yaf_Request_Abstract::getEnv' => ['void', 'name'=>'string', 'default='=>'string'],
'Yaf_Request_Abstract::getException' => ['void'],
'Yaf_Request_Abstract::getLanguage' => ['void'],
'Yaf_Request_Abstract::getMethod' => ['void'],
'Yaf_Request_Abstract::getModuleName' => ['void'],
'Yaf_Request_Abstract::getParam' => ['void', 'name'=>'string', 'default='=>'string'],
'Yaf_Request_Abstract::getParams' => ['void'],
'Yaf_Request_Abstract::getRequestUri' => ['void'],
'Yaf_Request_Abstract::getServer' => ['void', 'name'=>'string', 'default='=>'string'],
'Yaf_Request_Abstract::isCli' => ['void'],
'Yaf_Request_Abstract::isDispatched' => ['void'],
'Yaf_Request_Abstract::isGet' => ['void'],
'Yaf_Request_Abstract::isHead' => ['void'],
'Yaf_Request_Abstract::isOptions' => ['void'],
'Yaf_Request_Abstract::isPost' => ['void'],
'Yaf_Request_Abstract::isPut' => ['void'],
'Yaf_Request_Abstract::isRouted' => ['void'],
'Yaf_Request_Abstract::isXmlHttpRequest' => ['void'],
'Yaf_Request_Abstract::setActionName' => ['void', 'action'=>'string'],
'Yaf_Request_Abstract::setBaseUri' => ['bool', 'uir'=>'string'],
'Yaf_Request_Abstract::setControllerName' => ['void', 'controller'=>'string'],
'Yaf_Request_Abstract::setDispatched' => ['void'],
'Yaf_Request_Abstract::setModuleName' => ['void', 'module'=>'string'],
'Yaf_Request_Abstract::setParam' => ['void', 'name'=>'string', 'value='=>'string'],
'Yaf_Request_Abstract::setRequestUri' => ['void', 'uir'=>'string'],
'Yaf_Request_Abstract::setRouted' => ['void', 'flag='=>'string'],
'Yaf_Request_Http::__clone' => ['void'],
'Yaf_Request_Http::__construct' => ['void'],
'Yaf_Request_Http::get' => ['mixed', 'name'=>'string', 'default='=>'string'],
'Yaf_Request_Http::getActionName' => ['string'],
'Yaf_Request_Http::getBaseUri' => ['string'],
'Yaf_Request_Http::getControllerName' => ['string'],
'Yaf_Request_Http::getCookie' => ['mixed', 'name'=>'string', 'default='=>'string'],
'Yaf_Request_Http::getEnv' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf_Request_Http::getException' => ['Yaf_Exception'],
'Yaf_Request_Http::getFiles' => ['void'],
'Yaf_Request_Http::getLanguage' => ['string'],
'Yaf_Request_Http::getMethod' => ['string'],
'Yaf_Request_Http::getModuleName' => ['string'],
'Yaf_Request_Http::getParam' => ['mixed', 'name'=>'string', 'default='=>'mixed'],
'Yaf_Request_Http::getParams' => ['array'],
'Yaf_Request_Http::getPost' => ['mixed', 'name'=>'string', 'default='=>'string'],
'Yaf_Request_Http::getQuery' => ['mixed', 'name'=>'string', 'default='=>'string'],
'Yaf_Request_Http::getRaw' => ['mixed'],
'Yaf_Request_Http::getRequest' => ['void'],
'Yaf_Request_Http::getRequestUri' => ['string'],
'Yaf_Request_Http::getServer' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf_Request_Http::isCli' => ['bool'],
'Yaf_Request_Http::isDispatched' => ['bool'],
'Yaf_Request_Http::isGet' => ['bool'],
'Yaf_Request_Http::isHead' => ['bool'],
'Yaf_Request_Http::isOptions' => ['bool'],
'Yaf_Request_Http::isPost' => ['bool'],
'Yaf_Request_Http::isPut' => ['bool'],
'Yaf_Request_Http::isRouted' => ['bool'],
'Yaf_Request_Http::isXmlHttpRequest' => ['bool'],
'Yaf_Request_Http::setActionName' => ['Yaf_Request_Abstract|bool', 'action'=>'string'],
'Yaf_Request_Http::setBaseUri' => ['bool', 'uri'=>'string'],
'Yaf_Request_Http::setControllerName' => ['Yaf_Request_Abstract|bool', 'controller'=>'string'],
'Yaf_Request_Http::setDispatched' => ['bool'],
'Yaf_Request_Http::setModuleName' => ['Yaf_Request_Abstract|bool', 'module'=>'string'],
'Yaf_Request_Http::setParam' => ['Yaf_Request_Abstract|bool', 'name'=>'array|string', 'value='=>'string'],
'Yaf_Request_Http::setRequestUri' => ['', 'uri'=>'string'],
'Yaf_Request_Http::setRouted' => ['Yaf_Request_Abstract|bool'],
'Yaf_Request_Simple::__clone' => ['void'],
'Yaf_Request_Simple::__construct' => ['void'],
'Yaf_Request_Simple::get' => ['void'],
'Yaf_Request_Simple::getActionName' => ['string'],
'Yaf_Request_Simple::getBaseUri' => ['string'],
'Yaf_Request_Simple::getControllerName' => ['string'],
'Yaf_Request_Simple::getCookie' => ['void'],
'Yaf_Request_Simple::getEnv' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf_Request_Simple::getException' => ['Yaf_Exception'],
'Yaf_Request_Simple::getFiles' => ['void'],
'Yaf_Request_Simple::getLanguage' => ['string'],
'Yaf_Request_Simple::getMethod' => ['string'],
'Yaf_Request_Simple::getModuleName' => ['string'],
'Yaf_Request_Simple::getParam' => ['mixed', 'name'=>'string', 'default='=>'mixed'],
'Yaf_Request_Simple::getParams' => ['array'],
'Yaf_Request_Simple::getPost' => ['void'],
'Yaf_Request_Simple::getQuery' => ['void'],
'Yaf_Request_Simple::getRequest' => ['void'],
'Yaf_Request_Simple::getRequestUri' => ['string'],
'Yaf_Request_Simple::getServer' => ['mixed', 'name='=>'string', 'default='=>'mixed'],
'Yaf_Request_Simple::isCli' => ['bool'],
'Yaf_Request_Simple::isDispatched' => ['bool'],
'Yaf_Request_Simple::isGet' => ['bool'],
'Yaf_Request_Simple::isHead' => ['bool'],
'Yaf_Request_Simple::isOptions' => ['bool'],
'Yaf_Request_Simple::isPost' => ['bool'],
'Yaf_Request_Simple::isPut' => ['bool'],
'Yaf_Request_Simple::isRouted' => ['bool'],
'Yaf_Request_Simple::isXmlHttpRequest' => ['void'],
'Yaf_Request_Simple::setActionName' => ['Yaf_Request_Abstract|bool', 'action'=>'string'],
'Yaf_Request_Simple::setBaseUri' => ['bool', 'uri'=>'string'],
'Yaf_Request_Simple::setControllerName' => ['Yaf_Request_Abstract|bool', 'controller'=>'string'],
'Yaf_Request_Simple::setDispatched' => ['bool'],
'Yaf_Request_Simple::setModuleName' => ['Yaf_Request_Abstract|bool', 'module'=>'string'],
'Yaf_Request_Simple::setParam' => ['Yaf_Request_Abstract|bool', 'name'=>'array|string', 'value='=>'string'],
'Yaf_Request_Simple::setRequestUri' => ['', 'uri'=>'string'],
'Yaf_Request_Simple::setRouted' => ['Yaf_Request_Abstract|bool'],
'Yaf_Response_Abstract::__clone' => ['void'],
'Yaf_Response_Abstract::__construct' => ['void'],
'Yaf_Response_Abstract::__destruct' => ['void'],
'Yaf_Response_Abstract::__toString' => ['string'],
'Yaf_Response_Abstract::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Abstract::clearBody' => ['bool', 'key='=>'string'],
'Yaf_Response_Abstract::clearHeaders' => ['void'],
'Yaf_Response_Abstract::getBody' => ['mixed', 'key='=>'string'],
'Yaf_Response_Abstract::getHeader' => ['void'],
'Yaf_Response_Abstract::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Abstract::response' => ['void'],
'Yaf_Response_Abstract::setAllHeaders' => ['void'],
'Yaf_Response_Abstract::setBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Abstract::setHeader' => ['void'],
'Yaf_Response_Abstract::setRedirect' => ['void'],
'Yaf_Response_Cli::__clone' => ['void'],
'Yaf_Response_Cli::__construct' => ['void'],
'Yaf_Response_Cli::__destruct' => ['void'],
'Yaf_Response_Cli::__toString' => ['string'],
'Yaf_Response_Cli::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Cli::clearBody' => ['bool', 'key='=>'string'],
'Yaf_Response_Cli::getBody' => ['mixed', 'key='=>'?string'],
'Yaf_Response_Cli::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Cli::setBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Http::__clone' => ['void'],
'Yaf_Response_Http::__construct' => ['void'],
'Yaf_Response_Http::__destruct' => ['void'],
'Yaf_Response_Http::__toString' => ['string'],
'Yaf_Response_Http::appendBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Http::clearBody' => ['bool', 'key='=>'string'],
'Yaf_Response_Http::clearHeaders' => ['Yaf_Response_Abstract|false', 'name='=>'string'],
'Yaf_Response_Http::getBody' => ['mixed', 'key='=>'?string'],
'Yaf_Response_Http::getHeader' => ['mixed', 'name='=>'string'],
'Yaf_Response_Http::prependBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Http::response' => ['bool'],
'Yaf_Response_Http::setAllHeaders' => ['bool', 'headers'=>'array'],
'Yaf_Response_Http::setBody' => ['bool', 'content'=>'string', 'key='=>'string'],
'Yaf_Response_Http::setHeader' => ['bool', 'name'=>'string', 'value'=>'string', 'replace='=>'bool', 'response_code='=>'int'],
'Yaf_Response_Http::setRedirect' => ['bool', 'url'=>'string'],
'Yaf_Route_Interface::__construct' => ['void'],
'Yaf_Route_Interface::assemble' => ['string', 'info'=>'array', 'query='=>'array'],
'Yaf_Route_Interface::route' => ['bool', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Route_Map::__construct' => ['void', 'controller_prefer='=>'string', 'delimiter='=>'string'],
'Yaf_Route_Map::assemble' => ['string', 'info'=>'array', 'query='=>'array'],
'Yaf_Route_Map::route' => ['bool', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Route_Regex::__construct' => ['void', 'match'=>'string', 'route'=>'array', 'map='=>'array', 'verify='=>'array', 'reverse='=>'string'],
'Yaf_Route_Regex::addConfig' => ['Yaf_Router|bool', 'config'=>'Yaf_Config_Abstract'],
'Yaf_Route_Regex::addRoute' => ['Yaf_Router|bool', 'name'=>'string', 'route'=>'Yaf_Route_Interface'],
'Yaf_Route_Regex::assemble' => ['string', 'info'=>'array', 'query='=>'array'],
'Yaf_Route_Regex::getCurrentRoute' => ['string'],
'Yaf_Route_Regex::getRoute' => ['Yaf_Route_Interface', 'name'=>'string'],
'Yaf_Route_Regex::getRoutes' => ['Yaf_Route_Interface[]'],
'Yaf_Route_Regex::route' => ['bool', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Route_Rewrite::__construct' => ['void', 'match'=>'string', 'route'=>'array', 'verify='=>'array'],
'Yaf_Route_Rewrite::addConfig' => ['Yaf_Router|bool', 'config'=>'Yaf_Config_Abstract'],
'Yaf_Route_Rewrite::addRoute' => ['Yaf_Router|bool', 'name'=>'string', 'route'=>'Yaf_Route_Interface'],
'Yaf_Route_Rewrite::assemble' => ['string', 'info'=>'array', 'query='=>'array'],
'Yaf_Route_Rewrite::getCurrentRoute' => ['string'],
'Yaf_Route_Rewrite::getRoute' => ['Yaf_Route_Interface', 'name'=>'string'],
'Yaf_Route_Rewrite::getRoutes' => ['Yaf_Route_Interface[]'],
'Yaf_Route_Rewrite::route' => ['bool', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Route_Simple::__construct' => ['void', 'module_name'=>'string', 'controller_name'=>'string', 'action_name'=>'string'],
'Yaf_Route_Simple::assemble' => ['string', 'info'=>'array', 'query='=>'array'],
'Yaf_Route_Simple::route' => ['bool', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Route_Static::assemble' => ['string', 'info'=>'array', 'query='=>'array'],
'Yaf_Route_Static::match' => ['void', 'uri'=>'string'],
'Yaf_Route_Static::route' => ['bool', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Route_Supervar::__construct' => ['void', 'supervar_name'=>'string'],
'Yaf_Route_Supervar::assemble' => ['string', 'info'=>'array', 'query='=>'array'],
'Yaf_Route_Supervar::route' => ['bool', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Router::__construct' => ['void'],
'Yaf_Router::addConfig' => ['bool', 'config'=>'Yaf_Config_Abstract'],
'Yaf_Router::addRoute' => ['bool', 'name'=>'string', 'route'=>'Yaf_Route_Interface'],
'Yaf_Router::getCurrentRoute' => ['string'],
'Yaf_Router::getRoute' => ['Yaf_Route_Interface', 'name'=>'string'],
'Yaf_Router::getRoutes' => ['mixed'],
'Yaf_Router::route' => ['bool', 'request'=>'Yaf_Request_Abstract'],
'Yaf_Session::__clone' => ['void'],
'Yaf_Session::__construct' => ['void'],
'Yaf_Session::__get' => ['void', 'name'=>'string'],
'Yaf_Session::__isset' => ['void', 'name'=>'string'],
'Yaf_Session::__set' => ['void', 'name'=>'string', 'value'=>'string'],
'Yaf_Session::__sleep' => ['list<string>'],
'Yaf_Session::__unset' => ['void', 'name'=>'string'],
'Yaf_Session::__wakeup' => ['void'],
'Yaf_Session::count' => ['void'],
'Yaf_Session::current' => ['void'],
'Yaf_Session::del' => ['void', 'name'=>'string'],
'Yaf_Session::get' => ['mixed', 'name'=>'string'],
'Yaf_Session::getInstance' => ['void'],
'Yaf_Session::has' => ['void', 'name'=>'string'],
'Yaf_Session::key' => ['void'],
'Yaf_Session::next' => ['void'],
'Yaf_Session::offsetExists' => ['void', 'name'=>'string'],
'Yaf_Session::offsetGet' => ['void', 'name'=>'string'],
'Yaf_Session::offsetSet' => ['void', 'name'=>'string', 'value'=>'string'],
'Yaf_Session::offsetUnset' => ['void', 'name'=>'string'],
'Yaf_Session::rewind' => ['void'],
'Yaf_Session::set' => ['Yaf_Session|bool', 'name'=>'string', 'value'=>'mixed'],
'Yaf_Session::start' => ['void'],
'Yaf_Session::valid' => ['void'],
'Yaf_View_Interface::assign' => ['bool', 'name'=>'string', 'value='=>'string'],
'Yaf_View_Interface::display' => ['bool', 'tpl'=>'string', 'tpl_vars='=>'array'],
'Yaf_View_Interface::getScriptPath' => ['string'],
'Yaf_View_Interface::render' => ['string', 'tpl'=>'string', 'tpl_vars='=>'array'],
'Yaf_View_Interface::setScriptPath' => ['void', 'template_dir'=>'string'],
'Yaf_View_Simple::__construct' => ['void', 'tempalte_dir'=>'string', 'options='=>'array'],
'Yaf_View_Simple::__get' => ['void', 'name='=>'string'],
'Yaf_View_Simple::__isset' => ['void', 'name'=>'string'],
'Yaf_View_Simple::__set' => ['void', 'name'=>'string', 'value'=>'mixed'],
'Yaf_View_Simple::assign' => ['bool', 'name'=>'string', 'value='=>'mixed'],
'Yaf_View_Simple::assignRef' => ['bool', 'name'=>'string', '&rw_value'=>'mixed'],
'Yaf_View_Simple::clear' => ['bool', 'name='=>'string'],
'Yaf_View_Simple::display' => ['bool', 'tpl'=>'string', 'tpl_vars='=>'array'],
'Yaf_View_Simple::eval' => ['string', 'tpl_content'=>'string', 'tpl_vars='=>'array'],
'Yaf_View_Simple::getScriptPath' => ['string'],
'Yaf_View_Simple::render' => ['string', 'tpl'=>'string', 'tpl_vars='=>'array'],
'Yaf_View_Simple::setScriptPath' => ['bool', 'template_dir'=>'string'],
'yaml_emit' => ['string', 'data'=>'mixed', 'encoding='=>'int', 'linebreak='=>'int'],
'yaml_emit_file' => ['bool', 'filename'=>'string', 'data'=>'mixed', 'encoding='=>'int', 'linebreak='=>'int'],
'yaml_parse' => ['mixed|false', 'input'=>'string', 'pos='=>'int', '&w_ndocs='=>'int', 'callbacks='=>'array'],
'yaml_parse_file' => ['mixed|false', 'filename'=>'string', 'pos='=>'int', '&w_ndocs='=>'int', 'callbacks='=>'array'],
'yaml_parse_url' => ['mixed|false', 'url'=>'string', 'pos='=>'int', '&w_ndocs='=>'int', 'callbacks='=>'array'],
'Yar_Client::__call' => ['void', 'method'=>'string', 'parameters'=>'array'],
'Yar_Client::__construct' => ['void', 'url'=>'string'],
'Yar_Client::setOpt' => ['Yar_Client|false', 'name'=>'int', 'value'=>'mixed'],
'Yar_Client_Exception::__clone' => ['void'],
'Yar_Client_Exception::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'Yar_Client_Exception::__toString' => ['string'],
'Yar_Client_Exception::__wakeup' => ['void'],
'Yar_Client_Exception::getCode' => ['int'],
'Yar_Client_Exception::getFile' => ['string'],
'Yar_Client_Exception::getLine' => ['int'],
'Yar_Client_Exception::getMessage' => ['string'],
'Yar_Client_Exception::getPrevious' => ['?Exception|?Throwable'],
'Yar_Client_Exception::getTrace' => ['list<array<string,mixed>>'],
'Yar_Client_Exception::getTraceAsString' => ['string'],
'Yar_Client_Exception::getType' => ['string'],
'Yar_Concurrent_Client::call' => ['int', 'uri'=>'string', 'method'=>'string', 'parameters'=>'array', 'callback='=>'callable'],
'Yar_Concurrent_Client::loop' => ['bool', 'callback='=>'callable', 'error_callback='=>'callable'],
'Yar_Concurrent_Client::reset' => ['bool'],
'Yar_Server::__construct' => ['void', 'object'=>'Object'],
'Yar_Server::handle' => ['bool'],
'Yar_Server_Exception::__clone' => ['void'],
'Yar_Server_Exception::__construct' => ['void', 'message='=>'string', 'code='=>'int', 'previous='=>'?Exception|?Throwable'],
'Yar_Server_Exception::__toString' => ['string'],
'Yar_Server_Exception::__wakeup' => ['void'],
'Yar_Server_Exception::getCode' => ['int'],
'Yar_Server_Exception::getFile' => ['string'],
'Yar_Server_Exception::getLine' => ['int'],
'Yar_Server_Exception::getMessage' => ['string'],
'Yar_Server_Exception::getPrevious' => ['?Exception|?Throwable'],
'Yar_Server_Exception::getTrace' => ['list<array<string,mixed>>'],
'Yar_Server_Exception::getTraceAsString' => ['string'],
'Yar_Server_Exception::getType' => ['string'],
'yaz_addinfo' => ['string', 'id'=>'resource'],
'yaz_ccl_conf' => ['void', 'id'=>'resource', 'config'=>'array'],
'yaz_ccl_parse' => ['bool', 'id'=>'resource', 'query'=>'string', '&w_result'=>'array'],
'yaz_close' => ['bool', 'id'=>'resource'],
'yaz_connect' => ['mixed', 'zurl'=>'string', 'options='=>'mixed'],
'yaz_database' => ['bool', 'id'=>'resource', 'databases'=>'string'],
'yaz_element' => ['bool', 'id'=>'resource', 'elementset'=>'string'],
'yaz_errno' => ['int', 'id'=>'resource'],
'yaz_error' => ['string', 'id'=>'resource'],
'yaz_es' => ['void', 'id'=>'resource', 'type'=>'string', 'args'=>'array'],
'yaz_es_result' => ['array', 'id'=>'resource'],
'yaz_get_option' => ['string', 'id'=>'resource', 'name'=>'string'],
'yaz_hits' => ['int', 'id'=>'resource', 'searchresult='=>'array'],
'yaz_itemorder' => ['void', 'id'=>'resource', 'args'=>'array'],
'yaz_present' => ['bool', 'id'=>'resource'],
'yaz_range' => ['void', 'id'=>'resource', 'start'=>'int', 'number'=>'int'],
'yaz_record' => ['string', 'id'=>'resource', 'pos'=>'int', 'type'=>'string'],
'yaz_scan' => ['void', 'id'=>'resource', 'type'=>'string', 'startterm'=>'string', 'flags='=>'array'],
'yaz_scan_result' => ['array', 'id'=>'resource', 'result='=>'array'],
'yaz_schema' => ['void', 'id'=>'resource', 'schema'=>'string'],
'yaz_search' => ['bool', 'id'=>'resource', 'type'=>'string', 'query'=>'string'],
'yaz_set_option' => ['', 'id'=>'', 'name'=>'string', 'value'=>'string', 'options'=>'array'],
'yaz_sort' => ['void', 'id'=>'resource', 'criteria'=>'string'],
'yaz_syntax' => ['void', 'id'=>'resource', 'syntax'=>'string'],
'yaz_wait' => ['mixed', '&rw_options='=>'array'],
'yp_all' => ['void', 'domain'=>'string', 'map'=>'string', 'callback'=>'string'],
'yp_cat' => ['array', 'domain'=>'string', 'map'=>'string'],
'yp_err_string' => ['string', 'errorcode'=>'int'],
'yp_errno' => ['int'],
'yp_first' => ['array', 'domain'=>'string', 'map'=>'string'],
'yp_get_default_domain' => ['string'],
'yp_master' => ['string', 'domain'=>'string', 'map'=>'string'],
'yp_match' => ['string', 'domain'=>'string', 'map'=>'string', 'key'=>'string'],
'yp_next' => ['array', 'domain'=>'string', 'map'=>'string', 'key'=>'string'],
'yp_order' => ['int', 'domain'=>'string', 'map'=>'string'],
'zem_get_extension_info_by_id' => [''],
'zem_get_extension_info_by_name' => [''],
'zem_get_extensions_info' => [''],
'zem_get_license_info' => [''],
'zend_current_obfuscation_level' => ['int'],
'zend_disk_cache_clear' => ['bool', 'namespace='=>'mixed|string'],
'zend_disk_cache_delete' => ['mixed|null', 'key'=>'string'],
'zend_disk_cache_fetch' => ['mixed|null', 'key'=>'string'],
'zend_disk_cache_store' => ['bool', 'key'=>'', 'value'=>'', 'ttl='=>'int|mixed'],
'zend_get_id' => ['array', 'all_ids='=>'all_ids|false'],
'zend_is_configuration_changed' => [''],
'zend_loader_current_file' => ['string'],
'zend_loader_enabled' => ['bool'],
'zend_loader_file_encoded' => ['bool'],
'zend_loader_file_licensed' => ['array'],
'zend_loader_install_license' => ['bool', 'license_file'=>'string', 'override'=>'bool'],
'zend_logo_guid' => ['string'],
'zend_obfuscate_class_name' => ['string', 'class_name'=>'string'],
'zend_obfuscate_function_name' => ['string', 'function_name'=>'string'],
'zend_optimizer_version' => ['string'],
'zend_runtime_obfuscate' => ['void'],
'zend_send_buffer' => ['null|false', 'buffer'=>'string', 'mime_type='=>'string', 'custom_headers='=>'string'],
'zend_send_file' => ['null|false', 'filename'=>'string', 'mime_type='=>'string', 'custom_headers='=>'string'],
'zend_set_configuration_changed' => [''],
'zend_shm_cache_clear' => ['bool', 'namespace='=>'mixed|string'],
'zend_shm_cache_delete' => ['mixed|null', 'key'=>'string'],
'zend_shm_cache_fetch' => ['mixed|null', 'key'=>'string'],
'zend_shm_cache_store' => ['bool', 'key'=>'', 'value'=>'', 'ttl='=>'int|mixed'],
'zend_thread_id' => ['int'],
'zend_version' => ['string'],
'ZendAPI_Job::addJobToQueue' => ['int', 'jobqueue_url'=>'string', 'password'=>'string'],
'ZendAPI_Job::getApplicationID' => [''],
'ZendAPI_Job::getEndTime' => [''],
'ZendAPI_Job::getGlobalVariables' => [''],
'ZendAPI_Job::getHost' => [''],
'ZendAPI_Job::getID' => [''],
'ZendAPI_Job::getInterval' => [''],
'ZendAPI_Job::getJobDependency' => [''],
'ZendAPI_Job::getJobName' => [''],
'ZendAPI_Job::getJobPriority' => [''],
'ZendAPI_Job::getJobStatus' => ['int'],
'ZendAPI_Job::getLastPerformedStatus' => ['int'],
'ZendAPI_Job::getOutput' => ['An'],
'ZendAPI_Job::getPreserved' => [''],
'ZendAPI_Job::getProperties' => ['array'],
'ZendAPI_Job::getScheduledTime' => [''],
'ZendAPI_Job::getScript' => [''],
'ZendAPI_Job::getTimeToNextRepeat' => ['int'],
'ZendAPI_Job::getUserVariables' => [''],
'ZendAPI_Job::setApplicationID' => ['', 'app_id'=>''],
'ZendAPI_Job::setGlobalVariables' => ['', 'vars'=>''],
'ZendAPI_Job::setJobDependency' => ['', 'job_id'=>''],
'ZendAPI_Job::setJobName' => ['', 'name'=>''],
'ZendAPI_Job::setJobPriority' => ['', 'priority'=>'int'],
'ZendAPI_Job::setPreserved' => ['', 'preserved'=>''],
'ZendAPI_Job::setRecurrenceData' => ['', 'interval'=>'', 'end_time='=>'mixed'],
'ZendAPI_Job::setScheduledTime' => ['', 'timestamp'=>''],
'ZendAPI_Job::setScript' => ['', 'script'=>''],
'ZendAPI_Job::setUserVariables' => ['', 'vars'=>''],
'ZendAPI_Job::ZendAPI_Job' => ['Job', 'script'=>'script'],
'ZendAPI_Queue::addJob' => ['int', '&job'=>'Job'],
'ZendAPI_Queue::getAllApplicationIDs' => ['array'],
'ZendAPI_Queue::getAllhosts' => ['array'],
'ZendAPI_Queue::getHistoricJobs' => ['array', 'status'=>'int', 'start_time'=>'', 'end_time'=>'', 'index'=>'int', 'count'=>'int', '&total'=>'int'],
'ZendAPI_Queue::getJob' => ['Job', 'job_id'=>'int'],
'ZendAPI_Queue::getJobsInQueue' => ['array', 'filter_options='=>'array', 'max_jobs='=>'int', 'with_globals_and_output='=>'bool'],
'ZendAPI_Queue::getLastError' => ['string'],
'ZendAPI_Queue::getNumOfJobsInQueue' => ['int', 'filter_options='=>'array'],
'ZendAPI_Queue::getStatistics' => ['array'],
'ZendAPI_Queue::isScriptExists' => ['bool', 'path'=>'string'],
'ZendAPI_Queue::isSuspend' => ['bool'],
'ZendAPI_Queue::login' => ['bool', 'password'=>'string', 'application_id='=>'int'],
'ZendAPI_Queue::removeJob' => ['bool', 'job_id'=>'array|int'],
'ZendAPI_Queue::requeueJob' => ['bool', 'job'=>'Job'],
'ZendAPI_Queue::resumeJob' => ['bool', 'job_id'=>'array|int'],
'ZendAPI_Queue::resumeQueue' => ['bool'],
'ZendAPI_Queue::setMaxHistoryTime' => ['bool'],
'ZendAPI_Queue::suspendJob' => ['bool', 'job_id'=>'array|int'],
'ZendAPI_Queue::suspendQueue' => ['bool'],
'ZendAPI_Queue::updateJob' => ['int', '&job'=>'Job'],
'ZendAPI_Queue::zendapi_queue' => ['ZendAPI_Queue', 'queue_url'=>'string'],
'zip_close' => ['void', 'zip'=>'resource'],
'zip_entry_close' => ['bool', 'zip_ent'=>'resource'],
'zip_entry_compressedsize' => ['int', 'zip_entry'=>'resource'],
'zip_entry_compressionmethod' => ['string', 'zip_entry'=>'resource'],
'zip_entry_filesize' => ['int', 'zip_entry'=>'resource'],
'zip_entry_name' => ['string', 'zip_entry'=>'resource'],
'zip_entry_open' => ['bool', 'zip_dp'=>'resource', 'zip_entry'=>'resource', 'mode='=>'string'],
'zip_entry_read' => ['string|false', 'zip_entry'=>'resource', 'len='=>'int'],
'zip_open' => ['resource|int|false', 'filename'=>'string'],
'zip_read' => ['resource', 'zip'=>'resource'],
'ZipArchive::addEmptyDir' => ['bool', 'dirname'=>'string'],
'ZipArchive::addFile' => ['bool', 'filepath'=>'string', 'entryname='=>'string', 'start='=>'int', 'length='=>'int'],
'ZipArchive::addFromString' => ['bool', 'entryname'=>'string', 'content'=>'string'],
'ZipArchive::addGlob' => ['bool', 'pattern'=>'string', 'flags='=>'int', 'options='=>'array'],
'ZipArchive::addPattern' => ['bool', 'pattern'=>'string', 'path='=>'string', 'options='=>'array'],
'ZipArchive::close' => ['bool'],
'ZipArchive::count' => ['int'],
'ZipArchive::createEmptyDir' => ['bool', 'dirname'=>'string'],
'ZipArchive::deleteIndex' => ['bool', 'index'=>'int'],
'ZipArchive::deleteName' => ['bool', 'name'=>'string'],
'ZipArchive::extractTo' => ['bool', 'pathto'=>'string', 'files='=>'string[]|string'],
'ZipArchive::getArchiveComment' => ['string|false', 'flags='=>'int'],
'ZipArchive::getCommentIndex' => ['string|false', 'index'=>'int', 'flags='=>'int'],
'ZipArchive::getCommentName' => ['string|false', 'name'=>'string', 'flags='=>'int'],
'ZipArchive::getExternalAttributesIndex' => ['bool', 'index'=>'int', '&w_opsys'=>'int', '&w_attr'=>'int', 'flags='=>'int'],
'ZipArchive::getExternalAttributesName' => ['bool', 'name'=>'string', '&w_opsys'=>'int', '&w_attr'=>'int', 'flags='=>'int'],
'ZipArchive::getFromIndex' => ['string|false', 'index'=>'int', 'length='=>'int', 'flags='=>'int'],
'ZipArchive::getFromName' => ['string|false', 'entryname'=>'string', 'length='=>'int', 'flags='=>'int'],
'ZipArchive::getNameIndex' => ['string|false', 'index'=>'int', 'flags='=>'int'],
'ZipArchive::getStatusString' => ['string|false'],
'ZipArchive::getStream' => ['resource|false', 'entryname'=>'string'],
'ZipArchive::isCompressionMethodSupported' => ['bool', 'method'=>'int', 'encode='=>'bool'],
'ZipArchive::isEncryptionMethodSupported' => ['bool', 'method'=>'int', 'encode='=>'bool'],
'ZipArchive::locateName' => ['int|false', 'filename'=>'string', 'flags='=>'int'],
'ZipArchive::open' => ['int|bool', 'source'=>'string', 'flags='=>'int'],
'ZipArchive::registerCancelCallback' => ['bool', 'callback'=>'callable'],
'ZipArchive::registerProgressCallback' => ['bool', 'rate'=>'float', 'callback'=>'callable'],
'ZipArchive::renameIndex' => ['bool', 'index'=>'int', 'new_name'=>'string'],
'ZipArchive::renameName' => ['bool', 'name'=>'string', 'new_name'=>'string'],
'ZipArchive::replaceFile' => ['bool', 'filename'=>'string', 'index'=>'int', 'start='=>'int', 'length='=>'int', 'flags='=>'int'],
'ZipArchive::setArchiveComment' => ['bool', 'comment'=>'string'],
'ZipArchive::setCommentIndex' => ['bool', 'index'=>'int', 'comment'=>'string'],
'ZipArchive::setCommentName' => ['bool', 'name'=>'string', 'comment'=>'string'],
'ZipArchive::setCompressionIndex' => ['bool', 'index'=>'int', 'comp_method'=>'int', 'comp_flags='=>'int'],
'ZipArchive::setCompressionName' => ['bool', 'name'=>'string', 'comp_method'=>'int', 'comp_flags='=>'int'],
'ZipArchive::setEncryptionIndex' => ['bool', 'index'=>'int', 'method'=>'string', 'password='=>'string'],
'ZipArchive::setEncryptionName' => ['bool', 'name'=>'string', 'method'=>'int', 'password='=>'string'],
'ZipArchive::setExternalAttributesIndex' => ['bool', 'index'=>'int', 'opsys'=>'int', 'attr'=>'int', 'flags='=>'int'],
'ZipArchive::setExternalAttributesName' => ['bool', 'name'=>'string', 'opsys'=>'int', 'attr'=>'int', 'flags='=>'int'],
'ZipArchive::setMtimeIndex' => ['bool', 'index'=>'int', 'timestamp'=>'int', 'flags='=>'int'],
'ZipArchive::setMtimeName' => ['bool', 'name'=>'string', 'timestamp'=>'int', 'flags='=>'int'],
'ZipArchive::setPassword' => ['bool', 'password'=>'string'],
'ZipArchive::statIndex' => ['array|false', 'index'=>'int', 'flags='=>'int'],
'ZipArchive::statName' => ['array|false', 'filename'=>'string', 'flags='=>'int'],
'ZipArchive::unchangeAll' => ['bool'],
'ZipArchive::unchangeArchive' => ['bool'],
'ZipArchive::unchangeIndex' => ['bool', 'index'=>'int'],
'ZipArchive::unchangeName' => ['bool', 'name'=>'string'],
'zlib_decode' => ['string|false', 'data'=>'string', 'max_length='=>'int'],
'zlib_encode' => ['string', 'data'=>'string', 'encoding'=>'int', 'level='=>'string|int'],
'zlib_get_coding_type' => ['string|false'],
'ZMQ::__construct' => ['void'],
'ZMQContext::__construct' => ['void', 'io_threads='=>'int', 'is_persistent='=>'bool'],
'ZMQContext::getOpt' => ['int|string', 'key'=>'string'],
'ZMQContext::getSocket' => ['ZMQSocket', 'type'=>'int', 'persistent_id='=>'string', 'on_new_socket='=>'callable'],
'ZMQContext::isPersistent' => ['bool'],
'ZMQContext::setOpt' => ['ZMQContext', 'key'=>'int', 'value'=>'mixed'],
'ZMQDevice::__construct' => ['void', 'frontend'=>'ZMQSocket', 'backend'=>'ZMQSocket', 'listener='=>'ZMQSocket'],
'ZMQDevice::getIdleTimeout' => ['ZMQDevice'],
'ZMQDevice::getTimerTimeout' => ['ZMQDevice'],
'ZMQDevice::run' => ['void'],
'ZMQDevice::setIdleCallback' => ['ZMQDevice', 'cb_func'=>'callable', 'timeout'=>'int', 'user_data='=>'mixed'],
'ZMQDevice::setIdleTimeout' => ['ZMQDevice', 'timeout'=>'int'],
'ZMQDevice::setTimerCallback' => ['ZMQDevice', 'cb_func'=>'callable', 'timeout'=>'int', 'user_data='=>'mixed'],
'ZMQDevice::setTimerTimeout' => ['ZMQDevice', 'timeout'=>'int'],
'ZMQPoll::add' => ['string', 'entry'=>'mixed', 'type'=>'int'],
'ZMQPoll::clear' => ['ZMQPoll'],
'ZMQPoll::count' => ['int'],
'ZMQPoll::getLastErrors' => ['array'],
'ZMQPoll::poll' => ['int', '&w_readable'=>'array', '&w_writable'=>'array', 'timeout='=>'int'],
'ZMQPoll::remove' => ['bool', 'item'=>'mixed'],
'ZMQSocket::__construct' => ['void', 'context'=>'ZMQContext', 'type'=>'int', 'persistent_id='=>'string', 'on_new_socket='=>'callable'],
'ZMQSocket::bind' => ['ZMQSocket', 'dsn'=>'string', 'force='=>'bool'],
'ZMQSocket::connect' => ['ZMQSocket', 'dsn'=>'string', 'force='=>'bool'],
'ZMQSocket::disconnect' => ['ZMQSocket', 'dsn'=>'string'],
'ZMQSocket::getEndpoints' => ['array'],
'ZMQSocket::getPersistentId' => ['?string'],
'ZMQSocket::getSocketType' => ['int'],
'ZMQSocket::getSockOpt' => ['int|string', 'key'=>'string'],
'ZMQSocket::isPersistent' => ['bool'],
'ZMQSocket::recv' => ['string', 'mode='=>'int'],
'ZMQSocket::recvMulti' => ['string[]', 'mode='=>'int'],
'ZMQSocket::send' => ['ZMQSocket', 'message'=>'array', 'mode='=>'int'],
'ZMQSocket::send\'1' => ['ZMQSocket', 'message'=>'string', 'mode='=>'int'],
'ZMQSocket::sendmulti' => ['ZMQSocket', 'message'=>'array', 'mode='=>'int'],
'ZMQSocket::setSockOpt' => ['ZMQSocket', 'key'=>'int', 'value'=>'mixed'],
'ZMQSocket::unbind' => ['ZMQSocket', 'dsn'=>'string'],
'Zookeeper::addAuth' => ['bool', 'scheme'=>'string', 'cert'=>'string', 'completion_cb='=>'callable'],
'Zookeeper::close' => ['void'],
'Zookeeper::connect' => ['void', 'host'=>'string', 'watcher_cb='=>'callable', 'recv_timeout='=>'int'],
'Zookeeper::create' => ['string', 'path'=>'string', 'value'=>'string', 'acls'=>'array', 'flags='=>'int'],
'Zookeeper::delete' => ['bool', 'path'=>'string', 'version='=>'int'],
'Zookeeper::exists' => ['bool', 'path'=>'string', 'watcher_cb='=>'callable'],
'Zookeeper::get' => ['string', 'path'=>'string', 'watcher_cb='=>'callable', 'stat='=>'array', 'max_size='=>'int'],
'Zookeeper::getAcl' => ['array', 'path'=>'string'],
'Zookeeper::getChildren' => ['array|false', 'path'=>'string', 'watcher_cb='=>'callable'],
'Zookeeper::getClientId' => ['int'],
'Zookeeper::getConfig' => ['ZookeeperConfig'],
'Zookeeper::getRecvTimeout' => ['int'],
'Zookeeper::getState' => ['int'],
'Zookeeper::isRecoverable' => ['bool'],
'Zookeeper::set' => ['bool', 'path'=>'string', 'value'=>'string', 'version='=>'int', 'stat='=>'array'],
'Zookeeper::setAcl' => ['bool', 'path'=>'string', 'version'=>'int', 'acl'=>'array'],
'Zookeeper::setDebugLevel' => ['bool', 'logLevel'=>'int'],
'Zookeeper::setDeterministicConnOrder' => ['bool', 'yesOrNo'=>'bool'],
'Zookeeper::setLogStream' => ['bool', 'stream'=>'resource'],
'Zookeeper::setWatcher' => ['bool', 'watcher_cb'=>'callable'],
'zookeeper_dispatch' => ['void'],
'ZookeeperConfig::add' => ['void', 'members'=>'string', 'version='=>'int', 'stat='=>'array'],
'ZookeeperConfig::get' => ['string', 'watcher_cb='=>'callable', 'stat='=>'array'],
'ZookeeperConfig::remove' => ['void', 'id_list'=>'string', 'version='=>'int', 'stat='=>'array'],
'ZookeeperConfig::set' => ['void', 'members'=>'string', 'version='=>'int', 'stat='=>'array'],
];
| 1 | 11,768 | The docs say it's `false|null` | vimeo-psalm | php |
@@ -130,9 +130,14 @@ func (c *localCircuitBreaker) checkAndSet() {
// Config represents the configuration of a circuit breaker.
type Config struct {
+ // The threshold over sliding window that would trip the circuit breaker
Threshold float64 `json:"threshold"`
- Type string `json:"type"`
- TripTime string `json:"trip_time"`
+ // Possible values: latency, error_ratio, and status_ratio. It
+ // defaults to latency.
+ Type string `json:"type"`
+ // How long to wait after the circuit is tripped before allowing operations to resume.
+ // The default is 5s.
+ TripTime string `json:"trip_time"`
}
const ( | 1 | // Copyright 2015 Matthew Holt and The Caddy Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package reverseproxy
import (
"fmt"
"sync/atomic"
"time"
"github.com/caddyserver/caddy/v2"
"github.com/vulcand/oxy/memmetrics"
)
func init() {
caddy.RegisterModule(localCircuitBreaker{})
}
// localCircuitBreaker implements circuit breaking functionality
// for requests within this process over a sliding time window.
type localCircuitBreaker struct {
tripped int32
cbType int32
threshold float64
metrics *memmetrics.RTMetrics
tripTime time.Duration
Config
}
// CaddyModule returns the Caddy module information.
func (localCircuitBreaker) CaddyModule() caddy.ModuleInfo {
return caddy.ModuleInfo{
ID: "http.reverse_proxy.circuit_breakers.local",
New: func() caddy.Module { return new(localCircuitBreaker) },
}
}
// Provision sets up a configured circuit breaker.
func (c *localCircuitBreaker) Provision(ctx caddy.Context) error {
t, ok := typeCB[c.Type]
if !ok {
return fmt.Errorf("type is not defined")
}
if c.TripTime == "" {
c.TripTime = defaultTripTime
}
tw, err := time.ParseDuration(c.TripTime)
if err != nil {
return fmt.Errorf("cannot parse trip_time duration, %v", err.Error())
}
mt, err := memmetrics.NewRTMetrics()
if err != nil {
return fmt.Errorf("cannot create new metrics: %v", err.Error())
}
c.cbType = t
c.tripTime = tw
c.threshold = c.Threshold
c.metrics = mt
c.tripped = 0
return nil
}
// Ok returns whether the circuit breaker is tripped or not.
func (c *localCircuitBreaker) Ok() bool {
tripped := atomic.LoadInt32(&c.tripped)
return tripped == 0
}
// RecordMetric records a response status code and execution time of a request. This function should be run in a separate goroutine.
func (c *localCircuitBreaker) RecordMetric(statusCode int, latency time.Duration) {
c.metrics.Record(statusCode, latency)
c.checkAndSet()
}
// Ok checks our metrics to see if we should trip our circuit breaker, or if the fallback duration has completed.
func (c *localCircuitBreaker) checkAndSet() {
var isTripped bool
switch c.cbType {
case typeErrorRatio:
// check if amount of network errors exceed threshold over sliding window, threshold for comparison should be < 1.0 i.e. .5 = 50th percentile
if c.metrics.NetworkErrorRatio() > c.threshold {
isTripped = true
}
case typeLatency:
// check if threshold in milliseconds is reached and trip
hist, err := c.metrics.LatencyHistogram()
if err != nil {
return
}
l := hist.LatencyAtQuantile(c.threshold)
if l.Nanoseconds()/int64(time.Millisecond) > int64(c.threshold) {
isTripped = true
}
case typeStatusCodeRatio:
// check ratio of error status codes of sliding window, threshold for comparison should be < 1.0 i.e. .5 = 50th percentile
if c.metrics.ResponseCodeRatio(500, 600, 0, 600) > c.threshold {
isTripped = true
}
}
if isTripped {
c.metrics.Reset()
atomic.AddInt32(&c.tripped, 1)
// wait tripTime amount before allowing operations to resume.
t := time.NewTimer(c.tripTime)
<-t.C
atomic.AddInt32(&c.tripped, -1)
}
}
// Config represents the configuration of a circuit breaker.
type Config struct {
Threshold float64 `json:"threshold"`
Type string `json:"type"`
TripTime string `json:"trip_time"`
}
const (
typeLatency = iota + 1
typeErrorRatio
typeStatusCodeRatio
defaultTripTime = "5s"
)
var (
// typeCB handles converting a Config Type value to the internal circuit breaker types.
typeCB = map[string]int32{
"latency": typeLatency,
"error_ratio": typeErrorRatio,
"status_ratio": typeStatusCodeRatio,
}
)
| 1 | 14,061 | Thinking on it more, I actually really like your idea to rename `type` to `factor`. | caddyserver-caddy | go |
@@ -45,7 +45,11 @@ public class MessageWebView extends WebView {
* will network images that are already in the WebView cache.
*
*/
- getSettings().setBlockNetworkLoads(shouldBlockNetworkData);
+ try {
+ getSettings().setBlockNetworkLoads(shouldBlockNetworkData);
+ } catch(SecurityException e) {
+ Timber.e(e, "SecurityException in blockNetworkData(final boolean shouldBlockNetworkData)");
+ }
}
| 1 | package com.fsck.k9.view;
import android.content.Context;
import android.content.pm.PackageManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.util.AttributeSet;
import timber.log.Timber;
import android.view.KeyEvent;
import android.webkit.WebSettings;
import android.webkit.WebSettings.LayoutAlgorithm;
import android.webkit.WebSettings.RenderPriority;
import android.webkit.WebView;
import android.widget.Toast;
import com.fsck.k9.ui.R;
import com.fsck.k9.mailstore.AttachmentResolver;
public class MessageWebView extends WebView {
public MessageWebView(Context context) {
super(context);
}
public MessageWebView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MessageWebView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
/**
* Configure a web view to load or not load network data. A <b>true</b> setting here means that
* network data will be blocked.
* @param shouldBlockNetworkData True if network data should be blocked, false to allow network data.
*/
public void blockNetworkData(final boolean shouldBlockNetworkData) {
/*
* Block network loads.
*
* Images with content: URIs will not be blocked, nor
* will network images that are already in the WebView cache.
*
*/
getSettings().setBlockNetworkLoads(shouldBlockNetworkData);
}
/**
* Configure a {@link WebView} to display a Message. This method takes into account a user's
* preferences when configuring the view. This message is used to view a message and to display a message being
* replied to.
*/
public void configure(WebViewConfig config) {
this.setVerticalScrollBarEnabled(true);
this.setVerticalScrollbarOverlay(true);
this.setScrollBarStyle(SCROLLBARS_INSIDE_OVERLAY);
this.setLongClickable(true);
if (config.getUseDarkMode()) {
// Black theme should get a black webview background
// we'll set the background of the messages on load
this.setBackgroundColor(0xff000000);
}
final WebSettings webSettings = this.getSettings();
/* TODO this might improve rendering smoothness when webview is animated into view
if (VERSION.SDK_INT >= VERSION_CODES.M) {
webSettings.setOffscreenPreRaster(true);
}
*/
webSettings.setSupportZoom(true);
webSettings.setBuiltInZoomControls(true);
webSettings.setUseWideViewPort(true);
if (config.getAutoFitWidth()) {
webSettings.setLoadWithOverviewMode(true);
}
disableDisplayZoomControls();
webSettings.setJavaScriptEnabled(false);
webSettings.setLoadsImagesAutomatically(true);
webSettings.setRenderPriority(RenderPriority.HIGH);
// TODO: Review alternatives. NARROW_COLUMNS is deprecated on KITKAT
webSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS);
setOverScrollMode(OVER_SCROLL_NEVER);
webSettings.setTextZoom(config.getTextZoom());
// Disable network images by default. This is overridden by preferences.
blockNetworkData(true);
}
/**
* Disable on-screen zoom controls on devices that support zooming via pinch-to-zoom.
*/
private void disableDisplayZoomControls() {
PackageManager pm = getContext().getPackageManager();
boolean supportsMultiTouch =
pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH) ||
pm.hasSystemFeature(PackageManager.FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT);
getSettings().setDisplayZoomControls(!supportsMultiTouch);
}
public void displayHtmlContentWithInlineAttachments(@NonNull String htmlText,
@Nullable AttachmentResolver attachmentResolver, @Nullable OnPageFinishedListener onPageFinishedListener) {
setWebViewClient(attachmentResolver, onPageFinishedListener);
setHtmlContent(htmlText);
}
private void setWebViewClient(@Nullable AttachmentResolver attachmentResolver,
@Nullable OnPageFinishedListener onPageFinishedListener) {
K9WebViewClient webViewClient = K9WebViewClient.newInstance(attachmentResolver);
if (onPageFinishedListener != null) {
webViewClient.setOnPageFinishedListener(onPageFinishedListener);
}
setWebViewClient(webViewClient);
}
private void setHtmlContent(@NonNull String htmlText) {
loadDataWithBaseURL("about:blank", htmlText, "text/html", "utf-8", null);
resumeTimers();
}
/*
* Emulate the shift key being pressed to trigger the text selection mode
* of a WebView.
*/
public void emulateShiftHeld() {
try {
KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN,
KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
shiftPressEvent.dispatch(this, null, null);
Toast.makeText(getContext() , R.string.select_text_now, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Timber.e(e, "Exception in emulateShiftHeld()");
}
}
public interface OnPageFinishedListener {
void onPageFinished();
}
}
| 1 | 18,833 | This error message is redundant. All of this information is included in the stack trace. In general it's a good idea to avoid using method names in error messages. Chances are the method will be renamed at some point, but the string won't be updated accordingly. Then you'll end up with a very confusing error message. I suggest changing the message to: "Failed to unblock network loads. Missing INTERNET permission?" | k9mail-k-9 | java |
@@ -1,11 +1,9 @@
-# -*- coding: UTF-8 -*-
-#shlobj.py
-#A part of NonVisual Desktop Access (NVDA)
-#Copyright (C) 2006-2017 NV Access Limited, Babbage B.V.
-#This file is covered by the GNU General Public License.
-#See the file COPYING for more details.
+# A part of NonVisual Desktop Access (NVDA)
+# Copyright (C) 2009-2021 NV Access Limited, Babbage B.V.
+# This file is covered by the GNU General Public License.
+# See the file COPYING for more details.
-"""
+r"""
This module wraps the SHGetFolderPath function in shell32.dll and defines the necessary contstants.
CSIDL (constant special item ID list) values provide a unique system-independent way to
identify special folders used frequently by applications, but which may not have the same name | 1 | # -*- coding: UTF-8 -*-
#shlobj.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2017 NV Access Limited, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""
This module wraps the SHGetFolderPath function in shell32.dll and defines the necessary contstants.
CSIDL (constant special item ID list) values provide a unique system-independent way to
identify special folders used frequently by applications, but which may not have the same name
or location on any given system. For example, the system folder may be "C:\Windows" on one system
and "C:\Winnt" on another. The CSIDL system is used to be compatible with Windows XP.
"""
from ctypes import *
from ctypes.wintypes import *
shell32 = windll.shell32
MAX_PATH = 260
#: The file system directory that serves as a common repository for application-specific data.
#: A typical path is C:\Documents and Settings\username\Application Data.
CSIDL_APPDATA = 0x001a
#: The file system directory that serves as a data repository for local (nonroaming) applications.
#: A typical path is C:\Documents and Settings\username\Local Settings\Application Data.
CSIDL_LOCAL_APPDATA = 0x001c
#: The file system directory that contains application data for all users.
#: A typical path is C:\Documents and Settings\All Users\Application Data.
#: This folder is used for application data that is not user specific.
CSIDL_COMMON_APPDATA = 0x0023
def SHGetFolderPath(owner, folder, token=0, flags=0):
path = create_unicode_buffer(MAX_PATH)
# Note As of Windows Vista, this function is merely a wrapper for SHGetKnownFolderPath
if shell32.SHGetFolderPathW(owner, folder, token, flags, byref(path)) != 0:
raise WinError()
return path.value
| 1 | 34,139 | Feel free to add your own name while at it. | nvaccess-nvda | py |
@@ -30,11 +30,11 @@ import (
)
var (
- alias string
bytecode []byte
gasLimit uint64
gasPrice int64
nonce uint64
+ signer string
)
// ActionCmd represents the account command | 1 | // Copyright (c) 2019 IoTeX
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
// License 2.0 that can be found in the LICENSE file.
package action
import (
"context"
"encoding/hex"
"fmt"
"syscall"
"github.com/golang/protobuf/proto"
"github.com/spf13/cobra"
"go.uber.org/zap"
"golang.org/x/crypto/ssh/terminal"
"google.golang.org/grpc"
"github.com/iotexproject/iotex-core/action"
"github.com/iotexproject/iotex-core/cli/ioctl/cmd/account"
"github.com/iotexproject/iotex-core/cli/ioctl/cmd/config"
"github.com/iotexproject/iotex-core/pkg/hash"
"github.com/iotexproject/iotex-core/pkg/keypair"
"github.com/iotexproject/iotex-core/pkg/log"
"github.com/iotexproject/iotex-core/pkg/util/byteutil"
"github.com/iotexproject/iotex-core/protogen/iotexapi"
"github.com/iotexproject/iotex-core/protogen/iotextypes"
)
var (
alias string
bytecode []byte
gasLimit uint64
gasPrice int64
nonce uint64
)
// ActionCmd represents the account command
var ActionCmd = &cobra.Command{
Use: "action",
Short: "Deal with actions of IoTeX blockchain",
Args: cobra.MinimumNArgs(1),
}
func init() {
ActionCmd.AddCommand(actionHashCmd)
ActionCmd.AddCommand(actionTransferCmd)
ActionCmd.AddCommand(actionDeployCmd)
ActionCmd.AddCommand(actionInvokeCmd)
setActionFlags(actionTransferCmd, actionDeployCmd, actionInvokeCmd)
}
func setActionFlags(cmds ...*cobra.Command) {
for _, cmd := range cmds {
cmd.Flags().Uint64VarP(&gasLimit, "gas-limit", "l", 0, "set gas limit")
cmd.Flags().Int64VarP(&gasPrice, "gas-price", "p", 0, "set gas prize")
cmd.Flags().StringVarP(&alias, "alias", "a", "", "choose signing key")
cmd.Flags().Uint64VarP(&nonce, "nonce", "n", 0, "set nonce")
cmd.MarkFlagRequired("gas-limit")
cmd.MarkFlagRequired("gas-price")
cmd.MarkFlagRequired("alias")
if cmd == actionDeployCmd || cmd == actionInvokeCmd {
cmd.Flags().BytesHexVarP(&bytecode, "bytecode", "b", nil, "set the byte code")
actionInvokeCmd.MarkFlagRequired("bytecode")
}
}
}
func sendAction(elp action.Envelope) string {
fmt.Printf("Enter password #%s:\n", alias)
bytePassword, err := terminal.ReadPassword(syscall.Stdin)
if err != nil {
log.L().Error("fail to get password", zap.Error(err))
return err.Error()
}
password := string(bytePassword)
ehash := elp.Hash()
sig, err := account.Sign(alias, password, ehash[:])
if err != nil {
log.L().Error("fail to sign", zap.Error(err))
return err.Error()
}
pubKey, err := keypair.SigToPublicKey(ehash[:], sig)
if err != nil {
log.L().Error("fail to get public key", zap.Error(err))
return err.Error()
}
selp := &iotextypes.Action{
Core: elp.Proto(),
SenderPubKey: pubKey.Bytes(),
Signature: sig,
}
request := &iotexapi.SendActionRequest{Action: selp}
endpoint := config.Get("endpoint")
if endpoint == config.ErrEmptyEndpoint {
log.L().Error(config.ErrEmptyEndpoint)
return "use \"ioctl config set endpoint\" to config endpoint first."
}
conn, err := grpc.Dial(endpoint, grpc.WithInsecure())
if err != nil {
log.L().Error("failed to connect to server", zap.Error(err))
return err.Error()
}
defer conn.Close()
cli := iotexapi.NewAPIServiceClient(conn)
ctx := context.Background()
_, err = cli.SendAction(ctx, request)
if err != nil {
log.L().Error("server error", zap.Error(err))
return err.Error()
}
shash := hash.Hash256b(byteutil.Must(proto.Marshal(selp)))
return "Action has been sent to blockchain.\n" +
"Wait for several seconds and query this action by hash:\n" +
hex.EncodeToString(shash[:])
}
| 1 | 16,141 | `signer` is a global variable (from `gochecknoglobals`) | iotexproject-iotex-core | go |
@@ -74,8 +74,12 @@ module Mongoid
# @return [ String ] The normalized key.
#
# @since 1.0.0
- def normalized_key(name, serializer)
- serializer && serializer.localized? ? "#{name}.#{::I18n.locale}" : name
+ def normalized_key(name, serializer, opts = {})
+ if serializer && serializer.localized? && opts[:localize] != false
+ "#{name}.#{::I18n.locale}"
+ else
+ name
+ end
end
# Get the pair of objects needed to store the value in a hash by the | 1 | # encoding: utf-8
module Mongoid
class Criteria
module Queryable
# This is a smart hash for use with options and selectors.
class Smash < Hash
# @attribute [r] aliases The aliases.
# @attribute [r] serializers The serializers.
attr_reader :aliases, :serializers
# Perform a deep copy of the smash.
#
# @example Perform a deep copy.
# smash.__deep_copy__
#
# @return [ Smash ] The copied hash.
#
# @since 1.0.0
def __deep_copy__
self.class.new(aliases, serializers) do |copy|
each_pair do |key, value|
copy.store(key, value.__deep_copy__)
end
end
end
# Initialize the new selector.
#
# @example Initialize the new selector.
# Queryable::Smash.new(aliases, serializers)
#
# @param [ Hash ] aliases A hash of mappings from aliases to the actual
# field names in the database.
# @param [ Hash ] serializers An optional hash of objects that are
# responsible for serializing values. The keys of the hash must be
# strings that match the field name, and the values must respond to
# #localized? and #evolve(object).
#
# @since 1.0.0
def initialize(aliases = {}, serializers = {})
@aliases, @serializers = aliases, serializers
yield(self) if block_given?
end
# Get an item from the smart hash by the provided key.
#
# @example Get an item by the key.
# smash["test"]
#
# @param [ String ] key The key.
#
# @return [ Object ] The found object.
#
# @since 2.0.0
def [](key)
fetch(aliases[key]) { super }
end
private
# Get the normalized value for the key. If localization is in play the
# current locale will be appended to the key in MongoDB dot notation.
#
# @api private
#
# @example Get the normalized key name.
# smash.normalized_key("field", serializer)
#
# @param [ String ] name The name of the field.
# @param [ Object ] serializer The optional field serializer.
#
# @return [ String ] The normalized key.
#
# @since 1.0.0
def normalized_key(name, serializer)
serializer && serializer.localized? ? "#{name}.#{::I18n.locale}" : name
end
# Get the pair of objects needed to store the value in a hash by the
# provided key. This is the database field name and the serializer.
#
# @api private
#
# @example Get the name and serializer.
# smash.storage_pair("id")
#
# @param [ Symbol, String ] key The key provided to the selection.
#
# @return [ Array<String, Object> ] The name of the db field and
# serializer.
#
# @since 1.0.0
def storage_pair(key)
field = key.to_s
name = aliases[field] || field
[ name, serializers[name] ]
end
end
end
end
end
| 1 | 11,417 | shouldn't this be `&& opts[:localize]` (i.e. both nil and false skip localization?) | mongodb-mongoid | rb |
@@ -17,6 +17,7 @@ from .number_types import (UOffsetTFlags, SOffsetTFlags, VOffsetTFlags)
from . import encode
from . import packer
+import pickle
from . import compat
from .compat import range_func | 1 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from . import number_types as N
from .number_types import (UOffsetTFlags, SOffsetTFlags, VOffsetTFlags)
from . import encode
from . import packer
from . import compat
from .compat import range_func
from .compat import memoryview_type
## @file
## @addtogroup flatbuffers_python_api
## @{
## @cond FLATBUFFERS_INTERNAL
class OffsetArithmeticError(RuntimeError):
"""
Error caused by an Offset arithmetic error. Probably caused by bad
writing of fields. This is considered an unreachable situation in
normal circumstances.
"""
pass
class IsNotNestedError(RuntimeError):
"""
Error caused by using a Builder to write Object data when not inside
an Object.
"""
pass
class IsNestedError(RuntimeError):
"""
Error caused by using a Builder to begin an Object when an Object is
already being built.
"""
pass
class StructIsNotInlineError(RuntimeError):
"""
Error caused by using a Builder to write a Struct at a location that
is not the current Offset.
"""
pass
class BuilderSizeError(RuntimeError):
"""
Error caused by causing a Builder to exceed the hardcoded limit of 2
gigabytes.
"""
pass
class BuilderNotFinishedError(RuntimeError):
"""
Error caused by not calling `Finish` before calling `Output`.
"""
pass
# VtableMetadataFields is the count of metadata fields in each vtable.
VtableMetadataFields = 2
## @endcond
class Builder(object):
""" A Builder is used to construct one or more FlatBuffers.
Typically, Builder objects will be used from code generated by the `flatc`
compiler.
A Builder constructs byte buffers in a last-first manner for simplicity and
performance during reading.
Internally, a Builder is a state machine for creating FlatBuffer objects.
It holds the following internal state:
- Bytes: an array of bytes.
- current_vtable: a list of integers.
- vtables: a list of vtable entries (i.e. a list of list of integers).
Attributes:
Bytes: The internal `bytearray` for the Builder.
finished: A boolean determining if the Builder has been finalized.
"""
## @cond FLATBUFFERS_INTENRAL
__slots__ = ("Bytes", "current_vtable", "head", "minalign", "objectEnd",
"vtables", "nested", "finished")
"""Maximum buffer size constant, in bytes.
Builder will never allow it's buffer grow over this size.
Currently equals 2Gb.
"""
MAX_BUFFER_SIZE = 2**31
## @endcond
def __init__(self, initialSize):
"""Initializes a Builder of size `initial_size`.
The internal buffer is grown as needed.
"""
if not (0 <= initialSize <= Builder.MAX_BUFFER_SIZE):
msg = "flatbuffers: Cannot create Builder larger than 2 gigabytes."
raise BuilderSizeError(msg)
self.Bytes = bytearray(initialSize)
## @cond FLATBUFFERS_INTERNAL
self.current_vtable = None
self.head = UOffsetTFlags.py_type(initialSize)
self.minalign = 1
self.objectEnd = None
self.vtables = []
self.nested = False
## @endcond
self.finished = False
def Output(self):
"""Return the portion of the buffer that has been used for writing data.
This is the typical way to access the FlatBuffer data inside the
builder. If you try to access `Builder.Bytes` directly, you would need
to manually index it with `Head()`, since the buffer is constructed
backwards.
It raises BuilderNotFinishedError if the buffer has not been finished
with `Finish`.
"""
if not self.finished:
raise BuilderNotFinishedError()
return self.Bytes[self.Head():]
## @cond FLATBUFFERS_INTERNAL
def StartObject(self, numfields):
"""StartObject initializes bookkeeping for writing a new object."""
self.assertNotNested()
# use 32-bit offsets so that arithmetic doesn't overflow.
self.current_vtable = [0 for _ in range_func(numfields)]
self.objectEnd = self.Offset()
self.minalign = 1
self.nested = True
def WriteVtable(self):
"""
WriteVtable serializes the vtable for the current object, if needed.
Before writing out the vtable, this checks pre-existing vtables for
equality to this one. If an equal vtable is found, point the object to
the existing vtable and return.
Because vtable values are sensitive to alignment of object data, not
all logically-equal vtables will be deduplicated.
A vtable has the following format:
<VOffsetT: size of the vtable in bytes, including this value>
<VOffsetT: size of the object in bytes, including the vtable offset>
<VOffsetT: offset for a field> * N, where N is the number of fields
in the schema for this type. Includes deprecated fields.
Thus, a vtable is made of 2 + N elements, each VOffsetT bytes wide.
An object has the following format:
<SOffsetT: offset to this object's vtable (may be negative)>
<byte: data>+
"""
# Prepend a zero scalar to the object. Later in this function we'll
# write an offset here that points to the object's vtable:
self.PrependSOffsetTRelative(0)
objectOffset = self.Offset()
existingVtable = None
# Trim trailing 0 offsets.
while self.current_vtable and self.current_vtable[-1] == 0:
self.current_vtable.pop()
# Search backwards through existing vtables, because similar vtables
# are likely to have been recently appended. See
# BenchmarkVtableDeduplication for a case in which this heuristic
# saves about 30% of the time used in writing objects with duplicate
# tables.
i = len(self.vtables) - 1
while i >= 0:
# Find the other vtable, which is associated with `i`:
vt2Offset = self.vtables[i]
vt2Start = len(self.Bytes) - vt2Offset
vt2Len = encode.Get(packer.voffset, self.Bytes, vt2Start)
metadata = VtableMetadataFields * N.VOffsetTFlags.bytewidth
vt2End = vt2Start + vt2Len
vt2 = self.Bytes[vt2Start+metadata:vt2End]
# Compare the other vtable to the one under consideration.
# If they are equal, store the offset and break:
if vtableEqual(self.current_vtable, objectOffset, vt2):
existingVtable = vt2Offset
break
i -= 1
if existingVtable is None:
# Did not find a vtable, so write this one to the buffer.
# Write out the current vtable in reverse , because
# serialization occurs in last-first order:
i = len(self.current_vtable) - 1
while i >= 0:
off = 0
if self.current_vtable[i] != 0:
# Forward reference to field;
# use 32bit number to ensure no overflow:
off = objectOffset - self.current_vtable[i]
self.PrependVOffsetT(off)
i -= 1
# The two metadata fields are written last.
# First, store the object bytesize:
objectSize = UOffsetTFlags.py_type(objectOffset - self.objectEnd)
self.PrependVOffsetT(VOffsetTFlags.py_type(objectSize))
# Second, store the vtable bytesize:
vBytes = len(self.current_vtable) + VtableMetadataFields
vBytes *= N.VOffsetTFlags.bytewidth
self.PrependVOffsetT(VOffsetTFlags.py_type(vBytes))
# Next, write the offset to the new vtable in the
# already-allocated SOffsetT at the beginning of this object:
objectStart = SOffsetTFlags.py_type(len(self.Bytes) - objectOffset)
encode.Write(packer.soffset, self.Bytes, objectStart,
SOffsetTFlags.py_type(self.Offset() - objectOffset))
# Finally, store this vtable in memory for future
# deduplication:
self.vtables.append(self.Offset())
else:
# Found a duplicate vtable.
objectStart = SOffsetTFlags.py_type(len(self.Bytes) - objectOffset)
self.head = UOffsetTFlags.py_type(objectStart)
# Write the offset to the found vtable in the
# already-allocated SOffsetT at the beginning of this object:
encode.Write(packer.soffset, self.Bytes, self.Head(),
SOffsetTFlags.py_type(existingVtable - objectOffset))
self.current_vtable = None
return objectOffset
def EndObject(self):
"""EndObject writes data necessary to finish object construction."""
self.assertNested()
self.nested = False
return self.WriteVtable()
def growByteBuffer(self):
"""Doubles the size of the byteslice, and copies the old data towards
the end of the new buffer (since we build the buffer backwards)."""
if len(self.Bytes) == Builder.MAX_BUFFER_SIZE:
msg = "flatbuffers: cannot grow buffer beyond 2 gigabytes"
raise BuilderSizeError(msg)
newSize = min(len(self.Bytes) * 2, Builder.MAX_BUFFER_SIZE)
if newSize == 0:
newSize = 1
bytes2 = bytearray(newSize)
bytes2[newSize-len(self.Bytes):] = self.Bytes
self.Bytes = bytes2
## @endcond
def Head(self):
"""Get the start of useful data in the underlying byte buffer.
Note: unlike other functions, this value is interpreted as from the
left.
"""
## @cond FLATBUFFERS_INTERNAL
return self.head
## @endcond
## @cond FLATBUFFERS_INTERNAL
def Offset(self):
"""Offset relative to the end of the buffer."""
return UOffsetTFlags.py_type(len(self.Bytes) - self.Head())
def Pad(self, n):
"""Pad places zeros at the current offset."""
for i in range_func(n):
self.Place(0, N.Uint8Flags)
def Prep(self, size, additionalBytes):
"""
Prep prepares to write an element of `size` after `additional_bytes`
have been written, e.g. if you write a string, you need to align
such the int length field is aligned to SizeInt32, and the string
data follows it directly.
If all you need to do is align, `additionalBytes` will be 0.
"""
# Track the biggest thing we've ever aligned to.
if size > self.minalign:
self.minalign = size
# Find the amount of alignment needed such that `size` is properly
# aligned after `additionalBytes`:
alignSize = (~(len(self.Bytes) - self.Head() + additionalBytes)) + 1
alignSize &= (size - 1)
# Reallocate the buffer if needed:
while self.Head() < alignSize+size+additionalBytes:
oldBufSize = len(self.Bytes)
self.growByteBuffer()
updated_head = self.head + len(self.Bytes) - oldBufSize
self.head = UOffsetTFlags.py_type(updated_head)
self.Pad(alignSize)
def PrependSOffsetTRelative(self, off):
"""
PrependSOffsetTRelative prepends an SOffsetT, relative to where it
will be written.
"""
# Ensure alignment is already done:
self.Prep(N.SOffsetTFlags.bytewidth, 0)
if not (off <= self.Offset()):
msg = "flatbuffers: Offset arithmetic error."
raise OffsetArithmeticError(msg)
off2 = self.Offset() - off + N.SOffsetTFlags.bytewidth
self.PlaceSOffsetT(off2)
## @endcond
def PrependUOffsetTRelative(self, off):
"""Prepends an unsigned offset into vector data, relative to where it
will be written.
"""
# Ensure alignment is already done:
self.Prep(N.UOffsetTFlags.bytewidth, 0)
if not (off <= self.Offset()):
msg = "flatbuffers: Offset arithmetic error."
raise OffsetArithmeticError(msg)
off2 = self.Offset() - off + N.UOffsetTFlags.bytewidth
self.PlaceUOffsetT(off2)
## @cond FLATBUFFERS_INTERNAL
def StartVector(self, elemSize, numElems, alignment):
"""
StartVector initializes bookkeeping for writing a new vector.
A vector has the following format:
- <UOffsetT: number of elements in this vector>
- <T: data>+, where T is the type of elements of this vector.
"""
self.assertNotNested()
self.nested = True
self.Prep(N.Uint32Flags.bytewidth, elemSize*numElems)
self.Prep(alignment, elemSize*numElems) # In case alignment > int.
return self.Offset()
## @endcond
def EndVector(self, vectorNumElems):
"""EndVector writes data necessary to finish vector construction."""
self.assertNested()
## @cond FLATBUFFERS_INTERNAL
self.nested = False
## @endcond
# we already made space for this, so write without PrependUint32
self.PlaceUOffsetT(vectorNumElems)
return self.Offset()
def CreateString(self, s, encoding='utf-8', errors='strict'):
"""CreateString writes a null-terminated byte string as a vector."""
self.assertNotNested()
## @cond FLATBUFFERS_INTERNAL
self.nested = True
## @endcond
if isinstance(s, compat.string_types):
x = s.encode(encoding, errors)
elif isinstance(s, compat.binary_types):
x = s
else:
raise TypeError("non-string passed to CreateString")
self.Prep(N.UOffsetTFlags.bytewidth, (len(x)+1)*N.Uint8Flags.bytewidth)
self.Place(0, N.Uint8Flags)
l = UOffsetTFlags.py_type(len(s))
## @cond FLATBUFFERS_INTERNAL
self.head = UOffsetTFlags.py_type(self.Head() - l)
## @endcond
self.Bytes[self.Head():self.Head()+l] = x
return self.EndVector(len(x))
def CreateByteVector(self, x):
"""CreateString writes a byte vector."""
self.assertNotNested()
## @cond FLATBUFFERS_INTERNAL
self.nested = True
## @endcond
if not isinstance(x, compat.binary_types):
raise TypeError("non-byte vector passed to CreateByteVector")
self.Prep(N.UOffsetTFlags.bytewidth, len(x)*N.Uint8Flags.bytewidth)
l = UOffsetTFlags.py_type(len(x))
## @cond FLATBUFFERS_INTERNAL
self.head = UOffsetTFlags.py_type(self.Head() - l)
## @endcond
self.Bytes[self.Head():self.Head()+l] = x
return self.EndVector(len(x))
## @cond FLATBUFFERS_INTERNAL
def assertNested(self):
"""
Check that we are in the process of building an object.
"""
if not self.nested:
raise IsNotNestedError()
def assertNotNested(self):
"""
Check that no other objects are being built while making this
object. If not, raise an exception.
"""
if self.nested:
raise IsNestedError()
def assertStructIsInline(self, obj):
"""
Structs are always stored inline, so need to be created right
where they are used. You'll get this error if you created it
elsewhere.
"""
N.enforce_number(obj, N.UOffsetTFlags)
if obj != self.Offset():
msg = ("flatbuffers: Tried to write a Struct at an Offset that "
"is different from the current Offset of the Builder.")
raise StructIsNotInlineError(msg)
def Slot(self, slotnum):
"""
Slot sets the vtable key `voffset` to the current location in the
buffer.
"""
self.assertNested()
self.current_vtable[slotnum] = self.Offset()
## @endcond
def Finish(self, rootTable):
"""Finish finalizes a buffer, pointing to the given `rootTable`."""
N.enforce_number(rootTable, N.UOffsetTFlags)
self.Prep(self.minalign, N.UOffsetTFlags.bytewidth)
self.PrependUOffsetTRelative(rootTable)
self.finished = True
return self.Head()
## @cond FLATBUFFERS_INTERNAL
def Prepend(self, flags, off):
self.Prep(flags.bytewidth, 0)
self.Place(off, flags)
def PrependSlot(self, flags, o, x, d):
N.enforce_number(x, flags)
N.enforce_number(d, flags)
if x != d:
self.Prepend(flags, x)
self.Slot(o)
def PrependBoolSlot(self, *args): self.PrependSlot(N.BoolFlags, *args)
def PrependByteSlot(self, *args): self.PrependSlot(N.Uint8Flags, *args)
def PrependUint8Slot(self, *args): self.PrependSlot(N.Uint8Flags, *args)
def PrependUint16Slot(self, *args): self.PrependSlot(N.Uint16Flags, *args)
def PrependUint32Slot(self, *args): self.PrependSlot(N.Uint32Flags, *args)
def PrependUint64Slot(self, *args): self.PrependSlot(N.Uint64Flags, *args)
def PrependInt8Slot(self, *args): self.PrependSlot(N.Int8Flags, *args)
def PrependInt16Slot(self, *args): self.PrependSlot(N.Int16Flags, *args)
def PrependInt32Slot(self, *args): self.PrependSlot(N.Int32Flags, *args)
def PrependInt64Slot(self, *args): self.PrependSlot(N.Int64Flags, *args)
def PrependFloat32Slot(self, *args): self.PrependSlot(N.Float32Flags,
*args)
def PrependFloat64Slot(self, *args): self.PrependSlot(N.Float64Flags,
*args)
def PrependUOffsetTRelativeSlot(self, o, x, d):
"""
PrependUOffsetTRelativeSlot prepends an UOffsetT onto the object at
vtable slot `o`. If value `x` equals default `d`, then the slot will
be set to zero and no other data will be written.
"""
if x != d:
self.PrependUOffsetTRelative(x)
self.Slot(o)
def PrependStructSlot(self, v, x, d):
"""
PrependStructSlot prepends a struct onto the object at vtable slot `o`.
Structs are stored inline, so nothing additional is being added.
In generated code, `d` is always 0.
"""
N.enforce_number(d, N.UOffsetTFlags)
if x != d:
self.assertStructIsInline(x)
self.Slot(v)
## @endcond
def PrependBool(self, x):
"""Prepend a `bool` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.BoolFlags, x)
def PrependByte(self, x):
"""Prepend a `byte` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Uint8Flags, x)
def PrependUint8(self, x):
"""Prepend an `uint8` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Uint8Flags, x)
def PrependUint16(self, x):
"""Prepend an `uint16` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Uint16Flags, x)
def PrependUint32(self, x):
"""Prepend an `uint32` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Uint32Flags, x)
def PrependUint64(self, x):
"""Prepend an `uint64` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Uint64Flags, x)
def PrependInt8(self, x):
"""Prepend an `int8` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Int8Flags, x)
def PrependInt16(self, x):
"""Prepend an `int16` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Int16Flags, x)
def PrependInt32(self, x):
"""Prepend an `int32` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Int32Flags, x)
def PrependInt64(self, x):
"""Prepend an `int64` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Int64Flags, x)
def PrependFloat32(self, x):
"""Prepend a `float32` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Float32Flags, x)
def PrependFloat64(self, x):
"""Prepend a `float64` to the Builder buffer.
Note: aligns and checks for space.
"""
self.Prepend(N.Float64Flags, x)
##############################################################
## @cond FLATBUFFERS_INTERNAL
def PrependVOffsetT(self, x): self.Prepend(N.VOffsetTFlags, x)
def Place(self, x, flags):
"""
Place prepends a value specified by `flags` to the Builder,
without checking for available space.
"""
N.enforce_number(x, flags)
self.head = self.head - flags.bytewidth
encode.Write(flags.packer_type, self.Bytes, self.Head(), x)
def PlaceVOffsetT(self, x):
"""PlaceVOffsetT prepends a VOffsetT to the Builder, without checking
for space.
"""
N.enforce_number(x, N.VOffsetTFlags)
self.head = self.head - N.VOffsetTFlags.bytewidth
encode.Write(packer.voffset, self.Bytes, self.Head(), x)
def PlaceSOffsetT(self, x):
"""PlaceSOffsetT prepends a SOffsetT to the Builder, without checking
for space.
"""
N.enforce_number(x, N.SOffsetTFlags)
self.head = self.head - N.SOffsetTFlags.bytewidth
encode.Write(packer.soffset, self.Bytes, self.Head(), x)
def PlaceUOffsetT(self, x):
"""PlaceUOffsetT prepends a UOffsetT to the Builder, without checking
for space.
"""
N.enforce_number(x, N.UOffsetTFlags)
self.head = self.head - N.UOffsetTFlags.bytewidth
encode.Write(packer.uoffset, self.Bytes, self.Head(), x)
## @endcond
## @cond FLATBUFFERS_INTERNAL
def vtableEqual(a, objectStart, b):
"""vtableEqual compares an unwritten vtable to a written vtable."""
N.enforce_number(objectStart, N.UOffsetTFlags)
if len(a) * N.VOffsetTFlags.bytewidth != len(b):
return False
for i, elem in enumerate(a):
x = encode.Get(packer.voffset, b, i * N.VOffsetTFlags.bytewidth)
# Skip vtable entries that indicate a default value.
if x == 0 and elem == 0:
pass
else:
y = objectStart - elem
if x != y:
return False
return True
## @endcond
## @}
| 1 | 13,371 | This can also be removed. | google-flatbuffers | java |
@@ -32,7 +32,8 @@ SYNOPSIS
const char *key);
int flux_kvs_txn_symlink (flux_kvs_txn_t *txn, int flags,
- const char *key, const char *target);
+ const char *key, const char *ns,
+ const char *target);
int flux_kvs_txn_put_raw (flux_kvs_txn_t *txn, int flags,
const char *key, const void *data, int len); | 1 | flux_kvs_txn_create(3)
======================
:doctype: manpage
NAME
----
flux_kvs_txn_create, flux_kvs_txn_destroy, flux_kvs_txn_put, flux_kvs_txn_pack, flux_kvs_txn_vpack, flux_kvs_txn_mkdir, flux_kvs_txn_unlink, flux_kvs_txn_symlink, flux_kvs_txn_put_raw, flux_kvs_txn_put_treeobj - operate on a KVS transaction object
SYNOPSIS
--------
#include <flux/core.h>
flux_kvs_txn_t *flux_kvs_txn_create (void);
void flux_kvs_txn_destroy (flux_kvs_txn_t *txn);
int flux_kvs_txn_put (flux_kvs_txn_t *txn, int flags,
const char *key, const char *value);
int flux_kvs_txn_pack (flux_kvs_txn_t *txn, int flags,
const char *key, const char *fmt, ...);
int flux_kvs_txn_vpack (flux_kvs_txn_t *txn, int flags,
const char *key, const char *fmt, va_list ap);
int flux_kvs_txn_mkdir (flux_kvs_txn_t *txn, int flags,
const char *key);
int flux_kvs_txn_unlink (flux_kvs_txn_t *txn, int flags,
const char *key);
int flux_kvs_txn_symlink (flux_kvs_txn_t *txn, int flags,
const char *key, const char *target);
int flux_kvs_txn_put_raw (flux_kvs_txn_t *txn, int flags,
const char *key, const void *data, int len);
int flux_kvs_txn_put_treeobj (flux_kvs_txn_t *txn, int flags,
const char *key, const char *treeobj);
DESCRIPTION
-----------
The Flux Key Value Store is a general purpose distributed storage
service used by Flux services.
`flux_kvs_txn_create()` creates a KVS transaction object that may be
passed to `flux_kvs_commit(3)` or `flux_kvs_fence(3)`. The transaction
consists of a list of operations that are applied to the KVS together,
in order. The entire transaction either succeeds or fails. After commit
or fence, the object must be destroyed with `flux_kvs_txn_destroy()`.
Each function below adds a single operation to _txn_. _key_ is a
hierarchical path name with period (".") used as path separator.
When the transaction is committed, any existing keys or path components
that are in conflict with the requested operation are overwritten.
_flags_ can modify the request as described below.
`flux_kvs_txn_put()` sets _key_ to a NULL terminated string _value_.
_value_ may be NULL indicating that an empty value should be stored.
`flux_kvs_txn_pack()` sets _key_ to a NULL terminated string encoded
from a JSON object built with `json_pack()` style arguments (see below).
`flux_kvs_txn_vpack()` is a variant that accepts a _va_list_ argument.
`flux_kvs_txn_mkdir()` sets _key_ to an empty directory.
`flux_kvs_txn_unlink()` removes _key_. If _key_ is a directory,
all its contents are removed as well.
`flux_kvs_txn_symlink()` sets _key_ to a symbolic link pointing to _target_,
another key. _target_ need not exist.
`flux_kvs_txn_put_raw()` sets _key_ to a value containing raw data
referred to by _data_ of length _len_.
`flux_kvs_txn_put_treeobj()` sets _key_ to an RFC 11 object, encoded
as a JSON string.
FLAGS
-----
The following are valid bits in a _flags_ mask passed as an argument
to `flux_kvs_txn_put()` or `flux_kvs_txn_put_raw()`.
FLUX_KVS_APPEND::
Append value instead of overwriting it. If the key does not exist,
it will be created with the value as the initial value.
include::JSON_PACK.adoc[]
RETURN VALUE
------------
`flux_kvs_txn_create()` returns a `flux_kvs_txn_t` object on success,
or NULL on failure with errno set appropriately.
`flux_kvs_txn_put()`, `flux_kvs_txn_pack()`, `flux_kvs_txn_mkdir()`,
`flux_kvs_txn_unlink()`, `flux_kvs_txn_symlink()`, and `flux_kvs_txn_put_raw()`
returns 0 on success, or -1 on failure with errno set appropriately.
ERRORS
------
EINVAL::
One of the arguments was invalid.
ENOMEM::
Out of memory.
AUTHOR
------
This page is maintained by the Flux community.
RESOURCES
---------
Github: <http://github.com/flux-framework>
COPYRIGHT
---------
include::COPYRIGHT.adoc[]
SEE ALSO
---------
flux_kvs_commit(3)
https://github.com/flux-framework/rfc/blob/master/spec_11.adoc[RFC 11: Key Value Store Tree Object Format v1]
| 1 | 22,496 | Not critical but "common" is not that helpful in the commit title. Maybe go with "libkvs/txn:" for this one? | flux-framework-flux-core | c |
@@ -277,6 +277,7 @@ class YamlConfig(QObject):
self._mark_changed()
self._migrate_bool(settings, 'tabs.favicons.show', 'always', 'never')
+ self._migrate_bool(settings, 'scrolling.bar', 'when_searching', 'never')
self._migrate_bool(settings, 'qt.force_software_rendering',
'software-opengl', 'none')
| 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <[email protected]>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""Configuration files residing on disk."""
import pathlib
import types
import os.path
import sys
import textwrap
import traceback
import configparser
import contextlib
import yaml
from PyQt5.QtCore import pyqtSignal, QObject, QSettings
import qutebrowser
from qutebrowser.config import configexc, config, configdata, configutils
from qutebrowser.keyinput import keyutils
from qutebrowser.utils import standarddir, utils, qtutils, log, urlmatch
# The StateConfig instance
state = None
class StateConfig(configparser.ConfigParser):
"""The "state" file saving various application state."""
def __init__(self):
super().__init__()
self._filename = os.path.join(standarddir.data(), 'state')
self.read(self._filename, encoding='utf-8')
for sect in ['general', 'geometry']:
try:
self.add_section(sect)
except configparser.DuplicateSectionError:
pass
deleted_keys = ['fooled', 'backend-warning-shown']
for key in deleted_keys:
self['general'].pop(key, None)
def init_save_manager(self, save_manager):
"""Make sure the config gets saved properly.
We do this outside of __init__ because the config gets created before
the save_manager exists.
"""
save_manager.add_saveable('state-config', self._save)
def _save(self):
"""Save the state file to the configured location."""
with open(self._filename, 'w', encoding='utf-8') as f:
self.write(f)
class YamlConfig(QObject):
"""A config stored on disk as YAML file.
Class attributes:
VERSION: The current version number of the config file.
"""
VERSION = 2
changed = pyqtSignal()
def __init__(self, parent=None):
super().__init__(parent)
self._filename = os.path.join(standarddir.config(auto=True),
'autoconfig.yml')
self._dirty = None
self._values = {}
for name, opt in configdata.DATA.items():
self._values[name] = configutils.Values(opt)
def init_save_manager(self, save_manager):
"""Make sure the config gets saved properly.
We do this outside of __init__ because the config gets created before
the save_manager exists.
"""
save_manager.add_saveable('yaml-config', self._save, self.changed)
def __iter__(self):
"""Iterate over configutils.Values items."""
yield from self._values.values()
def _mark_changed(self):
"""Mark the YAML config as changed."""
self._dirty = True
self.changed.emit()
def _save(self):
"""Save the settings to the YAML file if they've changed."""
if not self._dirty:
return
settings = {}
for name, values in sorted(self._values.items()):
if not values:
continue
settings[name] = {}
for scoped in values:
key = ('global' if scoped.pattern is None
else str(scoped.pattern))
settings[name][key] = scoped.value
data = {'config_version': self.VERSION, 'settings': settings}
with qtutils.savefile_open(self._filename) as f:
f.write(textwrap.dedent("""
# DO NOT edit this file by hand, qutebrowser will overwrite it.
# Instead, create a config.py - see :help for details.
""".lstrip('\n')))
utils.yaml_dump(data, f)
def _pop_object(self, yaml_data, key, typ):
"""Get a global object from the given data."""
if not isinstance(yaml_data, dict):
desc = configexc.ConfigErrorDesc("While loading data",
"Toplevel object is not a dict")
raise configexc.ConfigFileErrors('autoconfig.yml', [desc])
if key not in yaml_data:
desc = configexc.ConfigErrorDesc(
"While loading data",
"Toplevel object does not contain '{}' key".format(key))
raise configexc.ConfigFileErrors('autoconfig.yml', [desc])
data = yaml_data.pop(key)
if not isinstance(data, typ):
desc = configexc.ConfigErrorDesc(
"While loading data",
"'{}' object is not a {}".format(key, typ.__name__))
raise configexc.ConfigFileErrors('autoconfig.yml', [desc])
return data
def load(self):
"""Load configuration from the configured YAML file."""
try:
with open(self._filename, 'r', encoding='utf-8') as f:
yaml_data = utils.yaml_load(f)
except FileNotFoundError:
return
except OSError as e:
desc = configexc.ConfigErrorDesc("While reading", e)
raise configexc.ConfigFileErrors('autoconfig.yml', [desc])
except yaml.YAMLError as e:
desc = configexc.ConfigErrorDesc("While parsing", e)
raise configexc.ConfigFileErrors('autoconfig.yml', [desc])
config_version = self._pop_object(yaml_data, 'config_version', int)
if config_version == 1:
settings = self._load_legacy_settings_object(yaml_data)
self._mark_changed()
elif config_version > self.VERSION:
desc = configexc.ConfigErrorDesc(
"While reading",
"Can't read config from incompatible newer version")
raise configexc.ConfigFileErrors('autoconfig.yml', [desc])
else:
settings = self._load_settings_object(yaml_data)
self._dirty = False
settings = self._handle_migrations(settings)
self._validate(settings)
self._build_values(settings)
def _load_settings_object(self, yaml_data):
"""Load the settings from the settings: key."""
return self._pop_object(yaml_data, 'settings', dict)
def _load_legacy_settings_object(self, yaml_data):
data = self._pop_object(yaml_data, 'global', dict)
settings = {}
for name, value in data.items():
settings[name] = {'global': value}
return settings
def _build_values(self, settings):
"""Build up self._values from the values in the given dict."""
errors = []
for name, yaml_values in settings.items():
if not isinstance(yaml_values, dict):
errors.append(configexc.ConfigErrorDesc(
"While parsing {!r}".format(name), "value is not a dict"))
continue
values = configutils.Values(configdata.DATA[name])
if 'global' in yaml_values:
values.add(yaml_values.pop('global'))
for pattern, value in yaml_values.items():
if not isinstance(pattern, str):
errors.append(configexc.ConfigErrorDesc(
"While parsing {!r}".format(name),
"pattern is not of type string"))
continue
try:
urlpattern = urlmatch.UrlPattern(pattern)
except urlmatch.ParseError as e:
errors.append(configexc.ConfigErrorDesc(
"While parsing pattern {!r} for {!r}"
.format(pattern, name), e))
continue
values.add(value, urlpattern)
self._values[name] = values
if errors:
raise configexc.ConfigFileErrors('autoconfig.yml', errors)
def _migrate_bool(self, settings, name, true_value, false_value):
"""Migrate a boolean in the settings."""
if name in settings:
for scope, val in settings[name].items():
if isinstance(val, bool):
settings[name][scope] = true_value if val else false_value
self._mark_changed()
def _handle_migrations(self, settings):
"""Migrate older configs to the newest format."""
# Simple renamed/deleted options
for name in list(settings):
if name in configdata.MIGRATIONS.renamed:
new_name = configdata.MIGRATIONS.renamed[name]
log.config.debug("Renaming {} to {}".format(name, new_name))
settings[new_name] = settings[name]
del settings[name]
self._mark_changed()
elif name in configdata.MIGRATIONS.deleted:
log.config.debug("Removing {}".format(name))
del settings[name]
self._mark_changed()
# tabs.persist_mode_on_change got merged into tabs.mode_on_change
old = 'tabs.persist_mode_on_change'
new = 'tabs.mode_on_change'
if old in settings:
settings[new] = {}
for scope, val in settings[old].items():
if val:
settings[new][scope] = 'persist'
else:
settings[new][scope] = 'normal'
del settings[old]
self._mark_changed()
# bindings.default can't be set in autoconfig.yml anymore, so ignore
# old values.
if 'bindings.default' in settings:
del settings['bindings.default']
self._mark_changed()
self._migrate_bool(settings, 'tabs.favicons.show', 'always', 'never')
self._migrate_bool(settings, 'qt.force_software_rendering',
'software-opengl', 'none')
return settings
def _validate(self, settings):
"""Make sure all settings exist."""
unknown = []
for name in settings:
if name not in configdata.DATA:
unknown.append(name)
if unknown:
errors = [configexc.ConfigErrorDesc("While loading options",
"Unknown option {}".format(e))
for e in sorted(unknown)]
raise configexc.ConfigFileErrors('autoconfig.yml', errors)
def set_obj(self, name, value, *, pattern=None):
"""Set the given setting to the given value."""
self._values[name].add(value, pattern)
self._mark_changed()
def unset(self, name, *, pattern=None):
"""Remove the given option name if it's configured."""
changed = self._values[name].remove(pattern)
if changed:
self._mark_changed()
def clear(self):
"""Clear all values from the YAML file."""
for values in self._values.values():
values.clear()
self._mark_changed()
class ConfigAPI:
"""Object which gets passed to config.py as "config" object.
This is a small wrapper over the Config object, but with more
straightforward method names (get/set call get_obj/set_obj) and a more
shallow API.
Attributes:
_config: The main Config object to use.
_keyconfig: The KeyConfig object.
errors: Errors which occurred while setting options.
configdir: The qutebrowser config directory, as pathlib.Path.
datadir: The qutebrowser data directory, as pathlib.Path.
"""
def __init__(self, conf, keyconfig):
self._config = conf
self._keyconfig = keyconfig
self.errors = []
self.configdir = pathlib.Path(standarddir.config())
self.datadir = pathlib.Path(standarddir.data())
@contextlib.contextmanager
def _handle_error(self, action, name):
"""Catch config-related exceptions and save them in self.errors."""
try:
yield
except configexc.ConfigFileErrors as e:
for err in e.errors:
new_err = err.with_text(e.basename)
self.errors.append(new_err)
except configexc.Error as e:
text = "While {} '{}'".format(action, name)
self.errors.append(configexc.ConfigErrorDesc(text, e))
except urlmatch.ParseError as e:
text = "While {} '{}' and parsing pattern".format(action, name)
self.errors.append(configexc.ConfigErrorDesc(text, e))
except keyutils.KeyParseError as e:
text = "While {} '{}' and parsing key".format(action, name)
self.errors.append(configexc.ConfigErrorDesc(text, e))
def finalize(self):
"""Do work which needs to be done after reading config.py."""
self._config.update_mutables()
def load_autoconfig(self):
"""Load the autoconfig.yml file which is used for :set/:bind/etc."""
with self._handle_error('reading', 'autoconfig.yml'):
read_autoconfig()
def get(self, name, pattern=None):
"""Get a setting value from the config, optionally with a pattern."""
with self._handle_error('getting', name):
urlpattern = urlmatch.UrlPattern(pattern) if pattern else None
return self._config.get_mutable_obj(name, pattern=urlpattern)
def set(self, name, value, pattern=None):
"""Set a setting value in the config, optionally with a pattern."""
with self._handle_error('setting', name):
urlpattern = urlmatch.UrlPattern(pattern) if pattern else None
self._config.set_obj(name, value, pattern=urlpattern)
def bind(self, key, command, mode='normal'):
"""Bind a key to a command, with an optional key mode."""
with self._handle_error('binding', key):
seq = keyutils.KeySequence.parse(key)
self._keyconfig.bind(seq, command, mode=mode)
def unbind(self, key, mode='normal'):
"""Unbind a key from a command, with an optional key mode."""
with self._handle_error('unbinding', key):
seq = keyutils.KeySequence.parse(key)
self._keyconfig.unbind(seq, mode=mode)
def source(self, filename):
"""Read the given config file from disk."""
if not os.path.isabs(filename):
filename = str(self.configdir / filename)
try:
read_config_py(filename)
except configexc.ConfigFileErrors as e:
self.errors += e.errors
@contextlib.contextmanager
def pattern(self, pattern):
"""Get a ConfigContainer for the given pattern."""
# We need to propagate the exception so we don't need to return
# something.
urlpattern = urlmatch.UrlPattern(pattern)
container = config.ConfigContainer(config=self._config, configapi=self,
pattern=urlpattern)
yield container
class ConfigPyWriter:
"""Writer for config.py files from given settings."""
def __init__(self, options, bindings, *, commented):
self._options = options
self._bindings = bindings
self._commented = commented
def write(self, filename):
"""Write the config to the given file."""
with open(filename, 'w', encoding='utf-8') as f:
f.write('\n'.join(self._gen_lines()))
def _line(self, line):
"""Get an (optionally commented) line."""
if self._commented:
if line.startswith('#'):
return '#' + line
else:
return '# ' + line
else:
return line
def _gen_lines(self):
"""Generate a config.py with the given settings/bindings.
Yields individual lines.
"""
yield from self._gen_header()
yield from self._gen_options()
yield from self._gen_bindings()
def _gen_header(self):
"""Generate the initial header of the config."""
yield self._line("# Autogenerated config.py")
yield self._line("# Documentation:")
yield self._line("# qute://help/configuring.html")
yield self._line("# qute://help/settings.html")
yield ''
if self._commented:
# When generated from an autoconfig.yml with commented=False,
# we don't want to load that autoconfig.yml anymore.
yield self._line("# This is here so configs done via the GUI are "
"still loaded.")
yield self._line("# Remove it to not load settings done via the "
"GUI.")
yield self._line("config.load_autoconfig()")
yield ''
else:
yield self._line("# Uncomment this to still load settings "
"configured via autoconfig.yml")
yield self._line("# config.load_autoconfig()")
yield ''
def _gen_options(self):
"""Generate the options part of the config."""
for pattern, opt, value in self._options:
if opt.name in ['bindings.commands', 'bindings.default']:
continue
for line in textwrap.wrap(opt.description):
yield self._line("# {}".format(line))
yield self._line("# Type: {}".format(opt.typ.get_name()))
valid_values = opt.typ.get_valid_values()
if valid_values is not None and valid_values.generate_docs:
yield self._line("# Valid values:")
for val in valid_values:
try:
desc = valid_values.descriptions[val]
yield self._line("# - {}: {}".format(val, desc))
except KeyError:
yield self._line("# - {}".format(val))
if pattern is None:
yield self._line('c.{} = {!r}'.format(opt.name, value))
else:
yield self._line('config.set({!r}, {!r}, {!r})'.format(
opt.name, value, str(pattern)))
yield ''
def _gen_bindings(self):
"""Generate the bindings part of the config."""
normal_bindings = self._bindings.pop('normal', {})
if normal_bindings:
yield self._line('# Bindings for normal mode')
for key, command in sorted(normal_bindings.items()):
yield self._line('config.bind({!r}, {!r})'.format(
key, command))
yield ''
for mode, mode_bindings in sorted(self._bindings.items()):
yield self._line('# Bindings for {} mode'.format(mode))
for key, command in sorted(mode_bindings.items()):
yield self._line('config.bind({!r}, {!r}, mode={!r})'.format(
key, command, mode))
yield ''
def read_config_py(filename, raising=False):
"""Read a config.py file.
Arguments;
filename: The name of the file to read.
raising: Raise exceptions happening in config.py.
This is needed during tests to use pytest's inspection.
"""
assert config.instance is not None
assert config.key_instance is not None
api = ConfigAPI(config.instance, config.key_instance)
container = config.ConfigContainer(config.instance, configapi=api)
basename = os.path.basename(filename)
module = types.ModuleType('config')
module.config = api
module.c = container
module.__file__ = filename
try:
with open(filename, mode='rb') as f:
source = f.read()
except OSError as e:
text = "Error while reading {}".format(basename)
desc = configexc.ConfigErrorDesc(text, e)
raise configexc.ConfigFileErrors(basename, [desc])
try:
code = compile(source, filename, 'exec')
except ValueError as e:
# source contains NUL bytes
desc = configexc.ConfigErrorDesc("Error while compiling", e)
raise configexc.ConfigFileErrors(basename, [desc])
except SyntaxError as e:
desc = configexc.ConfigErrorDesc("Unhandled exception", e,
traceback=traceback.format_exc())
raise configexc.ConfigFileErrors(basename, [desc])
try:
# Save and restore sys variables
with saved_sys_properties():
# Add config directory to python path, so config.py can import
# other files in logical places
config_dir = os.path.dirname(filename)
if config_dir not in sys.path:
sys.path.insert(0, config_dir)
exec(code, module.__dict__)
except Exception as e:
if raising:
raise
api.errors.append(configexc.ConfigErrorDesc(
"Unhandled exception",
exception=e, traceback=traceback.format_exc()))
api.finalize()
if api.errors:
raise configexc.ConfigFileErrors('config.py', api.errors)
def read_autoconfig():
"""Read the autoconfig.yml file."""
try:
config.instance.read_yaml()
except configexc.ConfigFileErrors:
raise # caught in outer block
except configexc.Error as e:
desc = configexc.ConfigErrorDesc("Error", e)
raise configexc.ConfigFileErrors('autoconfig.yml', [desc])
@contextlib.contextmanager
def saved_sys_properties():
"""Save various sys properties such as sys.path and sys.modules."""
old_path = sys.path.copy()
old_modules = sys.modules.copy()
try:
yield
finally:
sys.path = old_path
for module in set(sys.modules).difference(old_modules):
del sys.modules[module]
def init():
"""Initialize config storage not related to the main config."""
global state
state = StateConfig()
state['general']['version'] = qutebrowser.__version__
# Set the QSettings path to something like
# ~/.config/qutebrowser/qsettings/qutebrowser/qutebrowser.conf so it
# doesn't overwrite our config.
#
# This fixes one of the corruption issues here:
# https://github.com/qutebrowser/qutebrowser/issues/515
path = os.path.join(standarddir.config(auto=True), 'qsettings')
for fmt in [QSettings.NativeFormat, QSettings.IniFormat]:
QSettings.setPath(fmt, QSettings.UserScope, path)
| 1 | 22,144 | It's been a while, but I just noticed this was wrong: It migrated `True` to `when-searching` (so people with `scrolling.bar = True` suddenly didn't have scrollbars anymore) and `False` to never. Instead, it should migrate `True` to `always` (no behavior change) and `False` to `when-searching` (so people notice the new feature). I fixed this in cc0f5fc6d400e12833ba729049e31d16cf836d53. | qutebrowser-qutebrowser | py |
@@ -27,7 +27,7 @@ class RRDReader(BaseReader):
def _convert_fs_path(fs_path):
if isinstance(fs_path, six.text_type):
fs_path = fs_path.encode(sys.getfilesystemencoding())
- return os.path.realpath(fs_path)
+ return os.path.realpath(fs_path).decode("utf-8")
def __init__(self, fs_path, datasource_name):
self.fs_path = RRDReader._convert_fs_path(fs_path) | 1 | import sys
import os
import time
import six
# Use the built-in version of scandir/stat if possible, otherwise
# use the scandir module version
try:
from os import scandir, stat # noqa # pylint: disable=unused-import
except ImportError:
from scandir import scandir, stat # noqa # pylint: disable=unused-import
try:
import rrdtool
except ImportError:
rrdtool = False
from django.conf import settings
from graphite.intervals import Interval, IntervalSet
from graphite.readers.utils import BaseReader
class RRDReader(BaseReader):
supported = bool(rrdtool)
@staticmethod
def _convert_fs_path(fs_path):
if isinstance(fs_path, six.text_type):
fs_path = fs_path.encode(sys.getfilesystemencoding())
return os.path.realpath(fs_path)
def __init__(self, fs_path, datasource_name):
self.fs_path = RRDReader._convert_fs_path(fs_path)
self.datasource_name = datasource_name
def get_intervals(self):
start = time.time() - self.get_retention(self.fs_path)
end = max(stat(self.fs_path).st_mtime, start)
return IntervalSet([Interval(start, end)])
def fetch(self, startTime, endTime):
startString = time.strftime(
"%H:%M_%Y%m%d+%Ss", time.localtime(startTime))
endString = time.strftime("%H:%M_%Y%m%d+%Ss", time.localtime(endTime))
if settings.FLUSHRRDCACHED:
rrdtool.flushcached(self.fs_path, '--daemon',
settings.FLUSHRRDCACHED)
(timeInfo, columns, rows) = rrdtool.fetch(
self.fs_path,
settings.RRD_CF, '-s' + startString, '-e' + endString)
colIndex = list(columns).index(self.datasource_name)
rows.pop() # chop off the latest value because RRD returns crazy last values sometimes
values = (row[colIndex] for row in rows)
return (timeInfo, values)
@staticmethod
def get_datasources(fs_path):
info = rrdtool.info(RRDReader._convert_fs_path(fs_path))
if 'ds' in info:
return [datasource_name for datasource_name in info['ds']]
else:
ds_keys = [key for key in info if key.startswith('ds[')]
datasources = set(key[3:].split(']')[0] for key in ds_keys)
return list(datasources)
@staticmethod
def get_retention(fs_path):
info = rrdtool.info(RRDReader._convert_fs_path(fs_path))
if 'rra' in info:
rras = info['rra']
else:
# Ugh, I like the old python-rrdtool api better..
rra_count = max([int(key[4])
for key in info if key.startswith('rra[')]) + 1
rras = [{}] * rra_count
for i in range(rra_count):
rras[i]['pdp_per_row'] = info['rra[%d].pdp_per_row' % i]
rras[i]['rows'] = info['rra[%d].rows' % i]
retention_points = 0
for rra in rras:
points = rra['pdp_per_row'] * rra['rows']
if points > retention_points:
retention_points = points
return retention_points * info['step']
| 1 | 12,541 | .decode(sys.getfilesystemencoding()) will be better. Although I think rrdtool should accept bytes.. | graphite-project-graphite-web | py |
@@ -0,0 +1,9 @@
+using System;
+
+namespace Microsoft.AspNetCore.Server.Kestrel.Internal.Http
+{
+ public interface IHttpHeadersHandler
+ {
+ void OnHeader(Span<byte> name, Span<byte> value);
+ }
+} | 1 | 1 | 11,713 | An interface call per header might be more expensive than we want to pay. Do we really need this to be abstracted? I think a parser abstraction makes sense, but it seems to me like a separate abstraction for handling headers (one by one) might be an overkill. | aspnet-KestrelHttpServer | .cs |
|
@@ -51,15 +51,10 @@ namespace NLog
private const int StackTraceSkipMethods = 0;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", Justification = "Using 'NLog' in message.")]
- internal static void Write([NotNull] Type loggerType, TargetWithFilterChain targets, LogEventInfo logEvent, LogFactory factory)
+ internal static void Write([NotNull] Type loggerType, [NotNull] TargetWithFilterChain targetsForLevel, LogEventInfo logEvent, LogFactory factory)
{
- if (targets == null)
- {
- return;
- }
-
#if !NETSTANDARD1_0 || NETSTANDARD1_5
- StackTraceUsage stu = targets.GetStackTraceUsage();
+ StackTraceUsage stu = targetsForLevel.GetStackTraceUsage();
if (stu != StackTraceUsage.None && !logEvent.HasStackTrace)
{
#if NETSTANDARD1_5 | 1 | //
// Copyright (c) 2004-2019 Jaroslaw Kowalski <[email protected]>, Kim Christensen, Julian Verdurmen
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * Neither the name of Jaroslaw Kowalski nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
// THE POSSIBILITY OF SUCH DAMAGE.
//
namespace NLog
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using JetBrains.Annotations;
using NLog.Common;
using NLog.Config;
using NLog.Filters;
using NLog.Internal;
/// <summary>
/// Implementation of logging engine.
/// </summary>
internal static class LoggerImpl
{
private const int StackTraceSkipMethods = 0;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", Justification = "Using 'NLog' in message.")]
internal static void Write([NotNull] Type loggerType, TargetWithFilterChain targets, LogEventInfo logEvent, LogFactory factory)
{
if (targets == null)
{
return;
}
#if !NETSTANDARD1_0 || NETSTANDARD1_5
StackTraceUsage stu = targets.GetStackTraceUsage();
if (stu != StackTraceUsage.None && !logEvent.HasStackTrace)
{
#if NETSTANDARD1_5
var stackTrace = (StackTrace)Activator.CreateInstance(typeof(StackTrace), new object[] { stu == StackTraceUsage.WithSource });
#elif !SILVERLIGHT
var stackTrace = new StackTrace(StackTraceSkipMethods, stu == StackTraceUsage.WithSource);
#else
var stackTrace = new StackTrace();
#endif
var stackFrames = stackTrace.GetFrames();
int? firstUserFrame = FindCallingMethodOnStackTrace(stackFrames, loggerType);
int? firstLegacyUserFrame = firstUserFrame.HasValue ? SkipToUserStackFrameLegacy(stackFrames, firstUserFrame.Value) : (int?)null;
logEvent.GetCallSiteInformationInternal().SetStackTrace(stackTrace, firstUserFrame ?? 0, firstLegacyUserFrame);
}
#endif
AsyncContinuation exceptionHandler = (ex) => { };
if (factory.ThrowExceptions)
{
int originalThreadId = AsyncHelpers.GetManagedThreadId();
exceptionHandler = ex =>
{
if (ex != null && AsyncHelpers.GetManagedThreadId() == originalThreadId)
{
throw new NLogRuntimeException("Exception occurred in NLog", ex);
}
};
}
if (targets.NextInChain == null && logEvent.CanLogEventDeferMessageFormat())
{
// Change MessageFormatter so it writes directly to StringBuilder without string-allocation
logEvent.MessageFormatter = LogMessageTemplateFormatter.DefaultAutoSingleTarget.MessageFormatter;
}
IList<Filter> prevFilterChain = null;
FilterResult prevFilterResult = FilterResult.Neutral;
for (var t = targets; t != null; t = t.NextInChain)
{
FilterResult result = ReferenceEquals(prevFilterChain, t.FilterChain) ?
prevFilterResult : GetFilterResult(t.FilterChain, logEvent, t.DefaultResult);
if (!WriteToTargetWithFilterChain(t.Target, result, logEvent, exceptionHandler))
{
break;
}
prevFilterResult = result; // Cache the result, and reuse it for the next target, if it comes from the same logging-rule
prevFilterChain = t.FilterChain;
}
}
/// <summary>
/// Finds first user stack frame in a stack trace
/// </summary>
/// <param name="stackFrames">The stack trace of the logging method invocation</param>
/// <param name="loggerType">Type of the logger or logger wrapper. This is still Logger if it's a subclass of Logger.</param>
/// <returns>Index of the first user stack frame or 0 if all stack frames are non-user</returns>
internal static int? FindCallingMethodOnStackTrace(StackFrame[] stackFrames, [NotNull] Type loggerType)
{
if (stackFrames == null || stackFrames.Length == 0)
return null;
int? firstStackFrameAfterLogger = null;
int? firstUserStackFrame = null;
for (int i = 0; i < stackFrames.Length; ++i)
{
var stackFrame = stackFrames[i];
if (SkipAssembly(stackFrame))
continue;
if (!firstUserStackFrame.HasValue)
firstUserStackFrame = i;
if (IsLoggerType(stackFrame, loggerType))
{
firstStackFrameAfterLogger = null;
continue;
}
if (!firstStackFrameAfterLogger.HasValue)
firstStackFrameAfterLogger = i;
}
return firstStackFrameAfterLogger ?? firstUserStackFrame;
}
/// <summary>
/// This is only done for legacy reason, as the correct method-name and line-number should be extracted from the MoveNext-StackFrame
/// </summary>
/// <param name="stackFrames">The stack trace of the logging method invocation</param>
/// <param name="firstUserStackFrame">Starting point for skipping async MoveNext-frames</param>
internal static int SkipToUserStackFrameLegacy(StackFrame[] stackFrames, int firstUserStackFrame)
{
#if NET4_5
for (int i = firstUserStackFrame; i < stackFrames.Length; ++i)
{
var stackFrame = stackFrames[i];
if (SkipAssembly(stackFrame))
continue;
if (stackFrame.GetMethod()?.Name == "MoveNext" && stackFrames.Length > i)
{
var nextStackFrame = stackFrames[i + 1];
var declaringType = nextStackFrame.GetMethod()?.DeclaringType;
if (declaringType == typeof(System.Runtime.CompilerServices.AsyncTaskMethodBuilder) ||
declaringType == typeof(System.Runtime.CompilerServices.AsyncTaskMethodBuilder<>))
{
//async, search futher
continue;
}
}
return i;
}
#endif
return firstUserStackFrame;
}
/// <summary>
/// Assembly to skip?
/// </summary>
/// <param name="frame">Find assembly via this frame. </param>
/// <returns><c>true</c>, we should skip.</returns>
private static bool SkipAssembly(StackFrame frame)
{
var assembly = StackTraceUsageUtils.LookupAssemblyFromStackFrame(frame);
return assembly == null || LogManager.IsHiddenAssembly(assembly);
}
/// <summary>
/// Is this the type of the logger?
/// </summary>
/// <param name="frame">get type of this logger in this frame.</param>
/// <param name="loggerType">Type of the logger.</param>
/// <returns></returns>
private static bool IsLoggerType(StackFrame frame, Type loggerType)
{
var method = frame.GetMethod();
Type declaringType = method?.DeclaringType;
var isLoggerType = declaringType != null && (loggerType == declaringType || declaringType.IsSubclassOf(loggerType) || loggerType.IsAssignableFrom(declaringType));
return isLoggerType;
}
private static bool WriteToTargetWithFilterChain(Targets.Target target, FilterResult result, LogEventInfo logEvent, AsyncContinuation onException)
{
if ((result == FilterResult.Ignore) || (result == FilterResult.IgnoreFinal))
{
if (InternalLogger.IsDebugEnabled)
{
InternalLogger.Debug("{0}.{1} Rejecting message because of a filter.", logEvent.LoggerName, logEvent.Level);
}
if (result == FilterResult.IgnoreFinal)
{
return false;
}
return true;
}
target.WriteAsyncLogEvent(logEvent.WithContinuation(onException));
if (result == FilterResult.LogFinal)
{
return false;
}
return true;
}
/// <summary>
/// Gets the filter result.
/// </summary>
/// <param name="filterChain">The filter chain.</param>
/// <param name="logEvent">The log event.</param>
/// <param name="defaultFilterResult">default result if there are no filters, or none of the filters decides.</param>
/// <returns>The result of the filter.</returns>
private static FilterResult GetFilterResult(IList<Filter> filterChain, LogEventInfo logEvent, FilterResult defaultFilterResult)
{
FilterResult result = defaultFilterResult;
if (filterChain == null || filterChain.Count == 0)
return result;
try
{
//Memory profiling pointed out that using a foreach-loop was allocating
//an Enumerator. Switching to a for-loop avoids the memory allocation.
for (int i = 0; i < filterChain.Count; i++)
{
Filter f = filterChain[i];
result = f.GetFilterResult(logEvent);
if (result != FilterResult.Neutral)
{
return result;
}
}
return defaultFilterResult;
}
catch (Exception exception)
{
InternalLogger.Warn(exception, "Exception during filter evaluation. Message will be ignore.");
if (exception.MustBeRethrown())
{
throw;
}
return FilterResult.Ignore;
}
}
}
}
| 1 | 18,979 | Resharper annotations, always +1 | NLog-NLog | .cs |
@@ -46,6 +46,8 @@ var accountCreateAddCmd = &cobra.Command{
func init() {
accountCreateAddCmd.Flags().BoolVar(&CryptoSm2, "sm2", false,
config.TranslateInLang(flagSm2Usage, config.UILanguage))
+ accountCreateAddCmd.Flags().MarkHidden("sm2")
+
}
func accountCreateAdd(args []string) error { | 1 | // Copyright (c) 2019 IoTeX Foundation
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
// License 2.0 that can be found in the LICENSE file.
package account
import (
"fmt"
"io/ioutil"
"strings"
"github.com/spf13/cobra"
"gopkg.in/yaml.v2"
"github.com/iotexproject/iotex-core/ioctl/config"
"github.com/iotexproject/iotex-core/ioctl/output"
"github.com/iotexproject/iotex-core/ioctl/validator"
)
// Multi-language support
var (
createAddCmdShorts = map[config.Language]string{
config.English: "Create new account for ioctl",
config.Chinese: "为ioctl创建新账户",
}
createAddCmdUses = map[config.Language]string{
config.English: "createadd ALIAS",
config.Chinese: "createadd 别名",
}
)
// accountCreateAddCmd represents the account createadd command
var accountCreateAddCmd = &cobra.Command{
Use: config.TranslateInLang(createAddCmdUses, config.UILanguage),
Short: config.TranslateInLang(createAddCmdShorts, config.UILanguage),
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true
err := accountCreateAdd(args)
return output.PrintError(err)
},
}
func init() {
accountCreateAddCmd.Flags().BoolVar(&CryptoSm2, "sm2", false,
config.TranslateInLang(flagSm2Usage, config.UILanguage))
}
func accountCreateAdd(args []string) error {
// Validate inputs
if err := validator.ValidateAlias(args[0]); err != nil {
return output.NewError(output.ValidationError, "invalid alias", err)
}
alias := args[0]
if addr, ok := config.ReadConfig.Aliases[alias]; ok {
var confirm string
info := fmt.Sprintf("** Alias \"%s\" has already used for %s\n"+
"Overwriting the account will keep the previous keystore file stay, "+
"but bind the alias to the new one.\nWould you like to continue?\n", alias, addr)
message := output.ConfirmationMessage{Info: info, Options: []string{"yes"}}
fmt.Println(message.String())
fmt.Scanf("%s", &confirm)
if !strings.EqualFold(confirm, "yes") {
output.PrintResult("quit")
return nil
}
}
var addr string
var err error
if !CryptoSm2 {
addr, err = newAccount(alias)
if err != nil {
return output.NewError(0, "", err)
}
} else {
addr, err = newAccountSm2(alias)
if err != nil {
return output.NewError(0, "", err)
}
}
config.ReadConfig.Aliases[alias] = addr
out, err := yaml.Marshal(&config.ReadConfig)
if err != nil {
return output.NewError(output.SerializationError, "failed to marshal config", err)
}
if err := ioutil.WriteFile(config.DefaultConfigFile, out, 0600); err != nil {
return output.NewError(output.WriteFileError,
fmt.Sprintf("failed to write to config file %s", config.DefaultConfigFile), err)
}
output.PrintResult(fmt.Sprintf("New account \"%s\" is created.\n"+
"Please Keep your password, or your will lose your private key.", alias))
return nil
}
| 1 | 21,370 | same here, CryptoSm2 won't be changed once command is compiled | iotexproject-iotex-core | go |
@@ -655,6 +655,13 @@ public class OAuthWebviewHelper implements KeyChainAliasCallback {
try {
certChain = KeyChain.getCertificateChain(activity, alias);
key = KeyChain.getPrivateKey(activity, alias);
+ activity.runOnUiThread(new Runnable() {
+
+ @Override
+ public void run() {
+ loadLoginPage();
+ }
+ });
} catch (KeyChainException e) {
e.printStackTrace();
} catch (InterruptedException e) { | 1 | /*
* Copyright (c) 2011-2015, salesforce.com, inc.
* All rights reserved.
* Redistribution and use of this software in source and binary forms, with or
* without modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of salesforce.com, inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission of salesforce.com, inc.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package com.salesforce.androidsdk.ui;
import java.net.URI;
import java.net.URISyntaxException;
import java.security.PrivateKey;
import java.security.cert.X509Certificate;
import java.util.Locale;
import java.util.Map;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.net.http.SslError;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.security.KeyChain;
import android.security.KeyChainAliasCallback;
import android.security.KeyChainException;
import android.text.TextUtils;
import android.util.Log;
import android.webkit.ClientCertRequest;
import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import com.salesforce.androidsdk.R;
import com.salesforce.androidsdk.accounts.UserAccount;
import com.salesforce.androidsdk.app.SalesforceSDKManager;
import com.salesforce.androidsdk.auth.HttpAccess;
import com.salesforce.androidsdk.auth.OAuth2;
import com.salesforce.androidsdk.auth.OAuth2.IdServiceResponse;
import com.salesforce.androidsdk.auth.OAuth2.TokenEndpointResponse;
import com.salesforce.androidsdk.config.BootConfig;
import com.salesforce.androidsdk.config.RuntimeConfig;
import com.salesforce.androidsdk.push.PushMessaging;
import com.salesforce.androidsdk.rest.ClientManager;
import com.salesforce.androidsdk.rest.ClientManager.LoginOptions;
import com.salesforce.androidsdk.security.PasscodeManager;
import com.salesforce.androidsdk.util.EventsObservable;
import com.salesforce.androidsdk.util.EventsObservable.EventType;
import com.salesforce.androidsdk.util.UriFragmentParser;
/**
* Helper class to manage a WebView instance that is going through the OAuth login process.
* Basic flow is
* a) load and show the login page to the user
* b) user logins in and authorizes app
* c) we see the navigation to the auth complete Url, and grab the tokens
* d) we call the Id service to obtain additional info about the user
* e) we create a local account, and return an authentication result bundle.
* f) done!
*
*/
public class OAuthWebviewHelper implements KeyChainAliasCallback {
// Set a custom permission on your connected application with that name if you want
// the application to be restricted to managed devices
public static final String MUST_BE_MANAGED_APP_PERM = "must_be_managed_app";
private static final String ACCOUNT_OPTIONS = "accountOptions";
/**
* the host activity/fragment should pass in an implementation of this
* interface so that it can notify it of things it needs to do as part of
* the oauth process.
*/
public interface OAuthWebviewHelperEvents {
/** we're starting to load this login page into the webview */
void loadingLoginPage(String loginUrl);
/**
* progress update of loading the webview, totalProgress will go from
* 0..10000 (you can pass this directly to the activity progressbar)
*/
void onLoadingProgress(int totalProgress);
/** We're doing something that takes some unknown amount of time */
void onIndeterminateProgress(boolean show);
/** We've completed the auth process and here's the resulting Authentication Result bundle to return to the Authenticator */
void onAccountAuthenticatorResult(Bundle authResult);
/** we're in some end state and requesting that the host activity be finished/closed. */
void finish();
}
/**
* Construct a new OAuthWebviewHelper and perform the initial configuration of the Webview.
*/
@Deprecated
public OAuthWebviewHelper(OAuthWebviewHelperEvents callback,
LoginOptions options, WebView webview, Bundle savedInstanceState) {
this(new LoginActivity(), callback, options, webview, savedInstanceState);
}
/**
* Construct a new OAuthWebviewHelper and perform the initial configuration of the Webview.
*/
public OAuthWebviewHelper(Activity activity, OAuthWebviewHelperEvents callback,
LoginOptions options, WebView webview, Bundle savedInstanceState) {
assert options != null && callback != null && webview != null && activity != null;
this.activity = activity;
this.callback = callback;
this.loginOptions = options;
this.webview = webview;
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(makeWebViewClient());
webview.setWebChromeClient(makeWebChromeClient());
// Restore webview's state if available.
// This ensures the user is not forced to type in credentials again
// once the auth process has been kicked off.
if (savedInstanceState != null) {
webview.restoreState(savedInstanceState);
accountOptions = AccountOptions.fromBundle(savedInstanceState.getBundle(ACCOUNT_OPTIONS));
} else {
clearCookies();
}
}
private final OAuthWebviewHelperEvents callback;
protected final LoginOptions loginOptions;
private final WebView webview;
private AccountOptions accountOptions;
private Activity activity;
private PrivateKey key;
private X509Certificate[] certChain;
public void saveState(Bundle outState) {
webview.saveState(outState);
if (accountOptions != null) {
// we have completed the auth flow but not created the account, because we need to create a pin
outState.putBundle(ACCOUNT_OPTIONS, accountOptions.asBundle());
}
}
public WebView getWebView() {
return webview;
}
public void clearCookies() {
SalesforceSDKManager.getInstance().removeAllCookies();
}
public void clearView() {
webview.loadUrl("about:blank");
}
/**
* Method called by login activity when it resumes after the passcode activity
*
* When the server has a mobile policy requiring a passcode, we start the passcode activity after completing the
* auth flow (see onAuthFlowComplete).
* When the passcode activity completes, the login activity's onActivityResult gets invoked, and it calls this method
* to finalize the account creation.
*/
public void onNewPasscode() {
/*
* Re-encryption of existing accounts with the new passcode is taken
* care of in the 'Confirm Passcode' step in PasscodeActivity.
*/
if (accountOptions != null) {
loginOptions.passcodeHash = SalesforceSDKManager.getInstance().getPasscodeHash();
addAccount();
callback.finish();
}
}
/** Factory method for the WebViewClient, you can replace this with something else if you need to */
protected WebViewClient makeWebViewClient() {
return new AuthWebViewClient();
}
/** Factory method for the WebChromeClient, you can replace this with something else if you need to */
protected WebChromeClient makeWebChromeClient() {
return new AuthWebChromeClient();
}
protected Context getContext() {
return webview.getContext();
}
/**
* Called when the user facing part of the auth flow completed with an error.
* We show the user an error and end the activity.
*/
protected void onAuthFlowError(String error, String errorDesc) {
Log.w("LoginActivity:onAuthFlowError", error + ":" + errorDesc);
// look for deny. kick them back to login, so clear cookies and repoint browser
if ("access_denied".equals(error)
&& "end-user denied authorization".equals(errorDesc)) {
webview.post(new Runnable() {
@Override
public void run() {
clearCookies();
loadLoginPage();
}
});
} else {
Toast t = Toast.makeText(webview.getContext(), error + " : " + errorDesc,
Toast.LENGTH_LONG);
webview.postDelayed(new Runnable() {
@Override
public void run() {
callback.finish();
}
}, t.getDuration());
t.show();
}
}
protected void showError(Exception exception) {
Toast.makeText(getContext(),
getContext().getString(SalesforceSDKManager.getInstance().getSalesforceR().stringGenericError(), exception.toString()),
Toast.LENGTH_LONG).show();
}
/**
* Tells the webview to load the authorization page.
* We also update the window title, so its easier to
* see which system you're logging in to
*/
public void loadLoginPage() {
// Filling in loginUrl.
loginOptions.loginUrl = getLoginUrl();
try {
URI uri = getAuthorizationUrl();
callback.loadingLoginPage(loginOptions.loginUrl);
webview.loadUrl(uri.toString());
} catch (URISyntaxException ex) {
showError(ex);
}
}
protected String getOAuthClientId() {
return loginOptions.oauthClientId;
}
protected URI getAuthorizationUrl() throws URISyntaxException {
return OAuth2.getAuthorizationUrl(
new URI(loginOptions.loginUrl),
getOAuthClientId(),
loginOptions.oauthCallbackUrl,
loginOptions.oauthScopes,
null,
getAuthorizationDisplayType());
}
/**
* Override this to replace the default login webview's display param with
* your custom display param. You can override this by either subclassing this class,
* or adding "<string name="sf__oauth_display_type">desiredDisplayParam</string>"
* to your app's resource so that it overrides the default value in the SDK library.
*
* @return the OAuth login display type, e.g. 'mobile', 'touch',
* see the OAuth docs for the complete list of valid values.
*/
protected String getAuthorizationDisplayType() {
return this.getContext().getString(R.string.oauth_display_type);
}
/**
* Override this method to customize the login url.
* @return login url
*/
protected String getLoginUrl() {
return SalesforceSDKManager.getInstance().getLoginServerManager().getSelectedLoginServer().url.trim();
}
/**
* WebViewClient which intercepts the redirect to the oauth callback url.
* That redirect marks the end of the user facing portion of the authentication flow.
*
*/
protected class AuthWebViewClient extends WebViewClient {
@Override
public void onPageFinished(WebView view, String url) {
EventsObservable.get().notifyEvent(EventType.AuthWebViewPageFinished, url);
super.onPageFinished(view, url);
}
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
boolean isDone = url.replace("///", "/").toLowerCase(Locale.US).startsWith(loginOptions.oauthCallbackUrl.replace("///", "/").toLowerCase(Locale.US));
if (isDone) {
Uri callbackUri = Uri.parse(url);
Map<String, String> params = UriFragmentParser.parse(callbackUri);
String error = params.get("error");
// Did we fail?
if (error != null) {
String errorDesc = params.get("error_description");
onAuthFlowError(error, errorDesc);
}
// Or succeed?
else {
TokenEndpointResponse tr = new TokenEndpointResponse(params);
onAuthFlowComplete(tr);
}
}
return isDone;
}
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
int primError = error.getPrimaryError();
// Figuring out string resource id
SalesforceR r = SalesforceSDKManager.getInstance().getSalesforceR();
int primErrorStringId = r.stringSSLUnknownError();
switch (primError) {
case SslError.SSL_EXPIRED: primErrorStringId = r.stringSSLExpired(); break;
case SslError.SSL_IDMISMATCH: primErrorStringId = r.stringSSLIdMismatch(); break;
case SslError.SSL_NOTYETVALID: primErrorStringId = r.stringSSLNotYetValid(); break;
case SslError.SSL_UNTRUSTED: primErrorStringId = r.stringSSLUntrusted(); break;
}
// Building text message to show
String text = getContext().getString(r.stringSSLError(), getContext().getString(primErrorStringId));
// Bringing up toast
Toast.makeText(getContext(), text, Toast.LENGTH_LONG).show();
handler.cancel();
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void onReceivedClientCertRequest(WebView view, ClientCertRequest request) {
request.proceed(key, certChain);
}
}
/**
* Called when the user facing part of the auth flow completed successfully.
* The last step is to call the identity service to get the username.
*/
protected void onAuthFlowComplete(TokenEndpointResponse tr) {
FinishAuthTask t = new FinishAuthTask();
t.execute(tr);
}
// base class with common code for the background task that finishes off the auth process
protected abstract class BaseFinishAuthFlowTask<RequestType> extends AsyncTask<RequestType, Boolean, TokenEndpointResponse> {
protected volatile Exception backgroundException;
protected volatile IdServiceResponse id = null;
public BaseFinishAuthFlowTask() {
}
@Override
protected final TokenEndpointResponse doInBackground(RequestType ... params) {
try {
publishProgress(true);
return performRequest(params[0]);
} catch (Exception ex) {
handleException(ex);
}
return null;
}
protected abstract TokenEndpointResponse performRequest(RequestType param) throws Exception;
@Override
protected void onPostExecute(OAuth2.TokenEndpointResponse tr) {
final SalesforceSDKManager mgr = SalesforceSDKManager.getInstance();
//
// Failure cases.
//
if (backgroundException != null) {
Log.w("LoginActiviy.onAuthFlowComplete", backgroundException);
// Error
onAuthFlowError(getContext().getString(mgr.getSalesforceR().stringGenericAuthenticationErrorTitle()),
getContext().getString(mgr.getSalesforceR().stringGenericAuthenticationErrorBody()));
callback.finish();
return;
}
if (id.customPermissions != null) {
final boolean mustBeManagedApp = id.customPermissions.optBoolean(MUST_BE_MANAGED_APP_PERM);
if (mustBeManagedApp && !RuntimeConfig.getRuntimeConfig(getContext()).isManagedApp()) {
onAuthFlowError(getContext().getString(mgr.getSalesforceR().stringGenericAuthenticationErrorTitle()),
getContext().getString(mgr.getSalesforceR().stringManagedAppError()));
callback.finish();
return;
}
}
//
// Putting together all the information needed to create the new account.
//
accountOptions = new AccountOptions(id.username, tr.refreshToken,
tr.authToken, tr.idUrl, tr.instanceUrl, tr.orgId, tr.userId,
tr.communityId, tr.communityUrl);
// Sets additional admin prefs, if they exist.
final UserAccount account = new UserAccount(accountOptions.authToken,
accountOptions.refreshToken, loginOptions.loginUrl,
accountOptions.identityUrl, accountOptions.instanceUrl,
accountOptions.orgId, accountOptions.userId,
accountOptions.username, buildAccountName(accountOptions.username,
accountOptions.instanceUrl), loginOptions.clientSecret,
accountOptions.communityId, accountOptions.communityUrl);
if (id.customAttributes != null) {
mgr.getAdminSettingsManager().setPrefs(id.customAttributes, account);
}
if (id.customPermissions != null) {
mgr.getAdminPermsManager().setPrefs(id.customPermissions, account);
}
// Screen lock required by mobile policy
if (id.screenLockTimeout > 0) {
// Stores the mobile policy for the org.
final PasscodeManager passcodeManager = mgr.getPasscodeManager();
passcodeManager.storeMobilePolicyForOrg(account, id.screenLockTimeout * 1000 * 60, id.pinLength);
passcodeManager.setTimeoutMs(id.screenLockTimeout * 1000 * 60);
passcodeManager.setMinPasscodeLength(id.pinLength);
/*
* Checks if a passcode already exists. If a passcode has NOT
* been created yet, the user is taken through the passcode
* creation flow, at the end of which account data is encrypted
* with a hash of the passcode. Other existing accounts are
* also re-encrypted behind the scenes at this point. If a
* passcode already exists, the existing hash is used and the
* account is added at this point.
*/
if (!passcodeManager.hasStoredPasscode(mgr.getAppContext())) {
// This will bring up the create passcode screen - we will create the account in onResume
mgr.getPasscodeManager().setEnabled(true);
mgr.getPasscodeManager().lockIfNeeded((Activity) getContext(), true);
} else {
loginOptions.passcodeHash = mgr.getPasscodeHash();
addAccount();
callback.finish();
}
}
// No screen lock required or no mobile policy specified
else {
final PasscodeManager passcodeManager = mgr.getPasscodeManager();
passcodeManager.storeMobilePolicyForOrg(account, 0, PasscodeManager.MIN_PASSCODE_LENGTH);
loginOptions.passcodeHash = mgr.getPasscodeHash();
addAccount();
callback.finish();
}
}
protected void handleException(Exception ex) {
if (ex.getMessage() != null)
Log.w("BaseFinishAuthFlowTask", "handleException", ex);
backgroundException = ex;
}
@Override
protected void onProgressUpdate(Boolean... values) {
callback.onIndeterminateProgress(values[0]);
}
}
/**
* This is a background process that will call the identity service to get the info we need from
* the Identity service, and finally wrap up and create account.
*/
private class FinishAuthTask extends BaseFinishAuthFlowTask<TokenEndpointResponse> {
@Override
protected TokenEndpointResponse performRequest(TokenEndpointResponse tr) throws Exception {
try {
id = OAuth2.callIdentityService(
HttpAccess.DEFAULT, tr.idUrlWithInstance, tr.authToken);
} catch(Exception e) {
backgroundException = e;
}
return tr;
}
}
protected void addAccount() {
ClientManager clientManager = new ClientManager(getContext(),
SalesforceSDKManager.getInstance().getAccountType(),
loginOptions, SalesforceSDKManager.getInstance().shouldLogoutWhenTokenRevoked());
// Create account name (shown in Settings -> Accounts & sync)
String accountName = buildAccountName(accountOptions.username,
accountOptions.instanceUrl);
// New account
Bundle extras = clientManager.createNewAccount(accountName,
accountOptions.username,
accountOptions.refreshToken,
accountOptions.authToken,
accountOptions.instanceUrl,
loginOptions.loginUrl,
accountOptions.identityUrl,
getOAuthClientId(),
accountOptions.orgId,
accountOptions.userId,
loginOptions.passcodeHash,
loginOptions.clientSecret,
accountOptions.communityId,
accountOptions.communityUrl);
/*
* Registers for push notifications, if push notification client ID is present.
* This step needs to happen after the account has been added by client
* manager, so that the push service has all the account info it needs.
*/
final Context appContext = SalesforceSDKManager.getInstance().getAppContext();
final String pushNotificationId = BootConfig.getBootConfig(appContext).getPushNotificationClientId();
if (!TextUtils.isEmpty(pushNotificationId)) {
final UserAccount account = new UserAccount(accountOptions.authToken,
accountOptions.refreshToken, loginOptions.loginUrl,
accountOptions.identityUrl, accountOptions.instanceUrl,
accountOptions.orgId, accountOptions.userId,
accountOptions.username, accountName,
loginOptions.clientSecret, accountOptions.communityId,
accountOptions.communityUrl);
PushMessaging.register(appContext, account);
}
callback.onAccountAuthenticatorResult(extras);
}
/**
* @return name to be shown for account in Settings -> Accounts & Sync
*/
protected String buildAccountName(String username, String instanceServer) {
return String.format("%s (%s) (%s)", username, instanceServer,
SalesforceSDKManager.getInstance().getApplicationName());
}
/**
* WebChromeClient used to report back loading progress.
*/
protected class AuthWebChromeClient extends WebChromeClient {
@Override
public void onProgressChanged(WebView view, int newProgress) {
callback.onLoadingProgress(newProgress * 100);
}
}
/**
* Class encapsulating the parameters required to create a new account
*/
public static class AccountOptions {
private static final String USER_ID = "userId";
private static final String ORG_ID = "orgId";
private static final String IDENTITY_URL = "identityUrl";
private static final String INSTANCE_URL = "instanceUrl";
private static final String AUTH_TOKEN = "authToken";
private static final String REFRESH_TOKEN = "refreshToken";
private static final String USERNAME = "username";
private static final String COMMUNITY_ID = "communityId";
private static final String COMMUNITY_URL = "communityUrl";
public final String username;
public final String refreshToken;
public final String authToken;
public final String identityUrl;
public final String instanceUrl;
public final String orgId;
public final String userId;
public final String communityId;
public final String communityUrl;
private final Bundle bundle;
public AccountOptions(String username, String refreshToken,
String authToken, String identityUrl, String instanceUrl,
String orgId, String userId, String communityId, String communityUrl) {
super();
this.username = username;
this.refreshToken = refreshToken;
this.authToken = authToken;
this.identityUrl = identityUrl;
this.instanceUrl = instanceUrl;
this.orgId = orgId;
this.userId = userId;
this.communityId = communityId;
this.communityUrl = communityUrl;
bundle = new Bundle();
bundle.putString(USERNAME, username);
bundle.putString(REFRESH_TOKEN, refreshToken);
bundle.putString(AUTH_TOKEN, authToken);
bundle.putString(INSTANCE_URL, instanceUrl);
bundle.putString(ORG_ID, orgId);
bundle.putString(USER_ID, userId);
bundle.putString(COMMUNITY_ID, communityId);
bundle.putString(COMMUNITY_URL, communityUrl);
}
public Bundle asBundle() {
return bundle;
}
public static AccountOptions fromBundle(Bundle options) {
if (options == null) return null;
return new AccountOptions(
options.getString(USERNAME),
options.getString(REFRESH_TOKEN),
options.getString(AUTH_TOKEN),
options.getString(IDENTITY_URL),
options.getString(INSTANCE_URL),
options.getString(ORG_ID),
options.getString(USER_ID),
options.getString(COMMUNITY_ID),
options.getString(COMMUNITY_URL)
);
}
}
@Override
public void alias(String alias) {
try {
certChain = KeyChain.getCertificateChain(activity, alias);
key = KeyChain.getPrivateKey(activity, alias);
} catch (KeyChainException e) {
e.printStackTrace();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
| 1 | 14,581 | Loading the login page after the certificate has been loaded. Views can only be loaded from UI thread. | forcedotcom-SalesforceMobileSDK-Android | java |
@@ -52,7 +52,7 @@ func (v *ConfigValidator) Validate(config *configs.Config) error {
}
for _, c := range warns {
if err := c(config); err != nil {
- logrus.WithError(err).Warnf("invalid configuration")
+ logrus.WithError(err).Warn("invalid configuration")
}
}
return nil | 1 | package validate
import (
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"sync"
"github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/intelrdt"
selinux "github.com/opencontainers/selinux/go-selinux"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
)
type Validator interface {
Validate(*configs.Config) error
}
func New() Validator {
return &ConfigValidator{}
}
type ConfigValidator struct{}
type check func(config *configs.Config) error
func (v *ConfigValidator) Validate(config *configs.Config) error {
checks := []check{
v.cgroups,
v.rootfs,
v.network,
v.hostname,
v.security,
v.usernamespace,
v.cgroupnamespace,
v.sysctl,
v.intelrdt,
v.rootlessEUID,
}
for _, c := range checks {
if err := c(config); err != nil {
return err
}
}
// Relaxed validation rules for backward compatibility
warns := []check{
v.mounts, // TODO (runc v1.x.x): make this an error instead of a warning
}
for _, c := range warns {
if err := c(config); err != nil {
logrus.WithError(err).Warnf("invalid configuration")
}
}
return nil
}
// rootfs validates if the rootfs is an absolute path and is not a symlink
// to the container's root filesystem.
func (v *ConfigValidator) rootfs(config *configs.Config) error {
if _, err := os.Stat(config.Rootfs); err != nil {
if os.IsNotExist(err) {
return fmt.Errorf("rootfs (%s) does not exist", config.Rootfs)
}
return err
}
cleaned, err := filepath.Abs(config.Rootfs)
if err != nil {
return err
}
if cleaned, err = filepath.EvalSymlinks(cleaned); err != nil {
return err
}
if filepath.Clean(config.Rootfs) != cleaned {
return fmt.Errorf("%s is not an absolute path or is a symlink", config.Rootfs)
}
return nil
}
func (v *ConfigValidator) network(config *configs.Config) error {
if !config.Namespaces.Contains(configs.NEWNET) {
if len(config.Networks) > 0 || len(config.Routes) > 0 {
return errors.New("unable to apply network settings without a private NET namespace")
}
}
return nil
}
func (v *ConfigValidator) hostname(config *configs.Config) error {
if config.Hostname != "" && !config.Namespaces.Contains(configs.NEWUTS) {
return errors.New("unable to set hostname without a private UTS namespace")
}
return nil
}
func (v *ConfigValidator) security(config *configs.Config) error {
// restrict sys without mount namespace
if (len(config.MaskPaths) > 0 || len(config.ReadonlyPaths) > 0) &&
!config.Namespaces.Contains(configs.NEWNS) {
return errors.New("unable to restrict sys entries without a private MNT namespace")
}
if config.ProcessLabel != "" && !selinux.GetEnabled() {
return errors.New("selinux label is specified in config, but selinux is disabled or not supported")
}
return nil
}
func (v *ConfigValidator) usernamespace(config *configs.Config) error {
if config.Namespaces.Contains(configs.NEWUSER) {
if _, err := os.Stat("/proc/self/ns/user"); os.IsNotExist(err) {
return errors.New("USER namespaces aren't enabled in the kernel")
}
} else {
if config.UidMappings != nil || config.GidMappings != nil {
return errors.New("User namespace mappings specified, but USER namespace isn't enabled in the config")
}
}
return nil
}
func (v *ConfigValidator) cgroupnamespace(config *configs.Config) error {
if config.Namespaces.Contains(configs.NEWCGROUP) {
if _, err := os.Stat("/proc/self/ns/cgroup"); os.IsNotExist(err) {
return errors.New("cgroup namespaces aren't enabled in the kernel")
}
}
return nil
}
// sysctl validates that the specified sysctl keys are valid or not.
// /proc/sys isn't completely namespaced and depending on which namespaces
// are specified, a subset of sysctls are permitted.
func (v *ConfigValidator) sysctl(config *configs.Config) error {
validSysctlMap := map[string]bool{
"kernel.msgmax": true,
"kernel.msgmnb": true,
"kernel.msgmni": true,
"kernel.sem": true,
"kernel.shmall": true,
"kernel.shmmax": true,
"kernel.shmmni": true,
"kernel.shm_rmid_forced": true,
}
var (
netOnce sync.Once
hostnet bool
hostnetErr error
)
for s := range config.Sysctl {
if validSysctlMap[s] || strings.HasPrefix(s, "fs.mqueue.") {
if config.Namespaces.Contains(configs.NEWIPC) {
continue
} else {
return fmt.Errorf("sysctl %q is not allowed in the hosts ipc namespace", s)
}
}
if strings.HasPrefix(s, "net.") {
// Is container using host netns?
// Here "host" means "current", not "initial".
netOnce.Do(func() {
if !config.Namespaces.Contains(configs.NEWNET) {
hostnet = true
return
}
path := config.Namespaces.PathOf(configs.NEWNET)
if path == "" {
// own netns, so hostnet = false
return
}
hostnet, hostnetErr = isHostNetNS(path)
})
if hostnetErr != nil {
return hostnetErr
}
if hostnet {
return fmt.Errorf("sysctl %q not allowed in host network namespace", s)
}
continue
}
if config.Namespaces.Contains(configs.NEWUTS) {
switch s {
case "kernel.domainname":
// This is namespaced and there's no explicit OCI field for it.
continue
case "kernel.hostname":
// This is namespaced but there's a conflicting (dedicated) OCI field for it.
return fmt.Errorf("sysctl %q is not allowed as it conflicts with the OCI %q field", s, "hostname")
}
}
return fmt.Errorf("sysctl %q is not in a separate kernel namespace", s)
}
return nil
}
func (v *ConfigValidator) intelrdt(config *configs.Config) error {
if config.IntelRdt != nil {
if !intelrdt.IsCATEnabled() && !intelrdt.IsMBAEnabled() {
return errors.New("intelRdt is specified in config, but Intel RDT is not supported or enabled")
}
if !intelrdt.IsCATEnabled() && config.IntelRdt.L3CacheSchema != "" {
return errors.New("intelRdt.l3CacheSchema is specified in config, but Intel RDT/CAT is not enabled")
}
if !intelrdt.IsMBAEnabled() && config.IntelRdt.MemBwSchema != "" {
return errors.New("intelRdt.memBwSchema is specified in config, but Intel RDT/MBA is not enabled")
}
if intelrdt.IsCATEnabled() && config.IntelRdt.L3CacheSchema == "" {
return errors.New("Intel RDT/CAT is enabled and intelRdt is specified in config, but intelRdt.l3CacheSchema is empty")
}
if intelrdt.IsMBAEnabled() && config.IntelRdt.MemBwSchema == "" {
return errors.New("Intel RDT/MBA is enabled and intelRdt is specified in config, but intelRdt.memBwSchema is empty")
}
}
return nil
}
func (v *ConfigValidator) cgroups(config *configs.Config) error {
c := config.Cgroups
if c == nil {
return nil
}
if (c.Name != "" || c.Parent != "") && c.Path != "" {
return fmt.Errorf("cgroup: either Path or Name and Parent should be used, got %+v", c)
}
r := c.Resources
if r == nil {
return nil
}
if !cgroups.IsCgroup2UnifiedMode() && r.Unified != nil {
return cgroups.ErrV1NoUnified
}
if cgroups.IsCgroup2UnifiedMode() {
_, err := cgroups.ConvertMemorySwapToCgroupV2Value(r.MemorySwap, r.Memory)
if err != nil {
return err
}
}
return nil
}
func (v *ConfigValidator) mounts(config *configs.Config) error {
for _, m := range config.Mounts {
if !filepath.IsAbs(m.Destination) {
return fmt.Errorf("invalid mount %+v: mount destination not absolute", m)
}
}
return nil
}
func isHostNetNS(path string) (bool, error) {
const currentProcessNetns = "/proc/self/ns/net"
var st1, st2 unix.Stat_t
if err := unix.Stat(currentProcessNetns, &st1); err != nil {
return false, &os.PathError{Op: "stat", Path: currentProcessNetns, Err: err}
}
if err := unix.Stat(path, &st2); err != nil {
return false, &os.PathError{Op: "stat", Path: path, Err: err}
}
return (st1.Dev == st2.Dev) && (st1.Ino == st2.Ino), nil
}
| 1 | 24,661 | Technically it doesn't belong here; let me remove it. | opencontainers-runc | go |
@@ -78,7 +78,7 @@ MARKER_FILE_LIGHT_VERSION = "%s/.light-version" % dirs.static_libs
IMAGE_NAME_SFN_LOCAL = "amazon/aws-stepfunctions-local"
ARTIFACTS_REPO = "https://github.com/localstack/localstack-artifacts"
SFN_PATCH_URL_PREFIX = (
- f"{ARTIFACTS_REPO}/raw/a4adc8f4da9c7ec0d93b50ca5b73dd14df791c0e/stepfunctions-local-patch"
+ f"{ARTIFACTS_REPO}/raw/b2d48a8a8715dd31de2af75b0aa04c0c0091fa3c/stepfunctions-local-patch"
)
SFN_PATCH_CLASS1 = "com/amazonaws/stepfunctions/local/runtime/Config.class"
SFN_PATCH_CLASS2 = ( | 1 | #!/usr/bin/env python
import functools
import glob
import logging
import os
import platform
import re
import shutil
import stat
import sys
import tempfile
import time
from pathlib import Path
from typing import Callable, Dict, List, Tuple
import requests
from plugin import Plugin, PluginManager
from localstack import config
from localstack.config import dirs
from localstack.constants import (
DEFAULT_SERVICE_PORTS,
DYNAMODB_JAR_URL,
ELASTICMQ_JAR_URL,
ELASTICSEARCH_DEFAULT_VERSION,
ELASTICSEARCH_DELETE_MODULES,
ELASTICSEARCH_PLUGIN_LIST,
KMS_URL_PATTERN,
LOCALSTACK_MAVEN_VERSION,
MODULE_MAIN_PATH,
OPENSEARCH_DEFAULT_VERSION,
STS_JAR_URL,
)
from localstack.runtime import hooks
from localstack.utils.common import (
chmod_r,
download,
file_exists_not_empty,
get_arch,
is_windows,
load_file,
mkdir,
new_tmp_file,
parallelize,
replace_in_file,
retry,
rm_rf,
run,
safe_run,
save_file,
untar,
unzip,
)
from localstack.utils.docker_utils import DOCKER_CLIENT
LOG = logging.getLogger(__name__)
INSTALL_DIR_NPM = "%s/node_modules" % MODULE_MAIN_PATH # FIXME: migrate to infra
INSTALL_DIR_DDB = "%s/dynamodb" % dirs.static_libs
INSTALL_DIR_KCL = "%s/amazon-kinesis-client" % dirs.static_libs
INSTALL_DIR_STEPFUNCTIONS = "%s/stepfunctions" % dirs.static_libs
INSTALL_DIR_KMS = "%s/kms" % dirs.static_libs
INSTALL_DIR_ELASTICMQ = "%s/elasticmq" % dirs.static_libs
INSTALL_DIR_KINESIS_MOCK = os.path.join(dirs.static_libs, "kinesis-mock")
INSTALL_PATH_LOCALSTACK_FAT_JAR = "%s/localstack-utils-fat.jar" % dirs.static_libs
INSTALL_PATH_DDB_JAR = os.path.join(INSTALL_DIR_DDB, "DynamoDBLocal.jar")
INSTALL_PATH_KCL_JAR = os.path.join(INSTALL_DIR_KCL, "aws-java-sdk-sts.jar")
INSTALL_PATH_STEPFUNCTIONS_JAR = os.path.join(INSTALL_DIR_STEPFUNCTIONS, "StepFunctionsLocal.jar")
INSTALL_PATH_KMS_BINARY_PATTERN = os.path.join(INSTALL_DIR_KMS, "local-kms.<arch>.bin")
INSTALL_PATH_ELASTICMQ_JAR = os.path.join(INSTALL_DIR_ELASTICMQ, "elasticmq-server.jar")
INSTALL_PATH_KINESALITE_CLI = os.path.join(INSTALL_DIR_NPM, "kinesalite", "cli.js")
URL_LOCALSTACK_FAT_JAR = (
"https://repo1.maven.org/maven2/"
+ "cloud/localstack/localstack-utils/{v}/localstack-utils-{v}-fat.jar"
).format(v=LOCALSTACK_MAVEN_VERSION)
MARKER_FILE_LIGHT_VERSION = "%s/.light-version" % dirs.static_libs
IMAGE_NAME_SFN_LOCAL = "amazon/aws-stepfunctions-local"
ARTIFACTS_REPO = "https://github.com/localstack/localstack-artifacts"
SFN_PATCH_URL_PREFIX = (
f"{ARTIFACTS_REPO}/raw/a4adc8f4da9c7ec0d93b50ca5b73dd14df791c0e/stepfunctions-local-patch"
)
SFN_PATCH_CLASS1 = "com/amazonaws/stepfunctions/local/runtime/Config.class"
SFN_PATCH_CLASS2 = (
"com/amazonaws/stepfunctions/local/runtime/executors/task/LambdaTaskStateExecutor.class"
)
SFN_PATCH_CLASS_STARTER = "cloud/localstack/StepFunctionsStarter.class"
SFN_PATCH_CLASS_REGION = "cloud/localstack/RegionAspect.class"
SFN_PATCH_CLASS_ASYNC2SERVICEAPI = "cloud/localstack/Async2ServiceApi.class"
SFN_PATCH_CLASS_DESCRIBEEXECUTIONPARSED = "cloud/localstack/DescribeExecutionParsed.class"
SFN_PATCH_FILE_METAINF = "META-INF/aop.xml"
SFN_AWS_SDK_URL_PREFIX = (
f"{ARTIFACTS_REPO}/raw/a4adc8f4da9c7ec0d93b50ca5b73dd14df791c0e/stepfunctions-internal-awssdk"
)
SFN_AWS_SDK_LAMBDA_ZIP_FILE = f"{SFN_AWS_SDK_URL_PREFIX}/awssdk.zip"
# additional JAR libs required for multi-region and persistence (PRO only) support
MAVEN_REPO = "https://repo1.maven.org/maven2"
URL_ASPECTJRT = f"{MAVEN_REPO}/org/aspectj/aspectjrt/1.9.7/aspectjrt-1.9.7.jar"
URL_ASPECTJWEAVER = f"{MAVEN_REPO}/org/aspectj/aspectjweaver/1.9.7/aspectjweaver-1.9.7.jar"
JAR_URLS = [URL_ASPECTJRT, URL_ASPECTJWEAVER]
# kinesis-mock version
KINESIS_MOCK_VERSION = os.environ.get("KINESIS_MOCK_VERSION") or "0.2.2"
KINESIS_MOCK_RELEASE_URL = (
"https://api.github.com/repos/etspaceman/kinesis-mock/releases/tags/" + KINESIS_MOCK_VERSION
)
# debugpy module
DEBUGPY_MODULE = "debugpy"
DEBUGPY_DEPENDENCIES = ["gcc", "python3-dev", "musl-dev"]
# Target version for javac, to ensure compatibility with earlier JREs
JAVAC_TARGET_VERSION = "1.8"
# SQS backend implementation provider - either "moto" or "elasticmq"
SQS_BACKEND_IMPL = os.environ.get("SQS_PROVIDER") or "moto"
# GO Lambda runtime
GO_RUNTIME_VERSION = "0.4.0"
GO_RUNTIME_DOWNLOAD_URL_TEMPLATE = "https://github.com/localstack/awslamba-go-runtime/releases/download/v{version}/awslamba-go-runtime-{version}-{os}-{arch}.tar.gz"
GO_INSTALL_FOLDER = os.path.join(config.dirs.var_libs, "awslamba-go-runtime")
GO_LAMBDA_RUNTIME = os.path.join(GO_INSTALL_FOLDER, "aws-lambda-mock")
GO_LAMBDA_MOCKSERVER = os.path.join(GO_INSTALL_FOLDER, "mockserver")
# Terraform (used for tests)
TERRAFORM_VERSION = "1.1.3"
TERRAFORM_URL_TEMPLATE = (
"https://releases.hashicorp.com/terraform/{version}/terraform_{version}_{os}_{arch}.zip"
)
TERRAFORM_BIN = os.path.join(dirs.static_libs, f"terraform-{TERRAFORM_VERSION}", "terraform")
# Java Test Jar Download (used for tests)
TEST_LAMBDA_JAVA = os.path.join(config.dirs.var_libs, "localstack-utils-tests.jar")
MAVEN_BASE_URL = "https://repo.maven.apache.org/maven2"
TEST_LAMBDA_JAR_URL = "{url}/cloud/localstack/{name}/{version}/{name}-{version}-tests.jar".format(
version=LOCALSTACK_MAVEN_VERSION, url=MAVEN_BASE_URL, name="localstack-utils"
)
def get_elasticsearch_install_version(version: str) -> str:
from localstack.services.es import versions
if config.SKIP_INFRA_DOWNLOADS:
return ELASTICSEARCH_DEFAULT_VERSION
return versions.get_install_version(version)
def get_elasticsearch_install_dir(version: str) -> str:
version = get_elasticsearch_install_version(version)
if version == ELASTICSEARCH_DEFAULT_VERSION and not os.path.exists(MARKER_FILE_LIGHT_VERSION):
# install the default version into a subfolder of the code base
install_dir = os.path.join(dirs.static_libs, "elasticsearch")
else:
# put all other versions into the TMP_FOLDER
install_dir = os.path.join(config.dirs.tmp, "elasticsearch", version)
return install_dir
def install_elasticsearch(version=None):
from localstack.services.es import versions
if not version:
version = ELASTICSEARCH_DEFAULT_VERSION
version = get_elasticsearch_install_version(version)
install_dir = get_elasticsearch_install_dir(version)
installed_executable = os.path.join(install_dir, "bin", "elasticsearch")
if not os.path.exists(installed_executable):
log_install_msg("Elasticsearch (%s)" % version)
es_url = versions.get_download_url(version)
install_dir_parent = os.path.dirname(install_dir)
mkdir(install_dir_parent)
# download and extract archive
tmp_archive = os.path.join(config.dirs.tmp, "localstack.%s" % os.path.basename(es_url))
download_and_extract_with_retry(es_url, tmp_archive, install_dir_parent)
elasticsearch_dir = glob.glob(os.path.join(install_dir_parent, "elasticsearch*"))
if not elasticsearch_dir:
raise Exception("Unable to find Elasticsearch folder in %s" % install_dir_parent)
shutil.move(elasticsearch_dir[0], install_dir)
for dir_name in ("data", "logs", "modules", "plugins", "config/scripts"):
dir_path = os.path.join(install_dir, dir_name)
mkdir(dir_path)
chmod_r(dir_path, 0o777)
# install default plugins
for plugin in ELASTICSEARCH_PLUGIN_LIST:
plugin_binary = os.path.join(install_dir, "bin", "elasticsearch-plugin")
plugin_dir = os.path.join(install_dir, "plugins", plugin)
if not os.path.exists(plugin_dir):
LOG.info("Installing Elasticsearch plugin %s", plugin)
def try_install():
safe_run([plugin_binary, "install", "-b", plugin])
# We're occasionally seeing javax.net.ssl.SSLHandshakeException -> add download retries
download_attempts = 3
try:
retry(try_install, retries=download_attempts - 1, sleep=2)
except Exception:
LOG.warning(
"Unable to download Elasticsearch plugin '%s' after %s attempts",
plugin,
download_attempts,
)
if not os.environ.get("IGNORE_ES_DOWNLOAD_ERRORS"):
raise
# delete some plugins to free up space
for plugin in ELASTICSEARCH_DELETE_MODULES:
module_dir = os.path.join(install_dir, "modules", plugin)
rm_rf(module_dir)
# disable x-pack-ml plugin (not working on Alpine)
xpack_dir = os.path.join(install_dir, "modules", "x-pack-ml", "platform")
rm_rf(xpack_dir)
# patch JVM options file - replace hardcoded heap size settings
jvm_options_file = os.path.join(install_dir, "config", "jvm.options")
if os.path.exists(jvm_options_file):
jvm_options = load_file(jvm_options_file)
jvm_options_replaced = re.sub(
r"(^-Xm[sx][a-zA-Z0-9\.]+$)", r"# \1", jvm_options, flags=re.MULTILINE
)
if jvm_options != jvm_options_replaced:
save_file(jvm_options_file, jvm_options_replaced)
def get_opensearch_install_version(version: str) -> str:
from localstack.services.opensearch import versions
if config.SKIP_INFRA_DOWNLOADS:
return OPENSEARCH_DEFAULT_VERSION
return versions.get_install_version(version)
def get_opensearch_install_dir(version: str) -> str:
version = get_opensearch_install_version(version)
return os.path.join(config.dirs.var_libs, "opensearch", version)
def install_opensearch(version=None):
from localstack.services.opensearch import versions
if not version:
version = OPENSEARCH_DEFAULT_VERSION
version = get_opensearch_install_version(version)
install_dir = get_opensearch_install_dir(version)
installed_executable = os.path.join(install_dir, "bin", "opensearch")
if not os.path.exists(installed_executable):
log_install_msg("OpenSearch (%s)" % version)
opensearch_url = versions.get_download_url(version)
install_dir_parent = os.path.dirname(install_dir)
mkdir(install_dir_parent)
# download and extract archive
tmp_archive = os.path.join(
config.dirs.tmp, "localstack.%s" % os.path.basename(opensearch_url)
)
download_and_extract_with_retry(opensearch_url, tmp_archive, install_dir_parent)
opensearch_dir = glob.glob(os.path.join(install_dir_parent, "opensearch*"))
if not opensearch_dir:
raise Exception("Unable to find OpenSearch folder in %s" % install_dir_parent)
shutil.move(opensearch_dir[0], install_dir)
for dir_name in ("data", "logs", "modules", "plugins", "config/scripts"):
dir_path = os.path.join(install_dir, dir_name)
mkdir(dir_path)
chmod_r(dir_path, 0o777)
# patch JVM options file - replace hardcoded heap size settings
jvm_options_file = os.path.join(install_dir, "config", "jvm.options")
if os.path.exists(jvm_options_file):
jvm_options = load_file(jvm_options_file)
jvm_options_replaced = re.sub(
r"(^-Xm[sx][a-zA-Z0-9\.]+$)", r"# \1", jvm_options, flags=re.MULTILINE
)
if jvm_options != jvm_options_replaced:
save_file(jvm_options_file, jvm_options_replaced)
def install_sqs_provider():
if SQS_BACKEND_IMPL == "elasticmq":
install_elasticmq()
def install_elasticmq():
# TODO remove this function if we stop using ElasticMQ entirely
if not os.path.exists(INSTALL_PATH_ELASTICMQ_JAR):
log_install_msg("ElasticMQ")
mkdir(INSTALL_DIR_ELASTICMQ)
# download archive
tmp_archive = os.path.join(config.dirs.tmp, "elasticmq-server.jar")
if not os.path.exists(tmp_archive):
download(ELASTICMQ_JAR_URL, tmp_archive)
shutil.copy(tmp_archive, INSTALL_DIR_ELASTICMQ)
def install_kinesis():
if config.KINESIS_PROVIDER == "kinesalite":
install_kinesalite()
return
if config.KINESIS_PROVIDER == "kinesis-mock":
is_installed, bin_path = get_is_kinesis_mock_installed()
if not is_installed:
install_kinesis_mock(bin_path)
return
raise ValueError("unknown kinesis provider %s" % config.KINESIS_PROVIDER)
def _apply_patches_kinesalite():
files = [
"%s/kinesalite/validations/decreaseStreamRetentionPeriod.js",
"%s/kinesalite/validations/increaseStreamRetentionPeriod.js",
]
for file_path in files:
file_path = file_path % INSTALL_DIR_NPM
replace_in_file("lessThanOrEqual: 168", "lessThanOrEqual: 8760", file_path)
def install_kinesalite():
if not os.path.exists(INSTALL_PATH_KINESALITE_CLI):
log_install_msg("Kinesis")
run('cd "%s" && npm install' % MODULE_MAIN_PATH)
_apply_patches_kinesalite()
def get_is_kinesis_mock_installed() -> Tuple[bool, str]:
"""
Checks the host system to see if kinesis mock is installed and where.
:returns: True if kinesis mock is installed (False otherwise) and the expected installation path
"""
machine = platform.machine().lower()
system = platform.system().lower()
version = platform.version().lower()
is_probably_m1 = system == "darwin" and ("arm64" in version or "arm32" in version)
LOG.debug("getting kinesis-mock for %s %s", system, machine)
if config.is_env_true("KINESIS_MOCK_FORCE_JAVA"):
# sometimes the static binaries may have problems, and we want to fal back to Java
bin_file = "kinesis-mock.jar"
elif (machine == "x86_64" or machine == "amd64") and not is_probably_m1:
if system == "windows":
bin_file = "kinesis-mock-mostly-static.exe"
elif system == "linux":
bin_file = "kinesis-mock-linux-amd64-static"
elif system == "darwin":
bin_file = "kinesis-mock-macos-amd64-dynamic"
else:
bin_file = "kinesis-mock.jar"
else:
bin_file = "kinesis-mock.jar"
bin_file_path = os.path.join(INSTALL_DIR_KINESIS_MOCK, bin_file)
if os.path.exists(bin_file_path):
LOG.debug("kinesis-mock found at %s", bin_file_path)
return True, bin_file_path
return False, bin_file_path
def install_kinesis_mock(bin_file_path: str):
response = requests.get(KINESIS_MOCK_RELEASE_URL)
if not response.ok:
raise ValueError(
"Could not get list of releases from %s: %s" % (KINESIS_MOCK_RELEASE_URL, response.text)
)
github_release = response.json()
download_url = None
bin_file_name = os.path.basename(bin_file_path)
for asset in github_release.get("assets", []):
# find the correct binary in the release
if asset["name"] == bin_file_name:
download_url = asset["browser_download_url"]
break
if download_url is None:
raise ValueError(
"could not find required binary %s in release %s"
% (bin_file_name, KINESIS_MOCK_RELEASE_URL)
)
mkdir(INSTALL_DIR_KINESIS_MOCK)
LOG.info("downloading kinesis-mock binary from %s", download_url)
download(download_url, bin_file_path)
chmod_r(bin_file_path, 0o777)
def install_local_kms():
local_arch = f"{platform.system().lower()}-{get_arch()}"
binary_path = INSTALL_PATH_KMS_BINARY_PATTERN.replace("<arch>", local_arch)
if not os.path.exists(binary_path):
log_install_msg("KMS")
mkdir(INSTALL_DIR_KMS)
kms_url = KMS_URL_PATTERN.replace("<arch>", local_arch)
download(kms_url, binary_path)
chmod_r(binary_path, 0o777)
def install_stepfunctions_local():
if not os.path.exists(INSTALL_PATH_STEPFUNCTIONS_JAR):
# pull the JAR file from the Docker image, which is more up-to-date than the downloadable JAR file
# TODO: works only when running on the host, outside of Docker -> add a fallback if running in Docker?
log_install_msg("Step Functions")
mkdir(INSTALL_DIR_STEPFUNCTIONS)
DOCKER_CLIENT.pull_image(IMAGE_NAME_SFN_LOCAL)
docker_name = "tmp-ls-sfn"
DOCKER_CLIENT.run_container(
IMAGE_NAME_SFN_LOCAL,
remove=True,
entrypoint="",
name=docker_name,
detach=True,
command=["sleep", "15"],
)
time.sleep(5)
DOCKER_CLIENT.copy_from_container(
docker_name, local_path=dirs.static_libs, container_path="/home/stepfunctionslocal/"
)
path = Path(f"{dirs.static_libs}/stepfunctionslocal/")
for file in path.glob("*.jar"):
file.rename(Path(INSTALL_DIR_STEPFUNCTIONS) / file.name)
rm_rf("%s/stepfunctionslocal" % dirs.static_libs)
classes = [
SFN_PATCH_CLASS1,
SFN_PATCH_CLASS2,
SFN_PATCH_CLASS_REGION,
SFN_PATCH_CLASS_STARTER,
SFN_PATCH_CLASS_ASYNC2SERVICEAPI,
SFN_PATCH_CLASS_DESCRIBEEXECUTIONPARSED,
SFN_PATCH_FILE_METAINF,
]
for patch_class in classes:
patch_url = f"{SFN_PATCH_URL_PREFIX}/{patch_class}"
add_file_to_jar(patch_class, patch_url, target_jar=INSTALL_PATH_STEPFUNCTIONS_JAR)
# special case for Manifest file - extract first, replace content, then update in JAR file
manifest_file = os.path.join(INSTALL_DIR_STEPFUNCTIONS, "META-INF", "MANIFEST.MF")
if not os.path.exists(manifest_file):
content = run(["unzip", "-p", INSTALL_PATH_STEPFUNCTIONS_JAR, "META-INF/MANIFEST.MF"])
content = re.sub(
"Main-Class: .+", "Main-Class: cloud.localstack.StepFunctionsStarter", content
)
classpath = " ".join([os.path.basename(jar) for jar in JAR_URLS])
content = re.sub(r"Class-Path: \. ", f"Class-Path: {classpath} . ", content)
save_file(manifest_file, content)
run(
["zip", INSTALL_PATH_STEPFUNCTIONS_JAR, "META-INF/MANIFEST.MF"],
cwd=INSTALL_DIR_STEPFUNCTIONS,
)
# download additional jar libs
for jar_url in JAR_URLS:
target = os.path.join(INSTALL_DIR_STEPFUNCTIONS, os.path.basename(jar_url))
if not file_exists_not_empty(target):
download(jar_url, target)
# download aws-sdk lambda handler
target = os.path.join(INSTALL_DIR_STEPFUNCTIONS, "localstack-internal-awssdk", "awssdk.zip")
if not file_exists_not_empty(target):
download(SFN_AWS_SDK_LAMBDA_ZIP_FILE, target)
def add_file_to_jar(class_file, class_url, target_jar, base_dir=None):
base_dir = base_dir or os.path.dirname(target_jar)
patch_class_file = os.path.join(base_dir, class_file)
if not os.path.exists(patch_class_file):
download(class_url, patch_class_file)
run(["zip", target_jar, class_file], cwd=base_dir)
def install_dynamodb_local():
if not os.path.exists(INSTALL_PATH_DDB_JAR):
log_install_msg("DynamoDB")
# download and extract archive
tmp_archive = os.path.join(tempfile.gettempdir(), "localstack.ddb.zip")
download_and_extract_with_retry(DYNAMODB_JAR_URL, tmp_archive, INSTALL_DIR_DDB)
# fix logging configuration for DynamoDBLocal
log4j2_config = """<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
</Console>
</Appenders>
<Loggers>
<Root level="WARN"><AppenderRef ref="Console"/></Root>
</Loggers>
</Configuration>"""
log4j2_file = os.path.join(INSTALL_DIR_DDB, "log4j2.xml")
save_file(log4j2_file, log4j2_config)
run('cd "%s" && zip -u DynamoDBLocal.jar log4j2.xml || true' % INSTALL_DIR_DDB)
def install_amazon_kinesis_client_libs():
# install KCL/STS JAR files
if not os.path.exists(INSTALL_PATH_KCL_JAR):
mkdir(INSTALL_DIR_KCL)
tmp_archive = os.path.join(tempfile.gettempdir(), "aws-java-sdk-sts.jar")
if not os.path.exists(tmp_archive):
download(STS_JAR_URL, tmp_archive)
shutil.copy(tmp_archive, INSTALL_DIR_KCL)
# Compile Java files
from localstack.utils.kinesis import kclipy_helper
classpath = kclipy_helper.get_kcl_classpath()
if is_windows():
classpath = re.sub(r":([^\\])", r";\1", classpath)
java_files = "%s/utils/kinesis/java/cloud/localstack/*.java" % MODULE_MAIN_PATH
class_files = "%s/utils/kinesis/java/cloud/localstack/*.class" % MODULE_MAIN_PATH
if not glob.glob(class_files):
run(
'javac -source %s -target %s -cp "%s" %s'
% (JAVAC_TARGET_VERSION, JAVAC_TARGET_VERSION, classpath, java_files)
)
def install_lambda_java_libs():
# install LocalStack "fat" JAR file (contains all dependencies)
if not os.path.exists(INSTALL_PATH_LOCALSTACK_FAT_JAR):
log_install_msg("LocalStack Java libraries", verbatim=True)
download(URL_LOCALSTACK_FAT_JAR, INSTALL_PATH_LOCALSTACK_FAT_JAR)
def install_lambda_java_testlibs():
# Download the LocalStack Utils Test jar file from the maven repo
if not os.path.exists(TEST_LAMBDA_JAVA):
mkdir(os.path.dirname(TEST_LAMBDA_JAVA))
download(TEST_LAMBDA_JAR_URL, TEST_LAMBDA_JAVA)
def install_go_lambda_runtime():
if os.path.isfile(GO_LAMBDA_RUNTIME):
return
log_install_msg("Installing golang runtime")
system = platform.system().lower()
arch = get_arch()
if system not in ["linux"]:
raise ValueError("unsupported os %s for awslambda-go-runtime" % system)
if arch not in ["amd64", "arm64"]:
raise ValueError("unsupported arch %s for awslambda-go-runtime" % arch)
url = GO_RUNTIME_DOWNLOAD_URL_TEMPLATE.format(
version=GO_RUNTIME_VERSION,
os=system,
arch=arch,
)
download_and_extract(url, GO_INSTALL_FOLDER)
st = os.stat(GO_LAMBDA_RUNTIME)
os.chmod(GO_LAMBDA_RUNTIME, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
st = os.stat(GO_LAMBDA_MOCKSERVER)
os.chmod(GO_LAMBDA_MOCKSERVER, st.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
def install_cloudformation_libs():
from localstack.services.cloudformation import deployment_utils
# trigger download of CF module file
deployment_utils.get_cfn_response_mod_file()
def install_terraform() -> str:
if os.path.isfile(TERRAFORM_BIN):
return TERRAFORM_BIN
log_install_msg(f"Installing terraform {TERRAFORM_VERSION}")
system = platform.system().lower()
arch = get_arch()
url = TERRAFORM_URL_TEMPLATE.format(version=TERRAFORM_VERSION, os=system, arch=arch)
download_and_extract(url, os.path.dirname(TERRAFORM_BIN))
chmod_r(TERRAFORM_BIN, 0o777)
return TERRAFORM_BIN
def get_terraform_binary() -> str:
if not os.path.isfile(TERRAFORM_BIN):
install_terraform()
return TERRAFORM_BIN
def install_component(name):
installer = installers.get(name)
if installer:
installer()
def install_components(names):
parallelize(install_component, names)
install_lambda_java_libs()
def install_all_components():
# install dependencies - make sure that install_components(..) is called before hooks.install below!
install_components(DEFAULT_SERVICE_PORTS.keys())
hooks.install.run()
def install_debugpy_and_dependencies():
try:
import debugpy
assert debugpy
logging.debug("Debugpy module already Installed")
except ModuleNotFoundError:
logging.debug("Installing Debugpy module")
import pip
if hasattr(pip, "main"):
pip.main(["install", DEBUGPY_MODULE])
else:
pip._internal.main(["install", DEBUGPY_MODULE])
# -----------------
# HELPER FUNCTIONS
# -----------------
def log_install_msg(component, verbatim=False):
component = component if verbatim else "local %s server" % component
LOG.info("Downloading and installing %s. This may take some time.", component)
def download_and_extract(archive_url, target_dir, retries=0, sleep=3, tmp_archive=None):
mkdir(target_dir)
if tmp_archive:
_, ext = os.path.splitext(tmp_archive)
else:
_, ext = os.path.splitext(archive_url)
tmp_archive = tmp_archive or new_tmp_file()
if not os.path.exists(tmp_archive) or os.path.getsize(tmp_archive) <= 0:
# create temporary placeholder file, to avoid duplicate parallel downloads
save_file(tmp_archive, "")
for i in range(retries + 1):
try:
download(archive_url, tmp_archive)
break
except Exception:
time.sleep(sleep)
if ext == ".zip":
unzip(tmp_archive, target_dir)
elif ext == ".gz" or ext == ".bz2":
untar(tmp_archive, target_dir)
else:
raise Exception("Unsupported archive format: %s" % ext)
def download_and_extract_with_retry(archive_url, tmp_archive, target_dir):
try:
download_and_extract(archive_url, target_dir, tmp_archive=tmp_archive)
except Exception as e:
# try deleting and re-downloading the zip file
LOG.info("Unable to extract file, re-downloading ZIP archive %s: %s", tmp_archive, e)
rm_rf(tmp_archive)
download_and_extract(archive_url, target_dir, tmp_archive=tmp_archive)
# kept here for backwards compatibility (installed on "make init" - TODO should be removed)
installers = {
"cloudformation": install_cloudformation_libs,
"dynamodb": install_dynamodb_local,
"kinesis": install_kinesis,
"kms": install_local_kms,
"sqs": install_sqs_provider,
"stepfunctions": install_stepfunctions_local,
}
Installer = Tuple[str, Callable]
class InstallerRepository(Plugin):
namespace = "localstack.installer"
def get_installer(self) -> List[Installer]:
raise NotImplementedError
class CommunityInstallerRepository(InstallerRepository):
name = "community"
def get_installer(self) -> List[Installer]:
return [
("awslamba-go-runtime", install_go_lambda_runtime),
("cloudformation-libs", install_cloudformation_libs),
("dynamodb-local", install_dynamodb_local),
("elasticmq", install_elasticmq),
("elasticsearch", install_elasticsearch),
("opensearch", install_opensearch),
("kinesalite", install_kinesalite),
("kinesis-client-libs", install_amazon_kinesis_client_libs),
("kinesis-mock", install_kinesis_mock),
("lambda-java-libs", install_lambda_java_libs),
("local-kms", install_local_kms),
("stepfunctions-local", install_stepfunctions_local),
("terraform", install_terraform),
]
class InstallerManager:
def __init__(self):
self.repositories: PluginManager[InstallerRepository] = PluginManager(
InstallerRepository.namespace
)
@functools.lru_cache()
def get_installers(self) -> Dict[str, Callable]:
installer: List[Installer] = []
for repo in self.repositories.load_all():
installer.extend(repo.get_installer())
return dict(installer)
def install(self, package: str, *args, **kwargs):
installer = self.get_installers().get(package)
if not installer:
raise ValueError("no installer for package %s" % package)
return installer(*args, **kwargs)
def main():
if len(sys.argv) > 1:
# set test API key so pro install hooks are called
os.environ["LOCALSTACK_API_KEY"] = os.environ.get("LOCALSTACK_API_KEY") or "test"
if sys.argv[1] == "libs":
print("Initializing installation.")
logging.basicConfig(level=logging.INFO)
logging.getLogger("requests").setLevel(logging.WARNING)
install_all_components()
if sys.argv[1] in ("libs", "testlibs"):
# Install additional libraries for testing
install_amazon_kinesis_client_libs()
install_lambda_java_testlibs()
print("Done.")
if __name__ == "__main__":
main()
| 1 | 14,412 | remember to update the hash once the upstream PR is merged | localstack-localstack | py |
@@ -45,10 +45,8 @@ public class SFDCFcmListenerService extends FirebaseMessagingService {
@Override
public void onMessageReceived(RemoteMessage message) {
if (message != null && SalesforceSDKManager.hasInstance()) {
- final PushNotificationInterface pnInterface = SalesforceSDKManager.getInstance().getPushNotificationReceiver();
- if (pnInterface != null) {
- pnInterface.onPushMessageReceived(message);
- }
+ final PushNotificationDecryptor pnDecryptor = PushNotificationDecryptor.getInstance();
+ pnDecryptor.onPushMessageReceived(message);
}
}
} | 1 | /*
* Copyright (c) 2018-present, salesforce.com, inc.
* All rights reserved.
* Redistribution and use of this software in source and binary forms, with or
* without modification, are permitted provided that the following conditions
* are met:
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* - Neither the name of salesforce.com, inc. nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission of salesforce.com, inc.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package com.salesforce.androidsdk.push;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import com.salesforce.androidsdk.app.SalesforceSDKManager;
/**
* This class is called when a message is received or the token changes.
*
* @author bhariharan
*/
public class SFDCFcmListenerService extends FirebaseMessagingService {
/**
* Called when message is received.
*
* @param message Remote message received.
*/
@Override
public void onMessageReceived(RemoteMessage message) {
if (message != null && SalesforceSDKManager.hasInstance()) {
final PushNotificationInterface pnInterface = SalesforceSDKManager.getInstance().getPushNotificationReceiver();
if (pnInterface != null) {
pnInterface.onPushMessageReceived(message);
}
}
}
}
| 1 | 17,620 | Sends the incoming message to the decryptor, which will then forward it to the interface once processing is complete. | forcedotcom-SalesforceMobileSDK-Android | java |
@@ -317,10 +317,15 @@ func (ctx *invocationContext) Send(toAddr address.Address, methodNum abi.MethodN
}
}()
+ // DRAGONS: remove these once specs actors project enforces Send params
// replace nil params with empty value
if params == nil {
params = &adt_spec.EmptyValue{}
}
+ // replace non pointer with pointer
+ if _, ok := params.(adt_spec.EmptyValue); ok {
+ params = &adt_spec.EmptyValue{}
+ }
// check if side-effects are allowed
if !ctx.allowSideEffects { | 1 | package vmcontext
import (
"bytes"
"encoding/binary"
"fmt"
"runtime/debug"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin"
init_ "github.com/filecoin-project/specs-actors/actors/builtin/init"
specsruntime "github.com/filecoin-project/specs-actors/actors/runtime"
"github.com/filecoin-project/specs-actors/actors/runtime/exitcode"
adt_spec "github.com/filecoin-project/specs-actors/actors/util/adt"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/go-filecoin/internal/pkg/crypto"
e "github.com/filecoin-project/go-filecoin/internal/pkg/enccid"
"github.com/filecoin-project/go-filecoin/internal/pkg/vm/actor"
"github.com/filecoin-project/go-filecoin/internal/pkg/vm/gas"
"github.com/filecoin-project/go-filecoin/internal/pkg/vm/internal/runtime"
)
type invocationContext struct {
rt *VM
msg internalMessage
fromActor *actor.Actor
gasTank *GasTracker
randSource crypto.RandomnessSource
isCallerValidated bool
allowSideEffects bool
toActor *actor.Actor
stateHandle internalActorStateHandle
}
type internalActorStateHandle interface {
specsruntime.StateHandle
Validate(func(interface{}) cid.Cid)
}
func newInvocationContext(rt *VM, msg internalMessage, fromActor *actor.Actor, gasTank *GasTracker, randSource crypto.RandomnessSource) invocationContext {
// Note: the toActor and stateHandle are loaded during the `invoke()`
return invocationContext{
rt: rt,
msg: msg,
// Dragons: based on latest changes, it seems we could delete this
fromActor: fromActor,
gasTank: gasTank,
randSource: randSource,
isCallerValidated: false,
allowSideEffects: true,
}
}
type stateHandleContext invocationContext
func (ctx *stateHandleContext) AllowSideEffects(allow bool) {
ctx.allowSideEffects = allow
}
func (ctx *stateHandleContext) Store() specsruntime.Store {
return ((*invocationContext)(ctx)).Store()
}
func (ctx *invocationContext) invoke() interface{} {
// pre-dispatch
// 1. charge gas for message invocation
// 2. load target actor
// 3. transfer optional funds
// 4. short-circuit _Send_ method
// 5. load target actor code
// 6. create target state handle
// assert from address is an ID address.
if ctx.msg.from.Protocol() != address.ID {
panic("bad code: sender address MUST be an ID address at invocation time")
}
// 1. charge gas for msg
ctx.gasTank.Charge(ctx.rt.pricelist.OnMethodInvocation(ctx.msg.value, ctx.msg.method))
// 2. load target actor
// Note: we replace the "to" address with the normalized version
ctx.toActor, ctx.msg.to = ctx.resolveTarget(ctx.msg.to)
// 3. transfer funds carried by the msg
ctx.rt.transfer(ctx.msg.from, ctx.msg.to, ctx.msg.value)
// 4. if we are just sending funds, there is nothing else to do.
if ctx.msg.method == builtin.MethodSend {
return &adt_spec.EmptyValue{}
}
// 5. load target actor code
actorImpl := ctx.rt.getActorImpl(ctx.toActor.Code.Cid)
// 6. create target state handle
stateHandle := newActorStateHandle((*stateHandleContext)(ctx), ctx.toActor.Head.Cid)
ctx.stateHandle = &stateHandle
// dispatch
adapter := runtimeAdapter{ctx: ctx}
out, err := actorImpl.Dispatch(ctx.msg.method, &adapter, ctx.msg.params)
if err != nil {
// Dragons: this could be a deserialization error too
runtime.Abort(exitcode.SysErrInvalidMethod)
}
// post-dispatch
// 1. check caller was validated
// 2. check state manipulation was valid
// 3. update actor state
// 4. success!
// 1. check caller was validated
if !ctx.isCallerValidated {
runtime.Abortf(exitcode.SysErrorIllegalActor, "Caller MUST be validated during method execution")
}
// 2. validate state access
ctx.stateHandle.Validate(func(obj interface{}) cid.Cid {
id, err := ctx.rt.store.CidOf(obj)
if err != nil {
panic(err)
}
return id
})
// 3. update actor state
// we need to load the actor back up in case something changed during execution
var found bool
ctx.toActor, found, err = ctx.rt.state.GetActor(ctx.rt.context, ctx.msg.to)
if err != nil {
panic(err)
}
if !found {
// Note: this is ok, it means the actor was deleted during the execution of the message
return out
}
// update the head and save it
ctx.toActor.Head = e.NewCid(stateHandle.head)
if err := ctx.rt.state.SetActor(ctx.rt.context, ctx.msg.to, ctx.toActor); err != nil {
panic(err)
}
// 4. success! build the receipt
return out
}
// resolveTarget loads and actor and returns its ActorID address.
//
// If the target actor does not exist, and the target address is a pub-key address,
// a new account actor will be created.
// Otherwise, this method will abort execution.
func (ctx *invocationContext) resolveTarget(target address.Address) (*actor.Actor, address.Address) {
// resolve the target address via the InitActor, and attempt to load state.
initActorEntry, found, err := ctx.rt.state.GetActor(ctx.rt.context, builtin.InitActorAddr)
if err != nil {
panic(err)
}
if !found {
runtime.Abort(exitcode.SysErrActorNotFound)
}
if target == builtin.InitActorAddr {
return initActorEntry, target
}
// get a view into the actor state
var state init_.State
if _, err := ctx.rt.store.Get(ctx.rt.context, initActorEntry.Head.Cid, &state); err != nil {
panic(err)
}
// lookup the ActorID based on the address
targetIDAddr, err := state.ResolveAddress(ctx.rt.ContextStore(), target)
// Dragons: move this logic to resolve address
notFound := (targetIDAddr == target && target.Protocol() != address.ID)
if err != nil || notFound {
// Dragons: we should be ble to just call exec on init..
// actor does not exist, create an account actor
// - precond: address must be a pub-key
// - sent init actor a msg to create the new account
if target.Protocol() != address.SECP256K1 && target.Protocol() != address.BLS {
// Don't implicitly create an account actor for an address without an associated key.
runtime.Abort(exitcode.SysErrActorNotFound)
}
targetIDAddr, err = state.MapAddressToNewID(ctx.rt.ContextStore(), target)
if err != nil {
panic(err)
}
// store new state
initHead, _, err := ctx.rt.store.Put(ctx.rt.context, &state)
if err != nil {
panic(err)
}
// update init actor
initActorEntry.Head = e.NewCid(initHead)
if err := ctx.rt.state.SetActor(ctx.rt.context, builtin.InitActorAddr, initActorEntry); err != nil {
panic(err)
}
// Review: does this guy have to pay gas?
ctx.CreateActor(builtin.AccountActorCodeID, targetIDAddr)
// call constructor on account
newMsg := internalMessage{
from: builtin.SystemActorAddr,
to: targetIDAddr,
value: big.Zero(),
method: builtin.MethodsAccount.Constructor,
// use original address as constructor params
// Note: constructor takes a pointer
params: &target,
}
newCtx := newInvocationContext(ctx.rt, newMsg, nil, ctx.gasTank, ctx.randSource)
newCtx.invoke()
}
// load actor
targetActor, found, err := ctx.rt.state.GetActor(ctx.rt.context, targetIDAddr)
if err != nil {
panic(err)
}
if !found {
panic(fmt.Errorf("unreachable: actor is supposed to exist but it does not. %s", err))
}
return targetActor, targetIDAddr
}
//
// implement runtime.InvocationContext for invocationContext
//
var _ runtime.InvocationContext = (*invocationContext)(nil)
// Runtime implements runtime.InvocationContext.
func (ctx *invocationContext) Runtime() runtime.Runtime {
return ctx.rt
}
// Store implements runtime.Runtime.
func (ctx *invocationContext) Store() specsruntime.Store {
return actorStorage{
context: ctx.rt.context,
inner: ctx.rt.store,
gasTank: ctx.gasTank,
pricelist: ctx.rt.pricelist,
}
}
// Message implements runtime.InvocationContext.
func (ctx *invocationContext) Message() specsruntime.Message {
return ctx.msg
}
// ValidateCaller implements runtime.InvocationContext.
func (ctx *invocationContext) ValidateCaller(pattern runtime.CallerPattern) {
if ctx.isCallerValidated {
runtime.Abortf(exitcode.SysErrorIllegalActor, "Method must validate caller identity exactly once")
}
if !pattern.IsMatch((*patternContext2)(ctx)) {
runtime.Abortf(exitcode.SysErrorIllegalActor, "Method invoked by incorrect caller")
}
ctx.isCallerValidated = true
}
// State implements runtime.InvocationContext.
func (ctx *invocationContext) State() specsruntime.StateHandle {
return ctx.stateHandle
}
type returnWrapper struct {
inner specsruntime.CBORMarshaler
}
func (r returnWrapper) Into(o specsruntime.CBORUnmarshaler) error {
// TODO: if inner is also a specsruntime.CBORUnmarshaler, overwrite o with inner.
a := []byte{}
b := bytes.NewBuffer(a)
err := r.inner.MarshalCBOR(b)
if err != nil {
return err
}
err = o.UnmarshalCBOR(b)
return err
}
// Send implements runtime.InvocationContext.
func (ctx *invocationContext) Send(toAddr address.Address, methodNum abi.MethodNum, params specsruntime.CBORMarshaler, value abi.TokenAmount) (ret specsruntime.SendReturn, errcode exitcode.ExitCode) {
defer func() {
if r := recover(); r != nil {
switch r.(type) {
case runtime.ExecutionPanic:
p := r.(runtime.ExecutionPanic)
vmlog.Warnw("Abort during method execution.",
"errorMessage", p,
"exitCode", p.Code(),
"receiver", toAddr,
"methodNum", methodNum,
"value", value)
ret = nil
errcode = p.Code()
return
default:
// do not trap unknown panics
debug.PrintStack()
panic(r)
}
}
}()
// replace nil params with empty value
if params == nil {
params = &adt_spec.EmptyValue{}
}
// check if side-effects are allowed
if !ctx.allowSideEffects {
runtime.Abortf(exitcode.SysErrorIllegalActor, "Calling Send() is not allowed during side-effet lock")
}
// prepare
// 1. alias fromActor
// 2. build internal message
// 1. fromActor = executing toActor
from := ctx.msg.to
fromActor := ctx.toActor
// 2. build internal message
newMsg := internalMessage{
from: from,
to: toAddr,
value: value,
method: methodNum,
params: params,
}
// invoke
// 1. build new context
// 2. invoke message
// 3. success!
// 1. build new context
newCtx := newInvocationContext(ctx.rt, newMsg, fromActor, ctx.gasTank, ctx.randSource)
// 2. invoke
out := newCtx.invoke()
// 3. success!
marsh, ok := out.(specsruntime.CBORMarshaler)
if !ok {
runtime.Abortf(exitcode.SysErrorIllegalActor, "Returned value is not a CBORMarshaler")
}
return returnWrapper{inner: marsh}, exitcode.Ok
}
/// Balance implements runtime.InvocationContext.
func (ctx *invocationContext) Balance() abi.TokenAmount {
return ctx.toActor.Balance
}
// Charge implements runtime.InvocationContext.
func (ctx *invocationContext) Charge(cost gas.Unit) error {
ctx.gasTank.Charge(cost)
return nil
}
//
// implement runtime.InvocationContext for invocationContext
//
var _ runtime.ExtendedInvocationContext = (*invocationContext)(nil)
// CreateActor implements runtime.ExtendedInvocationContext.
func (ctx *invocationContext) CreateActor(codeID cid.Cid, addr address.Address) {
if !isBuiltinActor(codeID) {
runtime.Abortf(exitcode.ErrIllegalArgument, "Can only create built-in actors.")
}
if builtin.IsSingletonActor(codeID) {
runtime.Abortf(exitcode.ErrIllegalArgument, "Can only have one instance of singleton actors.")
}
ctx.gasTank.Charge(ctx.rt.pricelist.OnCreateActor())
// Check existing address. If nothing there, create empty actor.
//
// Note: we are storing the actors by ActorID *address*
_, found, err := ctx.rt.state.GetActor(ctx.rt.context, addr)
if err != nil {
panic(err)
}
if found {
runtime.Abortf(exitcode.ErrIllegalArgument, "Actor address already exists")
}
newActor := &actor.Actor{
// make this the right 'type' of actor
Code: e.NewCid(codeID),
Balance: abi.NewTokenAmount(0),
}
if err := ctx.rt.state.SetActor(ctx.rt.context, addr, newActor); err != nil {
panic(err)
}
}
// DeleteActor implements runtime.ExtendedInvocationContext.
func (ctx *invocationContext) DeleteActor() {
ctx.gasTank.Charge(ctx.rt.pricelist.OnDeleteActor())
if err := ctx.rt.state.DeleteActor(ctx.rt.context, ctx.msg.to); err != nil {
panic(err)
}
}
// patternContext implements the PatternContext
type patternContext2 invocationContext
var _ runtime.PatternContext = (*patternContext2)(nil)
func (ctx *patternContext2) CallerCode() cid.Cid {
return ctx.fromActor.Code.Cid
}
func (ctx *patternContext2) CallerAddr() address.Address {
return ctx.msg.from
}
// Dragons: delete once we remove the bootstrap miner
func isBuiltinActor(code cid.Cid) bool {
return builtin.IsBuiltinActor(code)
}
func computeActorAddress(creator address.Address, nonce uint64) (address.Address, error) {
buf := new(bytes.Buffer)
if _, err := buf.Write(creator.Bytes()); err != nil {
return address.Undef, err
}
if err := binary.Write(buf, binary.BigEndian, nonce); err != nil {
return address.Undef, err
}
return address.NewActorAddress(buf.Bytes())
}
| 1 | 23,207 | FYI This will go the other way, with nil being the correct value for "no params" | filecoin-project-venus | go |
@@ -162,8 +162,10 @@ namespace pwiz.Skyline.Model.Lib
var thatPeptideKey = thatItem.LibraryKey as PeptideLibraryKey;
if (thatPeptideKey == null)
{
- result.Add(thatItem.LibraryKey);
- nonPeptideKeySet.Add(thatItem.LibraryKey);
+ if (nonPeptideKeySet.Add(thatItem.LibraryKey))
+ {
+ result.Add(thatItem.LibraryKey); // First time we've seen it, add to list
+ }
continue;
}
PeptideLibraryKey[] thisKeysWithUnmodSeq; | 1 | /*
* Original author: Nicholas Shulman <nicksh .at. u.washington.edu>,
* MacCoss Lab, Department of Genome Sciences, UW
*
* Copyright 2017 University of Washington - Seattle, WA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using JetBrains.Annotations;
using pwiz.Common.Collections;
using pwiz.Skyline.Util;
namespace pwiz.Skyline.Model.Lib
{
public class LibKeyIndex : AbstractReadOnlyCollection<LibKeyIndex.IndexItem>
{
private readonly ImmutableList<ISubIndex> _subIndexes;
public LibKeyIndex(IEnumerable<IndexItem> items)
{
var allItems = items.ToArray();
_subIndexes = ImmutableList.ValueOf(new ISubIndex[]
{
new PeptideSubIndex(allItems),
new MoleculeSubIndex(allItems),
new PrecursorSubIndex(allItems)
});
Count = _subIndexes.Sum(index => index.Count);
}
public LibKeyIndex(IEnumerable<LibraryKey> keys)
: this(keys.Select((key, index) => new IndexItem(key, index)))
{
}
public override IEnumerator<IndexItem> GetEnumerator()
{
return _subIndexes.SelectMany(index => index).GetEnumerator();
}
public override int Count { get; }
public IndexItem? Find(LibraryKey libraryKey)
{
return _subIndexes.SelectMany(index => index.ItemsEqualTo(libraryKey)).FirstOrDefault();
}
public IEnumerable<IndexItem> ItemsMatching(LibraryKey libraryKey, bool matchAdductAlso)
{
return _subIndexes.SelectMany(index => index.ItemsMatching(libraryKey, matchAdductAlso));
}
public IEnumerable<IndexItem> ItemsWithUnmodifiedSequence(LibraryKey libraryKey)
{
return _subIndexes.SelectMany(index => index.ItemsMatchingWithoutModifications(libraryKey));
}
public struct IndexItem
{
public static IEnumerable<IndexItem> NONE =
ImmutableList<IndexItem>.EMPTY;
public IndexItem(LibraryKey libraryKey, int originalIndex) : this()
{
LibraryKey = libraryKey;
OriginalIndex = originalIndex;
}
public LibraryKey LibraryKey { get; private set; }
public int OriginalIndex { get; private set; }
}
public static bool ModificationsMatch(string strMod1, string strMod2)
{
if (strMod1 == strMod2)
{
return true;
}
var massMod1 = MassModification.Parse(strMod1);
var massMod2 = MassModification.Parse(strMod2);
if (massMod1 == null || massMod2 == null)
{
return false;
}
return massMod1.Matches(massMod2);
}
public static bool KeysMatch(LibraryKey key1, LibraryKey key2)
{
if (Equals(key1, key2))
{
return true;
}
if (!Equals(key1.Adduct, key2.Adduct))
{
return false;
}
var peptideKey1 = key1 as PeptideLibraryKey;
var peptideKey2 = key2 as PeptideLibraryKey;
if (peptideKey1 == null || peptideKey2 == null)
{
return false;
}
if (!Equals(peptideKey1.UnmodifiedSequence, peptideKey2.UnmodifiedSequence))
{
return false;
}
var mods1 = peptideKey1.GetModifications();
var mods2 = peptideKey2.GetModifications();
if (mods1.Count != mods2.Count)
{
return false;
}
if (!mods1.Select(mod => mod.Key).SequenceEqual(mods2.Select(mod => mod.Key)))
{
return false;
}
for (int i = 0; i < mods1.Count; i++)
{
if (!ModificationsMatch(mods1[i].Value, mods2[i].Value))
{
return false;
}
}
return true;
}
/// <summary>
/// Return a set of library keys that are the most general of the ones found in this and that,
/// and which covers all of the keys.
/// <see cref="MostGeneralPeptideKey" />
/// </summary>
public IList<LibraryKey> MergeKeys(LibKeyIndex that)
{
var keysByUnmodifiedSequence = this.Select(item => item.LibraryKey)
.OfType<PeptideLibraryKey>()
.ToLookup(key => key.UnmodifiedSequence)
.ToDictionary(grouping => grouping.Key, grouping => grouping.ToArray());
var result = new List<LibraryKey>();
var nonPeptideKeySet = new HashSet<LibraryKey>();
foreach (var thatItem in that)
{
var thatPeptideKey = thatItem.LibraryKey as PeptideLibraryKey;
if (thatPeptideKey == null)
{
result.Add(thatItem.LibraryKey);
nonPeptideKeySet.Add(thatItem.LibraryKey);
continue;
}
PeptideLibraryKey[] thisKeysWithUnmodSeq;
if (!keysByUnmodifiedSequence.TryGetValue(thatPeptideKey.UnmodifiedSequence, out thisKeysWithUnmodSeq))
{
result.Add(thatPeptideKey);
continue;
}
keysByUnmodifiedSequence[thatPeptideKey.UnmodifiedSequence] =
MergePeptideLibraryKey(thisKeysWithUnmodSeq, thatPeptideKey).ToArray();
}
result.AddRange(this.Select(item => item.LibraryKey)
.Where(key => !(key is PeptideLibraryKey) && !nonPeptideKeySet.Contains(key)));
result.AddRange(keysByUnmodifiedSequence.SelectMany(entry => entry.Value));
return result;
}
private IEnumerable<PeptideLibraryKey> MergePeptideLibraryKey(ICollection<PeptideLibraryKey> thisKeys,
PeptideLibraryKey thatKey)
{
while (true)
{
PeptideLibraryKey mostGeneralKey = thatKey;
foreach (var thisKey in thisKeys)
{
if (KeysMatch(thisKey, mostGeneralKey))
{
mostGeneralKey = MostGeneralPeptideKey(thisKey, mostGeneralKey);
}
}
if (Equals(mostGeneralKey, thatKey))
{
break;
}
thatKey = mostGeneralKey;
}
return new[] {thatKey}.Concat(thisKeys.Where(key => !KeysMatch(thatKey, key)));
}
/// <summary>
/// Given two keys that match each other (i.e. the modification masses are within the other's margin of error)
/// return a key which has the lower precision of the two.
/// For instance, if one key is C[+57.021464]PEPTIDER[+10] and the is C[+57.02]PEPTIDEK[10.0083],
/// the result be C[+57.02]PEPTIDER[+10].
/// </summary>
private PeptideLibraryKey MostGeneralPeptideKey(PeptideLibraryKey key1, PeptideLibraryKey key2)
{
Assume.AreEqual(key1.UnmodifiedSequence, key2.UnmodifiedSequence);
var mods1 = key1.GetModifications();
var mods2 = key2.GetModifications();
Assume.AreEqual(mods1.Count, mods2.Count);
var newMods = new List<KeyValuePair<int, string>>(mods1.Count);
for (int i = 0; i < mods1.Count; i++)
{
var mod1 = mods1[i];
var mod2 = mods2[i];
Assume.AreEqual(mod1.Key, mod2.Key);
if (mod1.Value == mod2.Value)
{
newMods.Add(mod1);
continue;
}
MassModification massMod1 = MassModification.Parse(mod1.Value);
MassModification massMod2 = MassModification.Parse(mod2.Value);
if (massMod1.Precision <= massMod2.Precision)
{
newMods.Add(mod1);
}
else
{
newMods.Add(mod2);
}
}
return new PeptideLibraryKey(MakeModifiedSequence(key1.UnmodifiedSequence, newMods), key1.Charge);
}
private string MakeModifiedSequence(string unmodifiedSequence,
IEnumerable<KeyValuePair<int, string>> modifications)
{
StringBuilder modifiedSequence = new StringBuilder();
int ichUnmodified = 0;
foreach (var modification in modifications)
{
Assume.IsTrue(modification.Key >= ichUnmodified);
modifiedSequence.Append(unmodifiedSequence.Substring(ichUnmodified,
modification.Key - ichUnmodified + 1));
ichUnmodified = modification.Key + 1;
modifiedSequence.Append(ModifiedSequence.Bracket(modification.Value));
}
modifiedSequence.Append(unmodifiedSequence.Substring(ichUnmodified));
return modifiedSequence.ToString();
}
private interface ISubIndex : IEnumerable<IndexItem>
{
int Count { get; }
/// <summary>
/// Returns the set of items whose LibraryKey is exactly equal to the requested key.
/// </summary>
IEnumerable<IndexItem> ItemsEqualTo(LibraryKey libraryKey);
/// <summary>
/// Returns the set of items whose LibraryKey matches, using the fuzzy logic specific to
/// the type of library key.
/// </summary>
IEnumerable<IndexItem> ItemsMatching(LibraryKey libraryKey, bool matchAdductAlso);
/// <summary>
/// For peptides, returns the set of items whose UnmodifiedSequence match, otherwise
/// returns the same as ItemsMatching(libraryKey, false).
/// </summary>
IEnumerable<IndexItem> ItemsMatchingWithoutModifications(LibraryKey libraryKey);
}
private abstract class SubIndex<TKey> : ISubIndex where TKey : LibraryKey
{
public int Count { get; protected set; }
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
public abstract IEnumerator<IndexItem> GetEnumerator();
public IEnumerable<IndexItem> ItemsEqualTo(LibraryKey libraryKey)
{
var key = libraryKey as TKey;
if (key == null)
{
return IndexItem.NONE;
}
return ExactMatches(key);
}
protected virtual IEnumerable<IndexItem> ExactMatches(TKey key)
{
return ItemsMatching(key, false).Where(indexItem => Equals(key, indexItem.LibraryKey));
}
public IEnumerable<IndexItem> ItemsMatching(LibraryKey libraryKey, bool matchAdductAlso)
{
var key = libraryKey as TKey;
if (key == null)
{
return IndexItem.NONE;
}
var matches = ItemsMatching(key);
return matchAdductAlso ? matches.Where(item => Equals(item.LibraryKey.Adduct, libraryKey.Adduct)) : matches;
}
protected abstract IEnumerable<IndexItem> ItemsMatching(TKey key);
public IEnumerable<IndexItem> ItemsMatchingWithoutModifications(LibraryKey libraryKey)
{
var key = libraryKey as TKey;
if (key == null)
{
return IndexItem.NONE;
}
return ItemsMatchingWithoutModifications(key);
}
protected virtual IEnumerable<IndexItem> ItemsMatchingWithoutModifications(TKey key)
{
return ItemsMatching(key);
}
}
/// <summary>
/// Holds the set of peptides in the LibKeyIndex. This maintains a Dictionary from
/// unmodified sequence to the keys.
/// For any particular unmodified sequence, the keys are sorted by the modification indexes
/// (the amino acid locations that are modified). The fuzzy modification comparison only
/// has to compare pepties that have modifications in the same locations.
/// </summary>
private class PeptideSubIndex : SubIndex<PeptideLibraryKey>
{
private readonly IDictionary<string, ImmutableList<PeptideEntry>> _entries;
public PeptideSubIndex(IEnumerable<IndexItem> items)
{
_entries = new Dictionary<string, ImmutableList<PeptideEntry>>();
var singletonIndexes = new Dictionary<int, ImmutableList<int>>();
var indexes = new Dictionary<ImmutableList<int>, ImmutableList<int>>();
var modIndexComparer = Comparer<IList<int>>.Create(CompareModificationIndexes);
foreach (var group in items.Where(item=>item.LibraryKey is PeptideLibraryKey)
.ToLookup(item => ((PeptideLibraryKey) item.LibraryKey).UnmodifiedSequence))
{
_entries.Add(group.Key, ImmutableList.ValueOf(group
.Select(item => PeptideEntry.NewInstance(singletonIndexes, indexes, item))
.OrderBy(entry => entry.ModificationIndexes, modIndexComparer)));
}
Count = _entries.Values.Sum(list => list.Count);
}
public override IEnumerator<IndexItem> GetEnumerator()
{
return _entries.Values.SelectMany(list => list.Select(entry => entry.IndexItem)).GetEnumerator();
}
protected override IEnumerable<IndexItem> ItemsMatching(PeptideLibraryKey libraryKey)
{
var matchingEntries = ModificationIndexMatches(libraryKey, out var modifications);
if (modifications != null && modifications.Count != 0)
{
matchingEntries = matchingEntries.Where(item =>
ModificationListsMatch(item.ModificationNames, modifications.Select(mod => mod.Value)));
}
return matchingEntries.Select(item => item.IndexItem);
}
private static bool ModificationListsMatch(IEnumerable<string> list1, IEnumerable<string> list2)
{
return !list1.Zip(list2, ModificationsMatch).Contains(false);
}
/// <summary>
/// Returns the set of entries with modifications on the same amino acids.
/// </summary>
private IEnumerable<PeptideEntry> ModificationIndexMatches(PeptideLibraryKey peptideLibraryKey,
[CanBeNull] out IList<KeyValuePair<int, string>> modifications)
{
modifications = null;
ImmutableList<PeptideEntry> entries;
if (!_entries.TryGetValue(peptideLibraryKey.UnmodifiedSequence, out entries))
{
return ImmutableList<PeptideEntry>.EMPTY;
}
modifications = peptideLibraryKey.GetModifications();
var peptideEntry = new PeptideEntry(new IndexItem(peptideLibraryKey, -1), modifications);
var range = CollectionUtil.BinarySearch(entries, item => item.CompareModIndexes(peptideEntry));
return Enumerable.Range(range.Start, range.Length)
.Select(index => entries[index]);
}
protected override IEnumerable<IndexItem> ExactMatches(PeptideLibraryKey libraryKey)
{
return ModificationIndexMatches(libraryKey, out _)
.Where(entry => Equals(libraryKey, entry.PeptideLibraryKey))
.Select(entry => entry.IndexItem);
}
protected override IEnumerable<IndexItem> ItemsMatchingWithoutModifications(PeptideLibraryKey libraryKey)
{
ImmutableList<PeptideEntry> entries;
if (!_entries.TryGetValue(libraryKey.UnmodifiedSequence, out entries))
{
return IndexItem.NONE;
}
return entries.Select(entry=>entry.IndexItem);
}
public struct PeptideEntry
{
public PeptideEntry(IndexItem indexItem, IList<KeyValuePair<int, string>> modifications)
{
IndexItem = indexItem;
ModificationIndexes = ImmutableList.ValueOf(modifications.Select(mod => mod.Key));
}
public PeptideLibraryKey PeptideLibraryKey
{
get { return (PeptideLibraryKey) IndexItem.LibraryKey; }
}
[NotNull]
public ImmutableList<int> ModificationIndexes { get; private set; }
public IEnumerable<string> ModificationNames
{
get
{
return PeptideLibraryKey.GetModifications().Select(mod => mod.Value);
}
}
public IndexItem IndexItem { get; private set; }
public int CompareModIndexes(PeptideEntry that)
{
return CompareModificationIndexes(ModificationIndexes, that.ModificationIndexes);
}
/// <summary>
/// Constructs a new PeptideEntry, and reuses ImmutableList values from the
/// passed in dictionaries to prevent redundant object creation.
/// </summary>
public static PeptideEntry NewInstance(IDictionary<int, ImmutableList<int>> singletonIndexCache,
IDictionary<ImmutableList<int>, ImmutableList<int>> indexCache, IndexItem indexItem)
{
var peptideEntry = new PeptideEntry(indexItem,
((PeptideLibraryKey)indexItem.LibraryKey).GetModifications());
if (peptideEntry.ModificationIndexes.Count == 0)
{
return peptideEntry;
}
ImmutableList<int> newIndexes;
if (peptideEntry.ModificationIndexes.Count == 1)
{
if (singletonIndexCache.TryGetValue(peptideEntry.ModificationIndexes[0], out newIndexes))
{
peptideEntry.ModificationIndexes = newIndexes;
}
else
{
singletonIndexCache.Add(peptideEntry.ModificationIndexes[0], peptideEntry.ModificationIndexes);
}
}
else
{
if (indexCache.TryGetValue(peptideEntry.ModificationIndexes, out newIndexes))
{
peptideEntry.ModificationIndexes = newIndexes;
}
else
{
indexCache.Add(peptideEntry.ModificationIndexes, peptideEntry.ModificationIndexes);
}
}
return peptideEntry;
}
}
private static int CompareModificationIndexes(IList<int> list1, IList<int> list2)
{
int count1 = list1.Count;
int count2 = list2.Count;
int result = count1.CompareTo(count2);
if (result != 0)
{
return result;
}
for (int i = 0; i < count1; i++)
{
result = list1[i].CompareTo(list2[i]);
if (result != 0)
{
return result;
}
}
return result;
}
}
private class MoleculeSubIndex : SubIndex<MoleculeLibraryKey>
{
private readonly ILookup<string, IndexItem> _entries;
public MoleculeSubIndex(IEnumerable<IndexItem> indexItems)
{
_entries = indexItems.Where(indexItem => indexItem.LibraryKey is MoleculeLibraryKey)
.ToLookup(item => ((MoleculeLibraryKey) item.LibraryKey).PreferredKey);
Count = _entries.Sum(entry => entry.Count());
}
public override IEnumerator<IndexItem> GetEnumerator()
{
return _entries.SelectMany(entry => entry).GetEnumerator();
}
protected override IEnumerable<IndexItem> ItemsMatching(MoleculeLibraryKey libraryKey)
{
return _entries[libraryKey.PreferredKey];
}
}
private class PrecursorSubIndex : SubIndex<PrecursorLibraryKey>
{
private readonly ILookup<double, IndexItem> _entries;
public PrecursorSubIndex(IEnumerable<IndexItem> indexItems)
{
_entries = indexItems.Where(item => item.LibraryKey is PrecursorLibraryKey)
.ToLookup(item => ((PrecursorLibraryKey) item.LibraryKey).Mz);
Count = _entries.Sum(group => group.Count());
}
public override IEnumerator<IndexItem> GetEnumerator()
{
return _entries.SelectMany(group => group).GetEnumerator();
}
protected override IEnumerable<IndexItem> ItemsMatching(PrecursorLibraryKey libraryKey)
{
return _entries[libraryKey.Mz];
}
}
}
}
| 1 | 12,582 | Is this necessary? Are there duplicates in your LibKeyIndex? | ProteoWizard-pwiz | .cs |
@@ -35,6 +35,7 @@ func (m *MockActionIterator) EXPECT() *MockActionIteratorMockRecorder {
// Next mocks base method
func (m *MockActionIterator) Next() (action.SealedEnvelope, bool) {
+ m.ctrl.T.Helper()
ret := m.ctrl.Call(m, "Next")
ret0, _ := ret[0].(action.SealedEnvelope)
ret1, _ := ret[1].(bool) | 1 | // Code generated by MockGen. DO NOT EDIT.
// Source: ./actpool/actioniterator/actioniterator.go
// Package mock_actioniterator is a generated GoMock package.
package mock_actioniterator
import (
gomock "github.com/golang/mock/gomock"
action "github.com/iotexproject/iotex-core/action"
reflect "reflect"
)
// MockActionIterator is a mock of ActionIterator interface
type MockActionIterator struct {
ctrl *gomock.Controller
recorder *MockActionIteratorMockRecorder
}
// MockActionIteratorMockRecorder is the mock recorder for MockActionIterator
type MockActionIteratorMockRecorder struct {
mock *MockActionIterator
}
// NewMockActionIterator creates a new mock instance
func NewMockActionIterator(ctrl *gomock.Controller) *MockActionIterator {
mock := &MockActionIterator{ctrl: ctrl}
mock.recorder = &MockActionIteratorMockRecorder{mock}
return mock
}
// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockActionIterator) EXPECT() *MockActionIteratorMockRecorder {
return m.recorder
}
// Next mocks base method
func (m *MockActionIterator) Next() (action.SealedEnvelope, bool) {
ret := m.ctrl.Call(m, "Next")
ret0, _ := ret[0].(action.SealedEnvelope)
ret1, _ := ret[1].(bool)
return ret0, ret1
}
// Next indicates an expected call of Next
func (mr *MockActionIteratorMockRecorder) Next() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Next", reflect.TypeOf((*MockActionIterator)(nil).Next))
}
// PopAccount mocks base method
func (m *MockActionIterator) PopAccount() {
m.ctrl.Call(m, "PopAccount")
}
// PopAccount indicates an expected call of PopAccount
func (mr *MockActionIteratorMockRecorder) PopAccount() *gomock.Call {
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PopAccount", reflect.TypeOf((*MockActionIterator)(nil).PopAccount))
}
| 1 | 15,373 | Why will the gomock files be regenerated? It seems to be irrelevant | iotexproject-iotex-core | go |
@@ -97,6 +97,7 @@ func newPlanner(
pipedConfig: pipedConfig,
plannerRegistry: registry.DefaultRegistry(),
appManifestsCache: appManifestsCache,
+ cancelledCh: make(chan *model.ReportableCommand, 1),
nowFunc: time.Now,
logger: logger,
} | 1 | // Copyright 2020 The PipeCD Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package controller
import (
"context"
"fmt"
"path/filepath"
"time"
"go.uber.org/atomic"
"go.uber.org/zap"
"github.com/pipe-cd/pipe/pkg/app/api/service/pipedservice"
pln "github.com/pipe-cd/pipe/pkg/app/piped/planner"
"github.com/pipe-cd/pipe/pkg/app/piped/planner/registry"
"github.com/pipe-cd/pipe/pkg/cache"
"github.com/pipe-cd/pipe/pkg/config"
"github.com/pipe-cd/pipe/pkg/model"
"github.com/pipe-cd/pipe/pkg/regexpool"
)
// What planner does:
// - Wait until there is no PLANNED or RUNNING deployment
// - Pick the oldest PENDING deployment to plan its pipeline
// - Compare with the last successful commit
// - Decide the pipeline should be executed (scale, progressive, rollback)
// - Update the pipeline stages and change the deployment status to PLANNED
type planner struct {
// Readonly deployment model.
deployment *model.Deployment
envName string
lastSuccessfulCommitHash string
workingDir string
apiClient apiClient
gitClient gitClient
notifier notifier
sealedSecretDecrypter sealedSecretDecrypter
plannerRegistry registry.Registry
pipedConfig *config.PipedSpec
appManifestsCache cache.Cache
logger *zap.Logger
deploymentConfig *config.Config
done atomic.Bool
doneTimestamp time.Time
cancelled bool
cancelledCh chan *model.ReportableCommand
nowFunc func() time.Time
}
func newPlanner(
d *model.Deployment,
envName string,
lastSuccessfulCommitHash string,
workingDir string,
apiClient apiClient,
gitClient gitClient,
notifier notifier,
ssd sealedSecretDecrypter,
pipedConfig *config.PipedSpec,
appManifestsCache cache.Cache,
logger *zap.Logger,
) *planner {
logger = logger.Named("planner").With(
zap.String("deployment-id", d.Id),
zap.String("app-id", d.ApplicationId),
zap.String("env-id", d.EnvId),
zap.String("project-id", d.ProjectId),
zap.String("app-kind", d.Kind.String()),
zap.String("working-dir", workingDir),
)
p := &planner{
deployment: d,
envName: envName,
lastSuccessfulCommitHash: lastSuccessfulCommitHash,
workingDir: workingDir,
apiClient: apiClient,
gitClient: gitClient,
notifier: notifier,
sealedSecretDecrypter: ssd,
pipedConfig: pipedConfig,
plannerRegistry: registry.DefaultRegistry(),
appManifestsCache: appManifestsCache,
nowFunc: time.Now,
logger: logger,
}
return p
}
// ID returns the id of planner.
// This is the same value with deployment ID.
func (p *planner) ID() string {
return p.deployment.Id
}
// IsDone tells whether this planner is done it tasks or not.
// Returning true means this planner can be removable.
func (p *planner) IsDone() bool {
return p.done.Load()
}
// DoneTimestamp returns the time when planner has done.
func (p *planner) DoneTimestamp() time.Time {
return p.doneTimestamp
}
func (p *planner) Cancel(cmd model.ReportableCommand) {
if p.cancelled {
return
}
p.cancelled = true
p.cancelledCh <- &cmd
close(p.cancelledCh)
}
func (p *planner) Run(ctx context.Context) error {
p.logger.Info("start running planner")
defer func() {
p.doneTimestamp = p.nowFunc()
p.done.Store(true)
}()
var (
repoDirPath = filepath.Join(p.workingDir, workspaceGitRepoDirName)
appDirPath = filepath.Join(repoDirPath, p.deployment.GitPath.Path)
)
planner, ok := p.plannerRegistry.Planner(p.deployment.Kind)
if !ok {
p.reportDeploymentFailed(ctx, "Unable to find the planner for this application kind")
return fmt.Errorf("unable to find the planner for application %v", p.deployment.Kind)
}
// Clone repository and checkout to the target revision.
gitRepo, err := prepareDeployRepository(ctx, p.deployment, p.gitClient, repoDirPath, p.pipedConfig)
if err != nil {
p.reportDeploymentFailed(ctx, fmt.Sprintf("Unable to prepare git repository (%v)", err))
return err
}
// Load deployment configuration for this application.
cfg, err := loadDeploymentConfiguration(gitRepo.GetPath(), p.deployment)
if err != nil {
p.reportDeploymentFailed(ctx, fmt.Sprintf("Unable to load deployment configuration (%v)", err))
return err
}
p.deploymentConfig = cfg
gds, ok := cfg.GetGenericDeployment()
if !ok {
p.reportDeploymentFailed(ctx, "This application kind is not supported yet")
return fmt.Errorf("unsupport application kind %s", cfg.Kind)
}
// Decrypt the sealed secrets at the target revision.
if len(gds.SealedSecrets) > 0 && p.sealedSecretDecrypter != nil {
if err := decryptSealedSecrets(appDirPath, gds.SealedSecrets, p.sealedSecretDecrypter); err != nil {
p.reportDeploymentFailed(ctx, fmt.Sprintf("Unable to decrypt the sealed secrets (%v)", err))
return fmt.Errorf("failed to decrypt sealed secrets (%w)", err)
}
}
in := pln.Input{
Deployment: p.deployment,
MostRecentSuccessfulCommitHash: p.lastSuccessfulCommitHash,
DeploymentConfig: cfg,
Repo: gitRepo,
RepoDir: gitRepo.GetPath(),
AppDir: filepath.Join(gitRepo.GetPath(), p.deployment.GitPath.Path),
AppManifestsCache: p.appManifestsCache,
RegexPool: regexpool.DefaultPool(),
Logger: p.logger,
}
out, err := planner.Plan(ctx, in)
// If the deployment was already cancelled, we ignore the plan result.
select {
case cmd := <-p.cancelledCh:
if cmd != nil {
desc := fmt.Sprintf("Deployment was cancelled by %s while planning", cmd.Commander)
p.reportDeploymentCancelled(ctx, cmd.Commander, desc)
return cmd.Report(ctx, model.CommandStatus_COMMAND_SUCCEEDED, nil)
}
default:
}
if err != nil {
return p.reportDeploymentFailed(ctx, fmt.Sprintf("Unable to plan the deployment (%v)", err))
}
return p.reportDeploymentPlanned(ctx, p.lastSuccessfulCommitHash, out)
}
func (p *planner) reportDeploymentPlanned(ctx context.Context, runningCommitHash string, out pln.Output) error {
var (
err error
retry = pipedservice.NewRetry(10)
req = &pipedservice.ReportDeploymentPlannedRequest{
DeploymentId: p.deployment.Id,
Summary: out.Summary,
StatusReason: "The deployment has been planned",
RunningCommitHash: runningCommitHash,
Version: out.Version,
Stages: out.Stages,
}
)
defer func() {
p.notifier.Notify(model.Event{
Type: model.EventType_EVENT_DEPLOYMENT_PLANNED,
Metadata: &model.EventDeploymentPlanned{
Deployment: p.deployment,
EnvName: p.envName,
Summary: out.Summary,
},
})
}()
for retry.WaitNext(ctx) {
if _, err = p.apiClient.ReportDeploymentPlanned(ctx, req); err == nil {
return nil
}
err = fmt.Errorf("failed to report deployment status to control-plane: %v", err)
}
if err != nil {
p.logger.Error("failed to mark deployment to be planned", zap.Error(err))
}
return err
}
func (p *planner) reportDeploymentFailed(ctx context.Context, reason string) error {
var (
err error
now = p.nowFunc()
req = &pipedservice.ReportDeploymentCompletedRequest{
DeploymentId: p.deployment.Id,
Status: model.DeploymentStatus_DEPLOYMENT_FAILURE,
StatusReason: reason,
StageStatuses: nil,
CompletedAt: now.Unix(),
}
retry = pipedservice.NewRetry(10)
)
defer func() {
p.notifier.Notify(model.Event{
Type: model.EventType_EVENT_DEPLOYMENT_FAILED,
Metadata: &model.EventDeploymentFailed{
Deployment: p.deployment,
EnvName: p.envName,
Reason: reason,
},
})
}()
for retry.WaitNext(ctx) {
if _, err = p.apiClient.ReportDeploymentCompleted(ctx, req); err == nil {
return nil
}
err = fmt.Errorf("failed to report deployment status to control-plane: %v", err)
}
if err != nil {
p.logger.Error("failed to mark deployment to be failed", zap.Error(err))
}
return err
}
func (p *planner) reportDeploymentCancelled(ctx context.Context, commander, reason string) error {
var (
err error
now = p.nowFunc()
req = &pipedservice.ReportDeploymentCompletedRequest{
DeploymentId: p.deployment.Id,
Status: model.DeploymentStatus_DEPLOYMENT_CANCELLED,
StatusReason: reason,
StageStatuses: nil,
CompletedAt: now.Unix(),
}
retry = pipedservice.NewRetry(10)
)
defer func() {
p.notifier.Notify(model.Event{
Type: model.EventType_EVENT_DEPLOYMENT_CANCELLED,
Metadata: &model.EventDeploymentCancelled{
Deployment: p.deployment,
EnvName: p.envName,
Commander: commander,
},
})
}()
for retry.WaitNext(ctx) {
if _, err = p.apiClient.ReportDeploymentCompleted(ctx, req); err == nil {
return nil
}
err = fmt.Errorf("failed to report deployment status to control-plane: %v", err)
}
if err != nil {
p.logger.Error("failed to mark deployment to be cancelled", zap.Error(err))
}
return err
}
| 1 | 11,032 | I'm very curious about why using buffered-channel. Is there something wrong to use an unbuffered channel with zero capacity? | pipe-cd-pipe | go |
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-from helpers import LuigiTestCase
+from helpers import LuigiTestCase, RunOnceTask
import luigi
import luigi.task | 1 | # -*- coding: utf-8 -*-
#
# Copyright 2016 VNG Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from helpers import LuigiTestCase
import luigi
import luigi.task
from luigi.util import requires
class BasicsTest(LuigiTestCase):
def test_requries(self):
class BaseTask(luigi.Task):
my_param = luigi.Parameter()
luigi.namespace('blah')
@requires(BaseTask)
class ChildTask(luigi.Task):
pass
luigi.namespace('')
child_task = ChildTask(my_param='hello')
self.assertEqual(str(child_task), 'blah.ChildTask(my_param=hello)')
self.assertIn(BaseTask(my_param='hello'), luigi.task.flatten(child_task.requires()))
def test_requries_weird_way(self):
# Here we use this decorator in a unnormal way.
# But it should still work.
class BaseTask(luigi.Task):
my_param = luigi.Parameter()
decorator = requires(BaseTask)
luigi.namespace('blah')
class ChildTask(luigi.Task):
pass
luigi.namespace('')
ChildTask = decorator(ChildTask)
child_task = ChildTask(my_param='hello')
self.assertEqual(str(child_task), 'blah.ChildTask(my_param=hello)')
self.assertIn(BaseTask(my_param='hello'), luigi.task.flatten(child_task.requires()))
| 1 | 16,453 | It seems like you accidentally pulled some unrelated changes to util_test into this. | spotify-luigi | py |
@@ -15,6 +15,7 @@
// along with the Nethermind. If not, see <http://www.gnu.org/licenses/>.
using Nethermind.Blockchain;
+using Nethermind.Blockchain.Bloom;
using Nethermind.Blockchain.Filters;
using Nethermind.Blockchain.Receipts;
using Nethermind.Blockchain.TxPools; | 1 | // Copyright (c) 2018 Demerzel Solutions Limited
// This file is part of the Nethermind library.
//
// The Nethermind library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The Nethermind library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the Nethermind. If not, see <http://www.gnu.org/licenses/>.
using Nethermind.Blockchain;
using Nethermind.Blockchain.Filters;
using Nethermind.Blockchain.Receipts;
using Nethermind.Blockchain.TxPools;
using Nethermind.Config;
using Nethermind.Core;
using Nethermind.Core.Crypto;
using Nethermind.Core.Specs;
using Nethermind.Crypto;
using Nethermind.Specs;
using Nethermind.DataMarketplace.Channels;
using Nethermind.DataMarketplace.Core;
using Nethermind.DataMarketplace.Core.Configs;
using Nethermind.DataMarketplace.Core.Services;
using Nethermind.DataMarketplace.Infrastructure.Persistence.Mongo;
using Nethermind.Facade.Proxy;
using Nethermind.Grpc;
using Nethermind.JsonRpc.Modules;
using Nethermind.KeyStore;
using Nethermind.Logging;
using Nethermind.Monitoring;
using Nethermind.Network;
using Nethermind.Serialization.Json;
using Nethermind.Store;
using Nethermind.Wallet;
namespace Nethermind.DataMarketplace.Infrastructure
{
public class NdmRequiredServices
{
public IConfigProvider ConfigProvider { get; }
public IConfigManager ConfigManager { get; }
public INdmConfig NdmConfig { get; }
public string BaseDbPath { get; }
public IDbProvider RocksProvider { get; }
public IMongoProvider MongoProvider { get; }
public ILogManager LogManager { get; }
public IBlockTree BlockTree { get; }
public ITxPool TransactionPool { get; }
public ISpecProvider SpecProvider { get; }
public IReceiptStorage ReceiptStorage { get; }
public IFilterStore FilterStore { get; }
public IFilterManager FilterManager { get; }
public IWallet Wallet { get; }
public ITimestamper Timestamper { get; }
public IEthereumEcdsa Ecdsa { get; }
public IKeyStore KeyStore { get; }
public IRpcModuleProvider RpcModuleProvider { get; }
public IJsonSerializer JsonSerializer { get; }
public ICryptoRandom CryptoRandom { get; }
public IEnode Enode { get; }
public INdmConsumerChannelManager NdmConsumerChannelManager { get; }
public INdmDataPublisher NdmDataPublisher { get; }
public IGrpcServer GrpcServer { get; }
public IEthRequestService EthRequestService { get; }
public INdmNotifier Notifier { get; }
public bool EnableUnsecuredDevWallet { get; }
public IBlockProcessor BlockProcessor { get; }
public IJsonRpcClientProxy JsonRpcClientProxy { get; }
public IEthJsonRpcClientProxy EthJsonRpcClientProxy { get; }
public IHttpClient HttpClient { get; }
public IMonitoringService MonitoringService { get; }
public NdmRequiredServices(IConfigProvider configProvider, IConfigManager configManager, INdmConfig ndmConfig,
string baseDbPath, IDbProvider rocksProvider, IMongoProvider mongoProvider, ILogManager logManager,
IBlockTree blockTree, ITxPool transactionPool, ISpecProvider specProvider, IReceiptStorage receiptStorage,
IFilterStore filterStore, IFilterManager filterManager, IWallet wallet, ITimestamper timestamper,
IEthereumEcdsa ecdsa, IKeyStore keyStore, IRpcModuleProvider rpcModuleProvider,
IJsonSerializer jsonSerializer, ICryptoRandom cryptoRandom, IEnode enode,
INdmConsumerChannelManager ndmConsumerChannelManager, INdmDataPublisher ndmDataPublisher,
IGrpcServer grpcServer, IEthRequestService ethRequestService, INdmNotifier notifier,
bool enableUnsecuredDevWallet, IBlockProcessor blockProcessor, IJsonRpcClientProxy jsonRpcClientProxy,
IEthJsonRpcClientProxy ethJsonRpcClientProxy, IHttpClient httpClient, IMonitoringService monitoringService)
{
ConfigProvider = configProvider;
ConfigManager = configManager;
NdmConfig = ndmConfig;
BaseDbPath = baseDbPath;
RocksProvider = rocksProvider;
MongoProvider = mongoProvider;
LogManager = logManager;
BlockTree = blockTree;
TransactionPool = transactionPool;
SpecProvider = specProvider;
ReceiptStorage = receiptStorage;
FilterStore = filterStore;
FilterManager = filterManager;
Wallet = wallet;
Timestamper = timestamper;
Ecdsa = ecdsa;
KeyStore = keyStore;
RpcModuleProvider = rpcModuleProvider;
JsonSerializer = jsonSerializer;
CryptoRandom = cryptoRandom;
Enode = enode;
NdmConsumerChannelManager = ndmConsumerChannelManager;
NdmDataPublisher = ndmDataPublisher;
GrpcServer = grpcServer;
EthRequestService = ethRequestService;
Notifier = notifier;
EnableUnsecuredDevWallet = enableUnsecuredDevWallet;
BlockProcessor = blockProcessor;
JsonRpcClientProxy = jsonRpcClientProxy;
EthJsonRpcClientProxy = ethJsonRpcClientProxy;
HttpClient = httpClient;
MonitoringService = monitoringService;
}
}
} | 1 | 23,301 | do not toucm NDM please - there will be lots of conflicts | NethermindEth-nethermind | .cs |
@@ -357,7 +357,7 @@ class XLSXWriter extends TextResponseWriter {
if (v instanceof IndexableField) {
IndexableField f = (IndexableField)v;
if (v instanceof Date) {
- output.append(((Date) val).toInstant().toString() + "; ");
+ output.append(((Date) v).toInstant().toString() + "; ");
} else {
output.append(f.stringValue() + "; ");
} | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.solr.handler.extraction;
import java.io.CharArrayWriter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
import org.apache.lucene.index.IndexableField;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.BasicResultContext;
import org.apache.solr.response.RawResponseWriter;
import org.apache.solr.response.ResultContext;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.response.TextResponseWriter;
import org.apache.solr.schema.FieldType;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.schema.StrField;
import org.apache.solr.search.DocList;
import org.apache.solr.search.ReturnFields;
public class XLSXResponseWriter extends RawResponseWriter {
@Override
public void write(OutputStream out, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
// throw away arraywriter just to satisfy super requirements; we're grabbing
// all writes before they go to it anyway
XLSXWriter w = new XLSXWriter(new CharArrayWriter(), req, rsp);
LinkedHashMap<String,String> reqNamesMap = new LinkedHashMap<>();
LinkedHashMap<String,Integer> reqWidthsMap = new LinkedHashMap<>();
Iterator<String> paramNamesIter = req.getParams().getParameterNamesIterator();
while (paramNamesIter.hasNext()) {
String nextParam = paramNamesIter.next();
if (nextParam.startsWith("colname.")) {
String field = nextParam.substring("colname.".length());
reqNamesMap.put(field, req.getParams().get(nextParam));
} else if (nextParam.startsWith("colwidth.")) {
String field = nextParam.substring("colwidth.".length());
reqWidthsMap.put(field, req.getParams().getInt(nextParam));
}
}
try {
w.writeResponse(out, reqNamesMap, reqWidthsMap);
} finally {
w.close();
}
}
@Override
public String getContentType(SolrQueryRequest request, SolrQueryResponse response) {
return "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
}
}
class XLSXWriter extends TextResponseWriter {
SolrQueryRequest req;
SolrQueryResponse rsp;
class SerialWriteWorkbook {
SXSSFWorkbook swb;
Sheet sh;
XSSFCellStyle headerStyle;
int rowIndex;
Row curRow;
int cellIndex;
SerialWriteWorkbook() {
this.swb = new SXSSFWorkbook(100);
this.sh = this.swb.createSheet();
this.rowIndex = 0;
this.headerStyle = (XSSFCellStyle)swb.createCellStyle();
this.headerStyle.setFillBackgroundColor(IndexedColors.BLACK.getIndex());
//solid fill
this.headerStyle.setFillPattern((short)1);
Font headerFont = swb.createFont();
headerFont.setFontHeightInPoints((short)14);
headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);
headerFont.setColor(IndexedColors.WHITE.getIndex());
this.headerStyle.setFont(headerFont);
}
void addRow() {
curRow = sh.createRow(rowIndex++);
cellIndex = 0;
}
void setHeaderRow() {
curRow.setHeightInPoints((short)21);
}
//sets last created cell to have header style
void setHeaderCell() {
curRow.getCell(cellIndex - 1).setCellStyle(this.headerStyle);
}
//set the width of the most recently created column
void setColWidth(int charWidth) {
//width in poi is units of 1/256th of a character width for some reason
this.sh.setColumnWidth(cellIndex - 1, 256*charWidth);
}
void writeCell(String value) {
Cell cell = curRow.createCell(cellIndex++);
cell.setCellValue(value);
}
void flush(OutputStream out) {
try {
swb.write(out);
} catch (IOException e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
String stacktrace = sw.toString();
}finally {
swb.dispose();
}
}
}
private SerialWriteWorkbook wb = new SerialWriteWorkbook();
static class XLField {
String name;
SchemaField sf;
}
private Map<String,XLField> xlFields = new LinkedHashMap<String,XLField>();
public XLSXWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp){
super(writer, req, rsp);
this.req = req;
this.rsp = rsp;
}
public void writeResponse(OutputStream out, LinkedHashMap<String, String> colNamesMap,
LinkedHashMap<String, Integer> colWidthsMap) throws IOException {
SolrParams params = req.getParams();
Collection<String> fields = returnFields.getRequestedFieldNames();
Object responseObj = rsp.getValues().get("response");
boolean returnOnlyStored = false;
if (fields==null||returnFields.hasPatternMatching()) {
if (responseObj instanceof SolrDocumentList) {
// get the list of fields from the SolrDocumentList
if(fields==null) {
fields = new LinkedHashSet<String>();
}
for (SolrDocument sdoc: (SolrDocumentList)responseObj) {
fields.addAll(sdoc.getFieldNames());
}
} else {
// get the list of fields from the index
Iterable<String> all = req.getSearcher().getFieldNames();
if (fields == null) {
fields = Sets.newHashSet(all);
} else {
Iterables.addAll(fields, all);
}
}
if (returnFields.wantsScore()) {
fields.add("score");
} else {
fields.remove("score");
}
returnOnlyStored = true;
}
for (String field : fields) {
if (!returnFields.wantsField(field)) {
continue;
}
if (field.equals("score")) {
XLField xlField = new XLField();
xlField.name = "score";
xlFields.put("score", xlField);
continue;
}
SchemaField sf = schema.getFieldOrNull(field);
if (sf == null) {
FieldType ft = new StrField();
sf = new SchemaField(field, ft);
}
// Return only stored fields, unless an explicit field list is specified
if (returnOnlyStored && sf != null && !sf.stored()) {
continue;
}
XLField xlField = new XLField();
xlField.name = field;
xlField.sf = sf;
xlFields.put(field, xlField);
}
wb.addRow();
//write header
for (XLField xlField : xlFields.values()) {
String printName = xlField.name;
int colWidth = 14;
String niceName = colNamesMap.get(xlField.name);
if (niceName != null) {
printName = niceName;
}
Integer niceWidth = colWidthsMap.get(xlField.name);
if (niceWidth != null) {
colWidth = niceWidth.intValue();
}
writeStr(xlField.name, printName, false);
wb.setColWidth(colWidth);
wb.setHeaderCell();
}
wb.setHeaderRow();
wb.addRow();
if (responseObj instanceof ResultContext) {
writeDocuments(null, (ResultContext)responseObj );
}
else if (responseObj instanceof DocList) {
ResultContext ctx = new BasicResultContext((DocList)responseObj, returnFields, null, null, req);
writeDocuments(null, ctx );
} else if (responseObj instanceof SolrDocumentList) {
writeSolrDocumentList(null, (SolrDocumentList)responseObj, returnFields );
}
wb.flush(out);
wb = null;
}
@Override
public void close() throws IOException {
super.close();
}
@Override
public void writeNamedList(String name, NamedList val) throws IOException {
}
@Override
public void writeStartDocumentList(String name,
long start, int size, long numFound, Float maxScore) throws IOException
{
// nothing
}
@Override
public void writeEndDocumentList() throws IOException
{
// nothing
}
//NOTE: a document cannot currently contain another document
List tmpList;
@Override
public void writeSolrDocument(String name, SolrDocument doc, ReturnFields returnFields, int idx ) throws IOException {
if (tmpList == null) {
tmpList = new ArrayList(1);
tmpList.add(null);
}
for (XLField xlField : xlFields.values()) {
Object val = doc.getFieldValue(xlField.name);
int nVals = val instanceof Collection ? ((Collection)val).size() : (val==null ? 0 : 1);
if (nVals == 0) {
writeNull(xlField.name);
continue;
}
if ((xlField.sf != null && xlField.sf.multiValued()) || nVals > 1) {
Collection values;
// normalize to a collection
if (val instanceof Collection) {
values = (Collection)val;
} else {
tmpList.set(0, val);
values = tmpList;
}
writeArray(xlField.name, values.iterator());
} else {
// normalize to first value
if (val instanceof Collection) {
Collection values = (Collection)val;
val = values.iterator().next();
}
writeVal(xlField.name, val);
}
}
wb.addRow();
}
@Override
public void writeStr(String name, String val, boolean needsEscaping) throws IOException {
wb.writeCell(val);
}
@Override
public void writeMap(String name, Map val, boolean excludeOuter, boolean isFirstVal) throws IOException {
}
@Override
public void writeArray(String name, Iterator val) throws IOException {
StringBuffer output = new StringBuffer();
while (val.hasNext()) {
Object v = val.next();
if (v instanceof IndexableField) {
IndexableField f = (IndexableField)v;
if (v instanceof Date) {
output.append(((Date) val).toInstant().toString() + "; ");
} else {
output.append(f.stringValue() + "; ");
}
} else {
output.append(v.toString() + "; ");
}
}
if (output.length() > 0) {
output.deleteCharAt(output.length()-1);
output.deleteCharAt(output.length()-1);
}
writeStr(name, output.toString(), false);
}
@Override
public void writeNull(String name) throws IOException {
wb.writeCell("");
}
@Override
public void writeInt(String name, String val) throws IOException {
wb.writeCell(val);
}
@Override
public void writeLong(String name, String val) throws IOException {
wb.writeCell(val);
}
@Override
public void writeBool(String name, String val) throws IOException {
wb.writeCell(val);
}
@Override
public void writeFloat(String name, String val) throws IOException {
wb.writeCell(val);
}
@Override
public void writeDouble(String name, String val) throws IOException {
wb.writeCell(val);
}
@Override
public void writeDate(String name, Date val) throws IOException {
writeDate(name, val.toInstant().toString());
}
@Override
public void writeDate(String name, String val) throws IOException {
wb.writeCell(val);
}
} | 1 | 26,290 | This looks legitimate - Would cause a classCastException. But have we ever seen it in the wild? | apache-lucene-solr | java |
@@ -48,6 +48,8 @@ class Testinfra(base.Base):
name: testinfra
options:
n: 1
+ v: True
+ setup-show: True
The testing can be disabled by setting `enabled` to False.
| 1 | # Copyright (c) 2015-2017 Cisco Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
import glob
import os
import sh
from molecule import logger
from molecule import util
from molecule.verifier import base
LOG = logger.get_logger(__name__)
class Testinfra(base.Base):
"""
`Testinfra`_ is the default test runner.
Additional options can be passed to `testinfra` through the options
dict. Any option set in this section will override the defaults.
.. note::
Molecule will remove any options matching '^[v]+$', and pass `-vvv`
to the underlying `py.test` command when executing `molecule --debug`.
.. code-block:: yaml
verifier:
name: testinfra
options:
n: 1
The testing can be disabled by setting `enabled` to False.
.. code-block:: yaml
verifier:
name: testinfra
enabled: False
Environment variables can be passed to the verifier.
.. code-block:: yaml
verifier:
name: testinfra
env:
FOO: bar
Change path to the test directory.
.. code-block:: yaml
verifier:
name: testinfra
directory: /foo/bar/
Additional tests from another file or directory relative to the scenario's
tests directory (supports regexp).
.. code-block:: yaml
verifier:
name: testinfra
additional_files_or_dirs:
- ../path/to/test_1.py
- ../path/to/test_2.py
- ../path/to/directory/*
.. _`Testinfra`: http://testinfra.readthedocs.io
"""
def __init__(self, config):
"""
Sets up the requirements to execute `testinfra` and returns None.
:param config: An instance of a Molecule config.
:return: None
"""
super(Testinfra, self).__init__(config)
self._testinfra_command = None
if config:
self._tests = self._get_tests()
@property
def name(self):
return 'testinfra'
@property
def default_options(self):
d = self._config.driver.testinfra_options
d['p'] = 'no:cacheprovider'
if self._config.debug:
d['debug'] = True
d['vvv'] = True
if self._config.args.get('sudo'):
d['sudo'] = True
return d
# NOTE(retr0h): Override the base classes' options() to handle
# `ansible-galaxy` one-off.
@property
def options(self):
o = self._config.config['verifier']['options']
# NOTE(retr0h): Remove verbose options added by the user while in
# debug.
if self._config.debug:
o = util.filter_verbose_permutation(o)
return util.merge_dicts(self.default_options, o)
@property
def default_env(self):
env = util.merge_dicts(os.environ.copy(), self._config.env)
env = util.merge_dicts(env, self._config.provisioner.env)
return env
@property
def additional_files_or_dirs(self):
files_list = []
c = self._config.config
for f in c['verifier']['additional_files_or_dirs']:
glob_path = os.path.join(self._config.verifier.directory, f)
glob_list = glob.glob(glob_path)
if glob_list:
files_list.extend(glob_list)
return files_list
def bake(self):
"""
Bake a `testinfra` command so it's ready to execute and returns None.
:return: None
"""
options = self.options
verbose_flag = util.verbose_flag(options)
args = verbose_flag + self.additional_files_or_dirs
self._testinfra_command = sh.Command('py.test').bake(
options,
self._tests,
*args,
_cwd=self._config.scenario.directory,
_env=self.env,
_out=LOG.out,
_err=LOG.error)
def execute(self):
if not self.enabled:
msg = 'Skipping, verifier is disabled.'
LOG.warn(msg)
return
if not len(self._tests) > 0:
msg = 'Skipping, no tests found.'
LOG.warn(msg)
return
if self._testinfra_command is None:
self.bake()
msg = 'Executing Testinfra tests found in {}/...'.format(
self.directory)
LOG.info(msg)
try:
util.run_command(self._testinfra_command, debug=self._config.debug)
msg = 'Verifier completed successfully.'
LOG.success(msg)
except sh.ErrorReturnCode as e:
util.sysexit(e.exit_code)
def _get_tests(self):
"""
Walk the verifier's directory for tests and returns a list.
:return: list
"""
return [
filename for filename in util.os_walk(self.directory, 'test_*.py')
]
| 1 | 7,241 | This looks out of scope for this particular PR. | ansible-community-molecule | py |
@@ -39,6 +39,14 @@ import (
// Warning when user configures leafnode TLS insecure
const leafnodeTLSInsecureWarning = "TLS certificate chain and hostname of solicited leafnodes will not be verified. DO NOT USE IN PRODUCTION!"
+const (
+ leafDefaultFirstPingInterval = int64(time.Second)
+)
+
+var (
+ leafFirstPingInterval = leafDefaultFirstPingInterval
+)
+
type leaf struct {
// Used to suppress sub and unsub interest. Same as routes but our audience
// here is tied to this leaf node. This will hold all subscriptions except this | 1 | // Copyright 2019 The NATS Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package server
import (
"bufio"
"bytes"
"crypto/tls"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"net/url"
"reflect"
"regexp"
"runtime"
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/nats-io/nkeys"
)
// Warning when user configures leafnode TLS insecure
const leafnodeTLSInsecureWarning = "TLS certificate chain and hostname of solicited leafnodes will not be verified. DO NOT USE IN PRODUCTION!"
type leaf struct {
// Used to suppress sub and unsub interest. Same as routes but our audience
// here is tied to this leaf node. This will hold all subscriptions except this
// leaf nodes. This represents all the interest we want to send to the other side.
smap map[string]int32
// We have any auth stuff here for solicited connections.
remote *leafNodeCfg
}
// Used for remote (solicited) leafnodes.
type leafNodeCfg struct {
sync.RWMutex
*RemoteLeafOpts
urls []*url.URL
curURL *url.URL
tlsName string
username string
password string
}
// Check to see if this is a solicited leafnode. We do special processing for solicited.
func (c *client) isSolicitedLeafNode() bool {
return c.kind == LEAF && c.leaf.remote != nil
}
// This will spin up go routines to solicit the remote leaf node connections.
func (s *Server) solicitLeafNodeRemotes(remotes []*RemoteLeafOpts) {
for _, r := range remotes {
remote := newLeafNodeCfg(r)
s.startGoRoutine(func() { s.connectToRemoteLeafNode(remote, true) })
}
}
func (s *Server) remoteLeafNodeStillValid(remote *leafNodeCfg) bool {
for _, ri := range s.getOpts().LeafNode.Remotes {
// FIXME(dlc) - What about auth changes?
if reflect.DeepEqual(ri.URLs, remote.URLs) {
return true
}
}
return false
}
// Ensure that leafnode is properly configured.
func validateLeafNode(o *Options) error {
if o.LeafNode.Port == 0 {
return nil
}
if o.Gateway.Name == "" && o.Gateway.Port == 0 {
return nil
}
// If we are here we have both leaf nodes and gateways defined, make sure there
// is a system account defined.
if o.SystemAccount == "" {
return fmt.Errorf("leaf nodes and gateways (both being defined) require a system account to also be configured")
}
return nil
}
func (s *Server) reConnectToRemoteLeafNode(remote *leafNodeCfg) {
delay := s.getOpts().LeafNode.ReconnectInterval
select {
case <-time.After(delay):
case <-s.quitCh:
s.grWG.Done()
return
}
s.connectToRemoteLeafNode(remote, false)
}
// Creates a leafNodeCfg object that wraps the RemoteLeafOpts.
func newLeafNodeCfg(remote *RemoteLeafOpts) *leafNodeCfg {
cfg := &leafNodeCfg{
RemoteLeafOpts: remote,
urls: make([]*url.URL, 0, len(remote.URLs)),
}
// Start with the one that is configured. We will add to this
// array when receiving async leafnode INFOs.
cfg.urls = append(cfg.urls, cfg.URLs...)
// If we are TLS make sure we save off a proper servername if possible.
// Do same for user/password since we may need them to connect to
// a bare URL that we get from INFO protocol.
for _, u := range cfg.urls {
cfg.saveTLSHostname(u)
cfg.saveUserPassword(u)
}
return cfg
}
// Will pick an URL from the list of available URLs.
func (cfg *leafNodeCfg) pickNextURL() *url.URL {
cfg.Lock()
defer cfg.Unlock()
// If the current URL is the first in the list and we have more than
// one URL, then move that one to end of the list.
if cfg.curURL != nil && len(cfg.urls) > 1 && urlsAreEqual(cfg.curURL, cfg.urls[0]) {
first := cfg.urls[0]
copy(cfg.urls, cfg.urls[1:])
cfg.urls[len(cfg.urls)-1] = first
}
cfg.curURL = cfg.urls[0]
return cfg.curURL
}
// Returns the current URL
func (cfg *leafNodeCfg) getCurrentURL() *url.URL {
cfg.RLock()
defer cfg.RUnlock()
return cfg.curURL
}
// Ensure that non-exported options (used in tests) have
// been properly set.
func (s *Server) setLeafNodeNonExportedOptions() {
opts := s.getOpts()
s.leafNodeOpts.dialTimeout = opts.LeafNode.dialTimeout
if s.leafNodeOpts.dialTimeout == 0 {
// Use same timeouts as routes for now.
s.leafNodeOpts.dialTimeout = DEFAULT_ROUTE_DIAL
}
s.leafNodeOpts.resolver = opts.LeafNode.resolver
if s.leafNodeOpts.resolver == nil {
s.leafNodeOpts.resolver = net.DefaultResolver
}
}
func (s *Server) connectToRemoteLeafNode(remote *leafNodeCfg, firstConnect bool) {
defer s.grWG.Done()
if remote == nil || len(remote.URLs) == 0 {
s.Debugf("Empty remote leafnode definition, nothing to connect")
return
}
opts := s.getOpts()
reconnectDelay := opts.LeafNode.ReconnectInterval
s.mu.Lock()
dialTimeout := s.leafNodeOpts.dialTimeout
resolver := s.leafNodeOpts.resolver
s.mu.Unlock()
var conn net.Conn
const connErrFmt = "Error trying to connect as leafnode to remote server %q (attempt %v): %v"
attempts := 0
for s.isRunning() && s.remoteLeafNodeStillValid(remote) {
rURL := remote.pickNextURL()
url, err := s.getRandomIP(resolver, rURL.Host)
if err == nil {
var ipStr string
if url != rURL.Host {
ipStr = fmt.Sprintf(" (%s)", url)
}
s.Debugf("Trying to connect as leafnode to remote server on %q%s", rURL.Host, ipStr)
conn, err = net.DialTimeout("tcp", url, dialTimeout)
}
if err != nil {
attempts++
if s.shouldReportConnectErr(firstConnect, attempts) {
s.Errorf(connErrFmt, rURL.Host, attempts, err)
} else {
s.Debugf(connErrFmt, rURL.Host, attempts, err)
}
select {
case <-s.quitCh:
return
case <-time.After(reconnectDelay):
continue
}
}
if !s.remoteLeafNodeStillValid(remote) {
conn.Close()
return
}
// We have a connection here to a remote server.
// Go ahead and create our leaf node and return.
s.createLeafNode(conn, remote)
// We will put this in the normal log if first connect, does not force -DV mode to know
// that the connect worked.
if firstConnect {
s.Noticef("Connected leafnode to %q", rURL.Hostname())
}
return
}
}
// Save off the tlsName for when we use TLS and mix hostnames and IPs. IPs usually
// come from the server we connect to.
func (cfg *leafNodeCfg) saveTLSHostname(u *url.URL) {
isTLS := cfg.TLSConfig != nil || u.Scheme == "tls"
if isTLS && cfg.tlsName == "" && net.ParseIP(u.Hostname()) == nil {
cfg.tlsName = u.Hostname()
}
}
// Save off the username/password for when we connect using a bare URL
// that we get from the INFO protocol.
func (cfg *leafNodeCfg) saveUserPassword(u *url.URL) {
if cfg.username == _EMPTY_ && u.User != nil {
cfg.username = u.User.Username()
cfg.password, _ = u.User.Password()
}
}
// This is the leafnode's accept loop. This runs as a go-routine.
// The listen specification is resolved (if use of random port),
// then a listener is started. After that, this routine enters
// a loop (until the server is shutdown) accepting incoming
// leaf node connections from remote servers.
func (s *Server) leafNodeAcceptLoop(ch chan struct{}) {
defer func() {
if ch != nil {
close(ch)
}
}()
// Snapshot server options.
opts := s.getOpts()
port := opts.LeafNode.Port
if port == -1 {
port = 0
}
hp := net.JoinHostPort(opts.LeafNode.Host, strconv.Itoa(port))
l, e := net.Listen("tcp", hp)
if e != nil {
s.Fatalf("Error listening on leafnode port: %d - %v", opts.LeafNode.Port, e)
return
}
s.Noticef("Listening for leafnode connections on %s",
net.JoinHostPort(opts.LeafNode.Host, strconv.Itoa(l.Addr().(*net.TCPAddr).Port)))
s.mu.Lock()
tlsRequired := opts.LeafNode.TLSConfig != nil
tlsVerify := tlsRequired && opts.LeafNode.TLSConfig.ClientAuth == tls.RequireAndVerifyClientCert
info := Info{
ID: s.info.ID,
Version: s.info.Version,
GitCommit: gitCommit,
GoVersion: runtime.Version(),
AuthRequired: true,
TLSRequired: tlsRequired,
TLSVerify: tlsVerify,
MaxPayload: s.info.MaxPayload, // TODO(dlc) - Allow override?
Proto: 1, // Fixed for now.
}
// If we have selected a random port...
if port == 0 {
// Write resolved port back to options.
opts.LeafNode.Port = l.Addr().(*net.TCPAddr).Port
}
s.leafNodeInfo = info
// Possibly override Host/Port and set IP based on Cluster.Advertise
if err := s.setLeafNodeInfoHostPortAndIP(); err != nil {
s.Fatalf("Error setting leafnode INFO with LeafNode.Advertise value of %s, err=%v", s.opts.LeafNode.Advertise, err)
l.Close()
s.mu.Unlock()
return
}
// Add our LeafNode URL to the list that we send to servers connecting
// to our LeafNode accept URL. This call also regenerates leafNodeInfoJSON.
s.addLeafNodeURL(s.leafNodeInfo.IP)
// Setup state that can enable shutdown
s.leafNodeListener = l
// As of now, a server that does not have remotes configured would
// never solicit a connection, so we should not have to warn if
// InsecureSkipVerify is set in main LeafNodes config (since
// this TLS setting matters only when soliciting a connection).
// Still, warn if insecure is set in any of LeafNode block.
// We need to check remotes, even if tls is not required on accept.
warn := tlsRequired && opts.LeafNode.TLSConfig.InsecureSkipVerify
if !warn {
for _, r := range opts.LeafNode.Remotes {
if r.TLSConfig != nil && r.TLSConfig.InsecureSkipVerify {
warn = true
break
}
}
}
if warn {
s.Warnf(leafnodeTLSInsecureWarning)
}
s.mu.Unlock()
// Let them know we are up
close(ch)
ch = nil
tmpDelay := ACCEPT_MIN_SLEEP
for s.isRunning() {
conn, err := l.Accept()
if err != nil {
tmpDelay = s.acceptError("LeafNode", err, tmpDelay)
continue
}
tmpDelay = ACCEPT_MIN_SLEEP
s.startGoRoutine(func() {
s.createLeafNode(conn, nil)
s.grWG.Done()
})
}
s.Debugf("Leafnode accept loop exiting..")
s.done <- true
}
// RegEx to match a creds file with user JWT and Seed.
var credsRe = regexp.MustCompile(`\s*(?:(?:[-]{3,}[^\n]*[-]{3,}\n)(.+)(?:\n\s*[-]{3,}[^\n]*[-]{3,}\n))`)
// Lock should be held entering here.
func (c *client) sendLeafConnect(tlsRequired bool) {
// We support basic user/pass and operator based user JWT with signatures.
cinfo := leafConnectInfo{
TLS: tlsRequired,
Name: c.srv.info.ID,
}
// Check for credentials first, that will take precedence..
if creds := c.leaf.remote.Credentials; creds != "" {
c.Debugf("Authenticating with credentials file %q", c.leaf.remote.Credentials)
contents, err := ioutil.ReadFile(creds)
if err != nil {
c.Errorf("%v", err)
return
}
defer wipeSlice(contents)
items := credsRe.FindAllSubmatch(contents, -1)
if len(items) < 2 {
c.Errorf("Credentials file malformed")
return
}
// First result should be the user JWT.
// We copy here so that the file containing the seed will be wiped appropriately.
raw := items[0][1]
tmp := make([]byte, len(raw))
copy(tmp, raw)
// Seed is second item.
kp, err := nkeys.FromSeed(items[1][1])
if err != nil {
c.Errorf("Credentials file has malformed seed")
return
}
// Wipe our key on exit.
defer kp.Wipe()
sigraw, _ := kp.Sign(c.nonce)
sig := base64.RawURLEncoding.EncodeToString(sigraw)
cinfo.JWT = string(tmp)
cinfo.Sig = sig
} else if userInfo := c.leaf.remote.curURL.User; userInfo != nil {
cinfo.User = userInfo.Username()
cinfo.Pass, _ = userInfo.Password()
} else if c.leaf.remote.username != _EMPTY_ {
cinfo.User = c.leaf.remote.username
cinfo.Pass = c.leaf.remote.password
}
b, err := json.Marshal(cinfo)
if err != nil {
c.Errorf("Error marshaling CONNECT to route: %v\n", err)
c.closeConnection(ProtocolViolation)
return
}
c.sendProto([]byte(fmt.Sprintf(ConProto, b)), true)
}
// Makes a deep copy of the LeafNode Info structure.
// The server lock is held on entry.
func (s *Server) copyLeafNodeInfo() *Info {
clone := s.leafNodeInfo
// Copy the array of urls.
if len(s.leafNodeInfo.LeafNodeURLs) > 0 {
clone.LeafNodeURLs = append([]string(nil), s.leafNodeInfo.LeafNodeURLs...)
}
return &clone
}
// Adds a LeafNode URL that we get when a route connects to the Info structure.
// Regenerates the JSON byte array so that it can be sent to LeafNode connections.
// Returns a boolean indicating if the URL was added or not.
// Server lock is held on entry
func (s *Server) addLeafNodeURL(urlStr string) bool {
// Make sure we already don't have it.
for _, url := range s.leafNodeInfo.LeafNodeURLs {
if url == urlStr {
return false
}
}
s.leafNodeInfo.LeafNodeURLs = append(s.leafNodeInfo.LeafNodeURLs, urlStr)
s.generateLeafNodeInfoJSON()
return true
}
// Removes a LeafNode URL of the route that is disconnecting from the Info structure.
// Regenerates the JSON byte array so that it can be sent to LeafNode connections.
// Returns a boolean indicating if the URL was removed or not.
// Server lock is held on entry.
func (s *Server) removeLeafNodeURL(urlStr string) bool {
// Don't need to do this if we are removing the route connection because
// we are shuting down...
if s.shutdown {
return false
}
removed := false
urls := s.leafNodeInfo.LeafNodeURLs
for i, url := range urls {
if url == urlStr {
// If not last, move last into the position we remove.
last := len(urls) - 1
if i != last {
urls[i] = urls[last]
}
s.leafNodeInfo.LeafNodeURLs = urls[0:last]
removed = true
break
}
}
if removed {
s.generateLeafNodeInfoJSON()
}
return removed
}
func (s *Server) generateLeafNodeInfoJSON() {
b, _ := json.Marshal(s.leafNodeInfo)
pcs := [][]byte{[]byte("INFO"), b, []byte(CR_LF)}
s.leafNodeInfoJSON = bytes.Join(pcs, []byte(" "))
}
// Sends an async INFO protocol so that the connected servers can update
// their list of LeafNode urls.
func (s *Server) sendAsyncLeafNodeInfo() {
for _, c := range s.leafs {
c.mu.Lock()
c.sendInfo(s.leafNodeInfoJSON)
c.mu.Unlock()
}
}
// Called when an inbound leafnode connection is accepted or we create one for a solicited leafnode.
func (s *Server) createLeafNode(conn net.Conn, remote *leafNodeCfg) *client {
// Snapshot server options.
opts := s.getOpts()
maxPay := int32(opts.MaxPayload)
maxSubs := int32(opts.MaxSubs)
// For system, maxSubs of 0 means unlimited, so re-adjust here.
if maxSubs == 0 {
maxSubs = -1
}
now := time.Now()
c := &client{srv: s, nc: conn, kind: LEAF, opts: defaultOpts, mpay: maxPay, msubs: maxSubs, start: now, last: now}
c.leaf = &leaf{smap: map[string]int32{}}
// Determines if we are soliciting the connection or not.
var solicited bool
c.mu.Lock()
c.initClient()
if remote != nil {
solicited = true
// Users can bind to any local account, if its empty
// we will assume the $G account.
if remote.LocalAccount == "" {
remote.LocalAccount = globalAccountName
}
c.leaf.remote = remote
c.mu.Unlock()
// TODO: Decide what should be the optimal behavior here.
// For now, if lookup fails, we will constantly try
// to recreate this LN connection.
acc, err := s.LookupAccount(remote.LocalAccount)
if err != nil {
c.Errorf("No local account %q for leafnode: %v", remote.LocalAccount, err)
c.closeConnection(MissingAccount)
return nil
}
c.mu.Lock()
c.acc = acc
}
c.mu.Unlock()
var nonce [nonceLen]byte
// Grab server variables
s.mu.Lock()
info := s.copyLeafNodeInfo()
if !solicited {
s.generateNonce(nonce[:])
}
s.mu.Unlock()
// Grab lock
c.mu.Lock()
if solicited {
// We need to wait here for the info, but not for too long.
c.nc.SetReadDeadline(time.Now().Add(DEFAULT_LEAFNODE_INFO_WAIT))
br := bufio.NewReaderSize(c.nc, MAX_CONTROL_LINE_SIZE)
info, err := br.ReadString('\n')
if err != nil {
c.mu.Unlock()
if err == io.EOF {
c.closeConnection(ClientClosed)
} else {
c.closeConnection(ReadError)
}
return nil
}
c.nc.SetReadDeadline(time.Time{})
c.mu.Unlock()
// Error will be handled below, so ignore here.
c.parse([]byte(info))
c.mu.Lock()
if !c.flags.isSet(infoReceived) {
c.mu.Unlock()
c.Debugf("Did not get the remote leafnode's INFO, timed-out")
c.closeConnection(ReadError)
return nil
}
// Do TLS here as needed.
tlsRequired := c.leaf.remote.TLS || c.leaf.remote.TLSConfig != nil
if tlsRequired {
c.Debugf("Starting TLS leafnode client handshake")
// Specify the ServerName we are expecting.
var tlsConfig *tls.Config
if c.leaf.remote.TLSConfig != nil {
tlsConfig = c.leaf.remote.TLSConfig.Clone()
} else {
tlsConfig = &tls.Config{MinVersion: tls.VersionTLS12}
}
url := c.leaf.remote.getCurrentURL()
host, _, _ := net.SplitHostPort(url.Host)
// We need to check if this host is an IP. If so, we probably
// had this advertised to us an should use the configured host
// name for the TLS server name.
if net.ParseIP(host) != nil {
if c.leaf.remote.tlsName != "" {
host = c.leaf.remote.tlsName
} else {
host, _, _ = net.SplitHostPort(c.leaf.remote.curURL.Host)
}
}
tlsConfig.ServerName = host
c.nc = tls.Client(c.nc, tlsConfig)
conn := c.nc.(*tls.Conn)
// Setup the timeout
var wait time.Duration
if c.leaf.remote.TLSTimeout == 0 {
wait = TLS_TIMEOUT
} else {
wait = secondsToDuration(c.leaf.remote.TLSTimeout)
}
time.AfterFunc(wait, func() { tlsTimeout(c, conn) })
conn.SetReadDeadline(time.Now().Add(wait))
// Force handshake
c.mu.Unlock()
if err := conn.Handshake(); err != nil {
c.Errorf("TLS handshake error: %v", err)
c.closeConnection(TLSHandshakeError)
return nil
}
// Reset the read deadline
conn.SetReadDeadline(time.Time{})
// Re-Grab lock
c.mu.Lock()
}
c.sendLeafConnect(tlsRequired)
c.Debugf("Remote leafnode connect msg sent")
} else {
// Send our info to the other side.
// Remember the nonce we sent here for signatures, etc.
c.nonce = make([]byte, nonceLen)
copy(c.nonce, nonce[:])
info.Nonce = string(c.nonce)
info.CID = c.cid
b, _ := json.Marshal(info)
pcs := [][]byte{[]byte("INFO"), b, []byte(CR_LF)}
c.sendInfo(bytes.Join(pcs, []byte(" ")))
// Check to see if we need to spin up TLS.
if info.TLSRequired {
c.Debugf("Starting TLS leafnode server handshake")
c.nc = tls.Server(c.nc, opts.LeafNode.TLSConfig)
conn := c.nc.(*tls.Conn)
// Setup the timeout
ttl := secondsToDuration(opts.LeafNode.TLSTimeout)
time.AfterFunc(ttl, func() { tlsTimeout(c, conn) })
conn.SetReadDeadline(time.Now().Add(ttl))
// Force handshake
c.mu.Unlock()
if err := conn.Handshake(); err != nil {
c.Errorf("TLS handshake error: %v", err)
c.closeConnection(TLSHandshakeError)
return nil
}
// Reset the read deadline
conn.SetReadDeadline(time.Time{})
// Re-Grab lock
c.mu.Lock()
// Indicate that handshake is complete (used in monitoring)
c.flags.set(handshakeComplete)
}
// Leaf nodes will always require a CONNECT to let us know
// when we are properly bound to an account.
// The connection may have been closed
if c.nc != nil {
c.setAuthTimer(secondsToDuration(opts.LeafNode.AuthTimeout))
}
}
// Spin up the read loop.
s.startGoRoutine(func() { c.readLoop() })
// Spin up the write loop.
s.startGoRoutine(func() { c.writeLoop() })
// Set the Ping timer
c.setPingTimer()
c.mu.Unlock()
c.Debugf("Leafnode connection created")
// Update server's accounting here if we solicited.
// Also send our local subs.
if solicited {
// Make sure we register with the account here.
c.registerWithAccount(c.acc)
s.addLeafNodeConnection(c)
s.initLeafNodeSmap(c)
c.sendAllLeafSubs()
}
return c
}
func (c *client) processLeafnodeInfo(info *Info) {
c.mu.Lock()
defer c.mu.Unlock()
if c.leaf == nil || c.nc == nil {
return
}
// Mark that the INFO protocol has been received.
// Note: For now, only the initial INFO has a nonce. We
// will probably do auto key rotation at some point.
if c.flags.setIfNotSet(infoReceived) {
// Capture a nonce here.
c.nonce = []byte(info.Nonce)
if info.TLSRequired && c.leaf.remote != nil {
c.leaf.remote.TLS = true
}
}
// For both initial INFO and async INFO protocols, Possibly
// update our list of remote leafnode URLs we can connect to.
if c.leaf.remote != nil && len(info.LeafNodeURLs) > 0 {
// Consider the incoming array as the most up-to-date
// representation of the remote cluster's list of URLs.
c.updateLeafNodeURLs(info)
}
}
// When getting a leaf node INFO protocol, use the provided
// array of urls to update the list of possible endpoints.
func (c *client) updateLeafNodeURLs(info *Info) {
cfg := c.leaf.remote
cfg.Lock()
defer cfg.Unlock()
cfg.urls = make([]*url.URL, 0, 1+len(info.LeafNodeURLs))
// Add the ones we receive in the protocol
for _, surl := range info.LeafNodeURLs {
url, err := url.Parse("nats-leaf://" + surl)
if err != nil {
c.Errorf("Error parsing url %q: %v", surl, err)
continue
}
// Do not add if it's the same as what we already have configured.
var dup bool
for _, u := range cfg.URLs {
// URLs that we receive never have user info, but the
// ones that were configured may have. Simply compare
// host and port to decide if they are equal or not.
if url.Host == u.Host && url.Port() == u.Port() {
dup = true
break
}
}
if !dup {
cfg.urls = append(cfg.urls, url)
cfg.saveTLSHostname(url)
}
}
// Add the configured one
cfg.urls = append(cfg.urls, cfg.URLs...)
}
// Similar to setInfoHostPortAndGenerateJSON, but for leafNodeInfo.
func (s *Server) setLeafNodeInfoHostPortAndIP() error {
opts := s.getOpts()
if opts.LeafNode.Advertise != _EMPTY_ {
advHost, advPort, err := parseHostPort(opts.LeafNode.Advertise, opts.LeafNode.Port)
if err != nil {
return err
}
s.leafNodeInfo.Host = advHost
s.leafNodeInfo.Port = advPort
} else {
s.leafNodeInfo.Host = opts.LeafNode.Host
s.leafNodeInfo.Port = opts.LeafNode.Port
// If the host is "0.0.0.0" or "::" we need to resolve to a public IP.
// This will return at most 1 IP.
hostIsIPAny, ips, err := s.getNonLocalIPsIfHostIsIPAny(s.leafNodeInfo.Host, false)
if err != nil {
return err
}
if hostIsIPAny {
if len(ips) == 0 {
s.Errorf("Could not find any non-local IP for leafnode's listen specification %q",
s.leafNodeInfo.Host)
} else {
// Take the first from the list...
s.leafNodeInfo.Host = ips[0]
}
}
}
// Use just host:port for the IP
s.leafNodeInfo.IP = net.JoinHostPort(s.leafNodeInfo.Host, strconv.Itoa(s.leafNodeInfo.Port))
if opts.LeafNode.Advertise != _EMPTY_ {
s.Noticef("Advertise address for leafnode is set to %s", s.leafNodeInfo.IP)
}
return nil
}
func (s *Server) addLeafNodeConnection(c *client) {
c.mu.Lock()
cid := c.cid
c.mu.Unlock()
s.mu.Lock()
s.leafs[cid] = c
s.mu.Unlock()
}
func (s *Server) removeLeafNodeConnection(c *client) {
c.mu.Lock()
cid := c.cid
c.mu.Unlock()
s.mu.Lock()
delete(s.leafs, cid)
s.mu.Unlock()
}
type leafConnectInfo struct {
JWT string `json:"jwt,omitempty"`
Sig string `json:"sig,omitempty"`
User string `json:"user,omitempty"`
Pass string `json:"pass,omitempty"`
TLS bool `json:"tls_required"`
Comp bool `json:"compression,omitempty"`
Name string `json:"name,omitempty"`
// Just used to detect wrong connection attempts.
Gateway string `json:"gateway,omitempty"`
}
// processLeafNodeConnect will process the inbound connect args.
// Once we are here we are bound to an account, so can send any interest that
// we would have to the other side.
func (c *client) processLeafNodeConnect(s *Server, arg []byte, lang string) error {
// Way to detect clients that incorrectly connect to the route listen
// port. Client provided "lang" in the CONNECT protocol while LEAFNODEs don't.
if lang != "" {
c.sendErrAndErr(ErrClientConnectedToLeafNodePort.Error())
c.closeConnection(WrongPort)
return ErrClientConnectedToLeafNodePort
}
// Unmarshal as a leaf node connect protocol
proto := &leafConnectInfo{}
if err := json.Unmarshal(arg, proto); err != nil {
return err
}
// Reject if this has Gateway which means that it would be from a gateway
// connection that incorrectly connects to the leafnode port.
if proto.Gateway != "" {
errTxt := fmt.Sprintf("Rejecting connection from gateway %q on the leafnode port", proto.Gateway)
c.Errorf(errTxt)
c.sendErr(errTxt)
c.closeConnection(WrongGateway)
return ErrWrongGateway
}
// Leaf Nodes do not do echo or verbose or pedantic.
c.opts.Verbose = false
c.opts.Echo = false
c.opts.Pedantic = false
// Create and initialize the smap since we know our bound account now.
s.initLeafNodeSmap(c)
// We are good to go, send over all the bound account subscriptions.
s.startGoRoutine(func() {
c.sendAllLeafSubs()
s.grWG.Done()
})
// Add in the leafnode here since we passed through auth at this point.
s.addLeafNodeConnection(c)
// Announce the account connect event for a leaf node.
// This will no-op as needed.
s.sendLeafNodeConnect(c.acc)
return nil
}
// Snapshot the current subscriptions from the sublist into our smap which
// we will keep updated from now on.
func (s *Server) initLeafNodeSmap(c *client) {
acc := c.acc
if acc == nil {
c.Debugf("Leafnode does not have an account bound")
return
}
// Collect all account subs here.
_subs := [32]*subscription{}
subs := _subs[:0]
ims := []string{}
acc.mu.RLock()
accName := acc.Name
// If we are solicited we only send interest for local clients.
if c.isSolicitedLeafNode() {
acc.sl.localSubs(&subs)
} else {
acc.sl.All(&subs)
}
// Since leaf nodes only send on interest, if the bound
// account has import services we need to send those over.
for isubj := range acc.imports.services {
ims = append(ims, isubj)
}
acc.mu.RUnlock()
// Now check for gateway interest. Leafnodes will put this into
// the proper mode to propagate, but they are not held in the account.
gwsa := [16]*client{}
gws := gwsa[:0]
s.getOutboundGatewayConnections(&gws)
for _, cgw := range gws {
cgw.mu.Lock()
gw := cgw.gw
cgw.mu.Unlock()
if gw != nil {
if ei, _ := gw.outsim.Load(accName); ei != nil {
if e := ei.(*outsie); e != nil && e.sl != nil {
e.sl.All(&subs)
}
}
}
}
applyGlobalRouting := s.gateway.enabled
// Now walk the results and add them to our smap
c.mu.Lock()
for _, sub := range subs {
// We ignore ourselves here.
if c != sub.client {
c.leaf.smap[keyFromSub(sub)]++
}
}
// FIXME(dlc) - We need to update appropriately on an account claims update.
for _, isubj := range ims {
c.leaf.smap[isubj]++
}
// If we have gateways enabled we need to make sure the other side sends us responses
// that have been augmented from the original subscription.
// TODO(dlc) - Should we lock this down more?
if applyGlobalRouting {
c.leaf.smap[gwReplyPrefix+"*.>"]++
}
c.mu.Unlock()
}
// updateInterestForAccountOnGateway called from gateway code when processing RS+ and RS-.
func (s *Server) updateInterestForAccountOnGateway(accName string, sub *subscription, delta int32) {
acc, err := s.LookupAccount(accName)
if acc == nil || err != nil {
s.Debugf("No or bad account for %q, failed to update interest from gateway", accName)
return
}
s.updateLeafNodes(acc, sub, delta)
}
// updateLeafNodes will make sure to update the smap for the subscription. Will
// also forward to all leaf nodes as needed.
func (s *Server) updateLeafNodes(acc *Account, sub *subscription, delta int32) {
if acc == nil || sub == nil {
return
}
_l := [32]*client{}
leafs := _l[:0]
// Grab all leaf nodes. Ignore a leafnode if sub's client is a leafnode and matches.
acc.mu.RLock()
for _, ln := range acc.lleafs {
if ln != sub.client {
leafs = append(leafs, ln)
}
}
acc.mu.RUnlock()
for _, ln := range leafs {
ln.updateSmap(sub, delta)
}
}
// This will make an update to our internal smap and determine if we should send out
// an interest update to the remote side.
func (c *client) updateSmap(sub *subscription, delta int32) {
key := keyFromSub(sub)
c.mu.Lock()
// If we are solicited make sure this is a local client.
if c.isSolicitedLeafNode() && sub.client.kind != CLIENT {
c.mu.Unlock()
return
}
n := c.leaf.smap[key]
// We will update if its a queue, if count is zero (or negative), or we were 0 and are N > 0.
update := sub.queue != nil || n == 0 || n+delta <= 0
n += delta
if n > 0 {
c.leaf.smap[key] = n
} else {
delete(c.leaf.smap, key)
}
if update {
c.sendLeafNodeSubUpdate(key, n)
}
c.mu.Unlock()
}
// Send the subscription interest change to the other side.
// Lock should be held.
func (c *client) sendLeafNodeSubUpdate(key string, n int32) {
_b := [64]byte{}
b := bytes.NewBuffer(_b[:0])
c.writeLeafSub(b, key, n)
c.sendProto(b.Bytes(), false)
}
// Helper function to build the key.
func keyFromSub(sub *subscription) string {
var _rkey [1024]byte
var key []byte
if sub.queue != nil {
// Just make the key subject spc group, e.g. 'foo bar'
key = _rkey[:0]
key = append(key, sub.subject...)
key = append(key, byte(' '))
key = append(key, sub.queue...)
} else {
key = sub.subject
}
return string(key)
}
// Send all subscriptions for this account that include local
// and possibly all other remote subscriptions.
func (c *client) sendAllLeafSubs() {
// Hold all at once for now.
var b bytes.Buffer
c.mu.Lock()
for key, n := range c.leaf.smap {
c.writeLeafSub(&b, key, n)
}
// We will make sure we don't overflow here due to a max_pending.
chunks := protoChunks(b.Bytes(), MAX_PAYLOAD_SIZE)
for _, chunk := range chunks {
c.queueOutbound(chunk)
c.flushOutbound()
}
c.mu.Unlock()
}
func (c *client) writeLeafSub(w *bytes.Buffer, key string, n int32) {
if key == "" {
return
}
if n > 0 {
w.WriteString("LS+ " + key)
// Check for queue semantics, if found write n.
if strings.Contains(key, " ") {
w.WriteString(" ")
var b [12]byte
var i = len(b)
for l := n; l > 0; l /= 10 {
i--
b[i] = digits[l%10]
}
w.Write(b[i:])
if c.trace {
arg := fmt.Sprintf("%s %d", key, n)
c.traceOutOp("LS+", []byte(arg))
}
} else if c.trace {
c.traceOutOp("LS+", []byte(key))
}
} else {
w.WriteString("LS- " + key)
if c.trace {
c.traceOutOp("LS-", []byte(key))
}
}
w.WriteString(CR_LF)
}
// processLeafSub will process an inbound sub request for the remote leaf node.
func (c *client) processLeafSub(argo []byte) (err error) {
c.traceInOp("LS+", argo)
// Indicate activity.
c.in.subs++
srv := c.srv
if srv == nil {
return nil
}
// Copy so we do not reference a potentially large buffer
arg := make([]byte, len(argo))
copy(arg, argo)
args := splitArg(arg)
sub := &subscription{client: c}
switch len(args) {
case 1:
sub.queue = nil
case 3:
sub.queue = args[1]
sub.qw = int32(parseSize(args[2]))
default:
return fmt.Errorf("processLeafSub Parse Error: '%s'", arg)
}
sub.subject = args[0]
c.mu.Lock()
if c.nc == nil {
c.mu.Unlock()
return nil
}
// Check permissions if applicable.
if !c.canExport(string(sub.subject)) {
c.mu.Unlock()
c.Debugf("Can not export %q, ignoring remote subscription request", sub.subject)
return nil
}
// Check if we have a maximum on the number of subscriptions.
if c.subsAtLimit() {
c.mu.Unlock()
c.maxSubsExceeded()
return nil
}
// Like Routes, we store local subs by account and subject and optionally queue name.
// If we have a queue it will have a trailing weight which we do not want.
if sub.queue != nil {
sub.sid = arg[:len(arg)-len(args[2])-1]
} else {
sub.sid = arg
}
acc := c.acc
key := string(sub.sid)
osub := c.subs[key]
updateGWs := false
if osub == nil {
c.subs[key] = sub
// Now place into the account sl.
if err = acc.sl.Insert(sub); err != nil {
delete(c.subs, key)
c.mu.Unlock()
c.Errorf("Could not insert subscription: %v", err)
c.sendErr("Invalid Subscription")
return nil
}
updateGWs = srv.gateway.enabled
} else if sub.queue != nil {
// For a queue we need to update the weight.
atomic.StoreInt32(&osub.qw, sub.qw)
acc.sl.UpdateRemoteQSub(osub)
}
solicited := c.isSolicitedLeafNode()
c.mu.Unlock()
if err := c.addShadowSubscriptions(acc, sub); err != nil {
c.Errorf(err.Error())
}
// If we are not solicited, treat leaf node subscriptions similar to a
// client subscription, meaning we forward them to routes, gateways and
// other leaf nodes as needed.
if !solicited {
// If we are routing add to the route map for the associated account.
srv.updateRouteSubscriptionMap(acc, sub, 1)
if updateGWs {
srv.gatewayUpdateSubInterest(acc.Name, sub, 1)
}
// Now check on leafnode updates for other leaf nodes.
srv.updateLeafNodes(acc, sub, 1)
}
return nil
}
// processLeafUnsub will process an inbound unsub request for the remote leaf node.
func (c *client) processLeafUnsub(arg []byte) error {
c.traceInOp("LS-", arg)
// Indicate any activity, so pub and sub or unsubs.
c.in.subs++
acc := c.acc
srv := c.srv
c.mu.Lock()
if c.nc == nil {
c.mu.Unlock()
return nil
}
updateGWs := false
// We store local subs by account and subject and optionally queue name.
// LS- will have the arg exactly as the key.
sub, ok := c.subs[string(arg)]
c.mu.Unlock()
if ok {
c.unsubscribe(acc, sub, true, true)
updateGWs = srv.gateway.enabled
}
// If we are routing subtract from the route map for the associated account.
srv.updateRouteSubscriptionMap(acc, sub, -1)
// Gateways
if updateGWs {
srv.gatewayUpdateSubInterest(acc.Name, sub, -1)
}
// Now check on leafnode updates for other leaf nodes.
srv.updateLeafNodes(acc, sub, -1)
return nil
}
func (c *client) processLeafMsgArgs(trace bool, arg []byte) error {
if trace {
c.traceInOp("LMSG", arg)
}
// Unroll splitArgs to avoid runtime/heap issues
a := [MAX_MSG_ARGS][]byte{}
args := a[:0]
start := -1
for i, b := range arg {
switch b {
case ' ', '\t', '\r', '\n':
if start >= 0 {
args = append(args, arg[start:i])
start = -1
}
default:
if start < 0 {
start = i
}
}
}
if start >= 0 {
args = append(args, arg[start:])
}
c.pa.arg = arg
switch len(args) {
case 0, 1:
return fmt.Errorf("processLeafMsgArgs Parse Error: '%s'", args)
case 2:
c.pa.reply = nil
c.pa.queues = nil
c.pa.szb = args[1]
c.pa.size = parseSize(args[1])
case 3:
c.pa.reply = args[1]
c.pa.queues = nil
c.pa.szb = args[2]
c.pa.size = parseSize(args[2])
default:
// args[1] is our reply indicator. Should be + or | normally.
if len(args[1]) != 1 {
return fmt.Errorf("processLeafMsgArgs Bad or Missing Reply Indicator: '%s'", args[1])
}
switch args[1][0] {
case '+':
c.pa.reply = args[2]
case '|':
c.pa.reply = nil
default:
return fmt.Errorf("processLeafMsgArgs Bad or Missing Reply Indicator: '%s'", args[1])
}
// Grab size.
c.pa.szb = args[len(args)-1]
c.pa.size = parseSize(c.pa.szb)
// Grab queue names.
if c.pa.reply != nil {
c.pa.queues = args[3 : len(args)-1]
} else {
c.pa.queues = args[2 : len(args)-1]
}
}
if c.pa.size < 0 {
return fmt.Errorf("processLeafMsgArgs Bad or Missing Size: '%s'", args)
}
// Common ones processed after check for arg length
c.pa.subject = args[0]
return nil
}
// processInboundLeafMsg is called to process an inbound msg from a leaf node.
func (c *client) processInboundLeafMsg(msg []byte) {
// Update statistics
c.in.msgs++
// The msg includes the CR_LF, so pull back out for accounting.
c.in.bytes += int32(len(msg) - LEN_CR_LF)
if c.trace {
c.traceMsg(msg)
}
// Check pub permissions
if c.perms != nil && (c.perms.pub.allow != nil || c.perms.pub.deny != nil) && !c.pubAllowed(string(c.pa.subject)) {
c.pubPermissionViolation(c.pa.subject)
return
}
srv := c.srv
acc := c.acc
// Mostly under testing scenarios.
if srv == nil || acc == nil {
return
}
// Check to see if we need to map/route to another account.
if acc.imports.services != nil {
c.checkForImportServices(acc, msg)
}
// Match the subscriptions. We will use our own L1 map if
// it's still valid, avoiding contention on the shared sublist.
var r *SublistResult
var ok bool
genid := atomic.LoadUint64(&c.acc.sl.genid)
if genid == c.in.genid && c.in.results != nil {
r, ok = c.in.results[string(c.pa.subject)]
} else {
// Reset our L1 completely.
c.in.results = make(map[string]*SublistResult)
c.in.genid = genid
}
// Go back to the sublist data structure.
if !ok {
r = c.acc.sl.Match(string(c.pa.subject))
c.in.results[string(c.pa.subject)] = r
// Prune the results cache. Keeps us from unbounded growth. Random delete.
if len(c.in.results) > maxResultCacheSize {
n := 0
for subject := range c.in.results {
delete(c.in.results, subject)
if n++; n > pruneSize {
break
}
}
}
}
// Collect queue names if needed.
var qnames [][]byte
// Check for no interest, short circuit if so.
// This is the fanout scale.
if len(r.psubs)+len(r.qsubs) > 0 {
flag := pmrNoFlag
// If we have queue subs in this cluster, then if we run in gateway
// mode and the remote gateways have queue subs, then we need to
// collect the queue groups this message was sent to so that we
// exclude them when sending to gateways.
if len(r.qsubs) > 0 && c.srv.gateway.enabled &&
atomic.LoadInt64(&c.srv.gateway.totalQSubs) > 0 {
flag = pmrCollectQueueNames
}
qnames = c.processMsgResults(acc, r, msg, c.pa.subject, c.pa.reply, flag)
}
// Now deal with gateways
if c.srv.gateway.enabled {
c.sendMsgToGateways(acc, msg, c.pa.subject, c.pa.reply, qnames)
}
}
// This functional will take a larger buffer and break it into
// chunks that are protocol correct. Reason being is that we are
// doing this in the first place to get things in smaller sizes
// out the door but we may allow someone to get in between us as
// we do.
// NOTE - currently this does not process MSG protos.
func protoChunks(b []byte, csz int) [][]byte {
if b == nil {
return nil
}
if len(b) <= csz {
return [][]byte{b}
}
var (
chunks [][]byte
start int
)
for i := csz; i < len(b); {
// Walk forward to find a CR_LF
delim := bytes.Index(b[i:], []byte(CR_LF))
if delim < 0 {
chunks = append(chunks, b[start:])
break
}
end := delim + LEN_CR_LF + i
chunks = append(chunks, b[start:end])
start = end
i = end + csz
}
return chunks
}
| 1 | 9,319 | Don't need () if only one. | nats-io-nats-server | go |
@@ -26,6 +26,7 @@ public class AbstractMailer {
private boolean usesAuth;
private String mailHost;
+ private String mailPort;
private String mailUser;
private String mailPassword;
private String mailSender; | 1 | /*
* Copyright 2012 LinkedIn Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package azkaban.utils;
import java.util.Collection;
public class AbstractMailer {
private static int MB_IN_BYTES = 1048576;
private String clientHostname;
private int clientPort;
private boolean usesSSL;
private boolean usesAuth;
private String mailHost;
private String mailUser;
private String mailPassword;
private String mailSender;
private String azkabanName;
private String referenceURL;
private long attachmentMazSizeInByte;
public AbstractMailer(Props props) {
this.azkabanName = props.getString("azkaban.name", "azkaban");
this.mailHost = props.getString("mail.host", "localhost");
this.mailUser = props.getString("mail.user", "");
this.mailPassword = props.getString("mail.password", "");
long maxAttachmentSizeInMB =
props.getInt("mail.max.attachment.size.mb", 100);
attachmentMazSizeInByte = maxAttachmentSizeInMB * MB_IN_BYTES;
this.mailSender = props.getString("mail.sender", "");
this.usesAuth = props.getBoolean("mail.useAuth", true);
this.clientHostname = props.get("server.hostname");
this.clientPort = props.getInt("server.port");
this.usesSSL = props.getBoolean("server.useSSL");
if (usesSSL) {
referenceURL =
"https://" + clientHostname
+ (clientPort == 443 ? "/" : ":" + clientPort + "/");
} else {
referenceURL =
"http://" + clientHostname
+ (clientPort == 80 ? "/" : ":" + clientPort + "/");
}
}
public String getReferenceURL() {
return referenceURL;
}
protected EmailMessage createEmailMessage(String subject, String mimetype,
Collection<String> emailList) {
EmailMessage message = new EmailMessage(mailHost, mailUser, mailPassword);
message.setFromAddress(mailSender);
message.addAllToAddress(emailList);
message.setMimeType(mimetype);
message.setSubject(subject);
message.setAuth(usesAuth);
return message;
}
public EmailMessage prepareEmailMessage(String subject, String mimetype,
Collection<String> emailList) {
return createEmailMessage(subject, mimetype, emailList);
}
public String getAzkabanName() {
return azkabanName;
}
public String getMailHost() {
return mailHost;
}
public String getMailUser() {
return mailUser;
}
public String getMailPassword() {
return mailPassword;
}
public String getMailSender() {
return mailSender;
}
/**
* Attachment maximum size in bytes
*
* @return
*/
public long getAttachmentMaxSize() {
return attachmentMazSizeInByte;
}
public boolean hasMailAuth() {
return usesAuth;
}
}
| 1 | 10,116 | Why not have mailPort as int since your are already parsing while calling t.connect ? | azkaban-azkaban | java |
@@ -38,7 +38,7 @@ with open('README.rst') as fobj:
install_requires = [
'tornado>=4.0,<5',
- 'python-daemon<3.0',
+ 'python-daemon<3.0'
]
if os.environ.get('READTHEDOCS', None) == 'True': | 1 | # Copyright (c) 2012 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
import os
from setuptools import setup
def get_static_files(path):
return [os.path.join(dirpath.replace("luigi/", ""), ext)
for (dirpath, dirnames, filenames) in os.walk(path)
for ext in ["*.html", "*.js", "*.css", "*.png",
"*.eot", "*.svg", "*.ttf", "*.woff", "*.woff2"]]
luigi_package_data = sum(map(get_static_files, ["luigi/static", "luigi/templates"]), [])
readme_note = """\
.. note::
For the latest source, discussion, etc, please visit the
`GitHub repository <https://github.com/spotify/luigi>`_\n\n
"""
with open('README.rst') as fobj:
long_description = readme_note + fobj.read()
install_requires = [
'tornado>=4.0,<5',
'python-daemon<3.0',
]
if os.environ.get('READTHEDOCS', None) == 'True':
# So that we can build documentation for luigi.db_task_history and luigi.contrib.sqla
install_requires.append('sqlalchemy')
# readthedocs don't like python-daemon, see #1342
install_requires.remove('python-daemon<3.0')
setup(
name='luigi',
version='2.0.1',
description='Workflow mgmgt + task scheduling + dependency resolution',
long_description=long_description,
author='Erik Bernhardsson',
url='https://github.com/spotify/luigi',
license='Apache License 2.0',
packages=[
'luigi',
'luigi.contrib',
'luigi.contrib.hdfs',
'luigi.tools'
],
package_data={
'luigi': luigi_package_data
},
entry_points={
'console_scripts': [
'luigi = luigi.cmdline:luigi_run',
'luigid = luigi.cmdline:luigid',
'luigi-grep = luigi.tools.luigi_grep:main',
'luigi-deps = luigi.tools.deps:main',
'luigi-migrate = luigi.tools.migrate:main'
]
},
install_requires=install_requires,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Environment :: Web Environment',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: System :: Monitoring',
],
)
| 1 | 14,357 | In the future, do not remove these trailing commas as they have the purpose of making append-diffs easier to read. :) | spotify-luigi | py |
@@ -739,6 +739,11 @@ class SolrDefault extends AbstractBase
// Get LCCN from Index
$raw = isset($this->fields['lccn']) ? $this->fields['lccn'] : '';
+ // First call number only.
+ if (is_array($raw)) {
+ $raw = reset($raw);
+ }
+
// Remove all blanks.
$raw = preg_replace('{[ \t]+}', '', $raw);
| 1 | <?php
/**
* Default model for Solr records -- used when a more specific model based on
* the recordtype field cannot be found.
*
* PHP version 5
*
* Copyright (C) Villanova University 2010.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* @category VuFind
* @package RecordDrivers
* @author Demian Katz <[email protected]>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development:plugins:record_drivers Wiki
*/
namespace VuFind\RecordDriver;
use VuFindCode\ISBN, VuFind\View\Helper\Root\RecordLink;
/**
* Default model for Solr records -- used when a more specific model based on
* the recordtype field cannot be found.
*
* This should be used as the base class for all Solr-based record models.
*
* @category VuFind
* @package RecordDrivers
* @author Demian Katz <[email protected]>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link https://vufind.org/wiki/development:plugins:record_drivers Wiki
*
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
*/
class SolrDefault extends AbstractBase
{
/**
* These Solr fields should be used for snippets if available (listed in order
* of preference).
*
* @var array
*/
protected $preferredSnippetFields = [
'contents', 'topic'
];
/**
* These Solr fields should NEVER be used for snippets. (We exclude author
* and title because they are already covered by displayed fields; we exclude
* spelling because it contains lots of fields jammed together and may cause
* glitchy output; we exclude ID because random numbers are not helpful).
*
* @var array
*/
protected $forbiddenSnippetFields = [
'author', 'title', 'title_short', 'title_full',
'title_full_unstemmed', 'title_auth', 'title_sub', 'spelling', 'id',
'ctrlnum', 'author_variant', 'author2_variant'
];
/**
* These are captions corresponding with Solr fields for use when displaying
* snippets.
*
* @var array
*/
protected $snippetCaptions = [];
/**
* Should we highlight fields in search results?
*
* @var bool
*/
protected $highlight = false;
/**
* Should we include snippets in search results?
*
* @var bool
*/
protected $snippet = false;
/**
* Hierarchy driver plugin manager
*
* @var \VuFind\Hierarchy\Driver\PluginManager
*/
protected $hierarchyDriverManager = null;
/**
* Hierarchy driver for current object
*
* @var \VuFind\Hierarchy\Driver\AbstractBase
*/
protected $hierarchyDriver = null;
/**
* Highlighting details
*
* @var array
*/
protected $highlightDetails = [];
/**
* Search results plugin manager
*
* @var \VuFindSearch\Service
*/
protected $searchService = null;
/**
* Should we use hierarchy fields for simple container-child records linking?
*
* @var bool
*/
protected $containerLinking = false;
/**
* Constructor
*
* @param \Zend\Config\Config $mainConfig VuFind main configuration (omit for
* built-in defaults)
* @param \Zend\Config\Config $recordConfig Record-specific configuration file
* (omit to use $mainConfig as $recordConfig)
* @param \Zend\Config\Config $searchSettings Search-specific configuration file
*/
public function __construct($mainConfig = null, $recordConfig = null,
$searchSettings = null
) {
// Turn on highlighting/snippets as needed:
$this->highlight = !isset($searchSettings->General->highlighting)
? false : $searchSettings->General->highlighting;
$this->snippet = !isset($searchSettings->General->snippets)
? false : $searchSettings->General->snippets;
// Load snippet caption settings:
if (isset($searchSettings->Snippet_Captions)
&& count($searchSettings->Snippet_Captions) > 0
) {
foreach ($searchSettings->Snippet_Captions as $key => $value) {
$this->snippetCaptions[$key] = $value;
}
}
// Container-contents linking
$this->containerLinking
= !isset($mainConfig->Hierarchy->simpleContainerLinks)
? false : $mainConfig->Hierarchy->simpleContainerLinks;
parent::__construct($mainConfig, $recordConfig);
}
/**
* Get highlighting details from the object.
*
* @return array
*/
public function getHighlightDetails()
{
return $this->highlightDetails;
}
/**
* Add highlighting details to the object.
*
* @param array $details Details to add
*
* @return void
*/
public function setHighlightDetails($details)
{
$this->highlightDetails = $details;
}
/**
* Get access restriction notes for the record.
*
* @return array
*/
public function getAccessRestrictions()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get all subject headings associated with this record. Each heading is
* returned as an array of chunks, increasing from least specific to most
* specific.
*
* @param bool $extended Whether to return a keyed array with the following
* keys:
* - heading: the actual subject heading chunks
* - type: heading type
* - source: source vocabulary
*
* @return array
*/
public function getAllSubjectHeadings($extended = false)
{
$headings = [];
foreach (['topic', 'geographic', 'genre', 'era'] as $field) {
if (isset($this->fields[$field])) {
$headings = array_merge($headings, $this->fields[$field]);
}
}
// The Solr index doesn't currently store subject headings in a broken-down
// format, so we'll just send each value as a single chunk. Other record
// drivers (i.e. MARC) can offer this data in a more granular format.
$callback = function ($i) use ($extended) {
return $extended
? ['heading' => [$i], 'type' => '', 'source' => '']
: [$i];
};
return array_map($callback, array_unique($headings));
}
/**
* Get all record links related to the current record. Each link is returned as
* array.
* NB: to use this method you must override it.
* Format:
* <code>
* array(
* array(
* 'title' => label_for_title
* 'value' => link_name
* 'link' => link_URI
* ),
* ...
* )
* </code>
*
* @return null|array
*/
public function getAllRecordLinks()
{
return null;
}
/**
* Get Author Information with Associated Data Fields
*
* @param string $index The author index [primary, corporate, or secondary]
* used to construct a method name for retrieving author data (e.g.
* getPrimaryAuthors).
* @param array $dataFields An array of fields to used to construct method
* names for retrieving author-related data (e.g., if you pass 'role' the
* data method will be similar to getPrimaryAuthorsRoles). This value will also
* be used as a key associated with each author in the resulting data array.
*
* @return array
*/
public function getAuthorDataFields($index, $dataFields = [])
{
$data = $dataFieldValues = [];
// Collect author data
$authorMethod = sprintf('get%sAuthors', ucfirst($index));
$authors = $this->tryMethod($authorMethod, [], []);
// Collect attribute data
foreach ($dataFields as $field) {
$fieldMethod = $authorMethod . ucfirst($field) . 's';
$dataFieldValues[$field] = $this->tryMethod($fieldMethod, [], []);
}
// Match up author and attribute data (this assumes that the attribute
// arrays have the same indices as the author array; i.e. $author[$i]
// has $dataFieldValues[$attribute][$i].
foreach ($authors as $i => $author) {
if (!isset($data[$author])) {
$data[$author] = [];
}
foreach ($dataFieldValues as $field => $dataFieldValue) {
if (!empty($dataFieldValue[$i])) {
$data[$author][$field][] = $dataFieldValue[$i];
}
}
}
return $data;
}
/**
* Get award notes for the record.
*
* @return array
*/
public function getAwards()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get notes on bibliography content.
*
* @return array
*/
public function getBibliographyNotes()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get text that can be displayed to represent this record in
* breadcrumbs.
*
* @return string Breadcrumb text to represent this record.
*/
public function getBreadcrumb()
{
return $this->getShortTitle();
}
/**
* Get the first call number associated with the record (empty string if none).
*
* @return string
*/
public function getCallNumber()
{
$all = $this->getCallNumbers();
return isset($all[0]) ? $all[0] : '';
}
/**
* Get all call numbers associated with the record (empty string if none).
*
* @return array
*/
public function getCallNumbers()
{
return isset($this->fields['callnumber-raw'])
? $this->fields['callnumber-raw'] : [];
}
/**
* Return the first valid DOI found in the record (false if none).
*
* @return mixed
*/
public function getCleanDOI()
{
$field = 'doi_str_mv';
return (isset($this->fields[$field][0]) && !empty($this->fields[$field][0]))
? $this->fields[$field][0] : false;
}
/**
* Return the first valid ISBN found in the record (favoring ISBN-10 over
* ISBN-13 when possible).
*
* @return mixed
*/
public function getCleanISBN()
{
// Get all the ISBNs and initialize the return value:
$isbns = $this->getISBNs();
$isbn13 = false;
// Loop through the ISBNs:
foreach ($isbns as $isbn) {
// Strip off any unwanted notes:
if ($pos = strpos($isbn, ' ')) {
$isbn = substr($isbn, 0, $pos);
}
// If we find an ISBN-10, return it immediately; otherwise, if we find
// an ISBN-13, save it if it is the first one encountered.
$isbnObj = new ISBN($isbn);
if ($isbn10 = $isbnObj->get10()) {
return $isbn10;
}
if (!$isbn13) {
$isbn13 = $isbnObj->get13();
}
}
return $isbn13;
}
/**
* Get just the base portion of the first listed ISSN (or false if no ISSNs).
*
* @return mixed
*/
public function getCleanISSN()
{
$issns = $this->getISSNs();
if (empty($issns)) {
return false;
}
$issn = $issns[0];
if ($pos = strpos($issn, ' ')) {
$issn = substr($issn, 0, $pos);
}
return $issn;
}
/**
* Get just the first listed OCLC Number (or false if none available).
*
* @return mixed
*/
public function getCleanOCLCNum()
{
$nums = $this->getOCLC();
return empty($nums) ? false : $nums[0];
}
/**
* Get just the first listed UPC Number (or false if none available).
*
* @return mixed
*/
public function getCleanUPC()
{
$nums = $this->getUPC();
return empty($nums) ? false : $nums[0];
}
/**
* Get the main corporate authors (if any) for the record.
*
* @return array
*/
public function getCorporateAuthors()
{
return isset($this->fields['author_corporate']) ?
$this->fields['author_corporate'] : [];
}
/**
* Get an array of all main corporate authors roles.
*
* @return array
*/
public function getCorporateAuthorsRoles()
{
return isset($this->fields['author_corporate_role']) ?
$this->fields['author_corporate_role'] : [];
}
/**
* Get the date coverage for a record which spans a period of time (i.e. a
* journal). Use getPublicationDates for publication dates of particular
* monographic items.
*
* @return array
*/
public function getDateSpan()
{
return isset($this->fields['dateSpan']) ?
$this->fields['dateSpan'] : [];
}
/**
* Deduplicate author information into associative array with main/corporate/
* secondary keys.
*
* @param array $dataFields An array of extra data fields to retrieve (see
* getAuthorDataFields)
*
* @return array
*/
public function getDeduplicatedAuthors($dataFields = ['role'])
{
$authors = [];
foreach (['primary', 'secondary', 'corporate'] as $type) {
$authors[$type] = $this->getAuthorDataFields($type, $dataFields);
}
// deduplicate
$dedup = function (&$array1, &$array2) {
if (!empty($array1) && !empty($array2)) {
$keys = array_keys($array1);
foreach ($keys as $author) {
if (isset($array2[$author])) {
$array1[$author] = array_merge(
$array1[$author],
$array2[$author]
);
unset($array2[$author]);
}
}
}
};
$dedup($authors['primary'], $authors['corporate']);
$dedup($authors['secondary'], $authors['corporate']);
$dedup($authors['primary'], $authors['secondary']);
$dedup_data = function (&$array) {
foreach ($array as $author => $data) {
foreach ($data as $field => $values) {
if (is_array($values)) {
$array[$author][$field] = array_unique($values);
}
}
}
};
$dedup_data($authors['primary']);
$dedup_data($authors['secondary']);
$dedup_data($authors['corporate']);
return $authors;
}
/**
* Get the edition of the current record.
*
* @return string
*/
public function getEdition()
{
return isset($this->fields['edition']) ?
$this->fields['edition'] : '';
}
/**
* Get notes on finding aids related to the record.
*
* @return array
*/
public function getFindingAids()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get an array of all the formats associated with the record.
*
* @return array
*/
public function getFormats()
{
return isset($this->fields['format']) ? $this->fields['format'] : [];
}
/**
* Get general notes on the record.
*
* @return array
*/
public function getGeneralNotes()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get highlighted author data, if available.
*
* @return array
*/
public function getRawAuthorHighlights()
{
// Don't check for highlighted values if highlighting is disabled:
return ($this->highlight && isset($this->highlightDetails['author']))
? $this->highlightDetails['author'] : [];
}
/**
* Get primary author information with highlights applied (if applicable)
*
* @return array
*/
public function getPrimaryAuthorsWithHighlighting()
{
$highlights = [];
// Create a map of de-highlighted valeus => highlighted values.
foreach ($this->getRawAuthorHighlights() as $current) {
$dehighlighted = str_replace(
['{{{{START_HILITE}}}}', '{{{{END_HILITE}}}}'], '', $current
);
$highlights[$dehighlighted] = $current;
}
// replace unhighlighted authors with highlighted versions where
// applicable:
$authors = [];
foreach ($this->getPrimaryAuthors() as $author) {
$authors[] = isset($highlights[$author])
? $highlights[$author] : $author;
}
return $authors;
}
/**
* Get a string representing the last date that the record was indexed.
*
* @return string
*/
public function getLastIndexed()
{
return isset($this->fields['last_indexed'])
? $this->fields['last_indexed'] : '';
}
/**
* Given a Solr field name, return an appropriate caption.
*
* @param string $field Solr field name
*
* @return mixed Caption if found, false if none available.
*/
public function getSnippetCaption($field)
{
return isset($this->snippetCaptions[$field])
? $this->snippetCaptions[$field] : false;
}
/**
* Pick one line from the highlighted text (if any) to use as a snippet.
*
* @return mixed False if no snippet found, otherwise associative array
* with 'snippet' and 'caption' keys.
*/
public function getHighlightedSnippet()
{
// Only process snippets if the setting is enabled:
if ($this->snippet) {
// First check for preferred fields:
foreach ($this->preferredSnippetFields as $current) {
if (isset($this->highlightDetails[$current][0])) {
return [
'snippet' => $this->highlightDetails[$current][0],
'caption' => $this->getSnippetCaption($current)
];
}
}
// No preferred field found, so try for a non-forbidden field:
if (isset($this->highlightDetails)
&& is_array($this->highlightDetails)
) {
foreach ($this->highlightDetails as $key => $value) {
if ($value && !in_array($key, $this->forbiddenSnippetFields)) {
return [
'snippet' => $value[0],
'caption' => $this->getSnippetCaption($key)
];
}
}
}
}
// If we got this far, no snippet was found:
return false;
}
/**
* Get a highlighted title string, if available.
*
* @return string
*/
public function getHighlightedTitle()
{
// Don't check for highlighted values if highlighting is disabled:
if (!$this->highlight) {
return '';
}
return (isset($this->highlightDetails['title'][0]))
? $this->highlightDetails['title'][0] : '';
}
/**
* Get the institutions holding the record.
*
* @return array
*/
public function getInstitutions()
{
return isset($this->fields['institution'])
? $this->fields['institution'] : [];
}
/**
* Get an array of all ISBNs associated with the record (may be empty).
*
* @return array
*/
public function getISBNs()
{
// If ISBN is in the index, it should automatically be an array... but if
// it's not set at all, we should normalize the value to an empty array.
return isset($this->fields['isbn']) && is_array($this->fields['isbn']) ?
$this->fields['isbn'] : [];
}
/**
* Get an array of all ISSNs associated with the record (may be empty).
*
* @return array
*/
public function getISSNs()
{
// If ISSN is in the index, it should automatically be an array... but if
// it's not set at all, we should normalize the value to an empty array.
return isset($this->fields['issn']) && is_array($this->fields['issn']) ?
$this->fields['issn'] : [];
}
/**
* Get an array of all the languages associated with the record.
*
* @return array
*/
public function getLanguages()
{
return isset($this->fields['language']) ?
$this->fields['language'] : [];
}
/**
* Get a LCCN, normalised according to info:lccn
*
* @return string
*/
public function getLCCN()
{
// Get LCCN from Index
$raw = isset($this->fields['lccn']) ? $this->fields['lccn'] : '';
// Remove all blanks.
$raw = preg_replace('{[ \t]+}', '', $raw);
// If there is a forward slash (/) in the string, remove it, and remove all
// characters to the right of the forward slash.
if (strpos($raw, '/') > 0) {
$tmpArray = explode("/", $raw);
$raw = $tmpArray[0];
}
/* If there is a hyphen in the string:
a. Remove it.
b. Inspect the substring following (to the right of) the (removed)
hyphen. Then (and assuming that steps 1 and 2 have been carried out):
i. All these characters should be digits, and there should be
six or less.
ii. If the length of the substring is less than 6, left-fill the
substring with zeros until the length is six.
*/
if (strpos($raw, '-') > 0) {
// haven't checked for i. above. If they aren't all digits, there is
// nothing that can be done, so might as well leave it.
$tmpArray = explode("-", $raw);
$raw = $tmpArray[0] . str_pad($tmpArray[1], 6, "0", STR_PAD_LEFT);
}
return $raw;
}
/**
* Get an array of newer titles for the record.
*
* @return array
*/
public function getNewerTitles()
{
return isset($this->fields['title_new']) ?
$this->fields['title_new'] : [];
}
/**
* Get the OCLC number(s) of the record.
*
* @return array
*/
public function getOCLC()
{
return isset($this->fields['oclc_num']) ?
$this->fields['oclc_num'] : [];
}
/**
* Support method for getOpenUrl() -- pick the OpenURL format.
*
* @return string
*/
protected function getOpenUrlFormat()
{
// If we have multiple formats, Book, Journal and Article are most
// important...
$formats = $this->getFormats();
if (in_array('Book', $formats)) {
return 'Book';
} else if (in_array('Article', $formats)) {
return 'Article';
} else if (in_array('Journal', $formats)) {
return 'Journal';
} else if (isset($formats[0])) {
return $formats[0];
} else if (strlen($this->getCleanISSN()) > 0) {
return 'Journal';
} else if (strlen($this->getCleanISBN()) > 0) {
return 'Book';
}
return 'UnknownFormat';
}
/**
* Get the COinS identifier.
*
* @return string
*/
protected function getCoinsID()
{
// Get the COinS ID -- it should be in the OpenURL section of config.ini,
// but we'll also check the COinS section for compatibility with legacy
// configurations (this moved between the RC2 and 1.0 releases).
if (isset($this->mainConfig->OpenURL->rfr_id)
&& !empty($this->mainConfig->OpenURL->rfr_id)
) {
return $this->mainConfig->OpenURL->rfr_id;
}
if (isset($this->mainConfig->COinS->identifier)
&& !empty($this->mainConfig->COinS->identifier)
) {
return $this->mainConfig->COinS->identifier;
}
return 'vufind.svn.sourceforge.net';
}
/**
* Get default OpenURL parameters.
*
* @return array
*/
protected function getDefaultOpenUrlParams()
{
// Get a representative publication date:
$pubDate = $this->getPublicationDates();
$pubDate = empty($pubDate) ? '' : $pubDate[0];
// Start an array of OpenURL parameters:
return [
'url_ver' => 'Z39.88-2004',
'ctx_ver' => 'Z39.88-2004',
'ctx_enc' => 'info:ofi/enc:UTF-8',
'rfr_id' => 'info:sid/' . $this->getCoinsID() . ':generator',
'rft.title' => $this->getTitle(),
'rft.date' => $pubDate
];
}
/**
* Get OpenURL parameters for a book.
*
* @return array
*/
protected function getBookOpenUrlParams()
{
$params = $this->getDefaultOpenUrlParams();
$params['rft_val_fmt'] = 'info:ofi/fmt:kev:mtx:book';
$params['rft.genre'] = 'book';
$params['rft.btitle'] = $params['rft.title'];
$series = $this->getSeries();
if (count($series) > 0) {
// Handle both possible return formats of getSeries:
$params['rft.series'] = is_array($series[0]) ?
$series[0]['name'] : $series[0];
}
$params['rft.au'] = $this->getPrimaryAuthor();
$publishers = $this->getPublishers();
if (count($publishers) > 0) {
$params['rft.pub'] = $publishers[0];
}
$params['rft.edition'] = $this->getEdition();
$params['rft.isbn'] = (string)$this->getCleanISBN();
return $params;
}
/**
* Get OpenURL parameters for an article.
*
* @return array
*/
protected function getArticleOpenUrlParams()
{
$params = $this->getDefaultOpenUrlParams();
$params['rft_val_fmt'] = 'info:ofi/fmt:kev:mtx:journal';
$params['rft.genre'] = 'article';
$params['rft.issn'] = (string)$this->getCleanISSN();
// an article may have also an ISBN:
$params['rft.isbn'] = (string)$this->getCleanISBN();
$params['rft.volume'] = $this->getContainerVolume();
$params['rft.issue'] = $this->getContainerIssue();
$params['rft.spage'] = $this->getContainerStartPage();
// unset default title -- we only want jtitle/atitle here:
unset($params['rft.title']);
$params['rft.jtitle'] = $this->getContainerTitle();
$params['rft.atitle'] = $this->getTitle();
$params['rft.au'] = $this->getPrimaryAuthor();
$params['rft.format'] = 'Article';
$langs = $this->getLanguages();
if (count($langs) > 0) {
$params['rft.language'] = $langs[0];
}
return $params;
}
/**
* Get OpenURL parameters for an unknown format.
*
* @param string $format Name of format
*
* @return array
*/
protected function getUnknownFormatOpenUrlParams($format = 'UnknownFormat')
{
$params = $this->getDefaultOpenUrlParams();
$params['rft_val_fmt'] = 'info:ofi/fmt:kev:mtx:dc';
$params['rft.creator'] = $this->getPrimaryAuthor();
$publishers = $this->getPublishers();
if (count($publishers) > 0) {
$params['rft.pub'] = $publishers[0];
}
$params['rft.format'] = $format;
$langs = $this->getLanguages();
if (count($langs) > 0) {
$params['rft.language'] = $langs[0];
}
return $params;
}
/**
* Get OpenURL parameters for a journal.
*
* @return array
*/
protected function getJournalOpenUrlParams()
{
$params = $this->getUnknownFormatOpenUrlParams('Journal');
/* This is probably the most technically correct way to represent
* a journal run as an OpenURL; however, it doesn't work well with
* Zotero, so it is currently commented out -- instead, we just add
* some extra fields and to the "unknown format" case.
$params['rft_val_fmt'] = 'info:ofi/fmt:kev:mtx:journal';
$params['rft.genre'] = 'journal';
$params['rft.jtitle'] = $params['rft.title'];
$params['rft.issn'] = $this->getCleanISSN();
$params['rft.au'] = $this->getPrimaryAuthor();
*/
$params['rft.issn'] = (string)$this->getCleanISSN();
// Including a date in a title-level Journal OpenURL may be too
// limiting -- in some link resolvers, it may cause the exclusion
// of databases if they do not cover the exact date provided!
unset($params['rft.date']);
// If we're working with the SFX resolver, we should add a
// special parameter to ensure that electronic holdings links
// are shown even though no specific date or issue is specified:
if (isset($this->mainConfig->OpenURL->resolver)
&& strtolower($this->mainConfig->OpenURL->resolver) == 'sfx'
) {
$params['sfx.ignore_date_threshold'] = 1;
}
return $params;
}
/**
* Get the OpenURL parameters to represent this record (useful for the
* title attribute of a COinS span tag).
*
* @param bool $overrideSupportsOpenUrl Flag to override checking
* supportsOpenUrl() (default is false)
*
* @return string OpenURL parameters.
*/
public function getOpenUrl($overrideSupportsOpenUrl = false)
{
// stop here if this record does not support OpenURLs
if (!$overrideSupportsOpenUrl && !$this->supportsOpenUrl()) {
return false;
}
// Set up parameters based on the format of the record:
$format = $this->getOpenUrlFormat();
$method = "get{$format}OpenUrlParams";
if (method_exists($this, $method)) {
$params = $this->$method();
} else {
$params = $this->getUnknownFormatOpenUrlParams($format);
}
// Assemble the URL:
return http_build_query($params);
}
/**
* Get the OpenURL parameters to represent this record for COinS even if
* supportsOpenUrl() is false for this RecordDriver.
*
* @return string OpenURL parameters.
*/
public function getCoinsOpenUrl()
{
return $this->getOpenUrl($this->supportsCoinsOpenUrl());
}
/**
* Get an array of physical descriptions of the item.
*
* @return array
*/
public function getPhysicalDescriptions()
{
return isset($this->fields['physical']) ?
$this->fields['physical'] : [];
}
/**
* Get the item's place of publication.
*
* @return array
*/
public function getPlacesOfPublication()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get an array of playing times for the record (if applicable).
*
* @return array
*/
public function getPlayingTimes()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get an array of previous titles for the record.
*
* @return array
*/
public function getPreviousTitles()
{
return isset($this->fields['title_old']) ?
$this->fields['title_old'] : [];
}
/**
* Get the main author of the record.
*
* @return string
*/
public function getPrimaryAuthor()
{
$authors = $this->getPrimaryAuthors();
return isset($authors[0]) ? $authors[0] : '';
}
/**
* Get the main authors of the record.
*
* @return array
*/
public function getPrimaryAuthors()
{
return isset($this->fields['author'])
? (array) $this->fields['author'] : [];
}
/**
* Get an array of all main authors roles (complementing
* getSecondaryAuthorsRoles()).
*
* @return array
*/
public function getPrimaryAuthorsRoles()
{
return isset($this->fields['author_role']) ?
$this->fields['author_role'] : [];
}
/**
* Get credits of people involved in production of the item.
*
* @return array
*/
public function getProductionCredits()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get the publication dates of the record. See also getDateSpan().
*
* @return array
*/
public function getPublicationDates()
{
return isset($this->fields['publishDate']) ?
$this->fields['publishDate'] : [];
}
/**
* Get human readable publication dates for display purposes (may not be suitable
* for computer processing -- use getPublicationDates() for that).
*
* @return array
*/
public function getHumanReadablePublicationDates()
{
return $this->getPublicationDates();
}
/**
* Get an array of publication detail lines combining information from
* getPublicationDates(), getPublishers() and getPlacesOfPublication().
*
* @return array
*/
public function getPublicationDetails()
{
$places = $this->getPlacesOfPublication();
$names = $this->getPublishers();
$dates = $this->getHumanReadablePublicationDates();
$i = 0;
$retval = [];
while (isset($places[$i]) || isset($names[$i]) || isset($dates[$i])) {
// Build objects to represent each set of data; these will
// transform seamlessly into strings in the view layer.
$retval[] = new Response\PublicationDetails(
isset($places[$i]) ? $places[$i] : '',
isset($names[$i]) ? $names[$i] : '',
isset($dates[$i]) ? $dates[$i] : ''
);
$i++;
}
return $retval;
}
/**
* Get an array of publication frequency information.
*
* @return array
*/
public function getPublicationFrequency()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get the publishers of the record.
*
* @return array
*/
public function getPublishers()
{
return isset($this->fields['publisher']) ?
$this->fields['publisher'] : [];
}
/**
* Get an array of information about record history, obtained in real-time
* from the ILS.
*
* @return array
*/
public function getRealTimeHistory()
{
// Not supported by the Solr index -- implement in child classes.
return [];
}
/**
* Get an array of information about record holdings, obtained in real-time
* from the ILS.
*
* @return array
*/
public function getRealTimeHoldings()
{
// Not supported by the Solr index -- implement in child classes.
return ['holdings' => []];
}
/**
* Get an array of strings describing relationships to other items.
*
* @return array
*/
public function getRelationshipNotes()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get an array of all secondary authors (complementing getPrimaryAuthors()).
*
* @return array
*/
public function getSecondaryAuthors()
{
return isset($this->fields['author2']) ?
$this->fields['author2'] : [];
}
/**
* Get an array of all secondary authors roles (complementing
* getPrimaryAuthorsRoles()).
*
* @return array
*/
public function getSecondaryAuthorsRoles()
{
return isset($this->fields['author2_role']) ?
$this->fields['author2_role'] : [];
}
/**
* Get an array of all series names containing the record. Array entries may
* be either the name string, or an associative array with 'name' and 'number'
* keys.
*
* @return array
*/
public function getSeries()
{
// Only use the contents of the series2 field if the series field is empty
if (isset($this->fields['series']) && !empty($this->fields['series'])) {
return $this->fields['series'];
}
return isset($this->fields['series2']) ?
$this->fields['series2'] : [];
}
/**
* Get the short (pre-subtitle) title of the record.
*
* @return string
*/
public function getShortTitle()
{
return isset($this->fields['title_short']) ?
$this->fields['title_short'] : '';
}
/**
* Get the item's source.
*
* @return string
*/
public function getSource()
{
// Not supported in base class:
return '';
}
/**
* Get the subtitle of the record.
*
* @return string
*/
public function getSubtitle()
{
return isset($this->fields['title_sub']) ?
$this->fields['title_sub'] : '';
}
/**
* Get an array of technical details on the item represented by the record.
*
* @return array
*/
public function getSystemDetails()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get an array of summary strings for the record.
*
* @return array
*/
public function getSummary()
{
// We need to return an array, so if we have a description, turn it into an
// array as needed (it should be a flat string according to the default
// schema, but we might as well support the array case just to be on the safe
// side:
if (isset($this->fields['description'])
&& !empty($this->fields['description'])
) {
return is_array($this->fields['description'])
? $this->fields['description'] : [$this->fields['description']];
}
// If we got this far, no description was found:
return [];
}
/**
* Get an array of note about the record's target audience.
*
* @return array
*/
public function getTargetAudienceNotes()
{
// Not currently stored in the Solr index
return [];
}
/**
* Returns one of three things: a full URL to a thumbnail preview of the record
* if an image is available in an external system; an array of parameters to
* send to VuFind's internal cover generator if no fixed URL exists; or false
* if no thumbnail can be generated.
*
* @param string $size Size of thumbnail (small, medium or large -- small is
* default).
*
* @return string|array|bool
*/
public function getThumbnail($size = 'small')
{
if (isset($this->fields['thumbnail']) && $this->fields['thumbnail']) {
return $this->fields['thumbnail'];
}
$arr = [
'author' => mb_substr($this->getPrimaryAuthor(), 0, 300, 'utf-8'),
'callnumber' => $this->getCallNumber(),
'size' => $size,
'title' => mb_substr($this->getTitle(), 0, 300, 'utf-8'),
'recordid' => $this->getUniqueID(),
'source' => $this->getSourceIdentifier(),
];
if ($isbn = $this->getCleanISBN()) {
$arr['isbn'] = $isbn;
}
if ($issn = $this->getCleanISSN()) {
$arr['issn'] = $issn;
}
if ($oclc = $this->getCleanOCLCNum()) {
$arr['oclc'] = $oclc;
}
if ($upc = $this->getCleanUPC()) {
$arr['upc'] = $upc;
}
// If an ILS driver has injected extra details, check for IDs in there
// to fill gaps:
if ($ilsDetails = $this->getExtraDetail('ils_details')) {
foreach (['isbn', 'issn', 'oclc', 'upc'] as $key) {
if (!isset($arr[$key]) && isset($ilsDetails[$key])) {
$arr[$key] = $ilsDetails[$key];
}
}
}
return $arr;
}
/**
* Get the full title of the record.
*
* @return string
*/
public function getTitle()
{
return isset($this->fields['title']) ?
$this->fields['title'] : '';
}
/**
* Get the text of the part/section portion of the title.
*
* @return string
*/
public function getTitleSection()
{
// Not currently stored in the Solr index
return null;
}
/**
* Get the statement of responsibility that goes with the title (i.e. "by John
* Smith").
*
* @return string
*/
public function getTitleStatement()
{
// Not currently stored in the Solr index
return null;
}
/**
* Get an array of lines from the table of contents.
*
* @return array
*/
public function getTOC()
{
return isset($this->fields['contents'])
? $this->fields['contents'] : [];
}
/**
* Get hierarchical place names
*
* @return array
*/
public function getHierarchicalPlaceNames()
{
// Not currently stored in the Solr index
return [];
}
/**
* Get the UPC number(s) of the record.
*
* @return array
*/
public function getUPC()
{
return isset($this->fields['upc_str_mv']) ?
$this->fields['upc_str_mv'] : [];
}
/**
* Return an array of associative URL arrays with one or more of the following
* keys:
*
* <li>
* <ul>desc: URL description text to display (optional)</ul>
* <ul>url: fully-formed URL (required if 'route' is absent)</ul>
* <ul>route: VuFind route to build URL with (required if 'url' is absent)</ul>
* <ul>routeParams: Parameters for route (optional)</ul>
* <ul>queryString: Query params to append after building route (optional)</ul>
* </li>
*
* @return array
*/
public function getURLs()
{
// If non-empty, map internal URL array to expected return format;
// otherwise, return empty array:
if (isset($this->fields['url']) && is_array($this->fields['url'])) {
$filter = function ($url) {
return ['url' => $url];
};
return array_map($filter, $this->fields['url']);
}
return [];
}
/**
* Get a hierarchy driver appropriate to the current object. (May be false if
* disabled/unavailable).
*
* @return \VuFind\Hierarchy\Driver\AbstractBase|bool
*/
public function getHierarchyDriver()
{
if (null === $this->hierarchyDriver
&& null !== $this->hierarchyDriverManager
) {
$type = $this->getHierarchyType();
$this->hierarchyDriver = $type
? $this->hierarchyDriverManager->get($type) : false;
}
return $this->hierarchyDriver;
}
/**
* Inject a hierarchy driver plugin manager.
*
* @param \VuFind\Hierarchy\Driver\PluginManager $pm Hierarchy driver manager
*
* @return SolrDefault
*/
public function setHierarchyDriverManager(
\VuFind\Hierarchy\Driver\PluginManager $pm
) {
$this->hierarchyDriverManager = $pm;
return $this;
}
/**
* Get the hierarchy_top_id(s) associated with this item (empty if none).
*
* @return array
*/
public function getHierarchyTopID()
{
return isset($this->fields['hierarchy_top_id'])
? $this->fields['hierarchy_top_id'] : [];
}
/**
* Get the absolute parent title(s) associated with this item (empty if none).
*
* @return array
*/
public function getHierarchyTopTitle()
{
return isset($this->fields['hierarchy_top_title'])
? $this->fields['hierarchy_top_title'] : [];
}
/**
* Get an associative array (id => title) of collections containing this record.
*
* @return array
*/
public function getContainingCollections()
{
// If collections are disabled or this record is not part of a hierarchy, go
// no further....
if (!isset($this->mainConfig->Collections->collections)
|| !$this->mainConfig->Collections->collections
|| !($hierarchyDriver = $this->getHierarchyDriver())
) {
return false;
}
// Initialize some variables needed within the switch below:
$isCollection = $this->isCollection();
$titles = $ids = [];
// Check config setting for what constitutes a collection, act accordingly:
switch ($hierarchyDriver->getCollectionLinkType()) {
case 'All':
if (isset($this->fields['hierarchy_parent_title'])
&& isset($this->fields['hierarchy_parent_id'])
) {
$titles = $this->fields['hierarchy_parent_title'];
$ids = $this->fields['hierarchy_parent_id'];
}
break;
case 'Top':
if (isset($this->fields['hierarchy_top_title'])
&& isset($this->fields['hierarchy_top_id'])
) {
foreach ($this->fields['hierarchy_top_id'] as $i => $topId) {
// Don't mark an item as its own parent -- filter out parent
// collections whose IDs match that of the current collection.
if (!$isCollection
|| $topId !== $this->fields['is_hierarchy_id']
) {
$ids[] = $topId;
$titles[] = $this->fields['hierarchy_top_title'][$i];
}
}
}
break;
}
// Map the titles and IDs to a useful format:
$c = count($ids);
$retVal = [];
for ($i = 0; $i < $c; $i++) {
$retVal[$ids[$i]] = $titles[$i];
}
return $retVal;
}
/**
* Get the value of whether or not this is a collection level record
*
* NOTE: \VuFind\Hierarchy\TreeDataFormatter\AbstractBase::isCollection()
* duplicates some of this logic.
*
* @return bool
*/
public function isCollection()
{
if (!($hierarchyDriver = $this->getHierarchyDriver())) {
// Not a hierarchy type record
return false;
}
// Check config setting for what constitutes a collection
switch ($hierarchyDriver->getCollectionLinkType()) {
case 'All':
return (isset($this->fields['is_hierarchy_id']));
case 'Top':
return isset($this->fields['is_hierarchy_title'])
&& isset($this->fields['is_hierarchy_id'])
&& in_array(
$this->fields['is_hierarchy_id'],
$this->fields['hierarchy_top_id']
);
default:
// Default to not be a collection level record
return false;
}
}
/**
* Get a list of hierarchy trees containing this record.
*
* @param string $hierarchyID The hierarchy to get the tree for
*
* @return mixed An associative array of hierarchy trees on success
* (id => title), false if no hierarchies found
*/
public function getHierarchyTrees($hierarchyID = false)
{
$hierarchyDriver = $this->getHierarchyDriver();
if ($hierarchyDriver && $hierarchyDriver->showTree()) {
return $hierarchyDriver->getTreeRenderer($this)
->getTreeList($hierarchyID);
}
return false;
}
/**
* Get the Hierarchy Type (false if none)
*
* @return string|bool
*/
public function getHierarchyType()
{
if (isset($this->fields['hierarchy_top_id'])) {
$hierarchyType = isset($this->fields['hierarchytype'])
? $this->fields['hierarchytype'] : false;
if (!$hierarchyType) {
$hierarchyType = isset($this->mainConfig->Hierarchy->driver)
? $this->mainConfig->Hierarchy->driver : false;
}
return $hierarchyType;
}
return false;
}
/**
* Return the unique identifier of this record within the Solr index;
* useful for retrieving additional information (like tags and user
* comments) from the external MySQL database.
*
* @return string Unique identifier.
*/
public function getUniqueID()
{
if (!isset($this->fields['id'])) {
throw new \Exception('ID not set!');
}
return $this->fields['id'];
}
/**
* Return an XML representation of the record using the specified format.
* Return false if the format is unsupported.
*
* @param string $format Name of format to use (corresponds with OAI-PMH
* metadataPrefix parameter).
* @param string $baseUrl Base URL of host containing VuFind (optional;
* may be used to inject record URLs into XML when appropriate).
* @param RecordLink $recordLink Record link helper (optional; may be used to
* inject record URLs into XML when appropriate).
*
* @return mixed XML, or false if format unsupported.
*/
public function getXML($format, $baseUrl = null, $recordLink = null)
{
// For OAI-PMH Dublin Core, produce the necessary XML:
if ($format == 'oai_dc') {
$dc = 'http://purl.org/dc/elements/1.1/';
$xml = new \SimpleXMLElement(
'<oai_dc:dc '
. 'xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" '
. 'xmlns:dc="' . $dc . '" '
. 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" '
. 'xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ '
. 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd" />'
);
$xml->addChild('title', htmlspecialchars($this->getTitle()), $dc);
$authors = $this->getDeduplicatedAuthors();
foreach ($authors as $list) {
foreach ((array)$list as $author) {
$xml->addChild('creator', htmlspecialchars($author), $dc);
}
}
foreach ($this->getLanguages() as $lang) {
$xml->addChild('language', htmlspecialchars($lang), $dc);
}
foreach ($this->getPublishers() as $pub) {
$xml->addChild('publisher', htmlspecialchars($pub), $dc);
}
foreach ($this->getPublicationDates() as $date) {
$xml->addChild('date', htmlspecialchars($date), $dc);
}
foreach ($this->getAllSubjectHeadings() as $subj) {
$xml->addChild(
'subject', htmlspecialchars(implode(' -- ', $subj)), $dc
);
}
if (null !== $baseUrl && null !== $recordLink) {
$url = $baseUrl . $recordLink->getUrl($this);
$xml->addChild('identifier', $url, $dc);
}
return $xml->asXml();
}
// Unsupported format:
return false;
}
/**
* Get an array of strings representing citation formats supported
* by this record's data (empty if none). For possible legal values,
* see /application/themes/root/helpers/Citation.php, getCitation()
* method.
*
* @return array Strings representing citation formats.
*/
protected function getSupportedCitationFormats()
{
return ['APA', 'Chicago', 'MLA'];
}
/**
* Get the title of the item that contains this record (i.e. MARC 773s of a
* journal).
*
* @return string
*/
public function getContainerTitle()
{
return isset($this->fields['container_title'])
? $this->fields['container_title'] : '';
}
/**
* Get the volume of the item that contains this record (i.e. MARC 773v of a
* journal).
*
* @return string
*/
public function getContainerVolume()
{
return isset($this->fields['container_volume'])
? $this->fields['container_volume'] : '';
}
/**
* Get the issue of the item that contains this record (i.e. MARC 773l of a
* journal).
*
* @return string
*/
public function getContainerIssue()
{
return isset($this->fields['container_issue'])
? $this->fields['container_issue'] : '';
}
/**
* Get the start page of the item that contains this record (i.e. MARC 773q of a
* journal).
*
* @return string
*/
public function getContainerStartPage()
{
return isset($this->fields['container_start_page'])
? $this->fields['container_start_page'] : '';
}
/**
* Get the end page of the item that contains this record.
*
* @return string
*/
public function getContainerEndPage()
{
// not currently supported by Solr index:
return '';
}
/**
* Get a full, free-form reference to the context of the item that contains this
* record (i.e. volume, year, issue, pages).
*
* @return string
*/
public function getContainerReference()
{
return isset($this->fields['container_reference'])
? $this->fields['container_reference'] : '';
}
/**
* Get a sortable title for the record (i.e. no leading articles).
*
* @return string
*/
public function getSortTitle()
{
return isset($this->fields['title_sort'])
? $this->fields['title_sort'] : parent::getSortTitle();
}
/**
* Get schema.org type mapping, an array of sub-types of
* http://schema.org/CreativeWork, defaulting to CreativeWork
* itself if nothing else matches.
*
* @return array
*/
public function getSchemaOrgFormatsArray()
{
$types = [];
foreach ($this->getFormats() as $format) {
switch ($format) {
case 'Book':
case 'eBook':
$types['Book'] = 1;
break;
case 'Video':
case 'VHS':
$types['Movie'] = 1;
break;
case 'Photo':
$types['Photograph'] = 1;
break;
case 'Map':
$types['Map'] = 1;
break;
case 'Audio':
$types['MusicAlbum'] = 1;
break;
default:
$types['CreativeWork'] = 1;
}
}
return array_keys($types);
}
/**
* Get schema.org type mapping, expected to be a space-delimited string of
* sub-types of http://schema.org/CreativeWork, defaulting to CreativeWork
* itself if nothing else matches.
*
* @return string
*/
public function getSchemaOrgFormats()
{
return implode(' ', $this->getSchemaOrgFormatsArray());
}
/**
* Get information on records deduplicated with this one
*
* @return array Array keyed by source id containing record id
*/
public function getDedupData()
{
return isset($this->fields['dedup_data'])
? $this->fields['dedup_data']
: [];
}
/**
* Attach a Search Results Plugin Manager connection and related logic to
* the driver
*
* @param \VuFindSearch\Service $service Search Service Manager
*
* @return void
*/
public function attachSearchService(\VuFindSearch\Service $service)
{
$this->searchService = $service;
}
/**
* Get the number of child records belonging to this record
*
* @return int Number of records
*/
public function getChildRecordCount()
{
// Shortcut: if this record is not the top record, let's not find out the
// count. This assumes that contained records cannot contain more records.
if (!$this->containerLinking
|| empty($this->fields['is_hierarchy_id'])
|| null === $this->searchService
) {
return 0;
}
$safeId = addcslashes($this->fields['is_hierarchy_id'], '"');
$query = new \VuFindSearch\Query\Query(
'hierarchy_parent_id:"' . $safeId . '"'
);
// Disable highlighting for efficiency; not needed here:
$params = new \VuFindSearch\ParamBag(['hl' => ['false']]);
return $this->searchService->search('Solr', $query, 0, 0, $params)
->getTotal();
}
/**
* Get the container record id.
*
* @return string Container record id (empty string if none)
*/
public function getContainerRecordID()
{
return $this->containerLinking
&& !empty($this->fields['hierarchy_parent_id'])
? $this->fields['hierarchy_parent_id'][0] : '';
}
/**
* Get the bbox-geo variable.
*
* @return array
*/
public function getGeoLocation()
{
return isset($this->fields['long_lat'])
? $this->fields['long_lat'] : [];
}
/**
* Get the map display (lat/lon) coordinates
*
* @return array
*/
public function getDisplayCoordinates()
{
return isset($this->fields['long_lat_display'])
? $this->fields['long_lat_display'] : [];
}
/**
* Get the map display (lat/lon) labels
*
* @return array
*/
public function getCoordinateLabels()
{
return isset($this->fields['long_lat_label'])
? $this->fields['long_lat_label'] : [];
}
}
| 1 | 22,663 | Was this added by accident? It doesn't seem related to Syndetics, and I don't think it should be necessary in core VuFind (but maybe it's related to one of your local customizations). | vufind-org-vufind | php |
@@ -44,6 +44,8 @@ type Config struct {
Manager Manager
Attestor Attestor
AllowUnauthenticatedVerifiers bool
+ AllowedForeignJWTClaims map[string]bool
+ TrustDomain spiffeid.TrustDomain
}
type Handler struct { | 1 | package workload
import (
"context"
"crypto"
"crypto/x509"
"encoding/json"
"errors"
"fmt"
"os"
"time"
"github.com/sirupsen/logrus"
"github.com/spiffe/go-spiffe/v2/proto/spiffe/workload"
"github.com/spiffe/go-spiffe/v2/spiffeid"
"github.com/spiffe/spire/pkg/agent/api/rpccontext"
"github.com/spiffe/spire/pkg/agent/client"
"github.com/spiffe/spire/pkg/agent/manager/cache"
"github.com/spiffe/spire/pkg/common/bundleutil"
"github.com/spiffe/spire/pkg/common/jwtsvid"
"github.com/spiffe/spire/pkg/common/telemetry"
"github.com/spiffe/spire/pkg/common/x509util"
"github.com/spiffe/spire/proto/spire/common"
"github.com/zeebo/errs"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/types/known/structpb"
)
type Manager interface {
SubscribeToCacheChanges(cache.Selectors) cache.Subscriber
MatchingIdentities([]*common.Selector) []cache.Identity
FetchJWTSVID(ctx context.Context, spiffeID spiffeid.ID, audience []string) (*client.JWTSVID, error)
FetchWorkloadUpdate([]*common.Selector) *cache.WorkloadUpdate
}
type Attestor interface {
Attest(ctx context.Context) ([]*common.Selector, error)
}
// Handler implements the Workload API interface
type Config struct {
Manager Manager
Attestor Attestor
AllowUnauthenticatedVerifiers bool
}
type Handler struct {
workload.UnsafeSpiffeWorkloadAPIServer
c Config
}
func New(c Config) *Handler {
return &Handler{
c: c,
}
}
// FetchJWTSVID processes request for a JWT-SVID
func (h *Handler) FetchJWTSVID(ctx context.Context, req *workload.JWTSVIDRequest) (resp *workload.JWTSVIDResponse, err error) {
log := rpccontext.Logger(ctx)
if len(req.Audience) == 0 {
log.Error("Missing required audience parameter")
return nil, status.Error(codes.InvalidArgument, "audience must be specified")
}
if req.SpiffeId != "" {
if _, err := spiffeid.FromString(req.SpiffeId); err != nil {
log.WithField(telemetry.SPIFFEID, req.SpiffeId).WithError(err).Error("Invalid requested SPIFFE ID")
return nil, status.Errorf(codes.InvalidArgument, "invalid requested SPIFFE ID: %v", err)
}
}
selectors, err := h.c.Attestor.Attest(ctx)
if err != nil {
log.WithError(err).Error("Workload attestation failed")
return nil, err
}
var spiffeIDs []spiffeid.ID
identities := h.c.Manager.MatchingIdentities(selectors)
if len(identities) == 0 {
log.WithField(telemetry.Registered, false).Error("No identity issued")
return nil, status.Error(codes.PermissionDenied, "no identity issued")
}
log = log.WithField(telemetry.Registered, true)
for _, identity := range identities {
if req.SpiffeId != "" && identity.Entry.SpiffeId != req.SpiffeId {
continue
}
spiffeID, err := spiffeid.FromString(identity.Entry.SpiffeId)
if err != nil {
log.WithField(telemetry.SPIFFEID, identity.Entry.SpiffeId).WithError(err).Error("Invalid requested SPIFFE ID")
return nil, status.Errorf(codes.InvalidArgument, "invalid requested SPIFFE ID: %v", err)
}
spiffeIDs = append(spiffeIDs, spiffeID)
}
resp = new(workload.JWTSVIDResponse)
for _, id := range spiffeIDs {
loopLog := log.WithField(telemetry.SPIFFEID, id.String())
var svid *client.JWTSVID
svid, err = h.c.Manager.FetchJWTSVID(ctx, id, req.Audience)
if err != nil {
loopLog.WithError(err).Error("Could not fetch JWT-SVID")
return nil, status.Errorf(codes.Unavailable, "could not fetch JWT-SVID: %v", err)
}
resp.Svids = append(resp.Svids, &workload.JWTSVID{
SpiffeId: id.String(),
Svid: svid.Token,
})
ttl := time.Until(svid.ExpiresAt)
loopLog.WithField(telemetry.TTL, ttl.Seconds()).Debug("Fetched JWT SVID")
}
return resp, nil
}
// FetchJWTBundles processes request for JWT bundles
func (h *Handler) FetchJWTBundles(req *workload.JWTBundlesRequest, stream workload.SpiffeWorkloadAPI_FetchJWTBundlesServer) error {
ctx := stream.Context()
log := rpccontext.Logger(ctx)
selectors, err := h.c.Attestor.Attest(ctx)
if err != nil {
log.WithError(err).Error("Workload attestation failed")
return err
}
subscriber := h.c.Manager.SubscribeToCacheChanges(selectors)
defer subscriber.Finish()
for {
select {
case update := <-subscriber.Updates():
if err := sendJWTBundlesResponse(update, stream, log, h.c.AllowUnauthenticatedVerifiers); err != nil {
return err
}
case <-ctx.Done():
return nil
}
}
}
// ValidateJWTSVID processes request for JWT-SVID validation
func (h *Handler) ValidateJWTSVID(ctx context.Context, req *workload.ValidateJWTSVIDRequest) (*workload.ValidateJWTSVIDResponse, error) {
log := rpccontext.Logger(ctx)
if req.Audience == "" {
log.Error("Missing required audience parameter")
return nil, status.Error(codes.InvalidArgument, "audience must be specified")
}
if req.Svid == "" {
log.Error("Missing required svid parameter")
return nil, status.Error(codes.InvalidArgument, "svid must be specified")
}
log = log.WithField(telemetry.Audience, req.Audience)
selectors, err := h.c.Attestor.Attest(ctx)
if err != nil {
log.WithError(err).Error("Workload attestation failed")
return nil, err
}
keyStore := keyStoreFromBundles(h.getWorkloadBundles(selectors))
spiffeID, claims, err := jwtsvid.ValidateToken(ctx, req.Svid, keyStore, []string{req.Audience})
if err != nil {
log.WithError(err).Warn("Failed to validate JWT")
return nil, status.Error(codes.InvalidArgument, err.Error())
}
log.WithField(telemetry.SPIFFEID, spiffeID).Debug("Successfully validated JWT")
s, err := structFromValues(claims)
if err != nil {
log.WithError(err).Error("Error deserializing claims from JWT-SVID")
return nil, status.Error(codes.InvalidArgument, err.Error())
}
return &workload.ValidateJWTSVIDResponse{
SpiffeId: spiffeID,
Claims: s,
}, nil
}
// FetchX509SVID processes request for an x509 SVID
func (h *Handler) FetchX509SVID(_ *workload.X509SVIDRequest, stream workload.SpiffeWorkloadAPI_FetchX509SVIDServer) error {
ctx := stream.Context()
log := rpccontext.Logger(ctx)
// The agent health check currently exercises the Workload API. Since this
// can happen with some frequency, it has a tendency to fill up logs with
// hard-to-filter details if we're not careful (e.g. issue #1537). Only log
// if it is not the agent itself.
quietLogging := rpccontext.CallerPID(ctx) == os.Getpid()
selectors, err := h.c.Attestor.Attest(ctx)
if err != nil {
log.WithError(err).Error("Workload attestation failed")
return err
}
subscriber := h.c.Manager.SubscribeToCacheChanges(selectors)
defer subscriber.Finish()
for {
select {
case update := <-subscriber.Updates():
if err := sendX509SVIDResponse(update, stream, log, quietLogging); err != nil {
return err
}
case <-ctx.Done():
return nil
}
}
}
// FetchX509Bundles processes request for x509 bundles
func (h *Handler) FetchX509Bundles(_ *workload.X509BundlesRequest, stream workload.SpiffeWorkloadAPI_FetchX509BundlesServer) error {
ctx := stream.Context()
log := rpccontext.Logger(ctx)
selectors, err := h.c.Attestor.Attest(ctx)
if err != nil {
log.WithError(err).Error("Workload attestation failed")
return err
}
subscriber := h.c.Manager.SubscribeToCacheChanges(selectors)
defer subscriber.Finish()
for {
select {
case update := <-subscriber.Updates():
err := sendX509BundlesResponse(update, stream, log, h.c.AllowUnauthenticatedVerifiers)
if err != nil {
return err
}
case <-ctx.Done():
return nil
}
}
}
func sendX509BundlesResponse(update *cache.WorkloadUpdate, stream workload.SpiffeWorkloadAPI_FetchX509BundlesServer, log logrus.FieldLogger, allowUnauthenticatedVerifiers bool) error {
if !allowUnauthenticatedVerifiers && !update.HasIdentity() {
log.WithField(telemetry.Registered, false).Error("No identity issued")
return status.Error(codes.PermissionDenied, "no identity issued")
}
resp, err := composeX509BundlesResponse(update)
if err != nil {
log.WithError(err).Error("Could not serialize X509 bundle response")
return status.Errorf(codes.Unavailable, "could not serialize response: %v", err)
}
if err := stream.Send(resp); err != nil {
log.WithError(err).Error("Failed to send X509 bundle response")
return err
}
return nil
}
func composeX509BundlesResponse(update *cache.WorkloadUpdate) (*workload.X509BundlesResponse, error) {
if update.Bundle == nil {
// This should be purely defensive since the cache should always supply
// a bundle.
return nil, errors.New("bundle not available")
}
bundles := make(map[string][]byte)
bundles[update.Bundle.TrustDomainID()] = marshalBundle(update.Bundle.RootCAs())
if update.HasIdentity() {
for _, federatedBundle := range update.FederatedBundles {
bundles[federatedBundle.TrustDomainID()] = marshalBundle(federatedBundle.RootCAs())
}
}
return &workload.X509BundlesResponse{
Bundles: bundles,
}, nil
}
func sendX509SVIDResponse(update *cache.WorkloadUpdate, stream workload.SpiffeWorkloadAPI_FetchX509SVIDServer, log logrus.FieldLogger, quietLogging bool) (err error) {
if len(update.Identities) == 0 {
if !quietLogging {
log.WithField(telemetry.Registered, false).Error("No identity issued")
}
return status.Error(codes.PermissionDenied, "no identity issued")
}
log = log.WithField(telemetry.Registered, true)
resp, err := composeX509SVIDResponse(update)
if err != nil {
log.WithError(err).Error("Could not serialize X.509 SVID response")
return status.Errorf(codes.Unavailable, "could not serialize response: %v", err)
}
if err := stream.Send(resp); err != nil {
log.WithError(err).Error("Failed to send X.509 SVID response")
return err
}
log = log.WithField(telemetry.Count, len(resp.Svids))
// log and emit telemetry on each SVID
// a response has already been sent so nothing is
// blocked on this logic
if !quietLogging {
for i, svid := range resp.Svids {
ttl := time.Until(update.Identities[i].SVID[0].NotAfter)
log.WithFields(logrus.Fields{
telemetry.SPIFFEID: svid.SpiffeId,
telemetry.TTL: ttl.Seconds(),
}).Debug("Fetched X.509 SVID")
}
}
return nil
}
func composeX509SVIDResponse(update *cache.WorkloadUpdate) (*workload.X509SVIDResponse, error) {
resp := new(workload.X509SVIDResponse)
resp.Svids = []*workload.X509SVID{}
resp.FederatedBundles = make(map[string][]byte)
bundle := marshalBundle(update.Bundle.RootCAs())
for td, federatedBundle := range update.FederatedBundles {
resp.FederatedBundles[td.IDString()] = marshalBundle(federatedBundle.RootCAs())
}
for _, identity := range update.Identities {
id := identity.Entry.SpiffeId
keyData, err := x509.MarshalPKCS8PrivateKey(identity.PrivateKey)
if err != nil {
return nil, fmt.Errorf("marshal key for %v: %w", id, err)
}
svid := &workload.X509SVID{
SpiffeId: id,
X509Svid: x509util.DERFromCertificates(identity.SVID),
X509SvidKey: keyData,
Bundle: bundle,
}
resp.Svids = append(resp.Svids, svid)
}
return resp, nil
}
func sendJWTBundlesResponse(update *cache.WorkloadUpdate, stream workload.SpiffeWorkloadAPI_FetchJWTBundlesServer, log logrus.FieldLogger, allowUnauthenticatedVerifiers bool) (err error) {
if !allowUnauthenticatedVerifiers && !update.HasIdentity() {
log.WithField(telemetry.Registered, false).Error("No identity issued")
return status.Error(codes.PermissionDenied, "no identity issued")
}
resp, err := composeJWTBundlesResponse(update)
if err != nil {
log.WithError(err).Error("Could not serialize JWT bundle response")
return status.Errorf(codes.Unavailable, "could not serialize response: %v", err)
}
if err := stream.Send(resp); err != nil {
log.WithError(err).Error("Failed to send JWT bundle response")
return err
}
return nil
}
func composeJWTBundlesResponse(update *cache.WorkloadUpdate) (*workload.JWTBundlesResponse, error) {
if update.Bundle == nil {
// This should be purely defensive since the cache should always supply
// a bundle.
return nil, errors.New("bundle not available")
}
bundles := make(map[string][]byte)
jwksBytes, err := bundleutil.Marshal(update.Bundle, bundleutil.NoX509SVIDKeys(), bundleutil.StandardJWKS())
if err != nil {
return nil, err
}
bundles[update.Bundle.TrustDomainID()] = jwksBytes
if update.HasIdentity() {
for _, federatedBundle := range update.FederatedBundles {
jwksBytes, err := bundleutil.Marshal(federatedBundle, bundleutil.NoX509SVIDKeys(), bundleutil.StandardJWKS())
if err != nil {
return nil, err
}
bundles[federatedBundle.TrustDomainID()] = jwksBytes
}
}
return &workload.JWTBundlesResponse{
Bundles: bundles,
}, nil
}
func (h *Handler) getWorkloadBundles(selectors []*common.Selector) (bundles []*bundleutil.Bundle) {
update := h.c.Manager.FetchWorkloadUpdate(selectors)
if update.Bundle != nil {
bundles = append(bundles, update.Bundle)
}
for _, federatedBundle := range update.FederatedBundles {
bundles = append(bundles, federatedBundle)
}
return bundles
}
func marshalBundle(certs []*x509.Certificate) []byte {
bundle := []byte{}
for _, c := range certs {
bundle = append(bundle, c.Raw...)
}
return bundle
}
func keyStoreFromBundles(bundles []*bundleutil.Bundle) jwtsvid.KeyStore {
trustDomainKeys := make(map[string]map[string]crypto.PublicKey)
for _, bundle := range bundles {
trustDomainKeys[bundle.TrustDomainID()] = bundle.JWTSigningKeys()
}
return jwtsvid.NewKeyStore(trustDomainKeys)
}
func structFromValues(values map[string]interface{}) (*structpb.Struct, error) {
valuesJSON, err := json.Marshal(values)
if err != nil {
return nil, errs.Wrap(err)
}
s := new(structpb.Struct)
if err := protojson.Unmarshal(valuesJSON, s); err != nil {
return nil, errs.Wrap(err)
}
return s, nil
}
| 1 | 17,002 | i know the ergonomics are a little nicer with map[string]bool, but I prefer map[string]struct{} for sets for a few reasons: 1 - optimized storage (not very relevant here) 2 - don't have to think about the conditions where the key exists in the map or if the value could somehow be false | spiffe-spire | go |
@@ -69,6 +69,7 @@ const (
History
Matching
Worker
+ Server
NumServices
)
| 1 | // The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package metrics
import (
"github.com/uber-go/tally/v4"
)
// types used/defined by the package
type (
// MetricName is the name of the metric
MetricName string
// MetricType is the type of the metric
MetricType int
// metricDefinition contains the definition for a metric
metricDefinition struct {
// nolint
metricType MetricType // metric type
metricName MetricName // metric name
metricRollupName MetricName // optional. if non-empty, this name must be used for rolled-up version of this metric
buckets tally.Buckets // buckets if we are emitting histograms
}
// scopeDefinition holds the tag definitions for a scope
scopeDefinition struct {
operation string // 'operation' tag for scope
tags map[string]string // additional tags for scope
}
// ServiceIdx is an index that uniquely identifies the service
ServiceIdx int
)
// MetricTypes which are supported
const (
Counter MetricType = iota
Timer
Gauge
)
// Service names for all services that emit metrics.
const (
Common ServiceIdx = iota
Frontend
History
Matching
Worker
NumServices
)
// Values used for metrics propagation
const (
HistoryWorkflowExecutionCacheLatency = "history_workflow_execution_cache_latency"
)
// Common tags for all services
const (
OperationTagName = "operation"
ServiceRoleTagName = "service_role"
StatsTypeTagName = "stats_type"
CacheTypeTagName = "cache_type"
FailureTagName = "failure"
TaskTypeTagName = "task_type"
QueueTypeTagName = "queue_type"
visibilityTypeTagName = "visibility_type"
httpStatusTagName = "http_status"
)
// This package should hold all the metrics and tags for temporal
const (
HistoryRoleTagValue = "history"
MatchingRoleTagValue = "matching"
FrontendRoleTagValue = "frontend"
AdminRoleTagValue = "admin"
DCRedirectionRoleTagValue = "dc_redirection"
BlobstoreRoleTagValue = "blobstore"
SizeStatsTypeTagValue = "size"
CountStatsTypeTagValue = "count"
MutableStateCacheTypeTagValue = "mutablestate"
EventsCacheTypeTagValue = "events"
standardVisibilityTagValue = "standard_visibility"
advancedVisibilityTagValue = "advanced_visibility"
)
// Common service base metrics
const (
RestartCount = "restarts"
NumGoRoutinesGauge = "num_goroutines"
GoMaxProcsGauge = "gomaxprocs"
MemoryAllocatedGauge = "memory_allocated"
MemoryHeapGauge = "memory_heap"
MemoryHeapIdleGauge = "memory_heapidle"
MemoryHeapInuseGauge = "memory_heapinuse"
MemoryStackGauge = "memory_stack"
NumGCCounter = "memory_num_gc"
GcPauseMsTimer = "memory_gc_pause_ms"
)
// ServiceMetrics are types for common service base metrics
var ServiceMetrics = map[MetricName]MetricType{
RestartCount: Counter,
}
// GoRuntimeMetrics represent the runtime stats from go runtime
var GoRuntimeMetrics = map[MetricName]MetricType{
NumGoRoutinesGauge: Gauge,
GoMaxProcsGauge: Gauge,
MemoryAllocatedGauge: Gauge,
MemoryHeapGauge: Gauge,
MemoryHeapIdleGauge: Gauge,
MemoryHeapInuseGauge: Gauge,
MemoryStackGauge: Gauge,
NumGCCounter: Counter,
GcPauseMsTimer: Timer,
}
// Scopes enum
const (
UnknownScope = iota
// -- Common Operation scopes --
// PersistenceCreateShardScope tracks CreateShard calls made by service to persistence layer
PersistenceCreateShardScope
// PersistenceGetShardScope tracks GetShard calls made by service to persistence layer
PersistenceGetShardScope
// PersistenceUpdateShardScope tracks UpdateShard calls made by service to persistence layer
PersistenceUpdateShardScope
// PersistenceCreateWorkflowExecutionScope tracks CreateWorkflowExecution calls made by service to persistence layer
PersistenceCreateWorkflowExecutionScope
// PersistenceGetWorkflowExecutionScope tracks GetWorkflowExecution calls made by service to persistence layer
PersistenceGetWorkflowExecutionScope
// PersistenceUpdateWorkflowExecutionScope tracks UpdateWorkflowExecution calls made by service to persistence layer
PersistenceUpdateWorkflowExecutionScope
// PersistenceConflictResolveWorkflowExecutionScope tracks ConflictResolveWorkflowExecution calls made by service to persistence layer
PersistenceConflictResolveWorkflowExecutionScope
// PersistenceResetWorkflowExecutionScope tracks ResetWorkflowExecution calls made by service to persistence layer
PersistenceResetWorkflowExecutionScope
// PersistenceDeleteWorkflowExecutionScope tracks DeleteWorkflowExecution calls made by service to persistence layer
PersistenceDeleteWorkflowExecutionScope
// PersistenceDeleteCurrentWorkflowExecutionScope tracks DeleteCurrentWorkflowExecution calls made by service to persistence layer
PersistenceDeleteCurrentWorkflowExecutionScope
// PersistenceGetCurrentExecutionScope tracks GetCurrentExecution calls made by service to persistence layer
PersistenceGetCurrentExecutionScope
// PersistenceListConcreteExecutionsScope tracks ListConcreteExecutions calls made by service to persistence layer
PersistenceListConcreteExecutionsScope
// PersistenceAddTasksScope tracks AddTasks calls made by service to persistence layer
PersistenceAddTasksScope
// PersistenceGetTransferTaskScope tracks GetTransferTask calls made by service to persistence layer
PersistenceGetTransferTaskScope
// PersistenceGetTransferTasksScope tracks GetTransferTasks calls made by service to persistence layer
PersistenceGetTransferTasksScope
// PersistenceCompleteTransferTaskScope tracks CompleteTransferTasks calls made by service to persistence layer
PersistenceCompleteTransferTaskScope
// PersistenceRangeCompleteTransferTaskScope tracks CompleteTransferTasks calls made by service to persistence layer
PersistenceRangeCompleteTransferTaskScope
// PersistenceGetVisibilityTaskScope tracks GetVisibilityTask calls made by service to persistence layer
PersistenceGetVisibilityTaskScope
// PersistenceGetVisibilityTasksScope tracks GetVisibilityTasks calls made by service to persistence layer
PersistenceGetVisibilityTasksScope
// PersistenceCompleteVisibilityTaskScope tracks CompleteVisibilityTasks calls made by service to persistence layer
PersistenceCompleteVisibilityTaskScope
// PersistenceRangeCompleteVisibilityTaskScope tracks CompleteVisibilityTasks calls made by service to persistence layer
PersistenceRangeCompleteVisibilityTaskScope
// PersistenceGetReplicationTaskScope tracks GetReplicationTask calls made by service to persistence layer
PersistenceGetReplicationTaskScope
// PersistenceGetReplicationTasksScope tracks GetReplicationTasks calls made by service to persistence layer
PersistenceGetReplicationTasksScope
// PersistenceCompleteReplicationTaskScope tracks CompleteReplicationTasks calls made by service to persistence layer
PersistenceCompleteReplicationTaskScope
// PersistenceRangeCompleteReplicationTaskScope tracks RangeCompleteReplicationTasks calls made by service to persistence layer
PersistenceRangeCompleteReplicationTaskScope
// PersistencePutReplicationTaskToDLQScope tracks PersistencePutReplicationTaskToDLQScope calls made by service to persistence layer
PersistencePutReplicationTaskToDLQScope
// PersistenceGetReplicationTasksFromDLQScope tracks PersistenceGetReplicationTasksFromDLQScope calls made by service to persistence layer
PersistenceGetReplicationTasksFromDLQScope
// PersistenceDeleteReplicationTaskFromDLQScope tracks PersistenceDeleteReplicationTaskFromDLQScope calls made by service to persistence layer
PersistenceDeleteReplicationTaskFromDLQScope
// PersistenceRangeDeleteReplicationTaskFromDLQScope tracks PersistenceRangeDeleteReplicationTaskFromDLQScope calls made by service to persistence layer
PersistenceRangeDeleteReplicationTaskFromDLQScope
// PersistenceGetTimerTaskScope tracks GetTimerTask calls made by service to persistence layer
PersistenceGetTimerTaskScope
// PersistenceGetTimerTasksScope tracks GetTimerTasks calls made by service to persistence layer
PersistenceGetTimerTasksScope
// PersistenceCompleteTimerTaskScope tracks CompleteTimerTasks calls made by service to persistence layer
PersistenceCompleteTimerTaskScope
// PersistenceRangeCompleteTimerTaskScope tracks CompleteTimerTasks calls made by service to persistence layer
PersistenceRangeCompleteTimerTaskScope
// PersistenceCreateTaskScope tracks CreateTask calls made by service to persistence layer
PersistenceCreateTaskScope
// PersistenceGetTasksScope tracks GetTasks calls made by service to persistence layer
PersistenceGetTasksScope
// PersistenceCompleteTaskScope tracks CompleteTask calls made by service to persistence layer
PersistenceCompleteTaskScope
// PersistenceCompleteTasksLessThanScope is the metric scope for persistence.TaskManager.PersistenceCompleteTasksLessThan API
PersistenceCompleteTasksLessThanScope
// PersistenceLeaseTaskQueueScope tracks LeaseTaskQueue calls made by service to persistence layer
PersistenceLeaseTaskQueueScope
// PersistenceUpdateTaskQueueScope tracks PersistenceUpdateTaskQueueScope calls made by service to persistence layer
PersistenceUpdateTaskQueueScope
// PersistenceListTaskQueueScope is the metric scope for persistence.TaskManager.ListTaskQueue API
PersistenceListTaskQueueScope
// PersistenceDeleteTaskQueueScope is the metric scope for persistence.TaskManager.DeleteTaskQueue API
PersistenceDeleteTaskQueueScope
// PersistenceAppendHistoryEventsScope tracks AppendHistoryEvents calls made by service to persistence layer
PersistenceAppendHistoryEventsScope
// PersistenceGetWorkflowExecutionHistoryScope tracks GetWorkflowExecutionHistory calls made by service to persistence layer
PersistenceGetWorkflowExecutionHistoryScope
// PersistenceDeleteWorkflowExecutionHistoryScope tracks DeleteWorkflowExecutionHistory calls made by service to persistence layer
PersistenceDeleteWorkflowExecutionHistoryScope
// PersistenceInitializeSystemNamespaceScope tracks InitializeSystemNamespaceScope calls made by service to persistence layer
PersistenceInitializeSystemNamespaceScope
// PersistenceCreateNamespaceScope tracks CreateNamespace calls made by service to persistence layer
PersistenceCreateNamespaceScope
// PersistenceGetNamespaceScope tracks GetNamespace calls made by service to persistence layer
PersistenceGetNamespaceScope
// PersistenceUpdateNamespaceScope tracks UpdateNamespace calls made by service to persistence layer
PersistenceUpdateNamespaceScope
// PersistenceDeleteNamespaceScope tracks DeleteNamespace calls made by service to persistence layer
PersistenceDeleteNamespaceScope
// PersistenceDeleteNamespaceByNameScope tracks DeleteNamespaceByName calls made by service to persistence layer
PersistenceDeleteNamespaceByNameScope
// PersistenceListNamespaceScope tracks DeleteNamespaceByName calls made by service to persistence layer
PersistenceListNamespaceScope
// PersistenceGetMetadataScope tracks DeleteNamespaceByName calls made by service to persistence layer
PersistenceGetMetadataScope
// VisibilityPersistenceRecordWorkflowExecutionStartedScope tracks RecordWorkflowExecutionStarted calls made by service to visibility persistence layer
VisibilityPersistenceRecordWorkflowExecutionStartedScope
// VisibilityPersistenceRecordWorkflowExecutionClosedScope tracks RecordWorkflowExecutionClosed calls made by service to visibility persistence layer
VisibilityPersistenceRecordWorkflowExecutionClosedScope
// VisibilityPersistenceUpsertWorkflowExecutionScope tracks UpsertWorkflowExecution calls made by service to persistence visibility layer
VisibilityPersistenceUpsertWorkflowExecutionScope
// VisibilityPersistenceListOpenWorkflowExecutionsScope tracks ListOpenWorkflowExecutions calls made by service to visibility persistence layer
VisibilityPersistenceListOpenWorkflowExecutionsScope
// VisibilityPersistenceListClosedWorkflowExecutionsScope tracks ListClosedWorkflowExecutions calls made by service to visibility persistence layer
VisibilityPersistenceListClosedWorkflowExecutionsScope
// VisibilityPersistenceListOpenWorkflowExecutionsByTypeScope tracks ListOpenWorkflowExecutionsByType calls made by service to visibility persistence layer
VisibilityPersistenceListOpenWorkflowExecutionsByTypeScope
// VisibilityPersistenceListClosedWorkflowExecutionsByTypeScope tracks ListClosedWorkflowExecutionsByType calls made by service to visibility persistence layer
VisibilityPersistenceListClosedWorkflowExecutionsByTypeScope
// VisibilityPersistenceListOpenWorkflowExecutionsByWorkflowIDScope tracks ListOpenWorkflowExecutionsByWorkflowID calls made by service to visibility persistence layer
VisibilityPersistenceListOpenWorkflowExecutionsByWorkflowIDScope
// VisibilityPersistenceListClosedWorkflowExecutionsByWorkflowIDScope tracks ListClosedWorkflowExecutionsByWorkflowID calls made by service to visibility persistence layer
VisibilityPersistenceListClosedWorkflowExecutionsByWorkflowIDScope
// VisibilityPersistenceListClosedWorkflowExecutionsByStatusScope tracks ListClosedWorkflowExecutionsByStatus calls made by service to visibility persistence layer
VisibilityPersistenceListClosedWorkflowExecutionsByStatusScope
// VisibilityPersistenceDeleteWorkflowExecutionScope tracks DeleteWorkflowExecutions calls made by service to visibility persistence layer
VisibilityPersistenceDeleteWorkflowExecutionScope
// VisibilityPersistenceListWorkflowExecutionsScope tracks ListWorkflowExecutions calls made by service to visibility persistence layer
VisibilityPersistenceListWorkflowExecutionsScope
// VisibilityPersistenceScanWorkflowExecutionsScope tracks ScanWorkflowExecutions calls made by service to visibility persistence layer
VisibilityPersistenceScanWorkflowExecutionsScope
// VisibilityPersistenceCountWorkflowExecutionsScope tracks CountWorkflowExecutions calls made by service to visibility persistence layer
VisibilityPersistenceCountWorkflowExecutionsScope
// PersistenceEnqueueMessageScope tracks Enqueue calls made by service to persistence layer
PersistenceEnqueueMessageScope
// PersistenceEnqueueMessageToDLQScope tracks Enqueue DLQ calls made by service to persistence layer
PersistenceEnqueueMessageToDLQScope
// PersistenceReadQueueMessagesScope tracks ReadMessages calls made by service to persistence layer
PersistenceReadQueueMessagesScope
// PersistenceReadQueueMessagesFromDLQScope tracks ReadMessagesFromDLQ calls made by service to persistence layer
PersistenceReadQueueMessagesFromDLQScope
// PersistenceDeleteQueueMessagesScope tracks DeleteMessages calls made by service to persistence layer
PersistenceDeleteQueueMessagesScope
// PersistenceDeleteQueueMessageFromDLQScope tracks DeleteMessageFromDLQ calls made by service to persistence layer
PersistenceDeleteQueueMessageFromDLQScope
// PersistenceRangeDeleteMessagesFromDLQScope tracks RangeDeleteMessagesFromDLQ calls made by service to persistence layer
PersistenceRangeDeleteMessagesFromDLQScope
// PersistenceUpdateAckLevelScope tracks UpdateAckLevel calls made by service to persistence layer
PersistenceUpdateAckLevelScope
// PersistenceGetAckLevelScope tracks GetAckLevel calls made by service to persistence layer
PersistenceGetAckLevelScope
// PersistenceUpdateDLQAckLevelScope tracks UpdateDLQAckLevel calls made by service to persistence layer
PersistenceUpdateDLQAckLevelScope
// PersistenceGetDLQAckLevelScope tracks GetDLQAckLevel calls made by service to persistence layer
PersistenceGetDLQAckLevelScope
// PersistenceGetClusterMetadataScope tracks GetClusterMetadata calls made by service to persistence layer
PersistenceGetClusterMetadataScope
// PersistenceSaveClusterMetadataScope tracks SaveClusterMetadata calls made by service to persistence layer
PersistenceSaveClusterMetadataScope
// PersistenceDeleteClusterMetadataScope tracks DeleteClusterMetadata calls made by service to persistence layer
PersistenceDeleteClusterMetadataScope
// PersistenceUpsertClusterMembershipScope tracks UpsertClusterMembership calls made by service to persistence layer
PersistenceUpsertClusterMembershipScope
// PersistencePruneClusterMembershipScope tracks PruneClusterMembership calls made by service to persistence layer
PersistencePruneClusterMembershipScope
// PersistenceGetClusterMembersScope tracks GetClusterMembers calls made by service to persistence layer
PersistenceGetClusterMembersScope
// HistoryClientStartWorkflowExecutionScope tracks RPC calls to history service
HistoryClientStartWorkflowExecutionScope
// HistoryClientRecordActivityTaskHeartbeatScope tracks RPC calls to history service
HistoryClientRecordActivityTaskHeartbeatScope
// HistoryClientRespondWorkflowTaskCompletedScope tracks RPC calls to history service
HistoryClientRespondWorkflowTaskCompletedScope
// HistoryClientRespondWorkflowTaskFailedScope tracks RPC calls to history service
HistoryClientRespondWorkflowTaskFailedScope
// HistoryClientRespondActivityTaskCompletedScope tracks RPC calls to history service
HistoryClientRespondActivityTaskCompletedScope
// HistoryClientRespondActivityTaskFailedScope tracks RPC calls to history service
HistoryClientRespondActivityTaskFailedScope
// HistoryClientRespondActivityTaskCanceledScope tracks RPC calls to history service
HistoryClientRespondActivityTaskCanceledScope
// HistoryClientGetMutableStateScope tracks RPC calls to history service
HistoryClientGetMutableStateScope
// HistoryClientPollMutableStateScope tracks RPC calls to history service
HistoryClientPollMutableStateScope
// HistoryClientResetStickyTaskQueueScope tracks RPC calls to history service
HistoryClientResetStickyTaskQueueScope
// HistoryClientDescribeWorkflowExecutionScope tracks RPC calls to history service
HistoryClientDescribeWorkflowExecutionScope
// HistoryClientRecordWorkflowTaskStartedScope tracks RPC calls to history service
HistoryClientRecordWorkflowTaskStartedScope
// HistoryClientRecordActivityTaskStartedScope tracks RPC calls to history service
HistoryClientRecordActivityTaskStartedScope
// HistoryClientRequestCancelWorkflowExecutionScope tracks RPC calls to history service
HistoryClientRequestCancelWorkflowExecutionScope
// HistoryClientSignalWorkflowExecutionScope tracks RPC calls to history service
HistoryClientSignalWorkflowExecutionScope
// HistoryClientSignalWithStartWorkflowExecutionScope tracks RPC calls to history service
HistoryClientSignalWithStartWorkflowExecutionScope
// HistoryClientRemoveSignalMutableStateScope tracks RPC calls to history service
HistoryClientRemoveSignalMutableStateScope
// HistoryClientTerminateWorkflowExecutionScope tracks RPC calls to history service
HistoryClientTerminateWorkflowExecutionScope
// HistoryClientResetWorkflowExecutionScope tracks RPC calls to history service
HistoryClientResetWorkflowExecutionScope
// HistoryClientScheduleWorkflowTaskScope tracks RPC calls to history service
HistoryClientScheduleWorkflowTaskScope
// HistoryClientRecordChildExecutionCompletedScope tracks RPC calls to history service
HistoryClientRecordChildExecutionCompletedScope
// HistoryClientReplicateEventsV2Scope tracks RPC calls to history service
HistoryClientReplicateEventsV2Scope
// HistoryClientSyncShardStatusScope tracks RPC calls to history service
HistoryClientSyncShardStatusScope
// HistoryClientSyncActivityScope tracks RPC calls to history service
HistoryClientSyncActivityScope
// HistoryClientGetReplicationTasksScope tracks RPC calls to history service
HistoryClientGetReplicationTasksScope
// HistoryClientGetDLQReplicationTasksScope tracks RPC calls to history service
HistoryClientGetDLQReplicationTasksScope
// HistoryClientQueryWorkflowScope tracks RPC calls to history service
HistoryClientQueryWorkflowScope
// HistoryClientReapplyEventsScope tracks RPC calls to history service
HistoryClientReapplyEventsScope
// HistoryClientGetDLQMessagesScope tracks RPC calls to history service
HistoryClientGetDLQMessagesScope
// HistoryClientPurgeDLQMessagesScope tracks RPC calls to history service
HistoryClientPurgeDLQMessagesScope
// HistoryClientMergeDLQMessagesScope tracks RPC calls to history service
HistoryClientMergeDLQMessagesScope
// HistoryClientRefreshWorkflowTasksScope tracks RPC calls to history service
HistoryClientRefreshWorkflowTasksScope
// HistoryClientGenerateLastHistoryReplicationTasksScope tracks RPC calls to history service
HistoryClientGenerateLastHistoryReplicationTasksScope
// HistoryClientGetReplicationStatusScope tracks RPC calls to history service
HistoryClientGetReplicationStatusScope
// MatchingClientPollWorkflowTaskQueueScope tracks RPC calls to matching service
MatchingClientPollWorkflowTaskQueueScope
// MatchingClientPollActivityTaskQueueScope tracks RPC calls to matching service
MatchingClientPollActivityTaskQueueScope
// MatchingClientAddActivityTaskScope tracks RPC calls to matching service
MatchingClientAddActivityTaskScope
// MatchingClientAddWorkflowTaskScope tracks RPC calls to matching service
MatchingClientAddWorkflowTaskScope
// MatchingClientQueryWorkflowScope tracks RPC calls to matching service
MatchingClientQueryWorkflowScope
// MatchingClientRespondQueryTaskCompletedScope tracks RPC calls to matching service
MatchingClientRespondQueryTaskCompletedScope
// MatchingClientCancelOutstandingPollScope tracks RPC calls to matching service
MatchingClientCancelOutstandingPollScope
// MatchingClientDescribeTaskQueueScope tracks RPC calls to matching service
MatchingClientDescribeTaskQueueScope
// MatchingClientListTaskQueuePartitionsScope tracks RPC calls to matching service
MatchingClientListTaskQueuePartitionsScope
// FrontendClientDeprecateNamespaceScope tracks RPC calls to frontend service
FrontendClientDeprecateNamespaceScope
// FrontendClientDescribeNamespaceScope tracks RPC calls to frontend service
FrontendClientDescribeNamespaceScope
// FrontendClientDescribeTaskQueueScope tracks RPC calls to frontend service
FrontendClientDescribeTaskQueueScope
// FrontendClientDescribeWorkflowExecutionScope tracks RPC calls to frontend service
FrontendClientDescribeWorkflowExecutionScope
// FrontendClientGetWorkflowExecutionHistoryScope tracks RPC calls to frontend service
FrontendClientGetWorkflowExecutionHistoryScope
// FrontendClientGetWorkflowExecutionRawHistoryScope tracks RPC calls to frontend service
FrontendClientGetWorkflowExecutionRawHistoryScope
// FrontendClientPollForWorkflowExecutionRawHistoryScope tracks RPC calls to frontend service
FrontendClientPollForWorkflowExecutionRawHistoryScope
// FrontendClientListArchivedWorkflowExecutionsScope tracks RPC calls to frontend service
FrontendClientListArchivedWorkflowExecutionsScope
// FrontendClientListClosedWorkflowExecutionsScope tracks RPC calls to frontend service
FrontendClientListClosedWorkflowExecutionsScope
// FrontendClientListNamespacesScope tracks RPC calls to frontend service
FrontendClientListNamespacesScope
// FrontendClientListOpenWorkflowExecutionsScope tracks RPC calls to frontend service
FrontendClientListOpenWorkflowExecutionsScope
// FrontendClientPollActivityTaskQueueScope tracks RPC calls to frontend service
FrontendClientPollActivityTaskQueueScope
// FrontendClientPollWorkflowTaskQueueScope tracks RPC calls to frontend service
FrontendClientPollWorkflowTaskQueueScope
// FrontendClientQueryWorkflowScope tracks RPC calls to frontend service
FrontendClientQueryWorkflowScope
// FrontendClientRecordActivityTaskHeartbeatScope tracks RPC calls to frontend service
FrontendClientRecordActivityTaskHeartbeatScope
// FrontendClientRecordActivityTaskHeartbeatByIdScope tracks RPC calls to frontend service
FrontendClientRecordActivityTaskHeartbeatByIdScope
// FrontendClientRegisterNamespaceScope tracks RPC calls to frontend service
FrontendClientRegisterNamespaceScope
// FrontendClientRequestCancelWorkflowExecutionScope tracks RPC calls to frontend service
FrontendClientRequestCancelWorkflowExecutionScope
// FrontendClientResetStickyTaskQueueScope tracks RPC calls to frontend service
FrontendClientResetStickyTaskQueueScope
// FrontendClientResetWorkflowExecutionScope tracks RPC calls to frontend service
FrontendClientResetWorkflowExecutionScope
// FrontendClientRespondActivityTaskCanceledScope tracks RPC calls to frontend service
FrontendClientRespondActivityTaskCanceledScope
// FrontendClientRespondActivityTaskCanceledByIdScope tracks RPC calls to frontend service
FrontendClientRespondActivityTaskCanceledByIdScope
// FrontendClientRespondActivityTaskCompletedScope tracks RPC calls to frontend service
FrontendClientRespondActivityTaskCompletedScope
// FrontendClientRespondActivityTaskCompletedByIdScope tracks RPC calls to frontend service
FrontendClientRespondActivityTaskCompletedByIdScope
// FrontendClientRespondActivityTaskFailedScope tracks RPC calls to frontend service
FrontendClientRespondActivityTaskFailedScope
// FrontendClientRespondActivityTaskFailedByIdScope tracks RPC calls to frontend service
FrontendClientRespondActivityTaskFailedByIdScope
// FrontendClientRespondWorkflowTaskCompletedScope tracks RPC calls to frontend service
FrontendClientRespondWorkflowTaskCompletedScope
// FrontendClientRespondWorkflowTaskFailedScope tracks RPC calls to frontend service
FrontendClientRespondWorkflowTaskFailedScope
// FrontendClientRespondQueryTaskCompletedScope tracks RPC calls to frontend service
FrontendClientRespondQueryTaskCompletedScope
// FrontendClientSignalWithStartWorkflowExecutionScope tracks RPC calls to frontend service
FrontendClientSignalWithStartWorkflowExecutionScope
// FrontendClientSignalWorkflowExecutionScope tracks RPC calls to frontend service
FrontendClientSignalWorkflowExecutionScope
// FrontendClientStartWorkflowExecutionScope tracks RPC calls to frontend service
FrontendClientStartWorkflowExecutionScope
// FrontendClientTerminateWorkflowExecutionScope tracks RPC calls to frontend service
FrontendClientTerminateWorkflowExecutionScope
// FrontendClientUpdateNamespaceScope tracks RPC calls to frontend service
FrontendClientUpdateNamespaceScope
// FrontendClientListWorkflowExecutionsScope tracks RPC calls to frontend service
FrontendClientListWorkflowExecutionsScope
// FrontendClientScanWorkflowExecutionsScope tracks RPC calls to frontend service
FrontendClientScanWorkflowExecutionsScope
// FrontendClientCountWorkflowExecutionsScope tracks RPC calls to frontend service
FrontendClientCountWorkflowExecutionsScope
// FrontendClientGetSearchAttributesScope tracks RPC calls to frontend service
FrontendClientGetSearchAttributesScope
// FrontendClientGetReplicationTasksScope tracks RPC calls to frontend service
FrontendClientGetReplicationTasksScope
// FrontendClientGetNamespaceReplicationTasksScope tracks RPC calls to frontend service
FrontendClientGetNamespaceReplicationTasksScope
// FrontendClientGetDLQReplicationTasksScope tracks RPC calls to frontend service
FrontendClientGetDLQReplicationTasksScope
// FrontendClientReapplyEventsScope tracks RPC calls to frontend service
FrontendClientReapplyEventsScope
// FrontendClientGetClusterInfoScope tracks RPC calls to frontend
FrontendClientGetClusterInfoScope
// FrontendClientListTaskQueuePartitionsScope tracks RPC calls to frontend service
FrontendClientListTaskQueuePartitionsScope
// AdminClientAddSearchAttributesScope tracks RPC calls to admin service
AdminClientAddSearchAttributesScope
// AdminClientRemoveSearchAttributesScope tracks RPC calls to admin service
AdminClientRemoveSearchAttributesScope
// AdminClientGetSearchAttributesScope tracks RPC calls to admin service
AdminClientGetSearchAttributesScope
// AdminClientCloseShardScope tracks RPC calls to admin service
AdminClientCloseShardScope
// AdminClientGetShardScope tracks RPC calls to admin service
AdminClientGetShardScope
// AdminClientDescribeHistoryHostScope tracks RPC calls to admin service
AdminClientDescribeHistoryHostScope
// AdminClientDescribeWorkflowMutableStateScope tracks RPC calls to admin service
AdminClientDescribeWorkflowMutableStateScope
// AdminClientGetWorkflowExecutionRawHistoryScope tracks RPC calls to admin service
AdminClientGetWorkflowExecutionRawHistoryScope
// AdminClientGetWorkflowExecutionRawHistoryV2Scope tracks RPC calls to admin service
AdminClientGetWorkflowExecutionRawHistoryV2Scope
// AdminClientDescribeClusterScope tracks RPC calls to admin service
AdminClientDescribeClusterScope
// AdminClientListClusterMembersScope tracks RPC calls to admin service
AdminClientListClusterMembersScope
// AdminClientAddOrUpdateRemoteClusterScope tracks RPC calls to admin service
AdminClientAddOrUpdateRemoteClusterScope
// AdminClientRemoveRemoteClusterScope tracks RPC calls to admin service
AdminClientRemoveRemoteClusterScope
// AdminClientGetDLQMessagesScope tracks RPC calls to admin service
AdminClientGetDLQMessagesScope
// AdminClientRegisterNamespaceScope tracks RPC calls to admin service
AdminClientRegisterNamespaceScope
// AdminClientUpdateNamespaceScope tracks RPC calls to admin service
AdminClientUpdateNamespaceScope
// AdminClientPurgeDLQMessagesScope tracks RPC calls to admin service
AdminClientPurgeDLQMessagesScope
// AdminClientListNamespacesScope tracks RPC calls to admin service
AdminClientListNamespacesScope
// AdminClientMergeDLQMessagesScope tracks RPC calls to admin service
AdminClientMergeDLQMessagesScope
// AdminClientRefreshWorkflowTasksScope tracks RPC calls to admin service
AdminClientRefreshWorkflowTasksScope
// AdminClientResendReplicationTasksScope tracks RPC calls to admin service
AdminClientResendReplicationTasksScope
// DCRedirectionDeprecateNamespaceScope tracks RPC calls for dc redirection
DCRedirectionDeprecateNamespaceScope
// DCRedirectionDescribeNamespaceScope tracks RPC calls for dc redirection
DCRedirectionDescribeNamespaceScope
// DCRedirectionDescribeTaskQueueScope tracks RPC calls for dc redirection
DCRedirectionDescribeTaskQueueScope
// DCRedirectionDescribeWorkflowExecutionScope tracks RPC calls for dc redirection
DCRedirectionDescribeWorkflowExecutionScope
// DCRedirectionGetWorkflowExecutionHistoryScope tracks RPC calls for dc redirection
DCRedirectionGetWorkflowExecutionHistoryScope
// DCRedirectionGetWorkflowExecutionRawHistoryScope tracks RPC calls for dc redirection
DCRedirectionGetWorkflowExecutionRawHistoryScope
// DCRedirectionPollForWorkflowExecutionRawHistoryScope tracks RPC calls for dc redirection
DCRedirectionPollForWorkflowExecutionRawHistoryScope
// DCRedirectionListArchivedWorkflowExecutionsScope tracks RPC calls for dc redirection
DCRedirectionListArchivedWorkflowExecutionsScope
// DCRedirectionListClosedWorkflowExecutionsScope tracks RPC calls for dc redirection
DCRedirectionListClosedWorkflowExecutionsScope
// DCRedirectionListNamespacesScope tracks RPC calls for dc redirection
DCRedirectionListNamespacesScope
// DCRedirectionListOpenWorkflowExecutionsScope tracks RPC calls for dc redirection
DCRedirectionListOpenWorkflowExecutionsScope
// DCRedirectionListWorkflowExecutionsScope tracks RPC calls for dc redirection
DCRedirectionListWorkflowExecutionsScope
// DCRedirectionScanWorkflowExecutionsScope tracks RPC calls for dc redirection
DCRedirectionScanWorkflowExecutionsScope
// DCRedirectionCountWorkflowExecutionsScope tracks RPC calls for dc redirection
DCRedirectionCountWorkflowExecutionsScope
// DCRedirectionGetSearchAttributesScope tracks RPC calls for dc redirection
DCRedirectionGetSearchAttributesScope
// DCRedirectionPollActivityTaskQueueScope tracks RPC calls for dc redirection
DCRedirectionPollActivityTaskQueueScope
// DCRedirectionPollWorkflowTaskQueueScope tracks RPC calls for dc redirection
DCRedirectionPollWorkflowTaskQueueScope
// DCRedirectionQueryWorkflowScope tracks RPC calls for dc redirection
DCRedirectionQueryWorkflowScope
// DCRedirectionRecordActivityTaskHeartbeatScope tracks RPC calls for dc redirection
DCRedirectionRecordActivityTaskHeartbeatScope
// DCRedirectionRecordActivityTaskHeartbeatByIdScope tracks RPC calls for dc redirection
DCRedirectionRecordActivityTaskHeartbeatByIdScope
// DCRedirectionRegisterNamespaceScope tracks RPC calls for dc redirection
DCRedirectionRegisterNamespaceScope
// DCRedirectionRequestCancelWorkflowExecutionScope tracks RPC calls for dc redirection
DCRedirectionRequestCancelWorkflowExecutionScope
// DCRedirectionResetStickyTaskQueueScope tracks RPC calls for dc redirection
DCRedirectionResetStickyTaskQueueScope
// DCRedirectionResetWorkflowExecutionScope tracks RPC calls for dc redirection
DCRedirectionResetWorkflowExecutionScope
// DCRedirectionRespondActivityTaskCanceledScope tracks RPC calls for dc redirection
DCRedirectionRespondActivityTaskCanceledScope
// DCRedirectionRespondActivityTaskCanceledByIdScope tracks RPC calls for dc redirection
DCRedirectionRespondActivityTaskCanceledByIdScope
// DCRedirectionRespondActivityTaskCompletedScope tracks RPC calls for dc redirection
DCRedirectionRespondActivityTaskCompletedScope
// DCRedirectionRespondActivityTaskCompletedByIdScope tracks RPC calls for dc redirection
DCRedirectionRespondActivityTaskCompletedByIdScope
// DCRedirectionRespondActivityTaskFailedScope tracks RPC calls for dc redirection
DCRedirectionRespondActivityTaskFailedScope
// DCRedirectionRespondActivityTaskFailedByIdScope tracks RPC calls for dc redirection
DCRedirectionRespondActivityTaskFailedByIdScope
// DCRedirectionRespondWorkflowTaskCompletedScope tracks RPC calls for dc redirection
DCRedirectionRespondWorkflowTaskCompletedScope
// DCRedirectionRespondWorkflowTaskFailedScope tracks RPC calls for dc redirection
DCRedirectionRespondWorkflowTaskFailedScope
// DCRedirectionRespondQueryTaskCompletedScope tracks RPC calls for dc redirection
DCRedirectionRespondQueryTaskCompletedScope
// DCRedirectionSignalWithStartWorkflowExecutionScope tracks RPC calls for dc redirection
DCRedirectionSignalWithStartWorkflowExecutionScope
// DCRedirectionSignalWorkflowExecutionScope tracks RPC calls for dc redirection
DCRedirectionSignalWorkflowExecutionScope
// DCRedirectionStartWorkflowExecutionScope tracks RPC calls for dc redirection
DCRedirectionStartWorkflowExecutionScope
// DCRedirectionTerminateWorkflowExecutionScope tracks RPC calls for dc redirection
DCRedirectionTerminateWorkflowExecutionScope
// DCRedirectionUpdateNamespaceScope tracks RPC calls for dc redirection
DCRedirectionUpdateNamespaceScope
// DCRedirectionListTaskQueuePartitionsScope tracks RPC calls for dc redirection
DCRedirectionListTaskQueuePartitionsScope
// MessagingClientPublishScope tracks Publish calls made by service to messaging layer
MessagingClientPublishScope
// MessagingClientPublishBatchScope tracks Publish calls made by service to messaging layer
MessagingClientPublishBatchScope
// NamespaceCacheScope tracks namespace cache callbacks
NamespaceCacheScope
// HistoryRereplicationByTransferTaskScope tracks history replication calls made by transfer task
HistoryRereplicationByTransferTaskScope
// HistoryRereplicationByTimerTaskScope tracks history replication calls made by timer task
HistoryRereplicationByTimerTaskScope
// HistoryRereplicationByHistoryReplicationScope tracks history replication calls made by history replication
HistoryRereplicationByHistoryReplicationScope
// HistoryRereplicationByHistoryMetadataReplicationScope tracks history replication calls made by history replication
HistoryRereplicationByHistoryMetadataReplicationScope
// HistoryRereplicationByActivityReplicationScope tracks history replication calls made by activity replication
HistoryRereplicationByActivityReplicationScope
// PersistenceAppendHistoryNodesScope tracks AppendHistoryNodes calls made by service to persistence layer
PersistenceAppendHistoryNodesScope
// PersistenceDeleteHistoryNodesScope tracks DeleteHistoryNodes calls made by service to persistence layer
PersistenceDeleteHistoryNodesScope
// PersistenceReadHistoryBranchScope tracks ReadHistoryBranch calls made by service to persistence layer
PersistenceReadHistoryBranchScope
// PersistenceForkHistoryBranchScope tracks ForkHistoryBranch calls made by service to persistence layer
PersistenceForkHistoryBranchScope
// PersistenceDeleteHistoryBranchScope tracks DeleteHistoryBranch calls made by service to persistence layer
PersistenceDeleteHistoryBranchScope
// PersistenceTrimHistoryBranchScope tracks TrimHistoryBranch calls made by service to persistence layer
PersistenceTrimHistoryBranchScope
// PersistenceCompleteForkBranchScope tracks CompleteForkBranch calls made by service to persistence layer
PersistenceCompleteForkBranchScope
// PersistenceGetHistoryTreeScope tracks GetHistoryTree calls made by service to persistence layer
PersistenceGetHistoryTreeScope
// PersistenceGetAllHistoryTreeBranchesScope tracks GetHistoryTree calls made by service to persistence layer
PersistenceGetAllHistoryTreeBranchesScope
// PersistenceNamespaceReplicationQueueScope is the metrics scope for namespace replication queue
PersistenceNamespaceReplicationQueueScope
// ClusterMetadataArchivalConfigScope tracks ArchivalConfig calls to ClusterMetadata
ClusterMetadataArchivalConfigScope
// ElasticsearchBulkProcessor is scope used by all metric emitted by Elasticsearch bulk processor
ElasticsearchBulkProcessor
// ElasticsearchVisibility is scope used by all Elasticsearch visibility metrics
ElasticsearchVisibility
// SequentialTaskProcessingScope is used by sequential task processing logic
SequentialTaskProcessingScope
// ParallelTaskProcessingScope is used by parallel task processing logic
ParallelTaskProcessingScope
// TaskSchedulerScope is used by task scheduler logic
TaskSchedulerScope
// HistoryArchiverScope is used by history archivers
HistoryArchiverScope
// VisibilityArchiverScope is used by visibility archivers
VisibilityArchiverScope
// The following metrics are only used by internal archiver implemention.
// TODO: move them to internal repo once temporal plugin model is in place.
// BlobstoreClientUploadScope tracks Upload calls to blobstore
BlobstoreClientUploadScope
// BlobstoreClientDownloadScope tracks Download calls to blobstore
BlobstoreClientDownloadScope
// BlobstoreClientGetMetadataScope tracks GetMetadata calls to blobstore
BlobstoreClientGetMetadataScope
// BlobstoreClientExistsScope tracks Exists calls to blobstore
BlobstoreClientExistsScope
// BlobstoreClientDeleteScope tracks Delete calls to blobstore
BlobstoreClientDeleteScope
// BlobstoreClientDirectoryExistsScope tracks DirectoryExists calls to blobstore
BlobstoreClientDirectoryExistsScope
DynamicConfigScope
NumCommonScopes
)
// -- Operation scopes for Admin service --
const (
// AdminDescribeHistoryHostScope is the metric scope for admin.AdminDescribeHistoryHostScope
AdminDescribeHistoryHostScope = iota + NumCommonScopes
// AdminAddSearchAttributesScope is the metric scope for admin.AdminAddSearchAttributesScope
AdminAddSearchAttributesScope
// AdminRemoveSearchAttributesScope is the metric scope for admin.AdminRemoveSearchAttributesScope
AdminRemoveSearchAttributesScope
// AdminGetSearchAttributesScope is the metric scope for admin.AdminGetSearchAttributesScope
AdminGetSearchAttributesScope
// AdminDescribeWorkflowExecutionScope is the metric scope for admin.AdminDescribeWorkflowExecutionScope
AdminDescribeWorkflowExecutionScope
// AdminGetWorkflowExecutionRawHistoryScope is the metric scope for admin.GetWorkflowExecutionRawHistoryScope
AdminGetWorkflowExecutionRawHistoryScope
// AdminGetWorkflowExecutionRawHistoryV2Scope is the metric scope for admin.GetWorkflowExecutionRawHistoryScope
AdminGetWorkflowExecutionRawHistoryV2Scope
// AdminGetReplicationMessagesScope is the metric scope for admin.GetReplicationMessages
AdminGetReplicationMessagesScope
// AdminGetNamespaceReplicationMessagesScope is the metric scope for admin.GetNamespaceReplicationMessages
AdminGetNamespaceReplicationMessagesScope
// AdminGetDLQReplicationMessagesScope is the metric scope for admin.GetDLQReplicationMessages
AdminGetDLQReplicationMessagesScope
// AdminReapplyEventsScope is the metric scope for admin.ReapplyEvents
AdminReapplyEventsScope
// AdminRefreshWorkflowTasksScope is the metric scope for admin.RefreshWorkflowTasks
AdminRefreshWorkflowTasksScope
// AdminResendReplicationTasksScope is the metric scope for admin.ResendReplicationTasks
AdminResendReplicationTasksScope
// AdminRemoveTaskScope is the metric scope for admin.AdminRemoveTaskScope
AdminRemoveTaskScope
// AdminCloseShardScope is the metric scope for admin.AdminCloseShardScope
AdminCloseShardScope
// AdminGetShardScope is the metric scope for admin.AdminGetShardScope
AdminGetShardScope
// AdminReadDLQMessagesScope is the metric scope for admin.AdminReadDLQMessagesScope
AdminReadDLQMessagesScope
// AdminPurgeDLQMessagesScope is the metric scope for admin.AdminPurgeDLQMessagesScope
AdminPurgeDLQMessagesScope
// AdminListNamespacesScope is the metric scope for admin.AdminListNamespacesScope
AdminListNamespacesScope
// AdminRegisterNamespaceScope is the metric scope for admin.AdminRegisterNamespaceScope
AdminRegisterNamespaceScope
// AdminUpdateNamespaceScope is the metric scope for admin.AdminUpdateNamespaceScope
AdminUpdateNamespaceScope
// AdminMergeDLQMessagesScope is the metric scope for admin.AdminMergeDLQMessagesScope
AdminMergeDLQMessagesScope
// AdminListClusterMembersScope is the metric scope for admin.AdminListClusterMembersScope
AdminListClusterMembersScope
// AdminDescribeClusterScope is the metric scope for admin.AdminDescribeClusterScope
AdminDescribeClusterScope
// AdminAddOrUpdateRemoteClusterScope is the metric scope for admin.AdminAddOrUpdateRemoteClusterScope
AdminAddOrUpdateRemoteClusterScope
// AdminRemoveRemoteClusterScope is the metric scope for admin.AdminRemoveRemoteClusterScope
AdminRemoveRemoteClusterScope
NumAdminScopes
)
// -- Operation scopes for Frontend service --
const (
// FrontendStartWorkflowExecutionScope is the metric scope for frontend.StartWorkflowExecution
FrontendStartWorkflowExecutionScope = iota + NumAdminScopes
// FrontendPollWorkflowTaskQueueScope is the metric scope for frontend.PollWorkflowTaskQueue
FrontendPollWorkflowTaskQueueScope
// FrontendPollActivityTaskQueueScope is the metric scope for frontend.PollActivityTaskQueue
FrontendPollActivityTaskQueueScope
// FrontendRecordActivityTaskHeartbeatScope is the metric scope for frontend.RecordActivityTaskHeartbeat
FrontendRecordActivityTaskHeartbeatScope
// FrontendRecordActivityTaskHeartbeatByIdScope is the metric scope for frontend.RespondWorkflowTaskCompleted
FrontendRecordActivityTaskHeartbeatByIdScope
// FrontendRespondWorkflowTaskCompletedScope is the metric scope for frontend.RespondWorkflowTaskCompleted
FrontendRespondWorkflowTaskCompletedScope
// FrontendRespondWorkflowTaskFailedScope is the metric scope for frontend.RespondWorkflowTaskFailed
FrontendRespondWorkflowTaskFailedScope
// FrontendRespondQueryTaskCompletedScope is the metric scope for frontend.RespondQueryTaskCompleted
FrontendRespondQueryTaskCompletedScope
// FrontendRespondActivityTaskCompletedScope is the metric scope for frontend.RespondActivityTaskCompleted
FrontendRespondActivityTaskCompletedScope
// FrontendRespondActivityTaskFailedScope is the metric scope for frontend.RespondActivityTaskFailed
FrontendRespondActivityTaskFailedScope
// FrontendRespondActivityTaskCanceledScope is the metric scope for frontend.RespondActivityTaskCanceled
FrontendRespondActivityTaskCanceledScope
// FrontendRespondActivityTaskCompletedByIdScope is the metric scope for frontend.RespondActivityTaskCompletedById
FrontendRespondActivityTaskCompletedByIdScope
// FrontendRespondActivityTaskFailedByIdScope is the metric scope for frontend.RespondActivityTaskFailedById
FrontendRespondActivityTaskFailedByIdScope
// FrontendRespondActivityTaskCanceledByIdScope is the metric scope for frontend.RespondActivityTaskCanceledById
FrontendRespondActivityTaskCanceledByIdScope
// FrontendGetWorkflowExecutionHistoryScope is the metric scope for non-long-poll frontend.GetWorkflowExecutionHistory
FrontendGetWorkflowExecutionHistoryScope
// FrontendPollWorkflowExecutionHistoryScope is the metric scope for long poll case of frontend.GetWorkflowExecutionHistory
FrontendPollWorkflowExecutionHistoryScope
// FrontendGetWorkflowExecutionRawHistoryScope is the metric scope for frontend.GetWorkflowExecutionRawHistory
FrontendGetWorkflowExecutionRawHistoryScope
// FrontendPollForWorkflowExecutionRawHistoryScope is the metric scope for frontend.GetWorkflowExecutionRawHistory
FrontendPollForWorkflowExecutionRawHistoryScope
// FrontendSignalWorkflowExecutionScope is the metric scope for frontend.SignalWorkflowExecution
FrontendSignalWorkflowExecutionScope
// FrontendSignalWithStartWorkflowExecutionScope is the metric scope for frontend.SignalWithStartWorkflowExecution
FrontendSignalWithStartWorkflowExecutionScope
// FrontendTerminateWorkflowExecutionScope is the metric scope for frontend.TerminateWorkflowExecution
FrontendTerminateWorkflowExecutionScope
// FrontendRequestCancelWorkflowExecutionScope is the metric scope for frontend.RequestCancelWorkflowExecution
FrontendRequestCancelWorkflowExecutionScope
// FrontendListArchivedWorkflowExecutionsScope is the metric scope for frontend.ListArchivedWorkflowExecutions
FrontendListArchivedWorkflowExecutionsScope
// FrontendListOpenWorkflowExecutionsScope is the metric scope for frontend.ListOpenWorkflowExecutions
FrontendListOpenWorkflowExecutionsScope
// FrontendListClosedWorkflowExecutionsScope is the metric scope for frontend.ListClosedWorkflowExecutions
FrontendListClosedWorkflowExecutionsScope
// FrontendListWorkflowExecutionsScope is the metric scope for frontend.ListWorkflowExecutions
FrontendListWorkflowExecutionsScope
// FrontendScanWorkflowExecutionsScope is the metric scope for frontend.ListWorkflowExecutions
FrontendScanWorkflowExecutionsScope
// FrontendCountWorkflowExecutionsScope is the metric scope for frontend.CountWorkflowExecutions
FrontendCountWorkflowExecutionsScope
// FrontendRegisterNamespaceScope is the metric scope for frontend.RegisterNamespace
FrontendRegisterNamespaceScope
// FrontendDescribeNamespaceScope is the metric scope for frontend.DescribeNamespace
FrontendDescribeNamespaceScope
// FrontendUpdateNamespaceScope is the metric scope for frontend.DescribeNamespace
FrontendUpdateNamespaceScope
// FrontendDeprecateNamespaceScope is the metric scope for frontend.DeprecateNamespace
FrontendDeprecateNamespaceScope
// FrontendQueryWorkflowScope is the metric scope for frontend.QueryWorkflow
FrontendQueryWorkflowScope
// FrontendDescribeWorkflowExecutionScope is the metric scope for frontend.DescribeWorkflowExecution
FrontendDescribeWorkflowExecutionScope
// FrontendDescribeTaskQueueScope is the metric scope for frontend.DescribeTaskQueue
FrontendDescribeTaskQueueScope
// FrontendListTaskQueuePartitionsScope is the metric scope for frontend.ResetStickyTaskQueue
FrontendListTaskQueuePartitionsScope
// FrontendResetStickyTaskQueueScope is the metric scope for frontend.ResetStickyTaskQueue
FrontendResetStickyTaskQueueScope
// FrontendListNamespacesScope is the metric scope for frontend.ListNamespace
FrontendListNamespacesScope
// FrontendResetWorkflowExecutionScope is the metric scope for frontend.ResetWorkflowExecution
FrontendResetWorkflowExecutionScope
// FrontendGetSearchAttributesScope is the metric scope for frontend.GetSearchAttributes
FrontendGetSearchAttributesScope
// FrontendGetClusterInfoScope is the metric scope for frontend.GetClusterInfo
FrontendGetClusterInfoScope
// VersionCheckScope is scope used by version checker
VersionCheckScope
// AuthorizationScope is the scope used by all metric emitted by authorization code
AuthorizationScope
NumFrontendScopes
)
// -- Operation scopes for History service --
const (
// HistoryStartWorkflowExecutionScope tracks StartWorkflowExecution API calls received by service
HistoryStartWorkflowExecutionScope = iota + NumFrontendScopes
// HistoryRecordActivityTaskHeartbeatScope tracks RecordActivityTaskHeartbeat API calls received by service
HistoryRecordActivityTaskHeartbeatScope
// HistoryRespondWorkflowTaskCompletedScope tracks RespondWorkflowTaskCompleted API calls received by service
HistoryRespondWorkflowTaskCompletedScope
// HistoryRespondWorkflowTaskFailedScope tracks RespondWorkflowTaskFailed API calls received by service
HistoryRespondWorkflowTaskFailedScope
// HistoryRespondActivityTaskCompletedScope tracks RespondActivityTaskCompleted API calls received by service
HistoryRespondActivityTaskCompletedScope
// HistoryRespondActivityTaskFailedScope tracks RespondActivityTaskFailed API calls received by service
HistoryRespondActivityTaskFailedScope
// HistoryRespondActivityTaskCanceledScope tracks RespondActivityTaskCanceled API calls received by service
HistoryRespondActivityTaskCanceledScope
// HistoryGetMutableStateScope tracks GetMutableStateScope API calls received by service
HistoryGetMutableStateScope
// HistoryPollMutableStateScope tracks PollMutableStateScope API calls received by service
HistoryPollMutableStateScope
// HistoryResetStickyTaskQueueScope tracks ResetStickyTaskQueueScope API calls received by service
HistoryResetStickyTaskQueueScope
// HistoryDescribeWorkflowExecutionScope tracks DescribeWorkflowExecution API calls received by service
HistoryDescribeWorkflowExecutionScope
// HistoryRecordWorkflowTaskStartedScope tracks RecordWorkflowTaskStarted API calls received by service
HistoryRecordWorkflowTaskStartedScope
// HistoryRecordActivityTaskStartedScope tracks RecordActivityTaskStarted API calls received by service
HistoryRecordActivityTaskStartedScope
// HistorySignalWorkflowExecutionScope tracks SignalWorkflowExecution API calls received by service
HistorySignalWorkflowExecutionScope
// HistorySignalWithStartWorkflowExecutionScope tracks SignalWithStartWorkflowExecution API calls received by service
HistorySignalWithStartWorkflowExecutionScope
// HistoryRemoveSignalMutableStateScope tracks RemoveSignalMutableState API calls received by service
HistoryRemoveSignalMutableStateScope
// HistoryTerminateWorkflowExecutionScope tracks TerminateWorkflowExecution API calls received by service
HistoryTerminateWorkflowExecutionScope
// HistoryScheduleWorkflowTaskScope tracks ScheduleWorkflowTask API calls received by service
HistoryScheduleWorkflowTaskScope
// HistoryRecordChildExecutionCompletedScope tracks CompleteChildExecution API calls received by service
HistoryRecordChildExecutionCompletedScope
// HistoryRequestCancelWorkflowExecutionScope tracks RequestCancelWorkflowExecution API calls received by service
HistoryRequestCancelWorkflowExecutionScope
// HistorySyncShardStatusScope tracks HistorySyncShardStatus API calls received by service
HistorySyncShardStatusScope
// HistorySyncActivityScope tracks HistoryActivity API calls received by service
HistorySyncActivityScope
// HistoryDescribeMutableStateScope tracks HistoryActivity API calls received by service
HistoryDescribeMutableStateScope
// HistoryGetReplicationMessagesScope tracks GetReplicationMessages API calls received by service
HistoryGetReplicationMessagesScope
// HistoryGetDLQReplicationMessagesScope tracks GetReplicationMessages API calls received by service
HistoryGetDLQReplicationMessagesScope
// HistoryReadDLQMessagesScope tracks GetDLQMessages API calls received by service
HistoryReadDLQMessagesScope
// HistoryPurgeDLQMessagesScope tracks PurgeDLQMessages API calls received by service
HistoryPurgeDLQMessagesScope
// HistoryMergeDLQMessagesScope tracks MergeDLQMessages API calls received by service
HistoryMergeDLQMessagesScope
// HistoryShardControllerScope is the scope used by shard controller
HistoryShardControllerScope
// HistoryReapplyEventsScope is the scope used by event reapplication
HistoryReapplyEventsScope
// HistoryRefreshWorkflowTasksScope is the scope used by refresh workflow tasks API
HistoryRefreshWorkflowTasksScope
// HistoryGenerateLastHistoryReplicationTasksScope is the scope used by generate last replication tasks API
HistoryGenerateLastHistoryReplicationTasksScope
// HistoryGetReplicationStatusScope is the scope used by GetReplicationStatus API
HistoryGetReplicationStatusScope
// HistoryHistoryRemoveTaskScope is the scope used by remove task API
HistoryHistoryRemoveTaskScope
// HistoryCloseShard is the scope used by close shard API
HistoryCloseShard
// HistoryGetShard is the scope used by get shard API
HistoryGetShard
// HistoryReplicateEventsV2 is the scope used by replicate events API
HistoryReplicateEventsV2
// HistoryResetStickyTaskQueue is the scope used by reset sticky task queue API
HistoryResetStickyTaskQueue
// HistoryReapplyEvents is the scope used by reapply events API
HistoryReapplyEvents
// HistoryDescribeHistoryHost is the scope used by describe history host API
HistoryDescribeHistoryHost
// TaskPriorityAssignerScope is the scope used by all metric emitted by task priority assigner
TaskPriorityAssignerScope
// TransferQueueProcessorScope is the scope used by all metric emitted by transfer queue processor
TransferQueueProcessorScope
// TransferActiveQueueProcessorScope is the scope used by all metric emitted by transfer queue processor
TransferActiveQueueProcessorScope
// TransferStandbyQueueProcessorScope is the scope used by all metric emitted by transfer queue processor
TransferStandbyQueueProcessorScope
// TransferActiveTaskActivityScope is the scope used for activity task processing by transfer queue processor
TransferActiveTaskActivityScope
// TransferActiveTaskWorkflowTaskScope is the scope used for workflow task processing by transfer queue processor
TransferActiveTaskWorkflowTaskScope
// TransferActiveTaskCloseExecutionScope is the scope used for close execution task processing by transfer queue processor
TransferActiveTaskCloseExecutionScope
// TransferActiveTaskCancelExecutionScope is the scope used for cancel execution task processing by transfer queue processor
TransferActiveTaskCancelExecutionScope
// TransferActiveTaskSignalExecutionScope is the scope used for signal execution task processing by transfer queue processor
TransferActiveTaskSignalExecutionScope
// TransferActiveTaskStartChildExecutionScope is the scope used for start child execution task processing by transfer queue processor
TransferActiveTaskStartChildExecutionScope
// TransferActiveTaskResetWorkflowScope is the scope used for record workflow started task processing by transfer queue processor
TransferActiveTaskResetWorkflowScope
// TransferStandbyTaskResetWorkflowScope is the scope used for record workflow started task processing by transfer queue processor
TransferStandbyTaskResetWorkflowScope
// TransferStandbyTaskActivityScope is the scope used for activity task processing by transfer queue processor
TransferStandbyTaskActivityScope
// TransferStandbyTaskWorkflowTaskScope is the scope used for workflow task processing by transfer queue processor
TransferStandbyTaskWorkflowTaskScope
// TransferStandbyTaskCloseExecutionScope is the scope used for close execution task processing by transfer queue processor
TransferStandbyTaskCloseExecutionScope
// TransferStandbyTaskCancelExecutionScope is the scope used for cancel execution task processing by transfer queue processor
TransferStandbyTaskCancelExecutionScope
// TransferStandbyTaskSignalExecutionScope is the scope used for signal execution task processing by transfer queue processor
TransferStandbyTaskSignalExecutionScope
// TransferStandbyTaskStartChildExecutionScope is the scope used for start child execution task processing by transfer queue processor
TransferStandbyTaskStartChildExecutionScope
// VisibilityQueueProcessorScope is the scope used by all metric emitted by visibility queue processor
VisibilityQueueProcessorScope
// VisibilityTaskStartExecutionScope is the scope used for start execution processing by visibility queue processor
VisibilityTaskStartExecutionScope
// VisibilityTaskUpsertExecutionScope is the scope used for upsert execution processing by visibility queue processor
VisibilityTaskUpsertExecutionScope
// VisibilityTaskCloseExecutionScope is the scope used for close execution attributes processing by visibility queue processor
VisibilityTaskCloseExecutionScope
// VisibilityTaskDeleteExecutionScope is the scope used for delete by visibility queue processor
VisibilityTaskDeleteExecutionScope
// TimerQueueProcessorScope is the scope used by all metric emitted by timer queue processor
TimerQueueProcessorScope
// TimerActiveQueueProcessorScope is the scope used by all metric emitted by timer queue processor
TimerActiveQueueProcessorScope
// TimerStandbyQueueProcessorScope is the scope used by all metric emitted by timer queue processor
TimerStandbyQueueProcessorScope
// TimerActiveTaskActivityTimeoutScope is the scope used by metric emitted by timer queue processor for processing activity timeouts
TimerActiveTaskActivityTimeoutScope
// TimerActiveTaskWorkflowTaskTimeoutScope is the scope used by metric emitted by timer queue processor for processing workflow task timeouts
TimerActiveTaskWorkflowTaskTimeoutScope
// TimerActiveTaskUserTimerScope is the scope used by metric emitted by timer queue processor for processing user timers
TimerActiveTaskUserTimerScope
// TimerActiveTaskWorkflowTimeoutScope is the scope used by metric emitted by timer queue processor for processing workflow timeouts.
TimerActiveTaskWorkflowTimeoutScope
// TimerActiveTaskActivityRetryTimerScope is the scope used by metric emitted by timer queue processor for processing retry task.
TimerActiveTaskActivityRetryTimerScope
// TimerActiveTaskWorkflowBackoffTimerScope is the scope used by metric emitted by timer queue processor for processing retry task.
TimerActiveTaskWorkflowBackoffTimerScope
// TimerActiveTaskDeleteHistoryEventScope is the scope used by metric emitted by timer queue processor for processing history event cleanup
TimerActiveTaskDeleteHistoryEventScope
// TimerStandbyTaskActivityTimeoutScope is the scope used by metric emitted by timer queue processor for processing activity timeouts
TimerStandbyTaskActivityTimeoutScope
// TimerStandbyTaskWorkflowTaskTimeoutScope is the scope used by metric emitted by timer queue processor for processing workflow task timeouts
TimerStandbyTaskWorkflowTaskTimeoutScope
// TimerStandbyTaskUserTimerScope is the scope used by metric emitted by timer queue processor for processing user timers
TimerStandbyTaskUserTimerScope
// TimerStandbyTaskWorkflowTimeoutScope is the scope used by metric emitted by timer queue processor for processing workflow timeouts.
TimerStandbyTaskWorkflowTimeoutScope
// TimerStandbyTaskActivityRetryTimerScope is the scope used by metric emitted by timer queue processor for processing retry task.
TimerStandbyTaskActivityRetryTimerScope
// TimerStandbyTaskDeleteHistoryEventScope is the scope used by metric emitted by timer queue processor for processing history event cleanup
TimerStandbyTaskDeleteHistoryEventScope
// TimerStandbyTaskWorkflowBackoffTimerScope is the scope used by metric emitted by timer queue processor for processing retry task.
TimerStandbyTaskWorkflowBackoffTimerScope
// HistoryEventNotificationScope is the scope used by shard history event nitification
HistoryEventNotificationScope
// ReplicatorQueueProcessorScope is the scope used by all metric emitted by replicator queue processor
ReplicatorQueueProcessorScope
// ReplicatorTaskHistoryScope is the scope used for history task processing by replicator queue processor
ReplicatorTaskHistoryScope
// ReplicatorTaskSyncActivityScope is the scope used for sync activity by replicator queue processor
ReplicatorTaskSyncActivityScope
// ReplicateHistoryEventsScope is the scope used by historyReplicator API for applying events
ReplicateHistoryEventsScope
// ShardInfoScope is the scope used when updating shard info
ShardInfoScope
// WorkflowContextScope is the scope used by WorkflowContext component
WorkflowContextScope
// HistoryCacheGetOrCreateScope is the scope used by history cache
HistoryCacheGetOrCreateScope
// HistoryCacheGetOrCreateCurrentScope is the scope used by history cache
HistoryCacheGetOrCreateCurrentScope
// EventsCacheGetEventScope is the scope used by events cache
EventsCacheGetEventScope
// EventsCachePutEventScope is the scope used by events cache
EventsCachePutEventScope
// EventsCacheDeleteEventScope is the scope used by events cache
EventsCacheDeleteEventScope
// EventsCacheGetFromStoreScope is the scope used by events cache
EventsCacheGetFromStoreScope
// ExecutionSizeStatsScope is the scope used for emiting workflow execution size related stats
ExecutionSizeStatsScope
// ExecutionCountStatsScope is the scope used for emiting workflow execution count related stats
ExecutionCountStatsScope
// SessionSizeStatsScope is the scope used for emiting session update size related stats
SessionSizeStatsScope
// SessionCountStatsScope is the scope used for emiting session update count related stats
SessionCountStatsScope
// HistoryResetWorkflowExecutionScope tracks ResetWorkflowExecution API calls received by service
HistoryResetWorkflowExecutionScope
// HistoryQueryWorkflowScope tracks QueryWorkflow API calls received by service
HistoryQueryWorkflowScope
// HistoryProcessDeleteHistoryEventScope tracks ProcessDeleteHistoryEvent processing calls
HistoryProcessDeleteHistoryEventScope
// WorkflowCompletionStatsScope tracks workflow completion updates
WorkflowCompletionStatsScope
// ArchiverClientScope is scope used by all metrics emitted by archiver.Client
ArchiverClientScope
// ReplicationTaskFetcherScope is scope used by all metrics emitted by ReplicationTaskFetcher
ReplicationTaskFetcherScope
// ReplicationTaskCleanupScope is scope used by all metrics emitted by ReplicationTaskProcessor cleanup
ReplicationTaskCleanupScope
// ReplicationDLQStatsScope is scope used by all metrics emitted related to replication DLQ
ReplicationDLQStatsScope
NumHistoryScopes
)
// -- Operation scopes for Matching service --
const (
// MatchingPollWorkflowTaskQueueScope tracks PollWorkflowTaskQueue API calls received by service
MatchingPollWorkflowTaskQueueScope = iota + NumHistoryScopes
// MatchingPollActivityTaskQueueScope tracks PollActivityTaskQueue API calls received by service
MatchingPollActivityTaskQueueScope
// MatchingAddActivityTaskScope tracks AddActivityTask API calls received by service
MatchingAddActivityTaskScope
// MatchingAddWorkflowTaskScope tracks AddWorkflowTask API calls received by service
MatchingAddWorkflowTaskScope
// MatchingTaskQueueMgrScope is the metrics scope for matching.TaskQueueManager component
MatchingTaskQueueMgrScope
// MatchingEngineScope is the metrics scope for matchingEngine component
MatchingEngineScope
// MatchingQueryWorkflowScope tracks AddWorkflowTask API calls received by service
MatchingQueryWorkflowScope
// MatchingRespondQueryTaskCompletedScope tracks AddWorkflowTask API calls received by service
MatchingRespondQueryTaskCompletedScope
// MatchingCancelOutstandingPollScope tracks CancelOutstandingPoll API calls received by service
MatchingCancelOutstandingPollScope
// MatchingDescribeTaskQueueScope tracks DescribeTaskQueue API calls received by service
MatchingDescribeTaskQueueScope
// MatchingListTaskQueuePartitionsScope tracks ListTaskQueuePartitions API calls received by service
MatchingListTaskQueuePartitionsScope
NumMatchingScopes
)
// -- Operation scopes for Worker service --
const (
// ReplicatorScope is the scope used by all metric emitted by replicator
ReplicatorScope = iota + NumMatchingScopes
// NamespaceReplicationTaskScope is the scope used by namespace task replication processing
NamespaceReplicationTaskScope
// HistoryReplicationTaskScope is the scope used by history task replication processing
HistoryReplicationTaskScope
// HistoryMetadataReplicationTaskScope is the scope used by history metadata task replication processing
HistoryMetadataReplicationTaskScope
// SyncShardTaskScope is the scope used by sync shrad information processing
SyncShardTaskScope
// SyncActivityTaskScope is the scope used by sync activity information processing
SyncActivityTaskScope
// ESProcessorScope is scope used by all metric emitted by esProcessor
ESProcessorScope
// IndexProcessorScope is scope used by all metric emitted by index processor
IndexProcessorScope
// ArchiverDeleteHistoryActivityScope is scope used by all metrics emitted by archiver.DeleteHistoryActivity
ArchiverDeleteHistoryActivityScope
// ArchiverUploadHistoryActivityScope is scope used by all metrics emitted by archiver.UploadHistoryActivity
ArchiverUploadHistoryActivityScope
// ArchiverArchiveVisibilityActivityScope is scope used by all metrics emitted by archiver.ArchiveVisibilityActivity
ArchiverArchiveVisibilityActivityScope
// ArchiverScope is scope used by all metrics emitted by archiver.Archiver
ArchiverScope
// ArchiverPumpScope is scope used by all metrics emitted by archiver.Pump
ArchiverPumpScope
// ArchiverArchivalWorkflowScope is scope used by all metrics emitted by archiver.ArchivalWorkflow
ArchiverArchivalWorkflowScope
// TaskQueueScavengerScope is scope used by all metrics emitted by worker.taskqueue.Scavenger module
TaskQueueScavengerScope
// ExecutionsScavengerScope is scope used by all metrics emitted by worker.executions.Scavenger module
ExecutionsScavengerScope
// BatcherScope is scope used by all metrics emitted by worker.Batcher module
BatcherScope
// HistoryScavengerScope is scope used by all metrics emitted by worker.history.Scavenger module
HistoryScavengerScope
// ParentClosePolicyProcessorScope is scope used by all metrics emitted by worker.ParentClosePolicyProcessor
ParentClosePolicyProcessorScope
// AddSearchAttributesWorkflowScope is scope used by all metrics emitted by worker.AddSearchAttributesWorkflowScope module
AddSearchAttributesWorkflowScope
NumWorkerScopes
)
// ScopeDefs record the scopes for all services
var ScopeDefs = map[ServiceIdx]map[int]scopeDefinition{
// common scope Names
Common: {
UnknownScope: {operation: "Unknown"},
PersistenceCreateShardScope: {operation: "CreateShard"},
PersistenceGetShardScope: {operation: "GetShard"},
PersistenceUpdateShardScope: {operation: "UpdateShard"},
PersistenceCreateWorkflowExecutionScope: {operation: "CreateWorkflowExecution"},
PersistenceGetWorkflowExecutionScope: {operation: "GetWorkflowExecution"},
PersistenceUpdateWorkflowExecutionScope: {operation: "UpdateWorkflowExecution"},
PersistenceConflictResolveWorkflowExecutionScope: {operation: "ConflictResolveWorkflowExecution"},
PersistenceResetWorkflowExecutionScope: {operation: "ResetWorkflowExecution"},
PersistenceDeleteWorkflowExecutionScope: {operation: "DeleteWorkflowExecution"},
PersistenceDeleteCurrentWorkflowExecutionScope: {operation: "DeleteCurrentWorkflowExecution"},
PersistenceGetCurrentExecutionScope: {operation: "GetCurrentExecution"},
PersistenceListConcreteExecutionsScope: {operation: "ListConcreteExecutions"},
PersistenceAddTasksScope: {operation: "AddTasks"},
PersistenceGetTransferTaskScope: {operation: "GetTransferTask"},
PersistenceGetTransferTasksScope: {operation: "GetTransferTasks"},
PersistenceCompleteTransferTaskScope: {operation: "CompleteTransferTask"},
PersistenceRangeCompleteTransferTaskScope: {operation: "RangeCompleteTransferTask"},
PersistenceGetVisibilityTaskScope: {operation: "GetVisibilityTask"},
PersistenceGetVisibilityTasksScope: {operation: "GetVisibilityTasks"},
PersistenceCompleteVisibilityTaskScope: {operation: "CompleteVisibilityTask"},
PersistenceRangeCompleteVisibilityTaskScope: {operation: "RangeCompleteVisibilityTask"},
PersistenceGetReplicationTaskScope: {operation: "GetReplicationTask"},
PersistenceGetReplicationTasksScope: {operation: "GetReplicationTasks"},
PersistenceCompleteReplicationTaskScope: {operation: "CompleteReplicationTask"},
PersistenceRangeCompleteReplicationTaskScope: {operation: "RangeCompleteReplicationTask"},
PersistencePutReplicationTaskToDLQScope: {operation: "PutReplicationTaskToDLQ"},
PersistenceGetReplicationTasksFromDLQScope: {operation: "GetReplicationTasksFromDLQ"},
PersistenceDeleteReplicationTaskFromDLQScope: {operation: "DeleteReplicationTaskFromDLQ"},
PersistenceRangeDeleteReplicationTaskFromDLQScope: {operation: "RangeDeleteReplicationTaskFromDLQ"},
PersistenceGetTimerTaskScope: {operation: "GetTimerTask"},
PersistenceGetTimerTasksScope: {operation: "GetTimerTasks"},
PersistenceCompleteTimerTaskScope: {operation: "CompleteTimerTask"},
PersistenceRangeCompleteTimerTaskScope: {operation: "RangeCompleteTimerTask"},
PersistenceCreateTaskScope: {operation: "CreateTask"},
PersistenceGetTasksScope: {operation: "GetTasks"},
PersistenceCompleteTaskScope: {operation: "CompleteTask"},
PersistenceCompleteTasksLessThanScope: {operation: "CompleteTasksLessThan"},
PersistenceLeaseTaskQueueScope: {operation: "LeaseTaskQueue"},
PersistenceUpdateTaskQueueScope: {operation: "UpdateTaskQueue"},
PersistenceListTaskQueueScope: {operation: "ListTaskQueue"},
PersistenceDeleteTaskQueueScope: {operation: "DeleteTaskQueue"},
PersistenceAppendHistoryEventsScope: {operation: "AppendHistoryEvents"},
PersistenceGetWorkflowExecutionHistoryScope: {operation: "GetWorkflowExecutionHistory"},
PersistenceDeleteWorkflowExecutionHistoryScope: {operation: "DeleteWorkflowExecutionHistory"},
PersistenceInitializeSystemNamespaceScope: {operation: "InitializeSystemNamespace"},
PersistenceCreateNamespaceScope: {operation: "CreateNamespace"},
PersistenceGetNamespaceScope: {operation: "GetNamespace"},
PersistenceUpdateNamespaceScope: {operation: "UpdateNamespace"},
PersistenceDeleteNamespaceScope: {operation: "DeleteNamespace"},
PersistenceDeleteNamespaceByNameScope: {operation: "DeleteNamespaceByName"},
PersistenceListNamespaceScope: {operation: "ListNamespace"},
PersistenceGetMetadataScope: {operation: "GetMetadata"},
VisibilityPersistenceRecordWorkflowExecutionStartedScope: {operation: "RecordWorkflowExecutionStarted", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceRecordWorkflowExecutionClosedScope: {operation: "RecordWorkflowExecutionClosed", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceUpsertWorkflowExecutionScope: {operation: "UpsertWorkflowExecution", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceListOpenWorkflowExecutionsScope: {operation: "ListOpenWorkflowExecutions", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceListClosedWorkflowExecutionsScope: {operation: "ListClosedWorkflowExecutions", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceListOpenWorkflowExecutionsByTypeScope: {operation: "ListOpenWorkflowExecutionsByType", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceListClosedWorkflowExecutionsByTypeScope: {operation: "ListClosedWorkflowExecutionsByType", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceListOpenWorkflowExecutionsByWorkflowIDScope: {operation: "ListOpenWorkflowExecutionsByWorkflowID", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceListClosedWorkflowExecutionsByWorkflowIDScope: {operation: "ListClosedWorkflowExecutionsByWorkflowID", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceListClosedWorkflowExecutionsByStatusScope: {operation: "ListClosedWorkflowExecutionsByStatus", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceDeleteWorkflowExecutionScope: {operation: "VisibilityDeleteWorkflowExecution", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceListWorkflowExecutionsScope: {operation: "ListWorkflowExecutions", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceScanWorkflowExecutionsScope: {operation: "ScanWorkflowExecutions", tags: map[string]string{visibilityTypeTagName: unknownValue}},
VisibilityPersistenceCountWorkflowExecutionsScope: {operation: "CountWorkflowExecutions", tags: map[string]string{visibilityTypeTagName: unknownValue}},
PersistenceAppendHistoryNodesScope: {operation: "AppendHistoryNodes"},
PersistenceDeleteHistoryNodesScope: {operation: "DeleteHistoryNodes"},
PersistenceReadHistoryBranchScope: {operation: "ReadHistoryBranch"},
PersistenceForkHistoryBranchScope: {operation: "ForkHistoryBranch"},
PersistenceDeleteHistoryBranchScope: {operation: "DeleteHistoryBranch"},
PersistenceTrimHistoryBranchScope: {operation: "TrimHistoryBranch"},
PersistenceCompleteForkBranchScope: {operation: "CompleteForkBranch"},
PersistenceGetHistoryTreeScope: {operation: "GetHistoryTree"},
PersistenceGetAllHistoryTreeBranchesScope: {operation: "GetAllHistoryTreeBranches"},
PersistenceEnqueueMessageScope: {operation: "EnqueueMessage"},
PersistenceEnqueueMessageToDLQScope: {operation: "EnqueueMessageToDLQ"},
PersistenceReadQueueMessagesScope: {operation: "ReadQueueMessages"},
PersistenceReadQueueMessagesFromDLQScope: {operation: "ReadQueueMessagesFromDLQ"},
PersistenceDeleteQueueMessagesScope: {operation: "DeleteQueueMessages"},
PersistenceDeleteQueueMessageFromDLQScope: {operation: "DeleteQueueMessageFromDLQ"},
PersistenceRangeDeleteMessagesFromDLQScope: {operation: "RangeDeleteMessagesFromDLQ"},
PersistenceUpdateAckLevelScope: {operation: "UpdateAckLevel"},
PersistenceGetAckLevelScope: {operation: "GetAckLevel"},
PersistenceUpdateDLQAckLevelScope: {operation: "UpdateDLQAckLevel"},
PersistenceGetDLQAckLevelScope: {operation: "GetDLQAckLevel"},
PersistenceNamespaceReplicationQueueScope: {operation: "NamespaceReplicationQueue"},
PersistenceGetClusterMetadataScope: {operation: "GetClusterMetadata"},
PersistenceSaveClusterMetadataScope: {operation: "SaveClusterMetadata"},
PersistenceDeleteClusterMetadataScope: {operation: "DeleteClusterMetadata"},
PersistencePruneClusterMembershipScope: {operation: "PruneClusterMembership"},
PersistenceGetClusterMembersScope: {operation: "GetClusterMembership"},
PersistenceUpsertClusterMembershipScope: {operation: "UpsertClusterMembership"},
ClusterMetadataArchivalConfigScope: {operation: "ArchivalConfig"},
HistoryClientStartWorkflowExecutionScope: {operation: "HistoryClientStartWorkflowExecution", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRecordActivityTaskHeartbeatScope: {operation: "HistoryClientRecordActivityTaskHeartbeat", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRespondWorkflowTaskCompletedScope: {operation: "HistoryClientRespondWorkflowTaskCompleted", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRespondWorkflowTaskFailedScope: {operation: "HistoryClientRespondWorkflowTaskFailed", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRespondActivityTaskCompletedScope: {operation: "HistoryClientRespondActivityTaskCompleted", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRespondActivityTaskFailedScope: {operation: "HistoryClientRespondActivityTaskFailed", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRespondActivityTaskCanceledScope: {operation: "HistoryClientRespondActivityTaskCanceled", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientGetMutableStateScope: {operation: "HistoryClientGetMutableState", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientPollMutableStateScope: {operation: "HistoryClientPollMutableState", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientResetStickyTaskQueueScope: {operation: "HistoryClientResetStickyTaskQueueScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientDescribeWorkflowExecutionScope: {operation: "HistoryClientDescribeWorkflowExecution", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRecordWorkflowTaskStartedScope: {operation: "HistoryClientRecordWorkflowTaskStarted", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRecordActivityTaskStartedScope: {operation: "HistoryClientRecordActivityTaskStarted", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRequestCancelWorkflowExecutionScope: {operation: "HistoryClientRequestCancelWorkflowExecution", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientSignalWorkflowExecutionScope: {operation: "HistoryClientSignalWorkflowExecution", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientSignalWithStartWorkflowExecutionScope: {operation: "HistoryClientSignalWithStartWorkflowExecution", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRemoveSignalMutableStateScope: {operation: "HistoryClientRemoveSignalMutableStateScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientTerminateWorkflowExecutionScope: {operation: "HistoryClientTerminateWorkflowExecution", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientResetWorkflowExecutionScope: {operation: "HistoryClientResetWorkflowExecution", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientScheduleWorkflowTaskScope: {operation: "HistoryClientScheduleWorkflowTask", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRecordChildExecutionCompletedScope: {operation: "HistoryClientRecordChildExecutionCompleted", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientReplicateEventsV2Scope: {operation: "HistoryClientReplicateEventsV2", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientSyncShardStatusScope: {operation: "HistoryClientSyncShardStatusScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientSyncActivityScope: {operation: "HistoryClientSyncActivityScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientGetReplicationTasksScope: {operation: "HistoryClientGetReplicationTasksScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientGetDLQReplicationTasksScope: {operation: "HistoryClientGetDLQReplicationTasksScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientQueryWorkflowScope: {operation: "HistoryClientQueryWorkflowScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientReapplyEventsScope: {operation: "HistoryClientReapplyEventsScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientGetDLQMessagesScope: {operation: "HistoryClientGetDLQMessagesScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientPurgeDLQMessagesScope: {operation: "HistoryClientPurgeDLQMessagesScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientMergeDLQMessagesScope: {operation: "HistoryClientMergeDLQMessagesScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientRefreshWorkflowTasksScope: {operation: "HistoryClientRefreshWorkflowTasksScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientGenerateLastHistoryReplicationTasksScope: {operation: "HistoryClientGenerateLastHistoryReplicationTasksScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
HistoryClientGetReplicationStatusScope: {operation: "HistoryClientGetReplicationStatusScope", tags: map[string]string{ServiceRoleTagName: HistoryRoleTagValue}},
MatchingClientPollWorkflowTaskQueueScope: {operation: "MatchingClientPollWorkflowTaskQueue", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
MatchingClientPollActivityTaskQueueScope: {operation: "MatchingClientPollActivityTaskQueue", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
MatchingClientAddActivityTaskScope: {operation: "MatchingClientAddActivityTask", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
MatchingClientAddWorkflowTaskScope: {operation: "MatchingClientAddWorkflowTask", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
MatchingClientQueryWorkflowScope: {operation: "MatchingClientQueryWorkflow", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
MatchingClientRespondQueryTaskCompletedScope: {operation: "MatchingClientRespondQueryTaskCompleted", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
MatchingClientCancelOutstandingPollScope: {operation: "MatchingClientCancelOutstandingPoll", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
MatchingClientDescribeTaskQueueScope: {operation: "MatchingClientDescribeTaskQueue", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
MatchingClientListTaskQueuePartitionsScope: {operation: "MatchingClientListTaskQueuePartitions", tags: map[string]string{ServiceRoleTagName: MatchingRoleTagValue}},
FrontendClientDeprecateNamespaceScope: {operation: "FrontendClientDeprecateNamespace", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientDescribeNamespaceScope: {operation: "FrontendClientDescribeNamespace", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientDescribeTaskQueueScope: {operation: "FrontendClientDescribeTaskQueue", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientDescribeWorkflowExecutionScope: {operation: "FrontendClientDescribeWorkflowExecution", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientGetWorkflowExecutionHistoryScope: {operation: "FrontendClientGetWorkflowExecutionHistory", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientGetWorkflowExecutionRawHistoryScope: {operation: "FrontendClientGetWorkflowExecutionRawHistory", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientPollForWorkflowExecutionRawHistoryScope: {operation: "FrontendClientPollForWorkflowExecutionRawHistoryScope", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientListArchivedWorkflowExecutionsScope: {operation: "FrontendClientListArchivedWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientListClosedWorkflowExecutionsScope: {operation: "FrontendClientListClosedWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientListNamespacesScope: {operation: "FrontendClientListNamespaces", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientListOpenWorkflowExecutionsScope: {operation: "FrontendClientListOpenWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientPollActivityTaskQueueScope: {operation: "FrontendClientPollActivityTaskQueue", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientPollWorkflowTaskQueueScope: {operation: "FrontendClientPollWorkflowTaskQueue", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientQueryWorkflowScope: {operation: "FrontendClientQueryWorkflow", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRecordActivityTaskHeartbeatScope: {operation: "FrontendClientRecordActivityTaskHeartbeat", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRecordActivityTaskHeartbeatByIdScope: {operation: "FrontendClientRecordActivityTaskHeartbeatById", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRegisterNamespaceScope: {operation: "FrontendClientRegisterNamespace", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRequestCancelWorkflowExecutionScope: {operation: "FrontendClientRequestCancelWorkflowExecution", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientResetStickyTaskQueueScope: {operation: "FrontendClientResetStickyTaskQueue", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientResetWorkflowExecutionScope: {operation: "FrontendClientResetWorkflowExecution", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondActivityTaskCanceledScope: {operation: "FrontendClientRespondActivityTaskCanceled", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondActivityTaskCanceledByIdScope: {operation: "FrontendClientRespondActivityTaskCanceledById", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondActivityTaskCompletedScope: {operation: "FrontendClientRespondActivityTaskCompleted", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondActivityTaskCompletedByIdScope: {operation: "FrontendClientRespondActivityTaskCompletedById", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondActivityTaskFailedScope: {operation: "FrontendClientRespondActivityTaskFailed", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondActivityTaskFailedByIdScope: {operation: "FrontendClientRespondActivityTaskFailedById", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondWorkflowTaskCompletedScope: {operation: "FrontendClientRespondWorkflowTaskCompleted", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondWorkflowTaskFailedScope: {operation: "FrontendClientRespondWorkflowTaskFailed", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientRespondQueryTaskCompletedScope: {operation: "FrontendClientRespondQueryTaskCompleted", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientSignalWithStartWorkflowExecutionScope: {operation: "FrontendClientSignalWithStartWorkflowExecution", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientSignalWorkflowExecutionScope: {operation: "FrontendClientSignalWorkflowExecution", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientStartWorkflowExecutionScope: {operation: "FrontendClientStartWorkflowExecution", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientTerminateWorkflowExecutionScope: {operation: "FrontendClientTerminateWorkflowExecution", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientUpdateNamespaceScope: {operation: "FrontendClientUpdateNamespace", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientListWorkflowExecutionsScope: {operation: "FrontendClientListWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientScanWorkflowExecutionsScope: {operation: "FrontendClientScanWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientCountWorkflowExecutionsScope: {operation: "FrontendClientCountWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientGetSearchAttributesScope: {operation: "FrontendClientGetSearchAttributes", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientGetReplicationTasksScope: {operation: "FrontendClientGetReplicationTasksScope", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientGetNamespaceReplicationTasksScope: {operation: "FrontendClientGetNamespaceReplicationTasksScope", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientGetDLQReplicationTasksScope: {operation: "FrontendClientGetDLQReplicationTasksScope", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientReapplyEventsScope: {operation: "FrontendClientReapplyEventsScope", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientGetClusterInfoScope: {operation: "FrontendClientGetClusterInfoScope", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
FrontendClientListTaskQueuePartitionsScope: {operation: "FrontendClientListTaskQueuePartitions", tags: map[string]string{ServiceRoleTagName: FrontendRoleTagValue}},
AdminClientAddSearchAttributesScope: {operation: "AdminClientAddSearchAttributes", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientRemoveSearchAttributesScope: {operation: "AdminClientRemoveSearchAttributes", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientGetSearchAttributesScope: {operation: "AdminClientGetSearchAttributes", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientDescribeHistoryHostScope: {operation: "AdminClientDescribeHistoryHost", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientDescribeWorkflowMutableStateScope: {operation: "AdminClientDescribeWorkflowMutableState", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientGetWorkflowExecutionRawHistoryScope: {operation: "AdminClientGetWorkflowExecutionRawHistory", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientGetWorkflowExecutionRawHistoryV2Scope: {operation: "AdminClientGetWorkflowExecutionRawHistoryV2", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientDescribeClusterScope: {operation: "AdminClientDescribeCluster", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientAddOrUpdateRemoteClusterScope: {operation: "AdminClientAddOrUpdateRemoteCluster", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientRemoveRemoteClusterScope: {operation: "AdminClientRemoveRemoteCluster", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientRegisterNamespaceScope: {operation: "AdminClientRegisterNamespace", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientUpdateNamespaceScope: {operation: "AdminClientUpdateNamespace", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientRefreshWorkflowTasksScope: {operation: "AdminClientRefreshWorkflowTasks", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientListNamespacesScope: {operation: "AdminClientListNamespaces", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientResendReplicationTasksScope: {operation: "AdminClientResendReplicationTasks", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientListClusterMembersScope: {operation: "AdminClientListClusterMembers", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientCloseShardScope: {operation: "AdminClientCloseShard", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientGetShardScope: {operation: "AdminClientGetShard", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientGetDLQMessagesScope: {operation: "AdminClientGetDLQMessages", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientPurgeDLQMessagesScope: {operation: "AdminClientPurgeDLQMessages", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
AdminClientMergeDLQMessagesScope: {operation: "AdminClientMergeDLQMessages", tags: map[string]string{ServiceRoleTagName: AdminRoleTagValue}},
DCRedirectionDeprecateNamespaceScope: {operation: "DCRedirectionDeprecateNamespace", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionDescribeNamespaceScope: {operation: "DCRedirectionDescribeNamespace", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionDescribeTaskQueueScope: {operation: "DCRedirectionDescribeTaskQueue", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionDescribeWorkflowExecutionScope: {operation: "DCRedirectionDescribeWorkflowExecution", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionGetWorkflowExecutionHistoryScope: {operation: "DCRedirectionGetWorkflowExecutionHistory", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionGetWorkflowExecutionRawHistoryScope: {operation: "DCRedirectionGetWorkflowExecutionRawHistoryScope", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionPollForWorkflowExecutionRawHistoryScope: {operation: "DCRedirectionPollForWorkflowExecutionRawHistoryScope", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionListArchivedWorkflowExecutionsScope: {operation: "DCRedirectionListArchivedWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionListClosedWorkflowExecutionsScope: {operation: "DCRedirectionListClosedWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionListNamespacesScope: {operation: "DCRedirectionListNamespaces", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionListOpenWorkflowExecutionsScope: {operation: "DCRedirectionListOpenWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionListWorkflowExecutionsScope: {operation: "DCRedirectionListWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionScanWorkflowExecutionsScope: {operation: "DCRedirectionScanWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionCountWorkflowExecutionsScope: {operation: "DCRedirectionCountWorkflowExecutions", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionGetSearchAttributesScope: {operation: "DCRedirectionGetSearchAttributes", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionPollActivityTaskQueueScope: {operation: "DCRedirectionPollActivityTaskQueue", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionPollWorkflowTaskQueueScope: {operation: "DCRedirectionPollWorkflowTaskQueue", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionQueryWorkflowScope: {operation: "DCRedirectionQueryWorkflow", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRecordActivityTaskHeartbeatScope: {operation: "DCRedirectionRecordActivityTaskHeartbeat", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRecordActivityTaskHeartbeatByIdScope: {operation: "DCRedirectionRecordActivityTaskHeartbeatById", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRegisterNamespaceScope: {operation: "DCRedirectionRegisterNamespace", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRequestCancelWorkflowExecutionScope: {operation: "DCRedirectionRequestCancelWorkflowExecution", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionResetStickyTaskQueueScope: {operation: "DCRedirectionResetStickyTaskQueue", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionResetWorkflowExecutionScope: {operation: "DCRedirectionResetWorkflowExecution", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondActivityTaskCanceledScope: {operation: "DCRedirectionRespondActivityTaskCanceled", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondActivityTaskCanceledByIdScope: {operation: "DCRedirectionRespondActivityTaskCanceledById", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondActivityTaskCompletedScope: {operation: "DCRedirectionRespondActivityTaskCompleted", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondActivityTaskCompletedByIdScope: {operation: "DCRedirectionRespondActivityTaskCompletedById", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondActivityTaskFailedScope: {operation: "DCRedirectionRespondActivityTaskFailed", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondActivityTaskFailedByIdScope: {operation: "DCRedirectionRespondActivityTaskFailedById", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondWorkflowTaskCompletedScope: {operation: "DCRedirectionRespondWorkflowTaskCompleted", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondWorkflowTaskFailedScope: {operation: "DCRedirectionRespondWorkflowTaskFailed", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionRespondQueryTaskCompletedScope: {operation: "DCRedirectionRespondQueryTaskCompleted", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionSignalWithStartWorkflowExecutionScope: {operation: "DCRedirectionSignalWithStartWorkflowExecution", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionSignalWorkflowExecutionScope: {operation: "DCRedirectionSignalWorkflowExecution", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionStartWorkflowExecutionScope: {operation: "DCRedirectionStartWorkflowExecution", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionTerminateWorkflowExecutionScope: {operation: "DCRedirectionTerminateWorkflowExecution", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionUpdateNamespaceScope: {operation: "DCRedirectionUpdateNamespace", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
DCRedirectionListTaskQueuePartitionsScope: {operation: "DCRedirectionListTaskQueuePartitions", tags: map[string]string{ServiceRoleTagName: DCRedirectionRoleTagValue}},
MessagingClientPublishScope: {operation: "MessagingClientPublish"},
MessagingClientPublishBatchScope: {operation: "MessagingClientPublishBatch"},
NamespaceCacheScope: {operation: "NamespaceCache"},
HistoryRereplicationByTransferTaskScope: {operation: "HistoryRereplicationByTransferTask"},
HistoryRereplicationByTimerTaskScope: {operation: "HistoryRereplicationByTimerTask"},
HistoryRereplicationByHistoryReplicationScope: {operation: "HistoryRereplicationByHistoryReplication"},
HistoryRereplicationByHistoryMetadataReplicationScope: {operation: "HistoryRereplicationByHistoryMetadataReplication"},
HistoryRereplicationByActivityReplicationScope: {operation: "HistoryRereplicationByActivityReplication"},
ElasticsearchBulkProcessor: {operation: "ElasticsearchBulkProcessor"},
ElasticsearchVisibility: {operation: "ElasticsearchVisibility"},
SequentialTaskProcessingScope: {operation: "SequentialTaskProcessing"},
ParallelTaskProcessingScope: {operation: "ParallelTaskProcessing"},
TaskSchedulerScope: {operation: "TaskScheduler"},
HistoryArchiverScope: {operation: "HistoryArchiver"},
VisibilityArchiverScope: {operation: "VisibilityArchiver"},
BlobstoreClientUploadScope: {operation: "BlobstoreClientUpload", tags: map[string]string{ServiceRoleTagName: BlobstoreRoleTagValue}},
BlobstoreClientDownloadScope: {operation: "BlobstoreClientDownload", tags: map[string]string{ServiceRoleTagName: BlobstoreRoleTagValue}},
BlobstoreClientGetMetadataScope: {operation: "BlobstoreClientGetMetadata", tags: map[string]string{ServiceRoleTagName: BlobstoreRoleTagValue}},
BlobstoreClientExistsScope: {operation: "BlobstoreClientExists", tags: map[string]string{ServiceRoleTagName: BlobstoreRoleTagValue}},
BlobstoreClientDeleteScope: {operation: "BlobstoreClientDelete", tags: map[string]string{ServiceRoleTagName: BlobstoreRoleTagValue}},
BlobstoreClientDirectoryExistsScope: {operation: "BlobstoreClientDirectoryExists", tags: map[string]string{ServiceRoleTagName: BlobstoreRoleTagValue}},
DynamicConfigScope: {operation: "DynamicConfig"},
},
// Frontend Scope Names
Frontend: {
// Admin API scope co-locates with with frontend
AdminRemoveTaskScope: {operation: "AdminRemoveTask"},
AdminCloseShardScope: {operation: "AdminCloseShard"},
AdminGetShardScope: {operation: "AdminGetShard"},
AdminReadDLQMessagesScope: {operation: "AdminReadDLQMessages"},
AdminPurgeDLQMessagesScope: {operation: "AdminPurgeDLQMessages"},
AdminMergeDLQMessagesScope: {operation: "AdminMergeDLQMessages"},
AdminDescribeHistoryHostScope: {operation: "DescribeHistoryHost"},
AdminAddSearchAttributesScope: {operation: "AdminAddSearchAttributes"},
AdminRemoveSearchAttributesScope: {operation: "AdminRemoveSearchAttributes"},
AdminGetSearchAttributesScope: {operation: "AdminGetSearchAttributes"},
AdminDescribeWorkflowExecutionScope: {operation: "DescribeWorkflowExecution"},
AdminGetWorkflowExecutionRawHistoryScope: {operation: "GetWorkflowExecutionRawHistory"},
AdminGetWorkflowExecutionRawHistoryV2Scope: {operation: "GetWorkflowExecutionRawHistoryV2"},
AdminGetReplicationMessagesScope: {operation: "GetReplicationMessages"},
AdminListClusterMembersScope: {operation: "AdminListClusterMembers"},
AdminGetNamespaceReplicationMessagesScope: {operation: "GetNamespaceReplicationMessages"},
AdminListNamespacesScope: {operation: "AdminListNamespaces"},
AdminRegisterNamespaceScope: {operation: "AdminRegisterNamespace"},
AdminUpdateNamespaceScope: {operation: "AdminUpdateNamespace"},
AdminGetDLQReplicationMessagesScope: {operation: "AdminGetDLQReplicationMessages"},
AdminReapplyEventsScope: {operation: "ReapplyEvents"},
AdminRefreshWorkflowTasksScope: {operation: "RefreshWorkflowTasks"},
AdminResendReplicationTasksScope: {operation: "ResendReplicationTasks"},
AdminDescribeClusterScope: {operation: "AdminDescribeCluster"},
AdminAddOrUpdateRemoteClusterScope: {operation: "AdminAddOrUpdateRemoteCluster"},
AdminRemoveRemoteClusterScope: {operation: "AdminRemoveRemoteCluster"},
FrontendStartWorkflowExecutionScope: {operation: "StartWorkflowExecution"},
FrontendPollWorkflowTaskQueueScope: {operation: "PollWorkflowTaskQueue"},
FrontendPollActivityTaskQueueScope: {operation: "PollActivityTaskQueue"},
FrontendRecordActivityTaskHeartbeatScope: {operation: "RecordActivityTaskHeartbeat"},
FrontendRecordActivityTaskHeartbeatByIdScope: {operation: "RecordActivityTaskHeartbeatById"},
FrontendRespondWorkflowTaskCompletedScope: {operation: "RespondWorkflowTaskCompleted"},
FrontendRespondWorkflowTaskFailedScope: {operation: "RespondWorkflowTaskFailed"},
FrontendRespondQueryTaskCompletedScope: {operation: "RespondQueryTaskCompleted"},
FrontendRespondActivityTaskCompletedScope: {operation: "RespondActivityTaskCompleted"},
FrontendRespondActivityTaskFailedScope: {operation: "RespondActivityTaskFailed"},
FrontendRespondActivityTaskCanceledScope: {operation: "RespondActivityTaskCanceled"},
FrontendRespondActivityTaskCompletedByIdScope: {operation: "RespondActivityTaskCompletedById"},
FrontendRespondActivityTaskFailedByIdScope: {operation: "RespondActivityTaskFailedById"},
FrontendRespondActivityTaskCanceledByIdScope: {operation: "RespondActivityTaskCanceledById"},
FrontendGetWorkflowExecutionHistoryScope: {operation: "GetWorkflowExecutionHistory"},
FrontendPollWorkflowExecutionHistoryScope: {operation: "PollWorkflowExecutionHistory"},
FrontendGetWorkflowExecutionRawHistoryScope: {operation: "GetWorkflowExecutionRawHistory"},
FrontendPollForWorkflowExecutionRawHistoryScope: {operation: "PollForWorkflowExecutionRawHistory"},
FrontendSignalWorkflowExecutionScope: {operation: "SignalWorkflowExecution"},
FrontendSignalWithStartWorkflowExecutionScope: {operation: "SignalWithStartWorkflowExecution"},
FrontendTerminateWorkflowExecutionScope: {operation: "TerminateWorkflowExecution"},
FrontendResetWorkflowExecutionScope: {operation: "ResetWorkflowExecution"},
FrontendRequestCancelWorkflowExecutionScope: {operation: "RequestCancelWorkflowExecution"},
FrontendListArchivedWorkflowExecutionsScope: {operation: "ListArchivedWorkflowExecutions"},
FrontendListOpenWorkflowExecutionsScope: {operation: "ListOpenWorkflowExecutions"},
FrontendListClosedWorkflowExecutionsScope: {operation: "ListClosedWorkflowExecutions"},
FrontendListWorkflowExecutionsScope: {operation: "ListWorkflowExecutions"},
FrontendScanWorkflowExecutionsScope: {operation: "ScanWorkflowExecutions"},
FrontendCountWorkflowExecutionsScope: {operation: "CountWorkflowExecutions"},
FrontendRegisterNamespaceScope: {operation: "RegisterNamespace"},
FrontendDescribeNamespaceScope: {operation: "DescribeNamespace"},
FrontendListNamespacesScope: {operation: "ListNamespaces"},
FrontendUpdateNamespaceScope: {operation: "UpdateNamespace"},
FrontendDeprecateNamespaceScope: {operation: "DeprecateNamespace"},
FrontendQueryWorkflowScope: {operation: "QueryWorkflow"},
FrontendDescribeWorkflowExecutionScope: {operation: "DescribeWorkflowExecution"},
FrontendListTaskQueuePartitionsScope: {operation: "ListTaskQueuePartitions"},
FrontendDescribeTaskQueueScope: {operation: "DescribeTaskQueue"},
FrontendResetStickyTaskQueueScope: {operation: "ResetStickyTaskQueue"},
FrontendGetSearchAttributesScope: {operation: "GetSearchAttributes"},
FrontendGetClusterInfoScope: {operation: "GetClusterInfo"},
VersionCheckScope: {operation: "VersionCheck"},
AuthorizationScope: {operation: "Authorization"},
},
// History Scope Names
History: {
HistoryStartWorkflowExecutionScope: {operation: "StartWorkflowExecution"},
HistoryRecordActivityTaskHeartbeatScope: {operation: "RecordActivityTaskHeartbeat"},
HistoryRespondWorkflowTaskCompletedScope: {operation: "RespondWorkflowTaskCompleted"},
HistoryRespondWorkflowTaskFailedScope: {operation: "RespondWorkflowTaskFailed"},
HistoryRespondActivityTaskCompletedScope: {operation: "RespondActivityTaskCompleted"},
HistoryRespondActivityTaskFailedScope: {operation: "RespondActivityTaskFailed"},
HistoryRespondActivityTaskCanceledScope: {operation: "RespondActivityTaskCanceled"},
HistoryGetMutableStateScope: {operation: "GetMutableState"},
HistoryPollMutableStateScope: {operation: "PollMutableState"},
HistoryResetStickyTaskQueueScope: {operation: "ResetStickyTaskQueueScope"},
HistoryDescribeWorkflowExecutionScope: {operation: "DescribeWorkflowExecution"},
HistoryRecordWorkflowTaskStartedScope: {operation: "RecordWorkflowTaskStarted"},
HistoryRecordActivityTaskStartedScope: {operation: "RecordActivityTaskStarted"},
HistorySignalWorkflowExecutionScope: {operation: "SignalWorkflowExecution"},
HistorySignalWithStartWorkflowExecutionScope: {operation: "SignalWithStartWorkflowExecution"},
HistoryRemoveSignalMutableStateScope: {operation: "RemoveSignalMutableState"},
HistoryTerminateWorkflowExecutionScope: {operation: "TerminateWorkflowExecution"},
HistoryResetWorkflowExecutionScope: {operation: "ResetWorkflowExecution"},
HistoryQueryWorkflowScope: {operation: "QueryWorkflow"},
HistoryProcessDeleteHistoryEventScope: {operation: "ProcessDeleteHistoryEvent"},
HistoryScheduleWorkflowTaskScope: {operation: "ScheduleWorkflowTask"},
HistoryRecordChildExecutionCompletedScope: {operation: "RecordChildExecutionCompleted"},
HistoryRequestCancelWorkflowExecutionScope: {operation: "RequestCancelWorkflowExecution"},
HistorySyncShardStatusScope: {operation: "SyncShardStatus"},
HistorySyncActivityScope: {operation: "SyncActivity"},
HistoryDescribeMutableStateScope: {operation: "DescribeMutableState"},
HistoryGetReplicationMessagesScope: {operation: "GetReplicationMessages"},
HistoryGetDLQReplicationMessagesScope: {operation: "GetDLQReplicationMessages"},
HistoryReadDLQMessagesScope: {operation: "GetDLQMessages"},
HistoryPurgeDLQMessagesScope: {operation: "PurgeDLQMessages"},
HistoryMergeDLQMessagesScope: {operation: "MergeDLQMessages"},
HistoryShardControllerScope: {operation: "ShardController"},
HistoryReapplyEventsScope: {operation: "EventReapplication"},
HistoryRefreshWorkflowTasksScope: {operation: "RefreshWorkflowTasks"},
HistoryGenerateLastHistoryReplicationTasksScope: {operation: "GenerateLastHistoryReplicationTasks"},
HistoryGetReplicationStatusScope: {operation: "GetReplicationStatus"},
HistoryHistoryRemoveTaskScope: {operation: "RemoveTask"},
HistoryCloseShard: {operation: "CloseShard"},
HistoryGetShard: {operation: "GetShard"},
HistoryReplicateEventsV2: {operation: "ReplicateEventsV2"},
HistoryResetStickyTaskQueue: {operation: "ResetStickyTaskQueue"},
HistoryReapplyEvents: {operation: "ReapplyEvents"},
HistoryDescribeHistoryHost: {operation: "DescribeHistoryHost"},
TaskPriorityAssignerScope: {operation: "TaskPriorityAssigner"},
TransferQueueProcessorScope: {operation: "TransferQueueProcessor"},
TransferActiveQueueProcessorScope: {operation: "TransferActiveQueueProcessor"},
TransferStandbyQueueProcessorScope: {operation: "TransferStandbyQueueProcessor"},
TransferActiveTaskActivityScope: {operation: "TransferActiveTaskActivity"},
TransferActiveTaskWorkflowTaskScope: {operation: "TransferActiveTaskWorkflowTask"},
TransferActiveTaskCloseExecutionScope: {operation: "TransferActiveTaskCloseExecution"},
TransferActiveTaskCancelExecutionScope: {operation: "TransferActiveTaskCancelExecution"},
TransferActiveTaskSignalExecutionScope: {operation: "TransferActiveTaskSignalExecution"},
TransferActiveTaskStartChildExecutionScope: {operation: "TransferActiveTaskStartChildExecution"},
TransferActiveTaskResetWorkflowScope: {operation: "TransferActiveTaskResetWorkflow"},
TransferStandbyTaskActivityScope: {operation: "TransferStandbyTaskActivity"},
TransferStandbyTaskWorkflowTaskScope: {operation: "TransferStandbyTaskWorkflowTask"},
TransferStandbyTaskCloseExecutionScope: {operation: "TransferStandbyTaskCloseExecution"},
TransferStandbyTaskCancelExecutionScope: {operation: "TransferStandbyTaskCancelExecution"},
TransferStandbyTaskSignalExecutionScope: {operation: "TransferStandbyTaskSignalExecution"},
TransferStandbyTaskStartChildExecutionScope: {operation: "TransferStandbyTaskStartChildExecution"},
TransferStandbyTaskResetWorkflowScope: {operation: "TransferStandbyTaskResetWorkflow"},
VisibilityQueueProcessorScope: {operation: "VisibilityQueueProcessor"},
VisibilityTaskStartExecutionScope: {operation: "VisibilityTaskStartExecution"},
VisibilityTaskUpsertExecutionScope: {operation: "VisibilityTaskUpsertExecution"},
VisibilityTaskCloseExecutionScope: {operation: "VisibilityTaskCloseExecution"},
VisibilityTaskDeleteExecutionScope: {operation: "VisibilityTaskDeleteExecution"},
TimerQueueProcessorScope: {operation: "TimerQueueProcessor"},
TimerActiveQueueProcessorScope: {operation: "TimerActiveQueueProcessor"},
TimerStandbyQueueProcessorScope: {operation: "TimerStandbyQueueProcessor"},
TimerActiveTaskActivityTimeoutScope: {operation: "TimerActiveTaskActivityTimeout"},
TimerActiveTaskWorkflowTaskTimeoutScope: {operation: "TimerActiveTaskWorkflowTaskTimeout"},
TimerActiveTaskUserTimerScope: {operation: "TimerActiveTaskUserTimer"},
TimerActiveTaskWorkflowTimeoutScope: {operation: "TimerActiveTaskWorkflowTimeout"},
TimerActiveTaskActivityRetryTimerScope: {operation: "TimerActiveTaskActivityRetryTimer"},
TimerActiveTaskWorkflowBackoffTimerScope: {operation: "TimerActiveTaskWorkflowBackoffTimer"},
TimerActiveTaskDeleteHistoryEventScope: {operation: "TimerActiveTaskDeleteHistoryEvent"},
TimerStandbyTaskActivityTimeoutScope: {operation: "TimerStandbyTaskActivityTimeout"},
TimerStandbyTaskWorkflowTaskTimeoutScope: {operation: "TimerStandbyTaskWorkflowTaskTimeout"},
TimerStandbyTaskUserTimerScope: {operation: "TimerStandbyTaskUserTimer"},
TimerStandbyTaskWorkflowTimeoutScope: {operation: "TimerStandbyTaskWorkflowTimeout"},
TimerStandbyTaskActivityRetryTimerScope: {operation: "TimerStandbyTaskActivityRetryTimer"},
TimerStandbyTaskWorkflowBackoffTimerScope: {operation: "TimerStandbyTaskWorkflowBackoffTimer"},
TimerStandbyTaskDeleteHistoryEventScope: {operation: "TimerStandbyTaskDeleteHistoryEvent"},
HistoryEventNotificationScope: {operation: "HistoryEventNotification"},
ReplicatorQueueProcessorScope: {operation: "ReplicatorQueueProcessor"},
ReplicatorTaskHistoryScope: {operation: "ReplicatorTaskHistory"},
ReplicatorTaskSyncActivityScope: {operation: "ReplicatorTaskSyncActivity"},
ReplicateHistoryEventsScope: {operation: "ReplicateHistoryEvents"},
ShardInfoScope: {operation: "ShardInfo"},
WorkflowContextScope: {operation: "WorkflowContext"},
HistoryCacheGetOrCreateScope: {operation: "HistoryCacheGetOrCreate", tags: map[string]string{CacheTypeTagName: MutableStateCacheTypeTagValue}},
HistoryCacheGetOrCreateCurrentScope: {operation: "HistoryCacheGetOrCreateCurrent", tags: map[string]string{CacheTypeTagName: MutableStateCacheTypeTagValue}},
EventsCacheGetEventScope: {operation: "EventsCacheGetEvent", tags: map[string]string{CacheTypeTagName: EventsCacheTypeTagValue}},
EventsCachePutEventScope: {operation: "EventsCachePutEvent", tags: map[string]string{CacheTypeTagName: EventsCacheTypeTagValue}},
EventsCacheDeleteEventScope: {operation: "EventsCacheDeleteEvent", tags: map[string]string{CacheTypeTagName: EventsCacheTypeTagValue}},
EventsCacheGetFromStoreScope: {operation: "EventsCacheGetFromStore", tags: map[string]string{CacheTypeTagName: EventsCacheTypeTagValue}},
ExecutionSizeStatsScope: {operation: "ExecutionStats", tags: map[string]string{StatsTypeTagName: SizeStatsTypeTagValue}},
ExecutionCountStatsScope: {operation: "ExecutionStats", tags: map[string]string{StatsTypeTagName: CountStatsTypeTagValue}},
SessionSizeStatsScope: {operation: "SessionStats", tags: map[string]string{StatsTypeTagName: SizeStatsTypeTagValue}},
SessionCountStatsScope: {operation: "SessionStats", tags: map[string]string{StatsTypeTagName: CountStatsTypeTagValue}},
WorkflowCompletionStatsScope: {operation: "CompletionStats", tags: map[string]string{StatsTypeTagName: CountStatsTypeTagValue}},
ArchiverClientScope: {operation: "ArchiverClient"},
ReplicationTaskFetcherScope: {operation: "ReplicationTaskFetcher"},
ReplicationTaskCleanupScope: {operation: "ReplicationTaskCleanup"},
ReplicationDLQStatsScope: {operation: "ReplicationDLQStats"},
SyncShardTaskScope: {operation: "SyncShardTask"},
SyncActivityTaskScope: {operation: "SyncActivityTask"},
HistoryMetadataReplicationTaskScope: {operation: "HistoryMetadataReplicationTask"},
HistoryReplicationTaskScope: {operation: "HistoryReplicationTask"},
ReplicatorScope: {operation: "Replicator"},
},
// Matching Scope Names
Matching: {
MatchingPollWorkflowTaskQueueScope: {operation: "PollWorkflowTaskQueue"},
MatchingPollActivityTaskQueueScope: {operation: "PollActivityTaskQueue"},
MatchingAddActivityTaskScope: {operation: "AddActivityTask"},
MatchingAddWorkflowTaskScope: {operation: "AddWorkflowTask"},
MatchingTaskQueueMgrScope: {operation: "TaskQueueMgr"},
MatchingEngineScope: {operation: "MatchingEngine"},
MatchingQueryWorkflowScope: {operation: "QueryWorkflow"},
MatchingRespondQueryTaskCompletedScope: {operation: "RespondQueryTaskCompleted"},
MatchingCancelOutstandingPollScope: {operation: "CancelOutstandingPoll"},
MatchingDescribeTaskQueueScope: {operation: "DescribeTaskQueue"},
MatchingListTaskQueuePartitionsScope: {operation: "ListTaskQueuePartitions"},
},
// Worker Scope Names
Worker: {
ReplicatorScope: {operation: "Replicator"},
NamespaceReplicationTaskScope: {operation: "NamespaceReplicationTask"},
HistoryReplicationTaskScope: {operation: "HistoryReplicationTask"},
HistoryMetadataReplicationTaskScope: {operation: "HistoryMetadataReplicationTask"},
SyncShardTaskScope: {operation: "SyncShardTask"},
SyncActivityTaskScope: {operation: "SyncActivityTask"},
ESProcessorScope: {operation: "ESProcessor"},
IndexProcessorScope: {operation: "IndexProcessor"},
ArchiverDeleteHistoryActivityScope: {operation: "ArchiverDeleteHistoryActivity"},
ArchiverUploadHistoryActivityScope: {operation: "ArchiverUploadHistoryActivity"},
ArchiverArchiveVisibilityActivityScope: {operation: "ArchiverArchiveVisibilityActivity"},
ArchiverScope: {operation: "Archiver"},
ArchiverPumpScope: {operation: "ArchiverPump"},
ArchiverArchivalWorkflowScope: {operation: "ArchiverArchivalWorkflow"},
TaskQueueScavengerScope: {operation: "taskqueuescavenger"},
ExecutionsScavengerScope: {operation: "executionsscavenger"},
HistoryScavengerScope: {operation: "historyscavenger"},
BatcherScope: {operation: "batcher"},
ParentClosePolicyProcessorScope: {operation: "ParentClosePolicyProcessor"},
AddSearchAttributesWorkflowScope: {operation: "AddSearchAttributesWorkflow"},
},
}
// Common Metrics enum
const (
ServiceRequests = iota
ServicePendingRequests
ServiceFailures
ServiceCriticalFailures
ServiceLatency
ServiceLatencyNoUserLatency
ServiceLatencyUserLatency
ServiceErrInvalidArgumentCounter
ServiceErrNamespaceNotActiveCounter
ServiceErrResourceExhaustedCounter
ServiceErrNotFoundCounter
ServiceErrExecutionAlreadyStartedCounter
ServiceErrNamespaceAlreadyExistsCounter
ServiceErrCancellationAlreadyRequestedCounter
ServiceErrQueryFailedCounter
ServiceErrContextCancelledCounter
ServiceErrContextTimeoutCounter
ServiceErrRetryTaskCounter
ServiceErrBadBinaryCounter
ServiceErrClientVersionNotSupportedCounter
ServiceErrIncompleteHistoryCounter
ServiceErrNonDeterministicCounter
ServiceErrUnauthorizedCounter
ServiceErrAuthorizeFailedCounter
PersistenceRequests
PersistenceFailures
PersistenceLatency
PersistenceErrShardExistsCounter
PersistenceErrShardOwnershipLostCounter
PersistenceErrConditionFailedCounter
PersistenceErrCurrentWorkflowConditionFailedCounter
PersistenceErrWorkflowConditionFailedCounter
PersistenceErrTimeoutCounter
PersistenceErrBusyCounter
PersistenceErrEntityNotExistsCounter
PersistenceErrNamespaceAlreadyExistsCounter
PersistenceErrBadRequestCounter
ClientRequests
ClientFailures
ClientLatency
ClientRedirectionRequests
ClientRedirectionFailures
ClientRedirectionLatency
ServiceAuthorizationLatency
NamespaceCachePrepareCallbacksLatency
NamespaceCacheCallbacksLatency
StateTransitionCount
HistorySize
HistoryCount
EventBlobSize
SearchAttributesSize
LockRequests
LockFailures
LockLatency
ArchivalConfigFailures
VisibilityPersistenceRequests
VisibilityPersistenceFailures
VisibilityPersistenceLatency
VisibilityPersistenceInvalidArgument
VisibilityPersistenceResourceExhausted
VisibilityPersistenceConditionFailed
VisibilityPersistenceTimeout
VisibilityPersistenceNotFound
VisibilityPersistenceInternal
VisibilityPersistenceUnavailable
SequentialTaskSubmitRequest
SequentialTaskSubmitRequestTaskQueueExist
SequentialTaskSubmitRequestTaskQueueMissing
SequentialTaskSubmitLatency
SequentialTaskQueueSize
SequentialTaskQueueProcessingLatency
SequentialTaskTaskProcessingLatency
ParallelTaskSubmitRequest
ParallelTaskSubmitLatency
ParallelTaskTaskProcessingLatency
PriorityTaskSubmitRequest
PriorityTaskSubmitLatency
HistoryArchiverArchiveNonRetryableErrorCount
HistoryArchiverArchiveTransientErrorCount
HistoryArchiverArchiveSuccessCount
HistoryArchiverHistoryMutatedCount
HistoryArchiverTotalUploadSize
HistoryArchiverHistorySize
// The following metrics are only used by internal history archiver implemention.
// TODO: move them to internal repo once temporal plugin model is in place.
HistoryArchiverBlobExistsCount
HistoryArchiverBlobSize
HistoryArchiverRunningDeterministicConstructionCheckCount
HistoryArchiverDeterministicConstructionCheckFailedCount
HistoryArchiverRunningBlobIntegrityCheckCount
HistoryArchiverBlobIntegrityCheckFailedCount
HistoryArchiverDuplicateArchivalsCount
VisibilityArchiverArchiveNonRetryableErrorCount
VisibilityArchiverArchiveTransientErrorCount
VisibilityArchiveSuccessCount
MatchingClientForwardedCounter
MatchingClientInvalidTaskQueueName
NamespaceReplicationTaskAckLevelGauge
NamespaceReplicationDLQAckLevelGauge
NamespaceReplicationDLQMaxLevelGauge
// common metrics that are emitted per task queue
ServiceRequestsPerTaskQueue
ServiceFailuresPerTaskQueue
ServiceLatencyPerTaskQueue
ServiceErrInvalidArgumentPerTaskQueueCounter
ServiceErrNamespaceNotActivePerTaskQueueCounter
ServiceErrResourceExhaustedPerTaskQueueCounter
ServiceErrNotFoundPerTaskQueueCounter
ServiceErrExecutionAlreadyStartedPerTaskQueueCounter
ServiceErrNamespaceAlreadyExistsPerTaskQueueCounter
ServiceErrCancellationAlreadyRequestedPerTaskQueueCounter
ServiceErrQueryFailedPerTaskQueueCounter
ServiceErrContextTimeoutPerTaskQueueCounter
ServiceErrRetryTaskPerTaskQueueCounter
ServiceErrBadBinaryPerTaskQueueCounter
ServiceErrClientVersionNotSupportedPerTaskQueueCounter
ServiceErrIncompleteHistoryPerTaskQueueCounter
ServiceErrNonDeterministicPerTaskQueueCounter
ServiceErrUnauthorizedPerTaskQueueCounter
ServiceErrAuthorizeFailedPerTaskQueueCounter
VersionCheckSuccessCount
VersionCheckRequestFailedCount
VersionCheckFailedCount
VersionCheckLatency
ParentClosePolicyProcessorSuccess
ParentClosePolicyProcessorFailures
AddSearchAttributesWorkflowSuccessCount
AddSearchAttributesWorkflowFailuresCount
ElasticsearchDocumentParseFailuresCount
ElasticsearchDocumentGenerateFailuresCount
NoopImplementationIsUsed
NumCommonMetrics // Needs to be last on this list for iota numbering
)
// History Metrics enum
const (
TaskRequests = iota + NumCommonMetrics
TaskLatency
TaskFailures
TaskDiscarded
TaskAttemptTimer
TaskStandbyRetryCounter
TaskNotActiveCounter
TaskLimitExceededCounter
TaskBatchCompleteCounter
TaskProcessingLatency
TaskNoUserProcessingLatency
TaskQueueLatency
TaskUserLatency
TaskNoUserLatency
TaskNoUserQueueLatency
TaskRedispatchQueuePendingTasksTimer
TaskScheduleToStartLatency
TransferTaskMissingEventCounter
TransferTaskThrottledCounter
TimerTaskThrottledCounter
ActivityE2ELatency
AckLevelUpdateCounter
AckLevelUpdateFailedCounter
CommandTypeScheduleActivityCounter
CommandTypeCompleteWorkflowCounter
CommandTypeFailWorkflowCounter
CommandTypeCancelWorkflowCounter
CommandTypeStartTimerCounter
CommandTypeCancelActivityCounter
CommandTypeCancelTimerCounter
CommandTypeRecordMarkerCounter
CommandTypeCancelExternalWorkflowCounter
CommandTypeChildWorkflowCounter
CommandTypeContinueAsNewCounter
CommandTypeSignalExternalWorkflowCounter
CommandTypeUpsertWorkflowSearchAttributesCounter
EmptyCompletionCommandsCounter
MultipleCompletionCommandsCounter
FailedWorkflowTasksCounter
StaleMutableStateCounter
AutoResetPointsLimitExceededCounter
AutoResetPointCorruptionCounter
ConcurrencyUpdateFailureCounter
ServiceErrTaskAlreadyStartedCounter
ServiceErrShardOwnershipLostCounter
HeartbeatTimeoutCounter
ScheduleToStartTimeoutCounter
StartToCloseTimeoutCounter
ScheduleToCloseTimeoutCounter
NewTimerNotifyCounter
AcquireShardsCounter
AcquireShardsLatency
ShardContextClosedCounter
ShardContextCreatedCounter
ShardContextRemovedCounter
ShardContextAcquisitionLatency
ShardInfoReplicationPendingTasksTimer
ShardInfoTransferActivePendingTasksTimer
ShardInfoTransferStandbyPendingTasksTimer
ShardInfoTimerActivePendingTasksTimer
ShardInfoTimerStandbyPendingTasksTimer
ShardInfoReplicationLagTimer
ShardInfoTransferLagTimer
ShardInfoTimerLagTimer
ShardInfoTransferDiffTimer
ShardInfoTimerDiffTimer
ShardInfoTransferFailoverInProgressTimer
ShardInfoTimerFailoverInProgressTimer
ShardInfoTransferFailoverLatencyTimer
ShardInfoTimerFailoverLatencyTimer
SyncShardFromRemoteCounter
SyncShardFromRemoteFailure
MembershipChangedCounter
NumShardsGauge
GetEngineForShardErrorCounter
GetEngineForShardLatency
RemoveEngineForShardLatency
CompleteWorkflowTaskWithStickyEnabledCounter
CompleteWorkflowTaskWithStickyDisabledCounter
WorkflowTaskHeartbeatTimeoutCounter
HistoryEventNotificationQueueingLatency
HistoryEventNotificationFanoutLatency
HistoryEventNotificationInFlightMessageGauge
HistoryEventNotificationFailDeliveryCount
EmptyReplicationEventsCounter
DuplicateReplicationEventsCounter
StaleReplicationEventsCounter
ReplicationEventsSizeTimer
BufferReplicationTaskTimer
UnbufferReplicationTaskTimer
HistoryConflictsCounter
CompleteTaskFailedCounter
CacheRequests
CacheFailures
CacheLatency
CacheMissCounter
AcquireLockFailedCounter
WorkflowContextCleared
MutableStateSize
ExecutionInfoSize
ExecutionStateSize
ActivityInfoSize
TimerInfoSize
ChildInfoSize
RequestCancelInfoSize
SignalInfoSize
BufferedEventsSize
ActivityInfoCount
TimerInfoCount
ChildInfoCount
SignalInfoCount
RequestCancelInfoCount
BufferedEventsCount
WorkflowRetryBackoffTimerCount
WorkflowCronBackoffTimerCount
WorkflowCleanupDeleteCount
WorkflowCleanupArchiveCount
WorkflowCleanupNopCount
WorkflowCleanupDeleteHistoryInlineCount
WorkflowSuccessCount
WorkflowCancelCount
WorkflowFailedCount
WorkflowTimeoutCount
WorkflowTerminateCount
WorkflowContinuedAsNewCount
ArchiverClientSendSignalCount
ArchiverClientSendSignalFailureCount
ArchiverClientHistoryRequestCount
ArchiverClientHistoryInlineArchiveAttemptCount
ArchiverClientHistoryInlineArchiveFailureCount
ArchiverClientVisibilityRequestCount
ArchiverClientVisibilityInlineArchiveAttemptCount
ArchiverClientVisibilityInlineArchiveFailureCount
LastRetrievedMessageID
LastProcessedMessageID
ReplicationTasksApplied
ReplicationTasksFailed
ReplicationTasksLag
ReplicationTasksFetched
ReplicationTasksReturned
ReplicationTasksAppliedLatency
ReplicationDLQFailed
ReplicationDLQMaxLevelGauge
ReplicationDLQAckLevelGauge
GetReplicationMessagesForShardLatency
GetDLQReplicationMessagesLatency
EventReapplySkippedCount
DirectQueryDispatchLatency
DirectQueryDispatchStickyLatency
DirectQueryDispatchNonStickyLatency
DirectQueryDispatchStickySuccessCount
DirectQueryDispatchNonStickySuccessCount
DirectQueryDispatchClearStickinessLatency
DirectQueryDispatchClearStickinessSuccessCount
DirectQueryDispatchTimeoutBeforeNonStickyCount
WorkflowTaskQueryLatency
ConsistentQueryTimeoutCount
QueryBeforeFirstWorkflowTaskCount
QueryBufferExceededCount
QueryRegistryInvalidStateCount
WorkerNotSupportsConsistentQueryCount
WorkflowTaskTimeoutOverrideCount
WorkflowRunTimeoutOverrideCount
ReplicationTaskCleanupCount
ReplicationTaskCleanupFailure
MutableStateChecksumMismatch
MutableStateChecksumInvalidated
ElasticsearchBulkProcessorRequests
ElasticsearchBulkProcessorQueuedRequests
ElasticsearchBulkProcessorRetries
ElasticsearchBulkProcessorFailures
ElasticsearchBulkProcessorCorruptedData
ElasticsearchBulkProcessorDuplicateRequest
ElasticsearchBulkProcessorRequestLatency
ElasticsearchBulkProcessorCommitLatency
ElasticsearchBulkProcessorWaitAddLatency
ElasticsearchBulkProcessorWaitStartLatency
ElasticsearchBulkProcessorBulkSize
ElasticsearchBulkProcessorDeadlock
NumHistoryMetrics
)
// Matching metrics enum
const (
PollSuccessPerTaskQueueCounter = iota + NumHistoryMetrics
PollTimeoutPerTaskQueueCounter
PollSuccessWithSyncPerTaskQueueCounter
LeaseRequestPerTaskQueueCounter
LeaseFailurePerTaskQueueCounter
ConditionFailedErrorPerTaskQueueCounter
RespondQueryTaskFailedPerTaskQueueCounter
SyncThrottlePerTaskQueueCounter
BufferThrottlePerTaskQueueCounter
SyncMatchLatencyPerTaskQueue
AsyncMatchLatencyPerTaskQueue
ExpiredTasksPerTaskQueueCounter
ForwardedPerTaskQueueCounter
ForwardTaskCallsPerTaskQueue
ForwardTaskErrorsPerTaskQueue
ForwardTaskLatencyPerTaskQueue
ForwardQueryCallsPerTaskQueue
ForwardQueryErrorsPerTaskQueue
ForwardQueryLatencyPerTaskQueue
ForwardPollCallsPerTaskQueue
ForwardPollErrorsPerTaskQueue
ForwardPollLatencyPerTaskQueue
LocalToLocalMatchPerTaskQueueCounter
LocalToRemoteMatchPerTaskQueueCounter
RemoteToLocalMatchPerTaskQueueCounter
RemoteToRemoteMatchPerTaskQueueCounter
TaskQueueGauge
NumMatchingMetrics
)
// Worker metrics enum
const (
ReplicatorMessages = iota + NumMatchingMetrics
ReplicatorFailures
ReplicatorLatency
ReplicatorDLQFailures
ArchiverNonRetryableErrorCount
ArchiverStartedCount
ArchiverStoppedCount
ArchiverCoroutineStartedCount
ArchiverCoroutineStoppedCount
ArchiverHandleHistoryRequestLatency
ArchiverHandleVisibilityRequestLatency
ArchiverUploadWithRetriesLatency
ArchiverDeleteWithRetriesLatency
ArchiverUploadFailedAllRetriesCount
ArchiverUploadSuccessCount
ArchiverDeleteFailedAllRetriesCount
ArchiverDeleteSuccessCount
ArchiverHandleVisibilityFailedAllRetiresCount
ArchiverHandleVisibilitySuccessCount
ArchiverBacklogSizeGauge
ArchiverPumpTimeoutCount
ArchiverPumpSignalThresholdCount
ArchiverPumpTimeoutWithoutSignalsCount
ArchiverPumpSignalChannelClosedCount
ArchiverWorkflowStartedCount
ArchiverNumPumpedRequestsCount
ArchiverNumHandledRequestsCount
ArchiverPumpedNotEqualHandledCount
ArchiverHandleAllRequestsLatency
ArchiverWorkflowStoppingCount
TaskProcessedCount
TaskDeletedCount
TaskQueueProcessedCount
TaskQueueDeletedCount
TaskQueueOutstandingCount
ExecutionsOutstandingCount
StartedCount
StoppedCount
ScanDuration
ExecutorTasksDoneCount
ExecutorTasksErrCount
ExecutorTasksDeferredCount
ExecutorTasksDroppedCount
BatcherProcessorSuccess
BatcherProcessorFailures
HistoryScavengerSuccessCount
HistoryScavengerErrorCount
HistoryScavengerSkipCount
NamespaceReplicationEnqueueDLQCount
ScavengerValidationRequestsCount
ScavengerValidationFailuresCount
AddSearchAttributesFailuresCount
NumWorkerMetrics
)
// MetricDefs record the metrics for all services
var MetricDefs = map[ServiceIdx]map[int]metricDefinition{
Common: {
ServiceRequests: {metricName: "service_requests", metricType: Counter},
ServicePendingRequests: {metricName: "service_pending_requests", metricType: Gauge},
ServiceFailures: {metricName: "service_errors", metricType: Counter},
ServiceCriticalFailures: {metricName: "service_errors_critical", metricType: Counter},
ServiceLatency: {metricName: "service_latency", metricType: Timer},
ServiceLatencyNoUserLatency: {metricName: "service_latency_nouserlatency", metricType: Timer},
ServiceLatencyUserLatency: {metricName: "service_latency_userlatency", metricType: Timer},
ServiceErrInvalidArgumentCounter: {metricName: "service_errors_invalid_argument", metricType: Counter},
ServiceErrNamespaceNotActiveCounter: {metricName: "service_errors_namespace_not_active", metricType: Counter},
ServiceErrResourceExhaustedCounter: {metricName: "service_errors_resource_exhausted", metricType: Counter},
ServiceErrNotFoundCounter: {metricName: "service_errors_entity_not_found", metricType: Counter},
ServiceErrExecutionAlreadyStartedCounter: {metricName: "service_errors_execution_already_started", metricType: Counter},
ServiceErrNamespaceAlreadyExistsCounter: {metricName: "service_errors_namespace_already_exists", metricType: Counter},
ServiceErrCancellationAlreadyRequestedCounter: {metricName: "service_errors_cancellation_already_requested", metricType: Counter},
ServiceErrQueryFailedCounter: {metricName: "service_errors_query_failed", metricType: Counter},
ServiceErrContextCancelledCounter: {metricName: "service_errors_context_cancelled", metricType: Counter},
ServiceErrContextTimeoutCounter: {metricName: "service_errors_context_timeout", metricType: Counter},
ServiceErrRetryTaskCounter: {metricName: "service_errors_retry_task", metricType: Counter},
ServiceErrBadBinaryCounter: {metricName: "service_errors_bad_binary", metricType: Counter},
ServiceErrClientVersionNotSupportedCounter: {metricName: "service_errors_client_version_not_supported", metricType: Counter},
ServiceErrIncompleteHistoryCounter: {metricName: "service_errors_incomplete_history", metricType: Counter},
ServiceErrNonDeterministicCounter: {metricName: "service_errors_nondeterministic", metricType: Counter},
ServiceErrUnauthorizedCounter: {metricName: "service_errors_unauthorized", metricType: Counter},
ServiceErrAuthorizeFailedCounter: {metricName: "service_errors_authorize_failed", metricType: Counter},
PersistenceRequests: {metricName: "persistence_requests", metricType: Counter},
PersistenceFailures: {metricName: "persistence_errors", metricType: Counter},
PersistenceLatency: {metricName: "persistence_latency", metricType: Timer},
PersistenceErrShardExistsCounter: {metricName: "persistence_errors_shard_exists", metricType: Counter},
PersistenceErrShardOwnershipLostCounter: {metricName: "persistence_errors_shard_ownership_lost", metricType: Counter},
PersistenceErrConditionFailedCounter: {metricName: "persistence_errors_condition_failed", metricType: Counter},
PersistenceErrCurrentWorkflowConditionFailedCounter: {metricName: "persistence_errors_current_workflow_condition_failed", metricType: Counter},
PersistenceErrWorkflowConditionFailedCounter: {metricName: "persistence_errors_workflow_condition_failed", metricType: Counter},
PersistenceErrTimeoutCounter: {metricName: "persistence_errors_timeout", metricType: Counter},
PersistenceErrBusyCounter: {metricName: "persistence_errors_busy", metricType: Counter},
PersistenceErrEntityNotExistsCounter: {metricName: "persistence_errors_entity_not_exists", metricType: Counter},
PersistenceErrNamespaceAlreadyExistsCounter: {metricName: "persistence_errors_namespace_already_exists", metricType: Counter},
PersistenceErrBadRequestCounter: {metricName: "persistence_errors_bad_request", metricType: Counter},
ClientRequests: {metricName: "client_requests", metricType: Counter},
ClientFailures: {metricName: "client_errors", metricType: Counter},
ClientLatency: {metricName: "client_latency", metricType: Timer},
ClientRedirectionRequests: {metricName: "client_redirection_requests", metricType: Counter},
ClientRedirectionFailures: {metricName: "client_redirection_errors", metricType: Counter},
ClientRedirectionLatency: {metricName: "client_redirection_latency", metricType: Timer},
ServiceAuthorizationLatency: {metricName: "service_authorization_latency", metricType: Timer},
NamespaceCachePrepareCallbacksLatency: {metricName: "namespace_cache_prepare_callbacks_latency", metricType: Timer},
NamespaceCacheCallbacksLatency: {metricName: "namespace_cache_callbacks_latency", metricType: Timer},
StateTransitionCount: {metricName: "state_transition_count", metricType: Timer},
HistorySize: {metricName: "history_size", metricType: Timer},
HistoryCount: {metricName: "history_count", metricType: Timer},
EventBlobSize: {metricName: "event_blob_size", metricType: Timer},
SearchAttributesSize: {metricName: "search_attributes_size", metricType: Timer},
LockRequests: {metricName: "lock_requests", metricType: Counter},
LockFailures: {metricName: "lock_failures", metricType: Counter},
LockLatency: {metricName: "lock_latency", metricType: Timer},
ArchivalConfigFailures: {metricName: "archivalconfig_failures", metricType: Counter},
VisibilityPersistenceRequests: {metricName: "visibility_persistence_requests", metricType: Counter},
VisibilityPersistenceFailures: {metricName: "visibility_persistence_errors", metricType: Counter},
VisibilityPersistenceLatency: {metricName: "visibility_persistence_latency", metricType: Timer},
VisibilityPersistenceInvalidArgument: {metricName: "visibility_persistence_invalid_argument", metricType: Counter},
VisibilityPersistenceResourceExhausted: {metricName: "visibility_persistence_resource_exhausted", metricType: Counter},
VisibilityPersistenceConditionFailed: {metricName: "visibility_persistence_condition_failed", metricType: Counter},
VisibilityPersistenceTimeout: {metricName: "visibility_persistence_timeout", metricType: Counter},
VisibilityPersistenceNotFound: {metricName: "visibility_persistence_not_found", metricType: Counter},
VisibilityPersistenceInternal: {metricName: "visibility_persistence_internal", metricType: Counter},
VisibilityPersistenceUnavailable: {metricName: "visibility_persistence_unavailable", metricType: Counter},
SequentialTaskSubmitRequest: {metricName: "sequentialtask_submit_request", metricType: Counter},
SequentialTaskSubmitRequestTaskQueueExist: {metricName: "sequentialtask_submit_request_taskqueue_exist", metricType: Counter},
SequentialTaskSubmitRequestTaskQueueMissing: {metricName: "sequentialtask_submit_request_taskqueue_missing", metricType: Counter},
SequentialTaskSubmitLatency: {metricName: "sequentialtask_submit_latency", metricType: Timer},
SequentialTaskQueueSize: {metricName: "sequentialtask_queue_size", metricType: Timer},
SequentialTaskQueueProcessingLatency: {metricName: "sequentialtask_queue_processing_latency", metricType: Timer},
SequentialTaskTaskProcessingLatency: {metricName: "sequentialtask_task_processing_latency", metricType: Timer},
ParallelTaskSubmitRequest: {metricName: "paralleltask_submit_request", metricType: Counter},
ParallelTaskSubmitLatency: {metricName: "paralleltask_submit_latency", metricType: Timer},
ParallelTaskTaskProcessingLatency: {metricName: "paralleltask_task_processing_latency", metricType: Timer},
PriorityTaskSubmitRequest: {metricName: "prioritytask_submit_request", metricType: Counter},
PriorityTaskSubmitLatency: {metricName: "prioritytask_submit_latency", metricType: Timer},
HistoryArchiverArchiveNonRetryableErrorCount: {metricName: "history_archiver_archive_non_retryable_error", metricType: Counter},
HistoryArchiverArchiveTransientErrorCount: {metricName: "history_archiver_archive_transient_error", metricType: Counter},
HistoryArchiverArchiveSuccessCount: {metricName: "history_archiver_archive_success", metricType: Counter},
HistoryArchiverHistoryMutatedCount: {metricName: "history_archiver_history_mutated", metricType: Counter},
HistoryArchiverTotalUploadSize: {metricName: "history_archiver_total_upload_size", metricType: Timer},
HistoryArchiverHistorySize: {metricName: "history_archiver_history_size", metricType: Timer},
HistoryArchiverBlobExistsCount: {metricName: "history_archiver_blob_exists", metricType: Counter},
HistoryArchiverBlobSize: {metricName: "history_archiver_blob_size", metricType: Timer},
HistoryArchiverRunningDeterministicConstructionCheckCount: {metricName: "history_archiver_running_deterministic_construction_check", metricType: Counter},
HistoryArchiverDeterministicConstructionCheckFailedCount: {metricName: "history_archiver_deterministic_construction_check_failed", metricType: Counter},
HistoryArchiverRunningBlobIntegrityCheckCount: {metricName: "history_archiver_running_blob_integrity_check", metricType: Counter},
HistoryArchiverBlobIntegrityCheckFailedCount: {metricName: "history_archiver_blob_integrity_check_failed", metricType: Counter},
HistoryArchiverDuplicateArchivalsCount: {metricName: "history_archiver_duplicate_archivals", metricType: Counter},
VisibilityArchiverArchiveNonRetryableErrorCount: {metricName: "visibility_archiver_archive_non_retryable_error", metricType: Counter},
VisibilityArchiverArchiveTransientErrorCount: {metricName: "visibility_archiver_archive_transient_error", metricType: Counter},
VisibilityArchiveSuccessCount: {metricName: "visibility_archiver_archive_success", metricType: Counter},
VersionCheckSuccessCount: {metricName: "version_check_success", metricType: Counter},
VersionCheckFailedCount: {metricName: "version_check_failed", metricType: Counter},
VersionCheckRequestFailedCount: {metricName: "version_check_request_failed", metricType: Counter},
VersionCheckLatency: {metricName: "version_check_latency", metricType: Timer},
ParentClosePolicyProcessorSuccess: {metricName: "parent_close_policy_processor_requests", metricType: Counter},
ParentClosePolicyProcessorFailures: {metricName: "parent_close_policy_processor_errors", metricType: Counter},
AddSearchAttributesWorkflowSuccessCount: {metricName: "add_search_attributes_workflow_success", metricType: Counter},
AddSearchAttributesWorkflowFailuresCount: {metricName: "add_search_attributes_workflow_failure", metricType: Counter},
MatchingClientForwardedCounter: {metricName: "forwarded", metricType: Counter},
MatchingClientInvalidTaskQueueName: {metricName: "invalid_task_queue_name", metricType: Counter},
NamespaceReplicationTaskAckLevelGauge: {metricName: "namespace_replication_task_ack_level", metricType: Gauge},
NamespaceReplicationDLQAckLevelGauge: {metricName: "namespace_dlq_ack_level", metricType: Gauge},
NamespaceReplicationDLQMaxLevelGauge: {metricName: "namespace_dlq_max_level", metricType: Gauge},
// per task queue common metrics
ServiceRequestsPerTaskQueue: {
metricName: "service_requests_per_tl", metricRollupName: "service_requests", metricType: Counter,
},
ServiceFailuresPerTaskQueue: {
metricName: "service_errors_per_tl", metricRollupName: "service_errors", metricType: Counter,
},
ServiceLatencyPerTaskQueue: {
metricName: "service_latency_per_tl", metricRollupName: "service_latency", metricType: Timer,
},
ServiceErrInvalidArgumentPerTaskQueueCounter: {
metricName: "service_errors_invalid_argument_per_tl", metricRollupName: "service_errors_invalid_argument", metricType: Counter,
},
ServiceErrNamespaceNotActivePerTaskQueueCounter: {
metricName: "service_errors_namespace_not_active_per_tl", metricRollupName: "service_errors_namespace_not_active", metricType: Counter,
},
ServiceErrResourceExhaustedPerTaskQueueCounter: {
metricName: "service_errors_resource_exhausted_per_tl", metricRollupName: "service_errors_resource_exhausted", metricType: Counter,
},
ServiceErrNotFoundPerTaskQueueCounter: {
metricName: "service_errors_entity_not_found_per_tl", metricRollupName: "service_errors_entity_not_found", metricType: Counter,
},
ServiceErrExecutionAlreadyStartedPerTaskQueueCounter: {
metricName: "service_errors_execution_already_started_per_tl", metricRollupName: "service_errors_execution_already_started", metricType: Counter,
},
ServiceErrNamespaceAlreadyExistsPerTaskQueueCounter: {
metricName: "service_errors_namespace_already_exists_per_tl", metricRollupName: "service_errors_namespace_already_exists", metricType: Counter,
},
ServiceErrCancellationAlreadyRequestedPerTaskQueueCounter: {
metricName: "service_errors_cancellation_already_requested_per_tl", metricRollupName: "service_errors_cancellation_already_requested", metricType: Counter,
},
ServiceErrQueryFailedPerTaskQueueCounter: {
metricName: "service_errors_query_failed_per_tl", metricRollupName: "service_errors_query_failed", metricType: Counter,
},
ServiceErrContextTimeoutPerTaskQueueCounter: {
metricName: "service_errors_context_timeout_per_tl", metricRollupName: "service_errors_context_timeout", metricType: Counter,
},
ServiceErrRetryTaskPerTaskQueueCounter: {
metricName: "service_errors_retry_task_per_tl", metricRollupName: "service_errors_retry_task", metricType: Counter,
},
ServiceErrBadBinaryPerTaskQueueCounter: {
metricName: "service_errors_bad_binary_per_tl", metricRollupName: "service_errors_bad_binary", metricType: Counter,
},
ServiceErrClientVersionNotSupportedPerTaskQueueCounter: {
metricName: "service_errors_client_version_not_supported_per_tl", metricRollupName: "service_errors_client_version_not_supported", metricType: Counter,
},
ServiceErrIncompleteHistoryPerTaskQueueCounter: {
metricName: "service_errors_incomplete_history_per_tl", metricRollupName: "service_errors_incomplete_history", metricType: Counter,
},
ServiceErrNonDeterministicPerTaskQueueCounter: {
metricName: "service_errors_nondeterministic_per_tl", metricRollupName: "service_errors_nondeterministic", metricType: Counter,
},
ServiceErrUnauthorizedPerTaskQueueCounter: {
metricName: "service_errors_unauthorized_per_tl", metricRollupName: "service_errors_unauthorized", metricType: Counter,
},
ServiceErrAuthorizeFailedPerTaskQueueCounter: {
metricName: "service_errors_authorize_failed_per_tl", metricRollupName: "service_errors_authorize_failed", metricType: Counter,
},
ElasticsearchDocumentParseFailuresCount: {metricName: "elasticsearch_document_parse_failures_counter", metricType: Counter},
ElasticsearchDocumentGenerateFailuresCount: {metricName: "elasticsearch_document_generate_failures_counter", metricType: Counter},
NoopImplementationIsUsed: {metricName: "noop_implementation_is_used", metricType: Counter},
},
History: {
TaskRequests: {metricName: "task_requests", metricType: Counter},
TaskLatency: {metricName: "task_latency", metricType: Timer}, // overall/all attempts within single worker
TaskUserLatency: {metricName: "task_latency_userlatency", metricType: Timer}, // from task generated to task complete
TaskNoUserLatency: {metricName: "task_latency_nouserlatency", metricType: Timer}, // from task generated to task complete
TaskAttemptTimer: {metricName: "task_attempt", metricType: Timer},
TaskFailures: {metricName: "task_errors", metricType: Counter},
TaskDiscarded: {metricName: "task_errors_discarded", metricType: Counter},
TaskStandbyRetryCounter: {metricName: "task_errors_standby_retry_counter", metricType: Counter},
TaskNotActiveCounter: {metricName: "task_errors_not_active_counter", metricType: Counter},
TaskLimitExceededCounter: {metricName: "task_errors_limit_exceeded_counter", metricType: Counter},
TaskScheduleToStartLatency: {metricName: "task_schedule_to_start_latency", metricType: Timer},
TaskProcessingLatency: {metricName: "task_latency_processing", metricType: Timer}, // per-attempt
TaskNoUserProcessingLatency: {metricName: "task_latency_processing_nouserlatency", metricType: Timer}, // per-attempt
TaskQueueLatency: {metricName: "task_latency_queue", metricType: Timer}, // from task generated to task complete
TaskNoUserQueueLatency: {metricName: "task_latency_queue_nouserlatency", metricType: Timer}, // from task generated to task complete
TransferTaskMissingEventCounter: {metricName: "transfer_task_missing_event_counter", metricType: Counter},
TaskBatchCompleteCounter: {metricName: "task_batch_complete_counter", metricType: Counter},
TaskRedispatchQueuePendingTasksTimer: {metricName: "task_redispatch_queue_pending_tasks", metricType: Timer},
TransferTaskThrottledCounter: {metricName: "transfer_task_throttled_counter", metricType: Counter},
TimerTaskThrottledCounter: {metricName: "timer_task_throttled_counter", metricType: Counter},
ActivityE2ELatency: {metricName: "activity_end_to_end_latency", metricType: Timer},
AckLevelUpdateCounter: {metricName: "ack_level_update", metricType: Counter},
AckLevelUpdateFailedCounter: {metricName: "ack_level_update_failed", metricType: Counter},
CommandTypeScheduleActivityCounter: {metricName: "schedule_activity_command", metricType: Counter},
CommandTypeCompleteWorkflowCounter: {metricName: "complete_workflow_command", metricType: Counter},
CommandTypeFailWorkflowCounter: {metricName: "fail_workflow_command", metricType: Counter},
CommandTypeCancelWorkflowCounter: {metricName: "cancel_workflow_command", metricType: Counter},
CommandTypeStartTimerCounter: {metricName: "start_timer_command", metricType: Counter},
CommandTypeCancelActivityCounter: {metricName: "cancel_activity_command", metricType: Counter},
CommandTypeCancelTimerCounter: {metricName: "cancel_timer_command", metricType: Counter},
CommandTypeRecordMarkerCounter: {metricName: "record_marker_command", metricType: Counter},
CommandTypeCancelExternalWorkflowCounter: {metricName: "cancel_external_workflow_command", metricType: Counter},
CommandTypeContinueAsNewCounter: {metricName: "continue_as_new_command", metricType: Counter},
CommandTypeSignalExternalWorkflowCounter: {metricName: "signal_external_workflow_command", metricType: Counter},
CommandTypeUpsertWorkflowSearchAttributesCounter: {metricName: "upsert_workflow_search_attributes_command", metricType: Counter},
CommandTypeChildWorkflowCounter: {metricName: "child_workflow_command", metricType: Counter},
EmptyCompletionCommandsCounter: {metricName: "empty_completion_commands", metricType: Counter},
MultipleCompletionCommandsCounter: {metricName: "multiple_completion_commands", metricType: Counter},
FailedWorkflowTasksCounter: {metricName: "failed_workflow_tasks", metricType: Counter},
StaleMutableStateCounter: {metricName: "stale_mutable_state", metricType: Counter},
AutoResetPointsLimitExceededCounter: {metricName: "auto_reset_points_exceed_limit", metricType: Counter},
AutoResetPointCorruptionCounter: {metricName: "auto_reset_point_corruption", metricType: Counter},
ConcurrencyUpdateFailureCounter: {metricName: "concurrency_update_failure", metricType: Counter},
ServiceErrShardOwnershipLostCounter: {metricName: "service_errors_shard_ownership_lost", metricType: Counter},
ServiceErrTaskAlreadyStartedCounter: {metricName: "service_errors_task_already_started", metricType: Counter},
HeartbeatTimeoutCounter: {metricName: "heartbeat_timeout", metricType: Counter},
ScheduleToStartTimeoutCounter: {metricName: "schedule_to_start_timeout", metricType: Counter},
StartToCloseTimeoutCounter: {metricName: "start_to_close_timeout", metricType: Counter},
ScheduleToCloseTimeoutCounter: {metricName: "schedule_to_close_timeout", metricType: Counter},
NewTimerNotifyCounter: {metricName: "new_timer_notifications", metricType: Counter},
AcquireShardsCounter: {metricName: "acquire_shards_count", metricType: Counter},
AcquireShardsLatency: {metricName: "acquire_shards_latency", metricType: Timer},
ShardContextClosedCounter: {metricName: "shard_closed_count", metricType: Counter},
ShardContextCreatedCounter: {metricName: "sharditem_created_count", metricType: Counter},
ShardContextRemovedCounter: {metricName: "sharditem_removed_count", metricType: Counter},
ShardContextAcquisitionLatency: {metricName: "sharditem_acquisition_latency", metricType: Timer},
ShardInfoReplicationPendingTasksTimer: {metricName: "shardinfo_replication_pending_task", metricType: Timer},
ShardInfoTransferActivePendingTasksTimer: {metricName: "shardinfo_transfer_active_pending_task", metricType: Timer},
ShardInfoTransferStandbyPendingTasksTimer: {metricName: "shardinfo_transfer_standby_pending_task", metricType: Timer},
ShardInfoTimerActivePendingTasksTimer: {metricName: "shardinfo_timer_active_pending_task", metricType: Timer},
ShardInfoTimerStandbyPendingTasksTimer: {metricName: "shardinfo_timer_standby_pending_task", metricType: Timer},
ShardInfoReplicationLagTimer: {metricName: "shardinfo_replication_lag", metricType: Timer},
ShardInfoTransferLagTimer: {metricName: "shardinfo_transfer_lag", metricType: Timer},
ShardInfoTimerLagTimer: {metricName: "shardinfo_timer_lag", metricType: Timer},
ShardInfoTransferDiffTimer: {metricName: "shardinfo_transfer_diff", metricType: Timer},
ShardInfoTimerDiffTimer: {metricName: "shardinfo_timer_diff", metricType: Timer},
ShardInfoTransferFailoverInProgressTimer: {metricName: "shardinfo_transfer_failover_in_progress", metricType: Timer},
ShardInfoTimerFailoverInProgressTimer: {metricName: "shardinfo_timer_failover_in_progress", metricType: Timer},
ShardInfoTransferFailoverLatencyTimer: {metricName: "shardinfo_transfer_failover_latency", metricType: Timer},
ShardInfoTimerFailoverLatencyTimer: {metricName: "shardinfo_timer_failover_latency", metricType: Timer},
SyncShardFromRemoteCounter: {metricName: "syncshard_remote_count", metricType: Counter},
SyncShardFromRemoteFailure: {metricName: "syncshard_remote_failed", metricType: Counter},
MembershipChangedCounter: {metricName: "membership_changed_count", metricType: Counter},
NumShardsGauge: {metricName: "numshards_gauge", metricType: Gauge},
GetEngineForShardErrorCounter: {metricName: "get_engine_for_shard_errors", metricType: Counter},
GetEngineForShardLatency: {metricName: "get_engine_for_shard_latency", metricType: Timer},
RemoveEngineForShardLatency: {metricName: "remove_engine_for_shard_latency", metricType: Timer},
CompleteWorkflowTaskWithStickyEnabledCounter: {metricName: "complete_workflow_task_sticky_enabled_count", metricType: Counter},
CompleteWorkflowTaskWithStickyDisabledCounter: {metricName: "complete_workflow_task_sticky_disabled_count", metricType: Counter},
WorkflowTaskHeartbeatTimeoutCounter: {metricName: "workflow_task_heartbeat_timeout_count", metricType: Counter},
HistoryEventNotificationQueueingLatency: {metricName: "history_event_notification_queueing_latency", metricType: Timer},
HistoryEventNotificationFanoutLatency: {metricName: "history_event_notification_fanout_latency", metricType: Timer},
HistoryEventNotificationInFlightMessageGauge: {metricName: "history_event_notification_inflight_message_gauge", metricType: Gauge},
HistoryEventNotificationFailDeliveryCount: {metricName: "history_event_notification_fail_delivery_count", metricType: Counter},
EmptyReplicationEventsCounter: {metricName: "empty_replication_events", metricType: Counter},
DuplicateReplicationEventsCounter: {metricName: "duplicate_replication_events", metricType: Counter},
StaleReplicationEventsCounter: {metricName: "stale_replication_events", metricType: Counter},
ReplicationEventsSizeTimer: {metricName: "replication_events_size", metricType: Timer},
BufferReplicationTaskTimer: {metricName: "buffer_replication_tasks", metricType: Timer},
UnbufferReplicationTaskTimer: {metricName: "unbuffer_replication_tasks", metricType: Timer},
HistoryConflictsCounter: {metricName: "history_conflicts", metricType: Counter},
CompleteTaskFailedCounter: {metricName: "complete_task_fail_count", metricType: Counter},
CacheRequests: {metricName: "cache_requests", metricType: Counter},
CacheFailures: {metricName: "cache_errors", metricType: Counter},
CacheLatency: {metricName: "cache_latency", metricType: Timer},
CacheMissCounter: {metricName: "cache_miss", metricType: Counter},
AcquireLockFailedCounter: {metricName: "acquire_lock_failed", metricType: Counter},
WorkflowContextCleared: {metricName: "workflow_context_cleared", metricType: Counter},
MutableStateSize: {metricName: "mutable_state_size", metricType: Timer},
ExecutionInfoSize: {metricName: "execution_info_size", metricType: Timer},
ExecutionStateSize: {metricName: "execution_state_size", metricType: Timer},
ActivityInfoSize: {metricName: "activity_info_size", metricType: Timer},
TimerInfoSize: {metricName: "timer_info_size", metricType: Timer},
ChildInfoSize: {metricName: "child_info_size", metricType: Timer},
RequestCancelInfoSize: {metricName: "request_cancel_info_size", metricType: Timer},
SignalInfoSize: {metricName: "signal_info_size", metricType: Timer},
BufferedEventsSize: {metricName: "buffered_events_size", metricType: Timer},
ActivityInfoCount: {metricName: "activity_info_count", metricType: Timer},
TimerInfoCount: {metricName: "timer_info_count", metricType: Timer},
ChildInfoCount: {metricName: "child_info_count", metricType: Timer},
SignalInfoCount: {metricName: "signal_info_count", metricType: Timer},
RequestCancelInfoCount: {metricName: "request_cancel_info_count", metricType: Timer},
BufferedEventsCount: {metricName: "buffered_events_count", metricType: Timer},
WorkflowRetryBackoffTimerCount: {metricName: "workflow_retry_backoff_timer", metricType: Counter},
WorkflowCronBackoffTimerCount: {metricName: "workflow_cron_backoff_timer", metricType: Counter},
WorkflowCleanupDeleteCount: {metricName: "workflow_cleanup_delete", metricType: Counter},
WorkflowCleanupArchiveCount: {metricName: "workflow_cleanup_archive", metricType: Counter},
WorkflowCleanupNopCount: {metricName: "workflow_cleanup_nop", metricType: Counter},
WorkflowCleanupDeleteHistoryInlineCount: {metricName: "workflow_cleanup_delete_history_inline", metricType: Counter},
WorkflowSuccessCount: {metricName: "workflow_success", metricType: Counter},
WorkflowCancelCount: {metricName: "workflow_cancel", metricType: Counter},
WorkflowFailedCount: {metricName: "workflow_failed", metricType: Counter},
WorkflowTimeoutCount: {metricName: "workflow_timeout", metricType: Counter},
WorkflowTerminateCount: {metricName: "workflow_terminate", metricType: Counter},
WorkflowContinuedAsNewCount: {metricName: "workflow_continued_as_new", metricType: Counter},
ArchiverClientSendSignalCount: {metricName: "archiver_client_sent_signal", metricType: Counter},
ArchiverClientSendSignalFailureCount: {metricName: "archiver_client_send_signal_error", metricType: Counter},
ArchiverClientHistoryRequestCount: {metricName: "archiver_client_history_request", metricType: Counter},
ArchiverClientHistoryInlineArchiveAttemptCount: {metricName: "archiver_client_history_inline_archive_attempt", metricType: Counter},
ArchiverClientHistoryInlineArchiveFailureCount: {metricName: "archiver_client_history_inline_archive_failure", metricType: Counter},
ArchiverClientVisibilityRequestCount: {metricName: "archiver_client_visibility_request", metricType: Counter},
ArchiverClientVisibilityInlineArchiveAttemptCount: {metricName: "archiver_client_visibility_inline_archive_attempt", metricType: Counter},
ArchiverClientVisibilityInlineArchiveFailureCount: {metricName: "archiver_client_visibility_inline_archive_failure", metricType: Counter},
LastRetrievedMessageID: {metricName: "last_retrieved_message_id", metricType: Gauge},
LastProcessedMessageID: {metricName: "last_processed_message_id", metricType: Gauge},
ReplicationTasksApplied: {metricName: "replication_tasks_applied", metricType: Counter},
ReplicationTasksFailed: {metricName: "replication_tasks_failed", metricType: Counter},
ReplicationTasksLag: {metricName: "replication_tasks_lag", metricType: Timer},
ReplicationTasksFetched: {metricName: "replication_tasks_fetched", metricType: Timer},
ReplicationTasksReturned: {metricName: "replication_tasks_returned", metricType: Timer},
ReplicationTasksAppliedLatency: {metricName: "replication_tasks_applied_latency", metricType: Timer},
ReplicationDLQFailed: {metricName: "replication_dlq_enqueue_failed", metricType: Counter},
ReplicationDLQMaxLevelGauge: {metricName: "replication_dlq_max_level", metricType: Gauge},
ReplicationDLQAckLevelGauge: {metricName: "replication_dlq_ack_level", metricType: Gauge},
GetReplicationMessagesForShardLatency: {metricName: "get_replication_messages_for_shard", metricType: Timer},
GetDLQReplicationMessagesLatency: {metricName: "get_dlq_replication_messages", metricType: Timer},
EventReapplySkippedCount: {metricName: "event_reapply_skipped_count", metricType: Counter},
DirectQueryDispatchLatency: {metricName: "direct_query_dispatch_latency", metricType: Timer},
DirectQueryDispatchStickyLatency: {metricName: "direct_query_dispatch_sticky_latency", metricType: Timer},
DirectQueryDispatchNonStickyLatency: {metricName: "direct_query_dispatch_non_sticky_latency", metricType: Timer},
DirectQueryDispatchStickySuccessCount: {metricName: "direct_query_dispatch_sticky_success", metricType: Counter},
DirectQueryDispatchNonStickySuccessCount: {metricName: "direct_query_dispatch_non_sticky_success", metricType: Counter},
DirectQueryDispatchClearStickinessLatency: {metricName: "direct_query_dispatch_clear_stickiness_latency", metricType: Timer},
DirectQueryDispatchClearStickinessSuccessCount: {metricName: "direct_query_dispatch_clear_stickiness_success", metricType: Counter},
DirectQueryDispatchTimeoutBeforeNonStickyCount: {metricName: "direct_query_dispatch_timeout_before_non_sticky", metricType: Counter},
WorkflowTaskQueryLatency: {metricName: "workflow_task_query_latency", metricType: Timer},
ConsistentQueryTimeoutCount: {metricName: "consistent_query_timeout", metricType: Counter},
QueryBeforeFirstWorkflowTaskCount: {metricName: "query_before_first_workflow_task", metricType: Counter},
QueryBufferExceededCount: {metricName: "query_buffer_exceeded", metricType: Counter},
QueryRegistryInvalidStateCount: {metricName: "query_registry_invalid_state", metricType: Counter},
WorkerNotSupportsConsistentQueryCount: {metricName: "worker_not_supports_consistent_query", metricType: Counter},
WorkflowTaskTimeoutOverrideCount: {metricName: "workflow_task_timeout_overrides", metricType: Counter},
WorkflowRunTimeoutOverrideCount: {metricName: "workflow_run_timeout_overrides", metricType: Counter},
ReplicationTaskCleanupCount: {metricName: "replication_task_cleanup_count", metricType: Counter},
ReplicationTaskCleanupFailure: {metricName: "replication_task_cleanup_failed", metricType: Counter},
MutableStateChecksumMismatch: {metricName: "mutable_state_checksum_mismatch", metricType: Counter},
MutableStateChecksumInvalidated: {metricName: "mutable_state_checksum_invalidated", metricType: Counter},
ElasticsearchBulkProcessorRequests: {metricName: "elasticsearch_bulk_processor_requests"},
ElasticsearchBulkProcessorQueuedRequests: {metricName: "elasticsearch_bulk_processor_queued_requests", metricType: Timer},
ElasticsearchBulkProcessorRetries: {metricName: "elasticsearch_bulk_processor_retries"},
ElasticsearchBulkProcessorFailures: {metricName: "elasticsearch_bulk_processor_errors"},
ElasticsearchBulkProcessorCorruptedData: {metricName: "elasticsearch_bulk_processor_corrupted_data"},
ElasticsearchBulkProcessorDuplicateRequest: {metricName: "elasticsearch_bulk_processor_duplicate_request"},
ElasticsearchBulkProcessorRequestLatency: {metricName: "elasticsearch_bulk_processor_request_latency", metricType: Timer},
ElasticsearchBulkProcessorCommitLatency: {metricName: "elasticsearch_bulk_processor_commit_latency", metricType: Timer},
ElasticsearchBulkProcessorWaitAddLatency: {metricName: "elasticsearch_bulk_processor_wait_add_latency", metricType: Timer},
ElasticsearchBulkProcessorWaitStartLatency: {metricName: "elasticsearch_bulk_processor_wait_start_latency", metricType: Timer},
ElasticsearchBulkProcessorBulkSize: {metricName: "elasticsearch_bulk_processor_bulk_size", metricType: Timer},
ElasticsearchBulkProcessorDeadlock: {metricName: "elasticsearch_bulk_processor_deadlock"},
},
Matching: {
PollSuccessPerTaskQueueCounter: {metricName: "poll_success_per_tl", metricRollupName: "poll_success"},
PollTimeoutPerTaskQueueCounter: {metricName: "poll_timeouts_per_tl", metricRollupName: "poll_timeouts"},
PollSuccessWithSyncPerTaskQueueCounter: {metricName: "poll_success_sync_per_tl", metricRollupName: "poll_success_sync"},
LeaseRequestPerTaskQueueCounter: {metricName: "lease_requests_per_tl", metricRollupName: "lease_requests"},
LeaseFailurePerTaskQueueCounter: {metricName: "lease_failures_per_tl", metricRollupName: "lease_failures"},
ConditionFailedErrorPerTaskQueueCounter: {metricName: "condition_failed_errors_per_tl", metricRollupName: "condition_failed_errors"},
RespondQueryTaskFailedPerTaskQueueCounter: {metricName: "respond_query_failed_per_tl", metricRollupName: "respond_query_failed"},
SyncThrottlePerTaskQueueCounter: {metricName: "sync_throttle_count_per_tl", metricRollupName: "sync_throttle_count"},
BufferThrottlePerTaskQueueCounter: {metricName: "buffer_throttle_count_per_tl", metricRollupName: "buffer_throttle_count"},
ExpiredTasksPerTaskQueueCounter: {metricName: "tasks_expired_per_tl", metricRollupName: "tasks_expired"},
ForwardedPerTaskQueueCounter: {metricName: "forwarded_per_tl"},
ForwardTaskCallsPerTaskQueue: {metricName: "forward_task_calls_per_tl", metricRollupName: "forward_task_calls"},
ForwardTaskErrorsPerTaskQueue: {metricName: "forward_task_errors_per_tl", metricRollupName: "forward_task_errors"},
ForwardQueryCallsPerTaskQueue: {metricName: "forward_query_calls_per_tl", metricRollupName: "forward_query_calls"},
ForwardQueryErrorsPerTaskQueue: {metricName: "forward_query_errors_per_tl", metricRollupName: "forward_query_errors"},
ForwardPollCallsPerTaskQueue: {metricName: "forward_poll_calls_per_tl", metricRollupName: "forward_poll_calls"},
ForwardPollErrorsPerTaskQueue: {metricName: "forward_poll_errors_per_tl", metricRollupName: "forward_poll_errors"},
SyncMatchLatencyPerTaskQueue: {metricName: "syncmatch_latency_per_tl", metricRollupName: "syncmatch_latency", metricType: Timer},
AsyncMatchLatencyPerTaskQueue: {metricName: "asyncmatch_latency_per_tl", metricRollupName: "asyncmatch_latency", metricType: Timer},
ForwardTaskLatencyPerTaskQueue: {metricName: "forward_task_latency_per_tl", metricRollupName: "forward_task_latency"},
ForwardQueryLatencyPerTaskQueue: {metricName: "forward_query_latency_per_tl", metricRollupName: "forward_query_latency"},
ForwardPollLatencyPerTaskQueue: {metricName: "forward_poll_latency_per_tl", metricRollupName: "forward_poll_latency"},
LocalToLocalMatchPerTaskQueueCounter: {metricName: "local_to_local_matches_per_tl", metricRollupName: "local_to_local_matches"},
LocalToRemoteMatchPerTaskQueueCounter: {metricName: "local_to_remote_matches_per_tl", metricRollupName: "local_to_remote_matches"},
RemoteToLocalMatchPerTaskQueueCounter: {metricName: "remote_to_local_matches_per_tl", metricRollupName: "remote_to_local_matches"},
RemoteToRemoteMatchPerTaskQueueCounter: {metricName: "remote_to_remote_matches_per_tl", metricRollupName: "remote_to_remote_matches"},
TaskQueueGauge: {metricName: "loaded_task_queue_count", metricType: Gauge},
},
Worker: {
ReplicatorMessages: {metricName: "replicator_messages"},
ReplicatorFailures: {metricName: "replicator_errors"},
ReplicatorLatency: {metricName: "replicator_latency"},
ReplicatorDLQFailures: {metricName: "replicator_dlq_enqueue_fails", metricType: Counter},
ArchiverNonRetryableErrorCount: {metricName: "archiver_non_retryable_error"},
ArchiverStartedCount: {metricName: "archiver_started"},
ArchiverStoppedCount: {metricName: "archiver_stopped"},
ArchiverCoroutineStartedCount: {metricName: "archiver_coroutine_started"},
ArchiverCoroutineStoppedCount: {metricName: "archiver_coroutine_stopped"},
ArchiverHandleHistoryRequestLatency: {metricName: "archiver_handle_history_request_latency"},
ArchiverHandleVisibilityRequestLatency: {metricName: "archiver_handle_visibility_request_latency"},
ArchiverUploadWithRetriesLatency: {metricName: "archiver_upload_with_retries_latency"},
ArchiverDeleteWithRetriesLatency: {metricName: "archiver_delete_with_retries_latency"},
ArchiverUploadFailedAllRetriesCount: {metricName: "archiver_upload_failed_all_retries"},
ArchiverUploadSuccessCount: {metricName: "archiver_upload_success"},
ArchiverDeleteFailedAllRetriesCount: {metricName: "archiver_delete_failed_all_retries"},
ArchiverDeleteSuccessCount: {metricName: "archiver_delete_success"},
ArchiverHandleVisibilityFailedAllRetiresCount: {metricName: "archiver_handle_visibility_failed_all_retries"},
ArchiverHandleVisibilitySuccessCount: {metricName: "archiver_handle_visibility_success"},
ArchiverBacklogSizeGauge: {metricName: "archiver_backlog_size"},
ArchiverPumpTimeoutCount: {metricName: "archiver_pump_timeout"},
ArchiverPumpSignalThresholdCount: {metricName: "archiver_pump_signal_threshold"},
ArchiverPumpTimeoutWithoutSignalsCount: {metricName: "archiver_pump_timeout_without_signals"},
ArchiverPumpSignalChannelClosedCount: {metricName: "archiver_pump_signal_channel_closed"},
ArchiverWorkflowStartedCount: {metricName: "archiver_workflow_started"},
ArchiverNumPumpedRequestsCount: {metricName: "archiver_num_pumped_requests"},
ArchiverNumHandledRequestsCount: {metricName: "archiver_num_handled_requests"},
ArchiverPumpedNotEqualHandledCount: {metricName: "archiver_pumped_not_equal_handled"},
ArchiverHandleAllRequestsLatency: {metricName: "archiver_handle_all_requests_latency"},
ArchiverWorkflowStoppingCount: {metricName: "archiver_workflow_stopping"},
TaskProcessedCount: {metricName: "task_processed", metricType: Gauge},
TaskDeletedCount: {metricName: "task_deleted", metricType: Gauge},
TaskQueueProcessedCount: {metricName: "taskqueue_processed", metricType: Gauge},
TaskQueueDeletedCount: {metricName: "taskqueue_deleted", metricType: Gauge},
TaskQueueOutstandingCount: {metricName: "taskqueue_outstanding", metricType: Gauge},
ExecutionsOutstandingCount: {metricName: "executions_outstanding", metricType: Gauge},
StartedCount: {metricName: "started", metricType: Counter},
StoppedCount: {metricName: "stopped", metricType: Counter},
ScanDuration: {metricName: "scan_duration", metricType: Timer},
ExecutorTasksDoneCount: {metricName: "executor_done", metricType: Counter},
ExecutorTasksErrCount: {metricName: "executor_err", metricType: Counter},
ExecutorTasksDeferredCount: {metricName: "executor_deferred", metricType: Counter},
ExecutorTasksDroppedCount: {metricName: "executor_dropped", metricType: Counter},
BatcherProcessorSuccess: {metricName: "batcher_processor_requests", metricType: Counter},
BatcherProcessorFailures: {metricName: "batcher_processor_errors", metricType: Counter},
HistoryScavengerSuccessCount: {metricName: "scavenger_success", metricType: Counter},
HistoryScavengerErrorCount: {metricName: "scavenger_errors", metricType: Counter},
HistoryScavengerSkipCount: {metricName: "scavenger_skips", metricType: Counter},
NamespaceReplicationEnqueueDLQCount: {metricName: "namespace_replication_dlq_enqueue_requests", metricType: Counter},
ScavengerValidationRequestsCount: {metricName: "scavenger_validation_requests", metricType: Counter},
ScavengerValidationFailuresCount: {metricName: "scavenger_validation_failures", metricType: Counter},
AddSearchAttributesFailuresCount: {metricName: "add_search_attributes_failures", metricType: Counter},
},
}
// ErrorClass is an enum to help with classifying SLA vs. non-SLA errors (SLA = "service level agreement")
type ErrorClass uint8
const (
// NoError indicates that there is no error (error should be nil)
NoError = ErrorClass(iota)
// UserError indicates that this is NOT an SLA-reportable error
UserError
// InternalError indicates that this is an SLA-reportable error
InternalError
)
// Empty returns true if the metricName is an empty string
func (mn MetricName) Empty() bool {
return mn == ""
}
// String returns string representation of this metric name
func (mn MetricName) String() string {
return string(mn)
}
| 1 | 13,291 | This is very unclear what Server means. We need a better name, maybe ServerExtension? | temporalio-temporal | go |
@@ -37,7 +37,6 @@ func TestDevLogs(t *testing.T) {
out, err := system.RunCommand(DdevBin, args)
assert.NoError(err)
assert.Contains(string(out), "Server started")
- assert.Contains(string(out), "GET")
cleanup()
} | 1 | package cmd
import (
"testing"
"os"
"github.com/drud/ddev/pkg/testcommon"
"github.com/drud/drud-go/utils/system"
"github.com/stretchr/testify/assert"
)
func TestDevLogsBadArgs(t *testing.T) {
assert := assert.New(t)
testDir := testcommon.CreateTmpDir("no-valid-ddev-config")
err := os.Chdir(testDir)
if err != nil {
t.Skip("Could not change to temporary directory %s: %v", testDir, err)
}
args := []string{"logs"}
out, err := system.RunCommand(DdevBin, args)
assert.Error(err)
assert.Contains(string(out), "unable to determine the application for this command")
}
// TestDevLogs tests that the Dev logs functionality is working.
func TestDevLogs(t *testing.T) {
assert := assert.New(t)
for _, v := range DevTestSites {
cleanup := v.Chdir()
args := []string{"logs"}
out, err := system.RunCommand(DdevBin, args)
assert.NoError(err)
assert.Contains(string(out), "Server started")
assert.Contains(string(out), "GET")
cleanup()
}
}
| 1 | 11,068 | I wonder if we should trigger a PHP error and ensure it ends up in the log? | drud-ddev | go |
@@ -232,7 +232,9 @@
* @returns {string} decoded string
*/
countlyCommon.decodeHtml = function(html) {
- return (html + "").replace(/&/g, '&');
+ var textArea = document.createElement('textarea');
+ textArea.innerHTML = html;
+ return textArea.value;
};
| 1 | /*global store, Handlebars, CountlyHelpers, countlyGlobal, _, Gauge, d3, moment, countlyTotalUsers, jQuery, filterXSS*/
(function(window, $) {
/**
* Object with common functions to be used for multiple purposes
* @name countlyCommon
* @global
* @namespace countlyCommon
*/
var CommonConstructor = function() {
// Private Properties
var countlyCommon = this;
var _period = (store.get("countly_date")) ? store.get("countly_date") : countlyCommon.DEFAULT_PERIOD || "30days";
var _persistentSettings;
var htmlEncodeOptions = {
"whiteList": {"a": ["href", "class", "target"], "ul": [], "li": [], "b": [], "br": [], "strong": [], "p": [], "span": ["class"], "div": ["class"]},
onTagAttr: function(tag, name, value/* isWhiteAttr*/) {
if (tag === "a") {
var re = new RegExp(/{[0-9]*}/);
var tested = re.test(value);
if (name === "target") {
if (!(value === "_blank" || value === "_self" || value === "_top" || value === "_parent" || tested)) {
return 'target="_blank"'; //set _blank if incorrect value
}
else {
return 'target="' + value + '"';
}
}
if (name === "href") {
if (!(value.substr(0, 1) === "#" || value.substr(0, 1) === "/" || value.substr(0, 4) === "http" || tested)) {
return 'href="#"'; //set # if incorrect value
}
else {
return 'href="' + value + '"';
}
}
}
}
};
/**
* Get Browser language
* @memberof countlyCommon
* @returns {string} browser locale in iso format en-US
* @example
* //outputs en-US
* countlyCommon.browserLang()
*/
countlyCommon.browserLang = function() {
var lang = navigator.language || navigator.userLanguage;
if (lang) {
lang = lang.toLowerCase();
lang.length > 3 && (lang = lang.substring(0, 3) + lang.substring(3).toUpperCase());
}
return lang;
};
// Public Properties
/**
* Set user persistent settings to store local storage
* @memberof countlyCommon
* @param {object} data - Object param for set new data
*/
countlyCommon.setPersistentSettings = function(data) {
if (!_persistentSettings) {
_persistentSettings = localStorage.getItem("persistentSettings") ? JSON.parse(localStorage.getItem("persistentSettings")) : {};
}
for (var i in data) {
_persistentSettings[i] = data[i];
}
localStorage.setItem("persistentSettings", JSON.stringify(_persistentSettings));
};
/**
* Get user persistent settings
* @memberof countlyCommon
* @returns {object} settings
*/
countlyCommon.getPersistentSettings = function() {
if (!_persistentSettings) {
_persistentSettings = localStorage.getItem("persistentSettings") ? JSON.parse(localStorage.getItem("persistentSettings")) : {};
}
return _persistentSettings;
};
/**
* App Key of currently selected app or 0 when not initialized
* @memberof countlyCommon
* @type {string|number}
*/
countlyCommon.ACTIVE_APP_KEY = 0;
/**
* App ID of currently selected app or 0 when not initialized
* @memberof countlyCommon
* @type {string|number}
*/
countlyCommon.ACTIVE_APP_ID = 0;
/**
* Current user's selected language in form en-EN, by default will use browser's language
* @memberof countlyCommon
* @type {string}
*/
countlyCommon.BROWSER_LANG = countlyCommon.browserLang() || "en-US";
/**
* Current user's browser language in short form as "en", by default will use browser's language
* @memberof countlyCommon
* @type {string}
*/
countlyCommon.BROWSER_LANG_SHORT = countlyCommon.BROWSER_LANG.split("-")[0];
if (store.get("countly_active_app")) {
if (countlyGlobal.apps[store.get("countly_active_app")]) {
countlyCommon.ACTIVE_APP_KEY = countlyGlobal.apps[store.get("countly_active_app")].key;
countlyCommon.ACTIVE_APP_ID = store.get("countly_active_app");
}
}
if (countlyGlobal.member.lang) {
var lang = countlyGlobal.member.lang;
store.set("countly_lang", lang);
countlyCommon.BROWSER_LANG_SHORT = lang;
countlyCommon.BROWSER_LANG = lang;
}
else if (store.get("countly_lang")) {
var lang1 = store.get("countly_lang");
countlyCommon.BROWSER_LANG_SHORT = lang1;
countlyCommon.BROWSER_LANG = lang1;
}
// Public Methods
/**
* Change currently selected period
* @memberof countlyCommon
* @param {string|array} period - new period, supported values are (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])
* @param {int} timeStamp - timeStamp for the period based
* @param {boolean} noSet - if false - updates countly_date
*/
countlyCommon.setPeriod = function(period, timeStamp, noSet) {
_period = period;
if (timeStamp) {
countlyCommon.periodObj = countlyCommon.calcSpecificPeriodObj(period, timeStamp);
}
else {
countlyCommon.periodObj = calculatePeriodObject(period);
}
if (window.app && window.app.recordEvent) {
window.app.recordEvent({
"key": "period-change",
"count": 1,
"segmentation": {is_custom: Array.isArray(period)}
});
}
if (noSet) {
/*
Dont update vuex or local storage if noSet is true
*/
return;
}
if (window.countlyVue && window.countlyVue.vuex) {
var currentStore = window.countlyVue.vuex.getGlobalStore();
if (currentStore) {
currentStore.dispatch("countlyCommon/updatePeriod", {period: period, label: countlyCommon.getDateRangeForCalendar()});
}
}
store.set("countly_date", period);
};
/**
* Get currently selected period
* @memberof countlyCommon
* @returns {string|array} supported values are (month, 60days, 30days, 7days, yesterday, hour or [startMiliseconds, endMiliseconds] as [1417730400000,1420149600000])
*/
countlyCommon.getPeriod = function() {
return _period;
};
countlyCommon.getPeriodForAjax = function() {
return CountlyHelpers.getPeriodUrlQueryParameter(_period);
};
/**
* Change currently selected app by app ID
* @memberof countlyCommon
* @param {string} appId - new app ID from @{countlyGlobal.apps} object
*/
countlyCommon.setActiveApp = function(appId) {
countlyCommon.ACTIVE_APP_KEY = countlyGlobal.apps[appId].key;
countlyCommon.ACTIVE_APP_ID = appId;
store.set("countly_active_app", appId);
$.ajax({
type: "POST",
url: countlyGlobal.path + "/user/settings/active-app",
data: {
"username": countlyGlobal.member.username,
"appId": appId,
_csrf: countlyGlobal.csrf_token
},
success: function() { }
});
};
/**
* Encode value to be passed to db as key, encoding $ symbol to $ if it is first and all . (dot) symbols to . in the string
* @memberof countlyCommon
* @param {string} str - value to encode
* @returns {string} encoded string
*/
countlyCommon.encode = function(str) {
return str.replace(/^\$/g, "$").replace(/\./g, '.');
};
/**
* Decode value from db, decoding first $ to $ and all . to . (dots). Decodes also url encoded values as &#36;.
* @memberof countlyCommon
* @param {string} str - value to decode
* @returns {string} decoded string
*/
countlyCommon.decode = function(str) {
return str.replace(/^$/g, "$").replace(/./g, '.');
};
/**
* Decode escaped HTML from db
* @memberof countlyCommon
* @param {string} html - value to decode
* @returns {string} decoded string
*/
countlyCommon.decodeHtml = function(html) {
return (html + "").replace(/&/g, '&');
};
/**
* Encode html
* @memberof countlyCommon
* @param {string} html - value to encode
* @returns {string} encode string
*/
countlyCommon.encodeHtml = function(html) {
var div = document.createElement('div');
div.innerText = html;
return div.innerHTML;
};
/**
* Encode some tags, leaving those set in whitelist as they are.
* @memberof countlyCommon
* @param {string} html - value to encode
* @param {object} options for encoding. Optional. If not passed, using default in common.
* @returns {string} encode string
*/
countlyCommon.encodeSomeHtml = function(html, options) {
if (options) {
return filterXSS(html, options);
}
else {
return filterXSS(html, htmlEncodeOptions);
}
};
/**
* Calculates the percent change between previous and current values.
* @memberof countlyCommon
* @param {number} previous - data for previous period
* @param {number} current - data for current period
* @returns {object} in the following format {"percent": "20%", "trend": "u"}
* @example
* //outputs {"percent":"100%","trend":"u"}
* countlyCommon.getPercentChange(100, 200);
*/
countlyCommon.getPercentChange = function(previous, current) {
var pChange = 0,
trend = "";
previous = parseFloat(previous);
current = parseFloat(current);
if (previous === 0) {
pChange = "NA";
trend = "u"; //upward
}
else if (current === 0) {
pChange = "∞";
trend = "d"; //downward
}
else {
var change = (((current - previous) / previous) * 100).toFixed(1);
pChange = countlyCommon.getShortNumber(change) + "%";
if (change < 0) {
trend = "d";
}
else {
trend = "u";
}
}
return { "percent": pChange, "trend": trend };
};
/**
* Fetches nested property values from an obj.
* @memberof countlyCommon
* @param {object} obj - standard countly metric object
* @param {string} my_passed_path - dot separate path to fetch from object
* @param {object} def - stub object to return if nothing is found on provided path
* @returns {object} fetched object from provided path
* @example <caption>Path found</caption>
* //outputs {"u":20,"t":20,"n":5}
* countlyCommon.getDescendantProp({"2017":{"1":{"2":{"u":20,"t":20,"n":5}}}}, "2017.1.2", {"u":0,"t":0,"n":0});
* @example <caption>Path not found</caption>
* //outputs {"u":0,"t":0,"n":0}
* countlyCommon.getDescendantProp({"2016":{"1":{"2":{"u":20,"t":20,"n":5}}}}, "2017.1.2", {"u":0,"t":0,"n":0});
*/
countlyCommon.getDescendantProp = function(obj, my_passed_path, def) {
for (var i = 0, my_path = (my_passed_path + "").split('.'), len = my_path.length; i < len; i++) {
if (!obj || typeof obj !== 'object') {
return def;
}
obj = obj[my_path[i]];
}
if (obj === undefined) {
return def;
}
return obj;
};
/**
* Checks if current graph type matches the one being drawn
* @memberof countlyCommon
* @param {string} type - graph type
* @param {object} settings - graph settings
* @returns {boolean} Return true if type is the same
*/
countlyCommon.checkGraphType = function(type, settings) {
var eType = "line";
if (settings && settings.series && settings.series.bars && settings.series.bars.show === true) {
if (settings.series.stack === true) {
eType = "bar";
}
else {
eType = "seperate-bar";
}
}
else if (settings && settings.series && settings.series.pie && settings.series.pie.show === true) {
eType = "pie";
}
if (type === eType) {
return true;
}
else {
return false;
}
};
/**
* Draws a graph with the given dataPoints to container. Used for drawing bar and pie charts.
* @memberof countlyCommon
* @param {object} dataPoints - data poitns to draw on graph
* @param {string|object} container - selector for container or container object itself where to create graph
* @param {string} graphType - type of the graph, accepted values are bar, line, pie, separate-bar
* @param {object} inGraphProperties - object with properties to extend and use on graph library directly
* @returns {boolean} false if container element not found, otherwise true
* @example <caption>Drawing Pie chart</caption>
* countlyCommon.drawGraph({"dp":[
* {"data":[[0,20]],"label":"Test1","color":"#52A3EF"},
* {"data":[[0,30]],"label":"Test2","color":"#FF8700"},
* {"data":[[0,50]],"label":"Test3","color":"#0EC1B9"}
* ]}, "#dashboard-graph", "pie");
* @example <caption>Drawing bar chart, to comapre values with different color bars</caption>
* //[-1,null] and [3,null] are used for offsets from left and right
* countlyCommon.drawGraph({"dp":[
* {"data":[[-1,null],[0,20],[1,30],[2,50],[3,null]],"color":"#52A3EF"}, //first bar set
* {"data":[[-1,null],[0,50],[1,30],[2,20],[3,null]],"color":"#0EC1B9"} //second bar set
*],
* "ticks":[[-1,""],[0,"Test1"],[1,"Test2"],[2,"Test3"],[3,""]]
*}, "#dashboard-graph", "separate-bar", {"series":{"stack":null}});
* @example <caption>Drawing Separate bars chart, to comapre values with different color bars</caption>
* //[-1,null] and [3,null] are used for offsets from left and right
* countlyCommon.drawGraph({"dp":[
* {"data":[[-1,null],[0,20],[1,null],[2,null],[3,null]],"label":"Test1","color":"#52A3EF"},
* {"data":[[-1,null],[0,null],[1,30],[2,null],[3,null]],"label":"Test2","color":"#FF8700"},
* {"data":[[-1,null],[0,null],[1,null],[2,50],[3,null]],"label":"Test3","color":"#0EC1B9"}
*],
* "ticks":[[-1,""],[0,"Test1"],[1,"Test2"],[2,"Test3"],[3,""]
*]}, "#dashboard-graph", "separate-bar");
*/
countlyCommon.drawGraph = function(dataPoints, container, graphType, inGraphProperties) {
var p = 0;
if ($(container).length <= 0) {
return false;
}
if (graphType === "pie") {
var min_treshold = 0.05; //minimum treshold for graph
var break_other = 0.3; //try breaking other in smaller if at least given % from all
var sum = 0;
var i = 0;
var useMerging = true;
for (i = 0; i < dataPoints.dp.length; i++) {
sum = sum + dataPoints.dp[i].data[0][1];
if (dataPoints.dp[i].moreInfo) {
useMerging = false;
}
else {
dataPoints.dp[i].moreInfo = "";
}
}
if (useMerging) {
var dpLength = dataPoints.dp.length;
var treshold_value = Math.round(min_treshold * sum);
var max_other = Math.round(min_treshold * sum);
var under_treshold = [];//array of values under treshold
var left_for_other = sum;
for (i = 0; i < dataPoints.dp.length; i++) {
if (dataPoints.dp[i].data[0][1] >= treshold_value) {
left_for_other = left_for_other - dataPoints.dp[i].data[0][1];
}
else {
under_treshold.push(dataPoints.dp[i].data[0][1]);
}
}
var stop_breaking = Math.round(sum * break_other);
if (left_for_other >= stop_breaking) { //fix values if other takes more than set % of data
under_treshold = under_treshold.sort(function(a, b) {
return a - b;
});
var tresholdMap = [];
treshold_value = treshold_value - 1; //to don't group exactly 5% values later in code
tresholdMap.push({value: treshold_value, text: 5});
var in_this_one = 0;
var count_in_this = 0;
for (p = under_treshold.length - 1; p >= 0 && under_treshold[p] > 0 && left_for_other >= stop_breaking; p--) {
if (under_treshold[p] <= treshold_value) {
if (in_this_one + under_treshold[p] <= max_other || count_in_this < 5) {
count_in_this++;
in_this_one += under_treshold[p];
left_for_other -= under_treshold[p];
}
else {
if (tresholdMap[tresholdMap.length - 1].value === under_treshold[p]) {
in_this_one = 0;
count_in_this = 0;
treshold_value = under_treshold[p] - 1;
}
else {
in_this_one = under_treshold[p];
count_in_this = 1;
treshold_value = under_treshold[p];
left_for_other -= under_treshold[p];
}
tresholdMap.push({value: treshold_value, text: Math.max(0.009, Math.round(treshold_value * 10000 / sum) / 100)});
}
}
}
treshold_value = Math.max(treshold_value - 1, 0);
tresholdMap.push({value: treshold_value, text: Math.round(treshold_value * 10000 / sum) / 100});
var tresholdPointer = 0;
while (tresholdPointer < tresholdMap.length - 1) {
dataPoints.dp.push({"label": tresholdMap[tresholdPointer + 1].text + "-" + tresholdMap[tresholdPointer].text + "%", "data": [[0, 0]], "moreInfo": []});
var tresholdPlace = dataPoints.dp.length - 1;
for (i = 0; i < dpLength; i++) {
if (dataPoints.dp[i].data[0][1] <= tresholdMap[tresholdPointer].value && dataPoints.dp[i].data[0][1] > tresholdMap[tresholdPointer + 1].value) {
dataPoints.dp[tresholdPlace].moreInfo.push({"label": dataPoints.dp[i].label, "value": Math.round(dataPoints.dp[i].data[0][1] * 10000 / sum) / 100});
dataPoints.dp[tresholdPlace].data[0][1] = dataPoints.dp[tresholdPlace].data[0][1] + dataPoints.dp[i].data[0][1];
dataPoints.dp.splice(i, 1);
dpLength = dataPoints.dp.length;
i--;
tresholdPlace--;
}
}
tresholdPointer = tresholdPointer + 1;
}
}
}
}
_.defer(function() {
if ((!dataPoints.dp || !dataPoints.dp.length) || (graphType === "bar" && (!dataPoints.dp[0].data[0] || (typeof dataPoints.dp[0].data[0][1] === 'undefined' && typeof dataPoints.dp[0].data[1][1] === 'undefined') || (dataPoints.dp[0].data[0][1] === null && dataPoints.dp[0].data[1][1] === null)))) {
$(container).hide();
$(container).siblings(".graph-no-data").show();
return true;
}
else {
$(container).show();
$(container).siblings(".graph-no-data").hide();
}
var graphProperties = {
series: {
lines: { show: true, fill: true },
points: { show: true }
},
grid: { hoverable: true, borderColor: "null", color: "#999", borderWidth: 0, minBorderMargin: 10 },
xaxis: { minTickSize: 1, tickDecimals: "number", tickLength: 0 },
yaxis: { min: 0, minTickSize: 1, tickDecimals: "number", position: "right" },
legend: { backgroundOpacity: 0, margin: [20, -19] },
colors: countlyCommon.GRAPH_COLORS
};
switch (graphType) {
case "line":
graphProperties.series = { lines: { show: true, fill: true }, points: { show: true } };
break;
case "bar":
if (dataPoints.ticks.length > 20) {
graphProperties.xaxis.rotateTicks = 45;
}
var barWidth = 0.6;
switch (dataPoints.dp.length) {
case 2:
barWidth = 0.3;
break;
case 3:
barWidth = 0.2;
break;
}
for (i = 0; i < dataPoints.dp.length; i++) {
dataPoints.dp[i].bars = {
order: i,
barWidth: barWidth
};
}
graphProperties.series = { stack: true, bars: { show: true, barWidth: 0.6, tickLength: 0, fill: 1 } };
graphProperties.xaxis.ticks = dataPoints.ticks;
break;
case "separate-bar":
if (dataPoints.ticks.length > 20) {
graphProperties.xaxis.rotateTicks = 45;
}
graphProperties.series = { bars: { show: true, align: "center", barWidth: 0.6, tickLength: 0, fill: 1 } };
graphProperties.xaxis.ticks = dataPoints.ticks;
break;
case "pie":
graphProperties.series = {
pie: {
show: true,
lineWidth: 0,
radius: 115,
innerRadius: 0.45,
combine: {
color: '#CCC',
threshold: 0.05
},
label: {
show: true,
radius: 160
}
}
};
graphProperties.legend.show = false;
break;
default:
break;
}
if (inGraphProperties) {
$.extend(true, graphProperties, inGraphProperties);
}
$.plot($(container), dataPoints.dp, graphProperties);
if (graphType === "bar" || graphType === "separate-bar") {
$(container).unbind("plothover");
$(container).bind("plothover", function(event, pos, item) {
$("#graph-tooltip").remove();
if (item && item.datapoint && item.datapoint[1]) {
// For stacked bar chart calculate the diff
var yAxisValue = item.datapoint[1].toFixed(1).replace(".0", "") - item.datapoint[2].toFixed(1).replace(".0", "");
if (inGraphProperties && inGraphProperties.tooltipType === "duration") {
yAxisValue = countlyCommon.formatSecond(yAxisValue);
}
showTooltip({
x: pos.pageX,
y: item.pageY,
contents: yAxisValue || 0
});
}
});
}
else if (graphType === 'pie') {
$(container).unbind("plothover");
$(container).bind("plothover", function(event, pos, item) {
$("#graph-tooltip").remove();
if (item && item.series && item.series.moreInfo) {
var tooltipcontent;
if (Array.isArray(item.series.moreInfo)) {
tooltipcontent = "<table class='pie_tooltip_table'>";
if (item.series.moreInfo.length <= 5) {
for (p = 0; p < item.series.moreInfo.length; p++) {
tooltipcontent = tooltipcontent + "<tr><td>" + item.series.moreInfo[p].label + ":</td><td>" + item.series.moreInfo[p].value + "%</td>";
}
}
else {
for (p = 0; p < 5; p = p + 1) {
tooltipcontent += "<tr><td>" + item.series.moreInfo[p].label + " :</td><td>" + item.series.moreInfo[p].value + "%</td></tr>";
}
tooltipcontent += "<tr><td colspan='2' style='text-align:center;'>...</td></tr><tr><td style='text-align:center;' colspan=2>(and " + (item.series.moreInfo.length - 5) + " other)</td></tr>";
}
tooltipcontent += "</table>";
}
else {
tooltipcontent = item.series.moreInfo;
}
showTooltip({
x: pos.pageX,
y: pos.pageY,
contents: tooltipcontent
});
}
});
}
else {
$(container).unbind("plothover");
}
}, dataPoints, container, graphType, inGraphProperties);
return true;
};
/**
* Draws a time line graph with the given dataPoints to container.
* @memberof countlyCommon
* @param {object} dataPoints - data points to draw on graph
* @param {string|object} container - selector for container or container object itself where to create graph
* @param {string=} bucket - time bucket to display on graph. See {@link countlyCommon.getTickObj}
* @param {string=} overrideBucket - time bucket to display on graph. See {@link countlyCommon.getTickObj}
* @param {boolean=} small - if graph won't be full width graph
* @param {array=} appIdsForNotes - display notes from provided apps ids on graph, will not show notes when empty
* @param {object=} options - extra graph options, see flot documentation
* @example
* countlyCommon.drawTimeGraph([{
* "data":[[1,0],[2,0],[3,0],[4,0],[5,0],[6,0],[7,12],[8,9],[9,10],[10,5],[11,8],[12,7],[13,9],[14,4],[15,6]],
* "label":"Total Sessions",
* "color":"#DDDDDD",
* "mode":"ghost"
*},{
* "data":[[1,74],[2,69],[3,60],[4,17],[5,6],[6,3],[7,13],[8,25],[9,62],[10,34],[11,34],[12,33],[13,34],[14,30],[15,1]],
* "label":"Total Sessions",
* "color":"#333933"
*}], "#dashboard-graph");
*/
countlyCommon.drawTimeGraph = function(dataPoints, container, bucket, overrideBucket, small, appIdsForNotes, options) {
_.defer(function() {
if (!dataPoints || !dataPoints.length) {
$(container).hide();
$(container).siblings(".graph-no-data").show();
return true;
}
else {
$(container).show();
$(container).siblings(".graph-no-data").hide();
}
var i = 0;
var j = 0;
// Some data points start with [1, XXX] (should be [0, XXX]) and brakes the new tick logic
// Below loops converts the old structures to the new one
if (dataPoints[0].data[0][0] === 1) {
for (i = 0; i < dataPoints.length; i++) {
for (j = 0; j < dataPoints[i].data.length; j++) {
dataPoints[i].data[j][0] -= 1;
}
}
}
var minValue = dataPoints[0].data[0][1];
var maxValue = dataPoints[0].data[0][1];
for (i = 0; i < dataPoints.length; i++) {
for (j = 0; j < dataPoints[i].data.length; j++) {
dataPoints[i].data[j][1] = Math.round(dataPoints[i].data[j][1] * 1000) / 1000; // 3 decimal places max
if (dataPoints[i].data[j][1] < minValue) {
minValue = dataPoints[i].data[j][1];
}
if (dataPoints[i].data[j][1] > maxValue) {
maxValue = dataPoints[i].data[j][1];
}
}
}
var myTickDecimals = 0;
var myMinTickSize = 1;
if (maxValue < 1 && maxValue > 0) {
myTickDecimals = maxValue.toString().length - 2;
myMinTickSize = 0.001;
}
var graphProperties = {
series: {
lines: {
stack: false,
show: false,
fill: true,
lineWidth: 2.5,
fillColor: {
colors: [
{ opacity: 0 },
{ opacity: 0 }
]
},
shadowSize: 0
},
splines: {
show: true,
lineWidth: 2.5
},
points: { show: true, radius: 0, shadowSize: 0, lineWidth: 2 },
shadowSize: 0
},
crosshair: { mode: "x", color: "rgba(78,78,78,0.4)" },
grid: { hoverable: true, borderColor: "null", color: "#666", borderWidth: 0, minBorderMargin: 10, labelMargin: 10 },
xaxis: { tickDecimals: "number", tickSize: 0, tickLength: 0 },
yaxis: { min: 0, minTickSize: 1, tickDecimals: "number", ticks: 3, position: "right"},
legend: { show: false, margin: [-25, -44], noColumns: 3, backgroundOpacity: 0 },
colors: countlyCommon.GRAPH_COLORS,
};
//overriding values
graphProperties.yaxis.minTickSize = myMinTickSize;
graphProperties.yaxis.tickDecimals = myTickDecimals;
if (myMinTickSize < 1) {
graphProperties.yaxis.tickFormatter = function(number) {
return (Math.round(number * 1000) / 1000).toString();
};
}
graphProperties.series.points.show = (dataPoints[0].data.length <= 90);
if (overrideBucket) {
graphProperties.series.points.radius = 4;
}
var graphTicks = [],
tickObj = {};
if (_period === "month" && !bucket) {
tickObj = countlyCommon.getTickObj("monthly");
if (tickObj.labelCn === 1) {
for (var kk = 0; kk < dataPoints.length; kk++) {
dataPoints[kk].data = dataPoints[kk].data.slice(0, 1);
}
graphProperties.series.points.radius = 4;
overrideBucket = true;//to get the dots added
}
else if (tickObj.labelCn === 2) {
for (var kkk = 0; kkk < dataPoints.length; kkk++) {
dataPoints[kkk].data = dataPoints[kkk].data.slice(0, 2);
}
}
}
else {
tickObj = countlyCommon.getTickObj(bucket, overrideBucket);
}
if (small) {
for (i = 0; i < tickObj.ticks.length; i = i + 2) {
tickObj.ticks[i][1] = "";
}
graphProperties.xaxis.font = {
size: 11,
color: "#a2a2a2"
};
}
graphProperties.xaxis.max = tickObj.max;
graphProperties.xaxis.min = tickObj.min;
graphProperties.xaxis.ticks = tickObj.ticks;
graphTicks = tickObj.tickTexts;
//set dashed line for not finished yet
if (countlyCommon.periodObj.periodContainsToday === true) {
var settings = countlyGlobal.apps[countlyCommon.ACTIVE_APP_ID];
var tzDate = new Date(new Date().toLocaleString('en-US', { timeZone: settings.timezone }));
for (var z = 0; z < dataPoints.length; z++) {
if (dataPoints[z].mode !== "ghost" && dataPoints[z].mode !== "previous") {
var bDate = new Date();
if (_period === "hour") {
if (bDate.getDate() === tzDate.getDate()) {
dataPoints[z].dashAfter = tzDate.getHours() - 1;
}
else if (bDate.getDate() > tzDate.getDate()) {
dataPoints[z].dashed = true; //all dashed because app lives still in yesterday
}
//for last - none dashed - because app lives in tomorrow(so don't do anything for this case)
}
else if (_period === "day") { //days in this month
var c = countlyCommon.periodObj.currentPeriodArr.length;
dataPoints[z].dashAfter = c - 2;
}
else if (_period === "month" && bDate.getMonth() <= 2 && (!bucket || bucket === "monthly")) {
dataPoints[z].dashed = true;
}
else {
if (bucket === "hourly") {
dataPoints[z].dashAfter = graphTicks.length - (24 - tzDate.getHours() + 1);
}
else {
dataPoints[z].dashAfter = graphTicks.length - 2;
}
}
if (typeof dataPoints[z].dashAfter !== 'undefined' && dataPoints[z].dashAfter <= 0) {
delete dataPoints[z].dashAfter;
dataPoints[z].dashed = true; //dash whole line
}
}
}
}
var graphObj = $(container).data("plot"),
keyEventCounter = "A",
keyEvents = [];
//keyEventsIndex = 0;
if (!(options && _.isObject(options) && $(container).parents("#dashboard-data").length > 0)) {
countlyCommon.deepObjectExtend(graphProperties, {
series: {lines: {show: true}, splines: {show: false}},
zoom: {active: true},
pan: {interactive: true, active: true, mode: "smartLock", frameRate: 120},
xaxis: {zoomRange: false, panRange: false},
yaxis: {showZeroTick: true, ticks: 5}
});
}
if (options && _.isObject(options)) {
countlyCommon.deepObjectExtend(graphProperties, options);
}
if (graphObj && countlyCommon.checkGraphType("line", graphObj.getOptions()) && graphObj.getOptions().series && graphObj.getOptions().grid.show && graphObj.getOptions().series.splines && graphObj.getOptions().yaxis.minTickSize === graphProperties.yaxis.minTickSize) {
graphObj = $(container).data("plot");
if (overrideBucket) {
graphObj.getOptions().series.points.radius = 4;
}
else {
graphObj.getOptions().series.points.radius = 0;
}
graphObj.getOptions().xaxes[0].max = tickObj.max;
graphObj.getOptions().xaxes[0].min = tickObj.min;
graphObj.getOptions().xaxes[0].ticks = tickObj.ticks;
graphObj.setData(dataPoints);
graphObj.setupGrid();
graphObj.draw();
}
else {
graphObj = $.plot($(container), dataPoints, graphProperties);
}
/** function calculates min and max
* @param {number} index - index
* @param {object} el - element
* @returns {boolean} true(if not set), else return nothing
*/
var findMinMax = function(index, el) {
// data point is null, this workaround is used to start drawing graph with a certain padding
if (!el[1] && parseInt(el[1]) !== 0) {
return true;
}
el[1] = parseFloat(el[1]);
if (el[1] >= tmpMax) {
tmpMax = el[1];
tmpMaxIndex = el[0];
}
if (el[1] <= tmpMin) {
tmpMin = el[1];
tmpMinIndex = el[0];
}
};
var k = 0;
for (k = 0; k < graphObj.getData().length; k++) {
var tmpMax = 0,
tmpMaxIndex = 0,
tmpMin = 999999999999,
tmpMinIndex = 0,
label = (graphObj.getData()[k].label + "").toLowerCase();
if (graphObj.getData()[k].mode === "ghost") {
//keyEventsIndex += graphObj.getData()[k].data.length;
continue;
}
$.each(graphObj.getData()[k].data, findMinMax);
if (tmpMax === tmpMin) {
continue;
}
keyEvents[k] = [];
keyEvents[k][keyEvents[k].length] = {
data: [tmpMinIndex, tmpMin],
code: keyEventCounter,
color: graphObj.getData()[k].color,
event: "min",
desc: jQuery.i18n.prop('common.graph-min', tmpMin, label, graphTicks[tmpMinIndex])
};
keyEventCounter = String.fromCharCode(keyEventCounter.charCodeAt() + 1);
keyEvents[k][keyEvents[k].length] = {
data: [tmpMaxIndex, tmpMax],
code: keyEventCounter,
color: graphObj.getData()[k].color,
event: "max",
desc: jQuery.i18n.prop('common.graph-max', tmpMax, label, graphTicks[tmpMaxIndex])
};
keyEventCounter = String.fromCharCode(keyEventCounter.charCodeAt() + 1);
}
var drawLabels = function() {
var graphWidth = graphObj.width(),
graphHeight = graphObj.height();
$(container).find(".graph-key-event-label").remove();
$(container).find(".graph-note-label").remove();
for (k = 0; k < keyEvents.length; k++) {
var bgColor = graphObj.getData()[k].color;
if (!keyEvents[k]) {
continue;
}
for (var l = 0; l < keyEvents[k].length; l++) {
var o = graphObj.pointOffset({ x: keyEvents[k][l].data[0], y: keyEvents[k][l].data[1] });
if (o.top <= 40) {
o.top = 40;
}
else if (o.top >= (graphHeight + 30)) {
o.top = graphHeight + 30;
}
if (o.left <= 15) {
o.left = 15;
}
else if (o.left >= (graphWidth - 15)) {
o.left = (graphWidth - 15);
}
var keyEventLabel = $('<div class="graph-key-event-label">').text(keyEvents[k][l].code);
keyEventLabel.attr({
"title": keyEvents[k][l].desc,
"data-points": "[" + keyEvents[k][l].data + "]"
}).css({
"position": 'absolute',
"left": o.left,
"top": o.top - 33,
"display": 'none',
"background-color": bgColor
}).appendTo(graphObj.getPlaceholder()).show();
$(".tipsy").remove();
keyEventLabel.tipsy({ gravity: $.fn.tipsy.autoWE, offset: 3, html: true });
}
}
// Add note labels to the graph
if (appIdsForNotes && !(countlyGlobal && countlyGlobal.ssr) && !(bucket === "hourly" && dataPoints[0].data.length > 24) && bucket !== "weekly") {
var noteDateIds = countlyCommon.getNoteDateIds(bucket),
frontData = graphObj.getData()[graphObj.getData().length - 1],
startIndex = (!frontData.data[1] && frontData.data[1] !== 0) ? 1 : 0;
for (k = 0, l = startIndex; k < frontData.data.length; k++, l++) {
if (frontData.data[l]) {
var graphPoint = graphObj.pointOffset({ x: frontData.data[l][0], y: frontData.data[l][1] });
var notes = countlyCommon.getNotesForDateId(noteDateIds[k], appIdsForNotes);
var colors = ["#79a3e9", "#70bbb8", "#e2bc33", "#a786cd", "#dd6b67", "#ece176"];
if (notes.length) {
var labelColor = colors[notes[0].color - 1];
var titleDom = '';
if (notes.length === 1) {
var noteTime = moment(notes[0].ts).format("D MMM, HH:mm");
var noteId = notes[0].app_id;
var app = countlyGlobal.apps[noteId] || {};
titleDom = "<div> <div class='note-header'><div class='note-title'>" + noteTime + "</div><div class='note-app' style='display:flex;line-height: 15px;'> <div class='icon' style='display:inline-block; border-radius:2px; width:15px; height:15px; margin-right: 5px; background: url(appimages/" + noteId + ".png) center center / cover no-repeat;'></div><span>" + app.name + "</span></div></div>" +
"<div class='note-content'>" + notes[0].note + "</div>" +
"<div class='note-footer'> <span class='note-owner'>" + (notes[0].owner_name) + "</span> | <span class='note-type'>" + (jQuery.i18n.map["notes.note-" + notes[0].noteType] || notes[0].noteType) + "</span> </div>" +
"</div>";
}
else {
var noteDateFormat = "D MMM, YYYY";
if (countlyCommon.getPeriod() === "month") {
noteDateFormat = "MMM YYYY";
}
noteTime = moment(notes[0].ts).format(noteDateFormat);
titleDom = "<div><div class='note-header'><div class='note-title'>" + noteTime + "</div></div>" +
"<div class='note-content'><span onclick='countlyCommon.getNotesPopup(" + noteDateIds[k] + "," + JSON.stringify(appIdsForNotes) + ")' class='notes-view-link'>View Notes (" + notes.length + ")</span></div>" +
"</div>";
}
var graphNoteLabel = $('<div class="graph-note-label graph-text-note" style="background-color:' + labelColor + ';"><div class="fa fa-align-left" ></div></div>');
graphNoteLabel.attr({
"title": titleDom,
"data-points": "[" + frontData.data[l] + "]"
}).css({
"position": 'absolute',
"left": graphPoint.left,
"top": graphPoint.top - 53,
"display": 'none',
"border-color": frontData.color
}).appendTo(graphObj.getPlaceholder()).show();
$(".tipsy").remove();
graphNoteLabel.tipsy({cssClass: 'tipsy-for-note', gravity: $.fn.tipsy.autoWE, offset: 3, html: true, trigger: 'hover', hoverable: true });
}
}
}
}
};
drawLabels();
$(container).on("mouseout", function() {
graphObj.unlockCrosshair();
graphObj.clearCrosshair();
graphObj.unhighlight();
$("#graph-tooltip").fadeOut(200, function() {
$(this).remove();
});
});
/** dShows tooltip
* @param {number} dataIndex - index
* @param {object} position - position
* @param {boolean} onPoint - if point found
*/
function showCrosshairTooltip(dataIndex, position, onPoint) {
//increase dataIndex if ticks are padded
var tickIndex = dataIndex;
if ((tickObj.ticks && tickObj.ticks[0] && tickObj.ticks[0][0] < 0) && (tickObj.tickTexts && tickObj.tickTexts[0] === "")) {
tickIndex++;
}
var tooltip = $("#graph-tooltip");
var crossHairPos = graphObj.p2c(position);
var minpoz = Math.max(200, tooltip.width());
var tooltipLeft = (crossHairPos.left < minpoz) ? crossHairPos.left + 20 : crossHairPos.left - tooltip.width() - 20;
tooltip.css({ left: tooltipLeft });
if (onPoint) {
var dataSet = graphObj.getData(),
tooltipHTML = "<div class='title'>" + tickObj.tickTexts[tickIndex] + "</div>";
dataSet = _.sortBy(dataSet, function(obj) {
return obj.data[dataIndex][1];
});
for (var m = dataSet.length - 1; m >= 0; --m) {
var series = dataSet[m],
formattedValue = series.data[dataIndex][1];
var addMe = "";
// Change label to previous period if there is a ghost graph
if (series.mode === "ghost") {
series.label = jQuery.i18n.map["common.previous-period"];
}
var opacity = "1.0";
//add lines over color block for dashed
if (series.dashed && series.previous) {
addMe = '<svg style="width: 12px; height: 12px; position:absolute; top:0; left:0;"><line stroke-dasharray="2, 2" x1="0" y1="100%" x2="100%" y2="0" style="stroke:rgb(255,255,255);stroke-width:30"/></svg>';
}
if (series.alpha) {
opacity = series.alpha + "";
}
if (formattedValue) {
formattedValue = parseFloat(formattedValue).toFixed(2).replace(/[.,]00$/, "");
}
if (series.data[dataIndex][2]) {
formattedValue = series.data[dataIndex][2]; // to show customized string value tips
}
tooltipHTML += "<div class='inner'>";
tooltipHTML += "<div class='color' style='position:relative; background-color: " + series.color + "; opacity:" + opacity + ";'>" + addMe + "</div>";
tooltipHTML += "<div class='series'>" + series.label + "</div>";
tooltipHTML += "<div class='value'>" + formattedValue + "</div>";
tooltipHTML += "</div>";
}
if (tooltip.length) {
tooltip.html(tooltipHTML);
}
else {
tooltip = $("<div id='graph-tooltip' class='white' style='top:-15px;'>" + tooltipHTML + "</div>");
$(container).prepend(tooltip);
}
if (tooltip.is(":visible")) {
tooltip.css({
"transition": "left .15s"
});
}
else {
tooltip.fadeIn();
}
}
}
$(container).unbind("plothover");
$(container).bind("plothover", function(event, pos) {
graphObj.unlockCrosshair();
graphObj.unhighlight();
var dataset = graphObj.getData(),
pointFound = false;
for (i = 0; i < dataset.length; ++i) {
var series = dataset[i];
// Find the nearest points, x-wise
for (j = 0; j < series.data.length; ++j) {
var currX = series.data[j][0],
currCrossX = pos.x.toFixed(2);
if ((currX - 0.10) < currCrossX && (currX + 0.10) > currCrossX) {
graphObj.lockCrosshair({
x: series.data[j][0],
y: series.data[j][1]
});
graphObj.highlight(series, j);
pointFound = true;
break;
}
}
}
showCrosshairTooltip(j, pos, pointFound);
});
if (!(options && _.isObject(options) && $(container).parents("#dashboard-data").length > 0)) {
var zoomTarget = $(container),
zoomContainer = $(container).parent();
zoomContainer.find(".zoom").remove();
zoomContainer.prepend("<div class=\"zoom\"><div class=\"zoom-button zoom-out\"></div><div class=\"zoom-button zoom-reset\"></div><div class=\"zoom-button zoom-in\"></div></div>");
zoomTarget.addClass("pannable");
zoomContainer.data("zoom", zoomContainer.data("zoom") || 1);
zoomContainer.find(".zoom-in").tooltipster({
theme: "tooltipster-borderless",
content: $.i18n.map["common.zoom-in"]
});
zoomContainer.find(".zoom-out").tooltipster({
theme: "tooltipster-borderless",
content: $.i18n.map["common.zoom-out"]
});
zoomContainer.find(".zoom-reset").tooltipster({
theme: "tooltipster-borderless",
content: {},
functionFormat: function() {
return $.i18n.prop("common.zoom-reset", Math.round(zoomContainer.data("zoom") * 100));
}
});
zoomContainer.find(".zoom-out").off("click").on("click", function() {
var plot = zoomTarget.data("plot");
plot.zoomOut({
amount: 1.5,
center: {left: plot.width() / 2, top: plot.height()}
});
zoomContainer.data("zoom", zoomContainer.data("zoom") / 1.5);
});
zoomContainer.find(".zoom-reset").off("click").on("click", function() {
var plot = zoomTarget.data("plot");
plot.zoomOut({
amount: zoomContainer.data("zoom"),
center: {left: plot.width() / 2, top: plot.height()}
});
zoomContainer.data("zoom", 1);
var yaxis = plot.getAxes().yaxis;
var panOffset = yaxis.p2c(0) - plot.height() + 2;
if (Math.abs(panOffset) > 2) {
plot.pan({top: panOffset});
}
});
zoomContainer.find(".zoom-in").off("click").on("click", function() {
var plot = zoomTarget.data("plot");
plot.zoom({
amount: 1.5,
center: {left: plot.width() / 2, top: plot.height()}
});
zoomContainer.data("zoom", zoomContainer.data("zoom") * 1.5);
});
zoomTarget.off("plotzoom").on("plotzoom", function() {
drawLabels();
});
zoomTarget.off("plotpan").on("plotpan", function() {
drawLabels();
});
}
}, dataPoints, container, bucket);
};
/**
* Draws a gauge with provided value on procided container.
* @memberof countlyCommon
* @param {string|object} targetEl - selector for container or container object itself where to create graph
* @param {number} value - value to display on gauge
* @param {number} maxValue - maximal value of the gauge
* @param {string} gaugeColor - color of the gauge in hexadecimal string as #ffffff
* @param {string|object} textField - selector for container or container object itself where to output textual value
*/
countlyCommon.drawGauge = function(targetEl, value, maxValue, gaugeColor, textField) {
var opts = {
lines: 12,
angle: 0.15,
lineWidth: 0.44,
pointer: {
length: 0.7,
strokeWidth: 0.05,
color: '#000000'
},
colorStart: gaugeColor,
colorStop: gaugeColor,
strokeColor: '#E0E0E0',
generateGradient: true
};
var gauge = new Gauge($(targetEl)[0]).setOptions(opts);
if (textField) {
gauge.setTextField($(textField)[0]);
}
gauge.maxValue = maxValue;
gauge.set(1);
gauge.set(value);
};
/**
* Draws horizibtally stacked bars like in platforms and density analytic sections.
* @memberof countlyCommon
* @param {array} data - data to draw in form of [{"data":[[0,85]],"label":"Test1"},{"data":[[0,79]],"label":"Test2"},{"data":[[0,78]],"label":"Test3"}]
* @param {object|string} intoElement - selector for container or container object itself where to create graph
* @param {number} colorIndex - index of color from {@link countlyCommon.GRAPH_COLORS}
*/
countlyCommon.drawHorizontalStackedBars = function(data, intoElement, colorIndex) {
var processedData = [],
tmpProcessedData = [],
totalCount = 0,
maxToDisplay = 10,
barHeight = 30;
var i = 0;
for (i = 0; i < data.length; i++) {
tmpProcessedData.push({
label: data[i].label,
count: data[i].data[0][1],
index: i
});
totalCount += data[i].data[0][1];
}
var totalPerc = 0,
proCount = 0;
for (i = 0; i < tmpProcessedData.length; i++) {
if (i >= maxToDisplay) {
processedData.push({
label: "Other",
count: totalCount - proCount,
perc: countlyCommon.round((100 - totalPerc), 2) + "%",
index: i
});
break;
}
var perc = countlyCommon.round((tmpProcessedData[i].count / totalCount) * 100, 2);
tmpProcessedData[i].perc = perc + "%";
totalPerc += perc;
proCount += tmpProcessedData[i].count;
processedData.push(tmpProcessedData[i]);
}
if (processedData.length > 0) {
var percentSoFar = 0;
var chart = d3.select(intoElement)
.attr("width", "100%")
.attr("height", barHeight);
var bar = chart.selectAll("g")
.data(processedData)
.enter().append("g");
bar.append("rect")
.attr("width", function(d) {
return ((d.count / totalCount) * 100) + "%";
})
.attr("x", function(d) {
var myPercent = percentSoFar;
percentSoFar = percentSoFar + (100 * (d.count / totalCount));
return myPercent + "%";
})
.attr("height", barHeight)
.attr("fill", function(d) {
if (colorIndex || colorIndex === 0) {
return countlyCommon.GRAPH_COLORS[colorIndex];
}
else {
return countlyCommon.GRAPH_COLORS[d.index];
}
})
.attr("stroke", "#FFF")
.attr("stroke-width", 2);
if (colorIndex || colorIndex === 0) {
bar.attr("opacity", function(d) {
return 1 - (0.05 * d.index);
});
}
percentSoFar = 0;
bar.append("foreignObject")
.attr("width", function(d) {
return ((d.count / totalCount) * 100) + "%";
})
.attr("height", barHeight)
.attr("x", function(d) {
var myPercent = percentSoFar;
percentSoFar = percentSoFar + (100 * (d.count / totalCount));
return myPercent + "%";
})
.append("xhtml:div")
.attr("class", "hsb-tip")
.html(function(d) {
return "<div>" + d.perc + "</div>";
});
percentSoFar = 0;
bar.append("text")
.attr("x", function(d) {
var myPercent = percentSoFar;
percentSoFar = percentSoFar + (100 * (d.count / totalCount));
return myPercent + 0.5 + "%";
})
.attr("dy", "1.35em")
.text(function(d) {
return d.label;
});
}
else {
var chart1 = d3.select(intoElement)
.attr("width", "100%")
.attr("height", barHeight);
var bar1 = chart1.selectAll("g")
.data([{ text: jQuery.i18n.map["common.bar.no-data"] }])
.enter().append("g");
bar1.append("rect")
.attr("width", "100%")
.attr("height", barHeight)
.attr("fill", "#FBFBFB")
.attr("stroke", "#FFF")
.attr("stroke-width", 2);
bar1.append("foreignObject")
.attr("width", "100%")
.attr("height", barHeight)
.append("xhtml:div")
.attr("class", "no-data")
.html(function(d) {
return d.text;
});
}
};
/**
* Extract range data from standard countly metric data model
* @memberof countlyCommon
* @param {object} db - countly standard metric data object
* @param {string} propertyName - name of the property to extract
* @param {object} rangeArray - array of all metrics/segments to extract (usually what is contained in meta)
* @param {function} explainRange - function to convert range/bucket index to meaningful label
* @param {array} myorder - arrays of preferred order for give keys. Optional. If not passed - sorted by values
* @returns {array} array containing extracted ranged data as [{"f":"First session","t":352,"percent":"88.4"},{"f":"2 days","t":46,"percent":"11.6"}]
* @example <caption>Extracting session frequency from users collection</caption>
* //outputs [{"f":"First session","t":352,"percent":"88.4"},{"f":"2 days","t":46,"percent":"11.6"}]
* countlyCommon.extractRangeData(_userDb, "f", _frequencies, countlySession.explainFrequencyRange);
*/
countlyCommon.extractRangeData = function(db, propertyName, rangeArray, explainRange, myorder) {
countlyCommon.periodObj = getPeriodObj();
var dataArr = [],
dataArrCounter = 0,
rangeTotal,
total = 0;
var tmp_x = 0;
if (!rangeArray) {
return dataArr;
}
for (var j = 0; j < rangeArray.length; j++) {
rangeTotal = 0;
if (!countlyCommon.periodObj.isSpecialPeriod) {
tmp_x = countlyCommon.getDescendantProp(db, countlyCommon.periodObj.activePeriod + "." + propertyName);
if (tmp_x && tmp_x[rangeArray[j]]) {
rangeTotal += tmp_x[rangeArray[j]];
}
if (rangeTotal !== 0) {
dataArr[dataArrCounter] = {};
dataArr[dataArrCounter][propertyName] = (explainRange) ? explainRange(rangeArray[j]) : rangeArray[j];
dataArr[dataArrCounter].t = rangeTotal;
total += rangeTotal;
dataArrCounter++;
}
}
else {
var tmpRangeTotal = 0;
var i = 0;
for (i = 0; i < (countlyCommon.periodObj.uniquePeriodArr.length); i++) {
tmp_x = countlyCommon.getDescendantProp(db, countlyCommon.periodObj.uniquePeriodArr[i] + "." + propertyName);
if (tmp_x && tmp_x[rangeArray[j]]) {
rangeTotal += tmp_x[rangeArray[j]];
}
}
for (i = 0; i < (countlyCommon.periodObj.uniquePeriodCheckArr.length); i++) {
tmp_x = countlyCommon.getDescendantProp(db, countlyCommon.periodObj.uniquePeriodCheckArr[i] + "." + propertyName);
if (tmp_x && tmp_x[rangeArray[j]]) {
tmpRangeTotal += tmp_x[rangeArray[j]];
}
}
if (rangeTotal > tmpRangeTotal) {
rangeTotal = tmpRangeTotal;
}
if (rangeTotal !== 0) {
dataArr[dataArrCounter] = {};
dataArr[dataArrCounter][propertyName] = (explainRange) ? explainRange(rangeArray[j]) : rangeArray[j];
dataArr[dataArrCounter].t = rangeTotal;
total += rangeTotal;
dataArrCounter++;
}
}
}
for (var z = 0; z < dataArr.length; z++) {
dataArr[z].percent = ((dataArr[z].t / total) * 100).toFixed(1);
}
if (myorder && Array.isArray(myorder)) {
dataArr.sort(function(a, b) {
return (myorder.indexOf(a[propertyName]) - myorder.indexOf(b[propertyName]));
});
}
else {
dataArr.sort(function(a, b) {
return -(a.t - b.t);
});
}
return dataArr;
};
/**
* Extract single level data without metrics/segments, like total user data from users collection
* @memberof countlyCommon
* @param {object} db - countly standard metric data object
* @param {function} clearFunction - function to prefill all expected properties as u, t, n, etc with 0, so you would not have null in the result which won't work when drawing graphs
* @param {object} chartData - prefill chart data with labels, colors, etc
* @param {object} dataProperties - describing which properties and how to extract
* @param {string} metric - metric to select
* @returns {object} object to use in timeline graph with {"chartDP":chartData, "chartData":_.compact(tableData), "keyEvents":keyEvents}
* @example <caption>Extracting total users data from users collection</caption>
* countlyCommon.extractChartData(_sessionDb, countlySession.clearObject, [
* { data:[], label:"Total Users" }
* ], [
* {
* name:"t",
* func:function (dataObj) {
* return dataObj["u"]
* }
* }
* ]);
* @example <caption>Returned data</caption>
* {"chartDP":[
* {
* "data":[[0,0],[1,0],[2,0],[3,0],[4,0],[5,0],[6,0],[7,0],[8,0],[9,0],[10,0],[11,0],[12,0],[13,0],[14,0],[15,12]],
* "label":"Total Sessions",
* "color":"#DDDDDD",
* "mode":"ghost"
* },
* {
* "data":[[0,6],[1,14],[2,11],[3,18],[4,10],[5,32],[6,53],[7,55],[8,71],[9,82],[10,74],[11,69],[12,60],[13,17],[14,6],[15,3]],
* "label":"Total Sessions",
* "color":"#333933"
* }
* ],
* "chartData":[
* {"date":"22 Dec, 2016","pt":0,"t":6},
* {"date":"23 Dec, 2016","pt":0,"t":14},
* {"date":"24 Dec, 2016","pt":0,"t":11},
* {"date":"25 Dec, 2016","pt":0,"t":18},
* {"date":"26 Dec, 2016","pt":0,"t":10},
* {"date":"27 Dec, 2016","pt":0,"t":32},
* {"date":"28 Dec, 2016","pt":0,"t":53},
* {"date":"29 Dec, 2016","pt":0,"t":55},
* {"date":"30 Dec, 2016","pt":0,"t":71},
* {"date":"31 Dec, 2016","pt":0,"t":82},
* {"date":"1 Jan, 2017","pt":0,"t":74},
* {"date":"2 Jan, 2017","pt":0,"t":69},
* {"date":"3 Jan, 2017","pt":0,"t":60},
* {"date":"4 Jan, 2017","pt":0,"t":17},
* {"date":"5 Jan, 2017","pt":0,"t":6},
* {"date":"6 Jan, 2017","pt":12,"t":3}
* ],
* "keyEvents":[{"min":0,"max":12},{"min":0,"max":82}]
* }
*/
countlyCommon.extractChartData = function(db, clearFunction, chartData, dataProperties, metric) {
if (metric) {
metric = "." + metric;
}
else {
metric = "";
}
countlyCommon.periodObj = getPeriodObj();
var periodMin = countlyCommon.periodObj.periodMin,
periodMax = (countlyCommon.periodObj.periodMax + 1),
dataObj = {},
formattedDate = "",
tableData = [],
propertyNames = _.pluck(dataProperties, "name"),
propertyFunctions = _.pluck(dataProperties, "func"),
currOrPrevious = _.pluck(dataProperties, "period"),
activeDate,
activeDateArr;
for (var j = 0; j < propertyNames.length; j++) {
if (currOrPrevious[j] === "previous") {
if (countlyCommon.periodObj.isSpecialPeriod) {
periodMin = 0;
periodMax = countlyCommon.periodObj.previousPeriodArr.length;
activeDateArr = countlyCommon.periodObj.previousPeriodArr;
}
else {
activeDate = countlyCommon.periodObj.previousPeriod;
}
}
else {
if (countlyCommon.periodObj.isSpecialPeriod) {
periodMin = 0;
periodMax = countlyCommon.periodObj.currentPeriodArr.length;
activeDateArr = countlyCommon.periodObj.currentPeriodArr;
}
else {
activeDate = countlyCommon.periodObj.activePeriod;
}
}
for (var i = periodMin; i < periodMax; i++) {
if (!countlyCommon.periodObj.isSpecialPeriod) {
if (countlyCommon.periodObj.periodMin === 0) {
formattedDate = moment((activeDate + " " + i + ":00:00").replace(/\./g, "/"), "YYYY/MM/DD HH:mm:ss");
}
else if (("" + activeDate).indexOf(".") === -1) {
formattedDate = moment((activeDate + "/" + i + "/1").replace(/\./g, "/"), "YYYY/MM/DD");
}
else {
formattedDate = moment((activeDate + "/" + i).replace(/\./g, "/"), "YYYY/MM/DD");
}
dataObj = countlyCommon.getDescendantProp(db, activeDate + "." + i + metric);
}
else {
formattedDate = moment((activeDateArr[i]).replace(/\./g, "/"), "YYYY/MM/DD");
dataObj = countlyCommon.getDescendantProp(db, activeDateArr[i] + metric);
}
dataObj = clearFunction(dataObj);
if (!tableData[i]) {
tableData[i] = {};
}
tableData[i].date = countlyCommon.formatDate(formattedDate, countlyCommon.periodObj.dateString);
var propertyValue = "";
if (propertyFunctions[j]) {
propertyValue = propertyFunctions[j](dataObj);
}
else {
propertyValue = dataObj[propertyNames[j]];
}
chartData[j].data[chartData[j].data.length] = [i, propertyValue];
tableData[i][propertyNames[j]] = propertyValue;
}
}
var keyEvents = [];
for (var k = 0; k < chartData.length; k++) {
var flatChartData = _.flatten(chartData[k].data);
var chartVals = _.reject(flatChartData, function(context, value) {
return value % 2 === 0;
});
keyEvents[k] = {};
keyEvents[k].min = _.min(chartVals);
keyEvents[k].max = _.max(chartVals);
}
return { "chartDP": chartData, "chartData": _.compact(tableData), "keyEvents": keyEvents };
};
/**
* Extract two level data with metrics/segments, like total user data from carriers collection
* @memberof countlyCommon
* @param {object} db - countly standard metric data object
* @param {object} rangeArray - array of all metrics/segments to extract (usually what is contained in meta)
* @param {function} clearFunction - function to prefill all expected properties as u, t, n, etc with 0, so you would not have null in the result which won't work when drawing graphs
* @param {object} dataProperties - describing which properties and how to extract
* @param {object=} estOverrideMetric - data from total users api request to correct unique user values
* @returns {object} object to use in bar and pie charts with {"chartData":_.compact(tableData)}
* @example <caption>Extracting carriers data from carriers collection</caption>
* var chartData = countlyCommon.extractTwoLevelData(_carrierDb, ["At&t", "Verizon"], countlyCarrier.clearObject, [
* {
* name:"carrier",
* func:function (rangeArr, dataObj) {
* return rangeArr;
* }
* },
* { "name":"t" },
* { "name":"u" },
* { "name":"n" }
* ]);
* @example <caption>Return data</caption>
* {"chartData":['
* {"carrier":"At&t","t":71,"u":62,"n":36},
* {"carrier":"Verizon","t":66,"u":60,"n":30}
* ]}
*/
countlyCommon.extractTwoLevelData = function(db, rangeArray, clearFunction, dataProperties, estOverrideMetric) {
countlyCommon.periodObj = getPeriodObj();
if (!rangeArray) {
return { "chartData": tableData };
}
var periodMin = 0,
periodMax = 0,
dataObj = {},
tableData = [],
propertyNames = _.pluck(dataProperties, "name"),
propertyFunctions = _.pluck(dataProperties, "func"),
propertyValue = 0;
if (!countlyCommon.periodObj.isSpecialPeriod) {
periodMin = countlyCommon.periodObj.periodMin;
periodMax = (countlyCommon.periodObj.periodMax + 1);
}
else {
periodMin = 0;
periodMax = countlyCommon.periodObj.currentPeriodArr.length;
}
var tableCounter = 0;
var j = 0;
var k = 0;
var i = 0;
if (!countlyCommon.periodObj.isSpecialPeriod) {
for (j = 0; j < rangeArray.length; j++) {
dataObj = countlyCommon.getDescendantProp(db, countlyCommon.periodObj.activePeriod + "." + rangeArray[j]);
if (!dataObj) {
continue;
}
var tmpPropertyObj1 = {};
dataObj = clearFunction(dataObj);
var propertySum = 0;
for (k = 0; k < propertyNames.length; k++) {
if (propertyFunctions[k]) {
propertyValue = propertyFunctions[k](rangeArray[j], dataObj);
}
else {
propertyValue = dataObj[propertyNames[k]];
}
if (typeof propertyValue !== 'string') {
propertySum += propertyValue;
}
tmpPropertyObj1[propertyNames[k]] = propertyValue;
}
if (propertySum > 0) {
tableData[tableCounter] = {};
tableData[tableCounter] = tmpPropertyObj1;
tableCounter++;
}
}
}
else {
var calculatedObj = (estOverrideMetric) ? countlyTotalUsers.get(estOverrideMetric) : {};
for (j = 0; j < rangeArray.length; j++) {
var tmp_x = {};
var tmpPropertyObj = {};
for (i = periodMin; i < periodMax; i++) {
dataObj = countlyCommon.getDescendantProp(db, countlyCommon.periodObj.currentPeriodArr[i] + "." + rangeArray[j]);
if (!dataObj) {
continue;
}
dataObj = clearFunction(dataObj);
for (k = 0; k < propertyNames.length; k++) {
if (propertyNames[k] === "u") {
propertyValue = 0;
}
else if (propertyFunctions[k]) {
propertyValue = propertyFunctions[k](rangeArray[j], dataObj);
}
else {
propertyValue = dataObj[propertyNames[k]];
}
if (!tmpPropertyObj[propertyNames[k]]) {
tmpPropertyObj[propertyNames[k]] = 0;
}
if (typeof propertyValue === 'string') {
tmpPropertyObj[propertyNames[k]] = propertyValue;
}
else {
tmpPropertyObj[propertyNames[k]] += propertyValue;
}
}
}
if (propertyNames.indexOf("u") !== -1 && Object.keys(tmpPropertyObj).length) {
if (countlyTotalUsers.isUsable() && estOverrideMetric && typeof calculatedObj[rangeArray[j]] !== "undefined") {
tmpPropertyObj.u = calculatedObj[rangeArray[j]];
}
else {
var tmpUniqVal = 0,
tmpUniqValCheck = 0,
tmpCheckVal = 0,
l = 0;
for (l = 0; l < (countlyCommon.periodObj.uniquePeriodArr.length); l++) {
tmp_x = countlyCommon.getDescendantProp(db, countlyCommon.periodObj.uniquePeriodArr[l] + "." + rangeArray[j]);
if (!tmp_x) {
continue;
}
tmp_x = clearFunction(tmp_x);
propertyValue = tmp_x.u;
if (typeof propertyValue === 'string') {
tmpPropertyObj.u = propertyValue;
}
else {
tmpUniqVal += propertyValue;
tmpPropertyObj.u += propertyValue;
}
}
for (l = 0; l < (countlyCommon.periodObj.uniquePeriodCheckArr.length); l++) {
tmp_x = countlyCommon.getDescendantProp(db, countlyCommon.periodObj.uniquePeriodCheckArr[l] + "." + rangeArray[j]);
if (!tmp_x) {
continue;
}
tmp_x = clearFunction(tmp_x);
tmpCheckVal = tmp_x.u;
if (typeof tmpCheckVal !== 'string') {
tmpUniqValCheck += tmpCheckVal;
}
}
if (tmpUniqVal > tmpUniqValCheck) {
tmpPropertyObj.u = tmpUniqValCheck;
}
}
// Total users can't be less than new users
if (tmpPropertyObj.u < tmpPropertyObj.n) {
if (countlyTotalUsers.isUsable() && estOverrideMetric && typeof calculatedObj[rangeArray[j]] !== "undefined") {
tmpPropertyObj.n = calculatedObj[rangeArray[j]];
}
else {
tmpPropertyObj.u = tmpPropertyObj.n;
}
}
// Total users can't be more than total sessions
if (tmpPropertyObj.u > tmpPropertyObj.t) {
tmpPropertyObj.u = tmpPropertyObj.t;
}
}
tableData[tableCounter] = {};
tableData[tableCounter] = tmpPropertyObj;
tableCounter++;
}
}
for (i = 0; i < tableData.length; i++) {
if (_.isEmpty(tableData[i])) {
tableData[i] = null;
}
}
tableData = _.compact(tableData);
if (propertyNames.indexOf("u") !== -1) {
countlyCommon.sortByProperty(tableData, "u");
}
else if (propertyNames.indexOf("t") !== -1) {
countlyCommon.sortByProperty(tableData, "t");
}
else if (propertyNames.indexOf("c") !== -1) {
countlyCommon.sortByProperty(tableData, "c");
}
return { "chartData": tableData };
};
countlyCommon.sortByProperty = function(tableData, prop) {
tableData.sort(function(a, b) {
a = (a && a[prop]) ? a[prop] : 0;
b = (b && b[prop]) ? b[prop] : 0;
return b - a;
});
};
/**
* Merge metric data in chartData returned by @{link countlyCommon.extractChartData} or @{link countlyCommon.extractTwoLevelData }, just in case if after data transformation of countly standard metric data model, resulting chartData contains duplicated values, as for example converting null, undefined and unknown values to unknown
* @memberof countlyCommon
* @param {object} chartData - chartData returned by @{link countlyCommon.extractChartData} or @{link countlyCommon.extractTwoLevelData }
* @param {string} metric - metric name to merge
* @returns {object} chartData object with same metrics summed up
* @example <caption>Sample input</caption>
* {"chartData":[
* {"metric":"Test","t":71,"u":62,"n":36},
* {"metric":"Test1","t":66,"u":60,"n":30},
* {"metric":"Test","t":2,"u":3,"n":4}
* ]}
* @example <caption>Sample output</caption>
* {"chartData":[
* {"metric":"Test","t":73,"u":65,"n":40},
* {"metric":"Test1","t":66,"u":60,"n":30}
* ]}
*/
countlyCommon.mergeMetricsByName = function(chartData, metric) {
var uniqueNames = {},
data;
for (var i = 0; i < chartData.length; i++) {
data = chartData[i];
var newName = (data[metric] + "").trim();
if (newName === "") {
newName = jQuery.i18n.map["common.unknown"];
}
data[metric] = newName;
if (newName && !uniqueNames[newName]) {
uniqueNames[newName] = data;
}
else {
for (var key in data) {
if (typeof data[key] === "string") {
uniqueNames[newName][key] = data[key];
}
else if (typeof data[key] === "number") {
if (!uniqueNames[newName][key]) {
uniqueNames[newName][key] = 0;
}
uniqueNames[newName][key] += data[key];
}
}
}
}
return _.values(uniqueNames);
};
/**
* Extracts top three items (from rangeArray) that have the biggest total session counts from the db object.
* @memberof countlyCommon
* @param {object} db - countly standard metric data object
* @param {object} rangeArray - array of all metrics/segments to extract (usually what is contained in meta)
* @param {function} clearFunction - function to prefill all expected properties as u, t, n, etc with 0, so you would not have null in the result which won't work when drawing graphs
* @param {function} fetchFunction - function to fetch property, default used is function (rangeArr, dataObj) {return rangeArr;}
* @param {String} metric - name of the metric to use ordering and returning
* @param {string} estOverrideMetric - name of the total users estimation override, by default will use default _estOverrideMetric provided on initialization
* @param {function} fixBarSegmentData - function to make any adjustments to the extracted data based on segment
* @returns {array} array with top 3 values
* @example <caption>Return data</caption>
* [
* {"name":"iOS","percent":35},
* {"name":"Android","percent":33},
* {"name":"Windows Phone","percent":32}
* ]
*/
countlyCommon.extractBarDataWPercentageOfTotal = function(db, rangeArray, clearFunction, fetchFunction, metric, estOverrideMetric, fixBarSegmentData) {
fetchFunction = fetchFunction || function(rangeArr) {
return rangeArr;
};
var rangeData = countlyCommon.extractTwoLevelData(db, rangeArray, clearFunction, [
{
name: "range",
func: fetchFunction
},
{ "name": metric }
], estOverrideMetric);
return countlyCommon.calculateBarDataWPercentageOfTotal(rangeData, metric, fixBarSegmentData);
};
/**
* Extracts top three items (from rangeArray) that have the biggest total session counts from the db object.
* @memberof countlyCommon
* @param {object} db - countly standard metric data object
* @param {object} rangeArray - array of all metrics/segments to extract (usually what is contained in meta)
* @param {function} clearFunction - function to prefill all expected properties as u, t, n, etc with 0, so you would not have null in the result which won't work when drawing graphs
* @param {function} fetchFunction - function to fetch property, default used is function (rangeArr, dataObj) {return rangeArr;}
* @returns {array} array with top 3 values
* @example <caption>Return data</caption>
* [
* {"name":"iOS","percent":35},
* {"name":"Android","percent":33},
* {"name":"Windows Phone","percent":32}
* ]
*/
countlyCommon.extractBarData = function(db, rangeArray, clearFunction, fetchFunction) {
fetchFunction = fetchFunction || function(rangeArr) {
return rangeArr;
};
var rangeData = countlyCommon.extractTwoLevelData(db, rangeArray, clearFunction, [
{
name: "range",
func: fetchFunction
},
{ "name": "t" }
]);
return countlyCommon.calculateBarData(rangeData);
};
/**
* Extracts top three items (from rangeArray) that have the biggest total session counts from the chartData with their percentage of total
* @memberof countlyCommon
* @param {object} rangeData - chartData retrieved from {@link countlyCommon.extractTwoLevelData} as {"chartData":[{"carrier":"At&t","t":71,"u":62,"n":36},{"carrier":"Verizon","t":66,"u":60,"n":30}]}
* @param {String} metric - name of the metric to use ordering and returning
* @param {Function} fixBarSegmentData - Function to fix bar data segment data
* @returns {array} array with top 3 values
* @example <caption>Return data</caption>
* [
* {"name":"iOS","percent":44},
* {"name":"Android","percent":22},
* {"name":"Windows Phone","percent":14}
* ]
*/
countlyCommon.calculateBarDataWPercentageOfTotal = function(rangeData, metric, fixBarSegmentData) {
rangeData.chartData = countlyCommon.mergeMetricsByName(rangeData.chartData, "range");
if (fixBarSegmentData) {
rangeData = fixBarSegmentData(rangeData);
}
rangeData.chartData = _.sortBy(rangeData.chartData, function(obj) {
return -obj[metric];
});
var rangeNames = _.pluck(rangeData.chartData, 'range'),
rangeTotal = _.pluck(rangeData.chartData, metric),
barData = [],
maxItems = 3,
totalSum = 0;
rangeTotal.forEach(function(r) {
totalSum += r;
});
rangeTotal.sort(function(a, b) {
if (a < b) {
return 1;
}
if (b < a) {
return -1;
}
return 0;
});
var totalPercent = 0;
for (var i = rangeNames.length - 1; i >= 0; i--) {
var percent = countlyCommon.round((rangeTotal[i] / totalSum) * 100, 1);
totalPercent += percent;
barData[i] = { "name": rangeNames[i], "percent": percent };
}
var deltaFixEl = 0;
if (totalPercent < 100) {
//Add the missing delta to the first value
deltaFixEl = 0;
}
else if (totalPercent > 100) {
//Subtract the extra delta from the last value
deltaFixEl = barData.length - 1;
}
barData[deltaFixEl].percent += 100 - totalPercent;
barData[deltaFixEl].percent = countlyCommon.round(barData[deltaFixEl].percent, 1);
if (rangeNames.length < maxItems) {
maxItems = rangeNames.length;
}
return barData.slice(0, maxItems);
};
/**
* Extracts top three items (from rangeArray) that have the biggest total session counts from the chartData.
* @memberof countlyCommon
* @param {object} rangeData - chartData retrieved from {@link countlyCommon.extractTwoLevelData} as {"chartData":[{"carrier":"At&t","t":71,"u":62,"n":36},{"carrier":"Verizon","t":66,"u":60,"n":30}]}
* @returns {array} array with top 3 values
* @example <caption>Return data</caption>
* [
* {"name":"iOS","percent":35},
* {"name":"Android","percent":33},
* {"name":"Windows Phone","percent":32}
* ]
*/
countlyCommon.calculateBarData = function(rangeData) {
rangeData.chartData = countlyCommon.mergeMetricsByName(rangeData.chartData, "range");
rangeData.chartData = _.sortBy(rangeData.chartData, function(obj) {
return -obj.t;
});
var rangeNames = _.pluck(rangeData.chartData, 'range'),
rangeTotal = _.pluck(rangeData.chartData, 't'),
barData = [],
sum = 0,
maxItems = 3,
totalPercent = 0;
rangeTotal.sort(function(a, b) {
if (a < b) {
return 1;
}
if (b < a) {
return -1;
}
return 0;
});
if (rangeNames.length < maxItems) {
maxItems = rangeNames.length;
}
var i = 0;
for (i = 0; i < maxItems; i++) {
sum += rangeTotal[i];
}
for (i = maxItems - 1; i >= 0; i--) {
var percent = Math.floor((rangeTotal[i] / sum) * 100);
totalPercent += percent;
if (i === 0) {
percent += 100 - totalPercent;
}
barData[i] = { "name": rangeNames[i], "percent": percent };
}
return barData;
};
countlyCommon.extractUserChartData = function(db, label, sec) {
var ret = { "data": [], "label": label };
countlyCommon.periodObj = getPeriodObj();
var periodMin, periodMax, dateob;
if (countlyCommon.periodObj.isSpecialPeriod) {
periodMin = 0;
periodMax = (countlyCommon.periodObj.daysInPeriod);
var dateob1 = countlyCommon.processPeriod(countlyCommon.periodObj.currentPeriodArr[0].toString());
var dateob2 = countlyCommon.processPeriod(countlyCommon.periodObj.currentPeriodArr[countlyCommon.periodObj.currentPeriodArr.length - 1].toString());
dateob = { timestart: dateob1.timestart, timeend: dateob2.timeend, range: "d" };
}
else {
periodMin = countlyCommon.periodObj.periodMin;
periodMax = countlyCommon.periodObj.periodMax + 1;
dateob = countlyCommon.processPeriod(countlyCommon.periodObj.activePeriod.toString());
}
var res = [],
ts;
//get all timestamps in that period
var i = 0;
for (i = 0, l = db.length; i < l; i++) {
ts = db[i];
if (sec) {
ts.ts = ts.ts * 1000;
}
if (ts.ts > dateob.timestart && ts.ts <= dateob.timeend) {
res.push(ts);
}
}
var lastStart,
lastEnd = dateob.timestart,
total,
data = ret.data;
for (i = periodMin; i < periodMax; i++) {
total = 0;
lastStart = lastEnd;
lastEnd = moment(lastStart).add(moment.duration(1, dateob.range)).valueOf();
for (var j = 0, l = res.length; j < l; j++) {
ts = res[j];
if (ts.ts > lastStart && ts.ts <= lastEnd) {
if (ts.c) {
total += ts.c;
}
else {
total++;
}
}
}
data.push([i, total]);
}
return ret;
};
countlyCommon.processPeriod = function(period) {
var date = period.split(".");
var range,
timestart,
timeend;
if (date.length === 1) {
range = "M";
timestart = moment(period, "YYYY").valueOf();
timeend = moment(period, "YYYY").add(moment.duration(1, "y")).valueOf();
}
else if (date.length === 2) {
range = "d";
timestart = moment(period, "YYYY.MM").valueOf();
timeend = moment(period, "YYYY.MM").add(moment.duration(1, "M")).valueOf();
}
else if (date.length === 3) {
range = "h";
timestart = moment(period, "YYYY.MM.DD").valueOf();
timeend = moment(period, "YYYY.MM.DD").add(moment.duration(1, "d")).valueOf();
}
return { timestart: timestart, timeend: timeend, range: range };
};
/**
* Shortens the given number by adding K (thousand) or M (million) postfix. K is added only if the number is bigger than 10000, etc.
* @memberof countlyCommon
* @param {number} number - number to shorten
* @returns {string} shorter representation of number
* @example
* //outputs 10K
* countlyCommon.getShortNumber(10000);
*/
countlyCommon.getShortNumber = function(number) {
var tmpNumber = "";
if (number >= 1000000000 || number <= -1000000000) {
tmpNumber = ((number / 1000000000).toFixed(1).replace(".0", "")) + "B";
}
else if (number >= 1000000 || number <= -1000000) {
tmpNumber = ((number / 1000000).toFixed(1).replace(".0", "")) + "M";
}
else if (number >= 10000 || number <= -10000) {
tmpNumber = ((number / 1000).toFixed(1).replace(".0", "")) + "K";
}
else if (number >= 0.1 || number <= -0.1) {
number += "";
tmpNumber = number.replace(".0", "");
}
else {
tmpNumber = number + "";
}
return tmpNumber;
};
/**
* Getting the date range shown on the dashboard like 1 Aug - 30 Aug, using {@link countlyCommon.periodObj) dateString property which holds the date format.
* @memberof countlyCommon
* @returns {string} string with formatted date range as 1 Aug - 30 Aug
*/
countlyCommon.getDateRange = function() {
countlyCommon.periodObj = getPeriodObj();
var formattedDateStart = "";
var formattedDateEnd = "";
if (!countlyCommon.periodObj.isSpecialPeriod) {
if (countlyCommon.periodObj.dateString === "HH:mm") {
formattedDateStart = moment(countlyCommon.periodObj.activePeriod + " " + countlyCommon.periodObj.periodMin + ":00", "YYYY.M.D HH:mm");
formattedDateEnd = moment(countlyCommon.periodObj.activePeriod + " " + countlyCommon.periodObj.periodMax + ":00", "YYYY.M.D HH:mm");
var nowMin = moment().format("mm");
formattedDateEnd.add(nowMin, "minutes");
}
else if (countlyCommon.periodObj.dateString === "D MMM, HH:mm") {
formattedDateStart = moment(countlyCommon.periodObj.activePeriod, "YYYY.M.D");
formattedDateEnd = moment(countlyCommon.periodObj.activePeriod, "YYYY.M.D").add(23, "hours").add(59, "minutes");
}
else {
formattedDateStart = moment(countlyCommon.periodObj.activePeriod + "." + countlyCommon.periodObj.periodMin, "YYYY.M.D");
formattedDateEnd = moment(countlyCommon.periodObj.activePeriod + "." + countlyCommon.periodObj.periodMax, "YYYY.M.D");
}
}
else {
formattedDateStart = moment(countlyCommon.periodObj.currentPeriodArr[0], "YYYY.M.D");
formattedDateEnd = moment(countlyCommon.periodObj.currentPeriodArr[(countlyCommon.periodObj.currentPeriodArr.length - 1)], "YYYY.M.D");
}
var fromStr = countlyCommon.formatDate(formattedDateStart, countlyCommon.periodObj.dateString),
toStr = countlyCommon.formatDate(formattedDateEnd, countlyCommon.periodObj.dateString);
if (fromStr === toStr) {
return fromStr;
}
else {
return fromStr + " - " + toStr;
}
};
countlyCommon.getDateRangeForCalendar = function() {
countlyCommon.periodObj = getPeriodObj();
var formattedDateStart = "";
var formattedDateEnd = "";
if (!countlyCommon.periodObj.isSpecialPeriod) {
if (countlyCommon.periodObj.dateString === "HH:mm") {
formattedDateStart = countlyCommon.formatDate(moment(countlyCommon.periodObj.activePeriod + " " + countlyCommon.periodObj.periodMin + ":00", "YYYY.M.D HH:mm"), "D MMM, YYYY HH:mm");
formattedDateEnd = moment(countlyCommon.periodObj.activePeriod + " " + countlyCommon.periodObj.periodMax + ":00", "YYYY.M.D HH:mm");
formattedDateEnd = formattedDateEnd.add(59, "minutes");
formattedDateEnd = countlyCommon.formatDate(formattedDateEnd, "D MMM, YYYY HH:mm");
}
else if (countlyCommon.periodObj.dateString === "D MMM, HH:mm") {
formattedDateStart = countlyCommon.formatDate(moment(countlyCommon.periodObj.activePeriod, "YYYY.M.D"), "D MMM, YYYY HH:mm");
formattedDateEnd = countlyCommon.formatDate(moment(countlyCommon.periodObj.activePeriod, "YYYY.M.D").add(23, "hours").add(59, "minutes"), "D MMM, YYYY HH:mm");
}
else if (countlyCommon.periodObj.dateString === "MMM") { //this year
formattedDateStart = countlyCommon.formatDate(moment(countlyCommon.periodObj.activePeriod + "." + countlyCommon.periodObj.periodMin + ".1", "YYYY.M.D"), "D MMM, YYYY");
formattedDateEnd = countlyCommon.formatDate(moment(countlyCommon.periodObj.activePeriod + "." + countlyCommon.periodObj.periodMax + ".31", "YYYY.M.D"), "D MMM, YYYY");
}
else {
formattedDateStart = countlyCommon.formatDate(moment(countlyCommon.periodObj.activePeriod + "." + countlyCommon.periodObj.periodMin, "YYYY.M.D"), "D MMM, YYYY");
formattedDateEnd = countlyCommon.formatDate(moment(countlyCommon.periodObj.activePeriod + "." + countlyCommon.periodObj.periodMax, "YYYY.M.D"), "D MMM, YYYY");
}
}
else {
formattedDateStart = countlyCommon.formatDate(moment(countlyCommon.periodObj.currentPeriodArr[0], "YYYY.M.D"), "D MMM, YYYY");
formattedDateEnd = countlyCommon.formatDate(moment(countlyCommon.periodObj.currentPeriodArr[(countlyCommon.periodObj.currentPeriodArr.length - 1)], "YYYY.M.D"), "D MMM, YYYY");
}
return formattedDateStart + " - " + formattedDateEnd;
};
/**
* Merge standard countly metric data object, by mergin updateObj retrieved from action=refresh api requests object into dbObj.
* Used for merging the received data for today to the existing data while updating the dashboard.
* @memberof countlyCommon
* @param {object} dbObj - standard metric data object
* @param {object} updateObj - standard metric data object retrieved from action=refresh request to last time bucket data only
*/
countlyCommon.extendDbObj = function(dbObj, updateObj) {
var now = moment(),
year = now.year(),
month = (now.month() + 1),
day = now.date(),
weekly = Math.ceil(now.format("DDD") / 7),
intRegex = /^\d+$/,
tmpUpdateObj = {},
tmpOldObj = {};
if (updateObj[year] && updateObj[year][month] && updateObj[year][month][day]) {
if (!dbObj[year]) {
dbObj[year] = {};
}
if (!dbObj[year][month]) {
dbObj[year][month] = {};
}
if (!dbObj[year][month][day]) {
dbObj[year][month][day] = {};
}
if (!dbObj[year]["w" + weekly]) {
dbObj[year]["w" + weekly] = {};
}
tmpUpdateObj = updateObj[year][month][day];
tmpOldObj = dbObj[year][month][day];
dbObj[year][month][day] = updateObj[year][month][day];
}
if (updateObj.meta) {
if (!dbObj.meta) {
dbObj.meta = {};
}
dbObj.meta = updateObj.meta;
}
for (var level1 in tmpUpdateObj) {
if (!Object.prototype.hasOwnProperty.call(tmpUpdateObj, level1)) {
continue;
}
if (intRegex.test(level1)) {
continue;
}
if (_.isObject(tmpUpdateObj[level1])) {
if (!dbObj[year][level1]) {
dbObj[year][level1] = {};
}
if (!dbObj[year][month][level1]) {
dbObj[year][month][level1] = {};
}
if (!dbObj[year]["w" + weekly][level1]) {
dbObj[year]["w" + weekly][level1] = {};
}
}
else {
if (dbObj[year][level1]) {
if (tmpOldObj[level1]) {
dbObj[year][level1] += (tmpUpdateObj[level1] - tmpOldObj[level1]);
}
else {
dbObj[year][level1] += tmpUpdateObj[level1];
}
}
else {
dbObj[year][level1] = tmpUpdateObj[level1];
}
if (dbObj[year][month][level1]) {
if (tmpOldObj[level1]) {
dbObj[year][month][level1] += (tmpUpdateObj[level1] - tmpOldObj[level1]);
}
else {
dbObj[year][month][level1] += tmpUpdateObj[level1];
}
}
else {
dbObj[year][month][level1] = tmpUpdateObj[level1];
}
if (dbObj[year]["w" + weekly][level1]) {
if (tmpOldObj[level1]) {
dbObj[year]["w" + weekly][level1] += (tmpUpdateObj[level1] - tmpOldObj[level1]);
}
else {
dbObj[year]["w" + weekly][level1] += tmpUpdateObj[level1];
}
}
else {
dbObj[year]["w" + weekly][level1] = tmpUpdateObj[level1];
}
}
if (tmpUpdateObj[level1]) {
for (var level2 in tmpUpdateObj[level1]) {
if (!Object.prototype.hasOwnProperty.call(tmpUpdateObj[level1], level2)) {
continue;
}
if (dbObj[year][level1][level2]) {
if (tmpOldObj[level1] && tmpOldObj[level1][level2]) {
dbObj[year][level1][level2] += (tmpUpdateObj[level1][level2] - tmpOldObj[level1][level2]);
}
else {
dbObj[year][level1][level2] += tmpUpdateObj[level1][level2];
}
}
else {
dbObj[year][level1][level2] = tmpUpdateObj[level1][level2];
}
if (dbObj[year][month][level1][level2]) {
if (tmpOldObj[level1] && tmpOldObj[level1][level2]) {
dbObj[year][month][level1][level2] += (tmpUpdateObj[level1][level2] - tmpOldObj[level1][level2]);
}
else {
dbObj[year][month][level1][level2] += tmpUpdateObj[level1][level2];
}
}
else {
dbObj[year][month][level1][level2] = tmpUpdateObj[level1][level2];
}
if (dbObj[year]["w" + weekly][level1][level2]) {
if (tmpOldObj[level1] && tmpOldObj[level1][level2]) {
dbObj[year]["w" + weekly][level1][level2] += (tmpUpdateObj[level1][level2] - tmpOldObj[level1][level2]);
}
else {
dbObj[year]["w" + weekly][level1][level2] += tmpUpdateObj[level1][level2];
}
}
else {
dbObj[year]["w" + weekly][level1][level2] = tmpUpdateObj[level1][level2];
}
}
}
}
// Fix update of total user count
if (updateObj[year]) {
if (updateObj[year].u) {
if (!dbObj[year]) {
dbObj[year] = {};
}
dbObj[year].u = updateObj[year].u;
}
if (updateObj[year][month] && updateObj[year][month].u) {
if (!dbObj[year]) {
dbObj[year] = {};
}
if (!dbObj[year][month]) {
dbObj[year][month] = {};
}
dbObj[year][month].u = updateObj[year][month].u;
}
if (updateObj[year]["w" + weekly] && updateObj[year]["w" + weekly].u) {
if (!dbObj[year]) {
dbObj[year] = {};
}
if (!dbObj[year]["w" + weekly]) {
dbObj[year]["w" + weekly] = {};
}
dbObj[year]["w" + weekly].u = updateObj[year]["w" + weekly].u;
}
}
};
/**
* Convert string to first letter uppercase and all other letters - lowercase for each word
* @memberof countlyCommon
* @param {string} str - string to convert
* @returns {string} converted string
* @example
* //outputs Hello World
* countlyCommon.toFirstUpper("hello world");
*/
countlyCommon.toFirstUpper = function(str) {
return str.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
};
/**
* Safe division between numbers providing 0 as result in cases when dividing by 0
* @memberof countlyCommon
* @param {number} val1 - number which to divide
* @param {number} val2 - number by which to divide
* @returns {number} result of division
* @example
* //outputs 0
* countlyCommon.divide(100, 0);
*/
countlyCommon.divide = function(val1, val2) {
var temp = val1 / val2;
if (!temp || temp === Number.POSITIVE_INFINITY) {
temp = 0;
}
return temp;
};
/**
* Get Date graph ticks
* @memberof countlyCommon
* @param {string} bucket - time bucket, accepted values, hourly, weekly, monthly
* @param {boolean} overrideBucket - override existing bucket logic and simply use current date for generating ticks
* @param {boolean} newChart - new chart implementation
* @returns {object} object containing tick texts and ticks to use on time graphs
* @example <caption>Example output</caption>
*{
* "min":0,
* "max":29,
* "tickTexts":["22 Dec, Thursday","23 Dec, Friday","24 Dec, Saturday","25 Dec, Sunday","26 Dec, Monday","27 Dec, Tuesday","28 Dec, Wednesday",
* "29 Dec, Thursday","30 Dec, Friday","31 Dec, Saturday","1 Jan, Sunday","2 Jan, Monday","3 Jan, Tuesday","4 Jan, Wednesday","5 Jan, Thursday",
* "6 Jan, Friday","7 Jan, Saturday","8 Jan, Sunday","9 Jan, Monday","10 Jan, Tuesday","11 Jan, Wednesday","12 Jan, Thursday","13 Jan, Friday",
* "14 Jan, Saturday","15 Jan, Sunday","16 Jan, Monday","17 Jan, Tuesday","18 Jan, Wednesday","19 Jan, Thursday","20 Jan, Friday"],
* "ticks":[[1,"23 Dec"],[4,"26 Dec"],[7,"29 Dec"],[10,"1 Jan"],[13,"4 Jan"],[16,"7 Jan"],[19,"10 Jan"],[22,"13 Jan"],[25,"16 Jan"],[28,"19 Jan"]]
*}
*/
countlyCommon.getTickObj = function(bucket, overrideBucket, newChart) {
var days = parseInt(countlyCommon.periodObj.numberOfDays, 10),
ticks = [],
tickTexts = [],
skipReduction = false,
limitAdjustment = 0;
if (overrideBucket) {
var thisDay;
if (countlyCommon.periodObj.activePeriod) {
thisDay = moment(countlyCommon.periodObj.activePeriod, "YYYY.M.D");
}
else {
thisDay = moment(countlyCommon.periodObj.currentPeriodArr[0], "YYYY.M.D");
}
ticks.push([0, countlyCommon.formatDate(thisDay, "D MMM")]);
tickTexts[0] = countlyCommon.formatDate(thisDay, "D MMM, dddd");
}
else if ((days === 1 && _period !== "month" && _period !== "day") || (days === 1 && bucket === "hourly")) {
//When period is an array or string like Xdays, Xweeks
for (var z = 0; z < 24; z++) {
ticks.push([z, (z + ":00")]);
tickTexts.push((z + ":00"));
}
skipReduction = true;
}
else {
var start = moment().subtract(days, 'days');
if (Object.prototype.toString.call(countlyCommon.getPeriod()) === '[object Array]') {
start = moment(countlyCommon.periodObj.currentPeriodArr[countlyCommon.periodObj.currentPeriodArr.length - 1], "YYYY.MM.DD").subtract(days, 'days');
}
var i = 0;
if (bucket === "monthly") {
var allMonths = [];
//so we would not start from previous year
start.add(1, 'day');
var monthCount = moment().diff(start, "months") + 1;
for (i = 0; i < monthCount; i++) {
allMonths.push(start.format(countlyCommon.getDateFormat("MMM YYYY")));
start.add(1, 'months');
}
allMonths = _.uniq(allMonths);
for (i = 0; i < allMonths.length; i++) {
ticks.push([i, allMonths[i]]);
tickTexts[i] = allMonths[i];
}
}
else if (bucket === "weekly") {
var allWeeks = [];
for (i = 0; i < days; i++) {
start.add(1, 'days');
allWeeks.push(start.isoWeek() + " " + start.isoWeekYear());
}
allWeeks = _.uniq(allWeeks);
for (i = 0; i < allWeeks.length; i++) {
var parts = allWeeks[i].split(" ");
//iso week falls in the year which has thursday of the week
if (parseInt(parts[1]) === moment().isoWeekYear(parseInt(parts[1])).isoWeek(parseInt(parts[0])).isoWeekday(4).year()) {
ticks.push([i, "W" + allWeeks[i]]);
var weekText = countlyCommon.formatDate(moment().isoWeekYear(parseInt(parts[1])).isoWeek(parseInt(parts[0])).isoWeekday(1), ", D MMM YYYY");
tickTexts[i] = "W" + parts[0] + weekText;
}
}
}
else if (bucket === "hourly") {
for (i = 0; i < days; i++) {
start.add(1, 'days');
for (var j = 0; j < 24; j++) {
//if (j === 0) {
ticks.push([((24 * i) + j), countlyCommon.formatDate(start, "D MMM") + " 0:00"]);
//}
tickTexts.push(countlyCommon.formatDate(start, "D MMM, ") + j + ":00");
}
}
}
else {
if (_period === "day") {
for (i = 0; i < new Date(start.year(), start.month(), 0).getDate(); i++) {
start.add(1, 'days');
ticks.push([i, countlyCommon.formatDate(start, "D MMM")]);
tickTexts[i] = countlyCommon.formatDate(start, "D MMM, dddd");
}
}
else {
var startYear = start.year();
var endYear = moment().year();
for (i = 0; i < days; i++) {
start.add(1, 'days');
if (startYear < endYear) {
ticks.push([i, countlyCommon.formatDate(start, "D MMM YYYY")]);
tickTexts[i] = countlyCommon.formatDate(start, "D MMM YYYY, dddd");
}
else {
ticks.push([i, countlyCommon.formatDate(start, "D MMM")]);
tickTexts[i] = countlyCommon.formatDate(start, "D MMM, dddd");
}
}
}
}
ticks = _.compact(ticks);
tickTexts = _.compact(tickTexts);
}
var labelCn = ticks.length;
if (!newChart) {
if (ticks.length <= 2) {
limitAdjustment = 0.02;
var tmpTicks = [],
tmpTickTexts = [];
tmpTickTexts[0] = "";
tmpTicks[0] = [-0.02, ""];
for (var m = 0; m < ticks.length; m++) {
tmpTicks[m + 1] = [m, ticks[m][1]];
tmpTickTexts[m + 1] = tickTexts[m];
}
tmpTickTexts.push("");
tmpTicks.push([tmpTicks.length - 1 - 0.98, ""]);
ticks = tmpTicks;
tickTexts = tmpTickTexts;
}
else if (!skipReduction && ticks.length > 10) {
var reducedTicks = [],
step = (Math.floor(ticks.length / 10) < 1) ? 1 : Math.floor(ticks.length / 10),
pickStartIndex = (Math.floor(ticks.length / 30) < 1) ? 1 : Math.floor(ticks.length / 30);
for (var l = pickStartIndex; l < (ticks.length - 1); l = l + step) {
reducedTicks.push(ticks[l]);
}
ticks = reducedTicks;
}
else {
ticks[0] = null;
// Hourly ticks already contain 23 empty slots at the end
if (!(bucket === "hourly" && days !== 1)) {
ticks[ticks.length - 1] = null;
}
}
}
return {
min: 0 - limitAdjustment,
max: (limitAdjustment) ? tickTexts.length - 3 + limitAdjustment : tickTexts.length - 1,
tickTexts: tickTexts,
ticks: _.compact(ticks),
labelCn: labelCn
};
};
/**
* Joined 2 arrays into one removing all duplicated values
* @memberof countlyCommon
* @param {array} x - first array
* @param {array} y - second array
* @returns {array} new array with only unique values from x and y
* @example
* //outputs [1,2,3]
* countlyCommon.union([1,2],[2,3]);
*/
countlyCommon.union = function(x, y) {
if (!x) {
return y;
}
else if (!y) {
return x;
}
var obj = {};
var i = 0;
for (i = x.length - 1; i >= 0; --i) {
obj[x[i]] = true;
}
for (i = y.length - 1; i >= 0; --i) {
obj[y[i]] = true;
}
var res = [];
for (var k in obj) {
res.push(k);
}
return res;
};
/**
* Recursively merges an object into another
* @memberof countlyCommon
* @param {Object} target - object to be merged into
* @param {Object} source - object to merge into the target
* @returns {Object} target after the merge
*/
countlyCommon.deepObjectExtend = function(target, source) {
Object.keys(source).forEach(function(key) {
if ((key in target) && _.isObject(target[key])) {
countlyCommon.deepObjectExtend(target[key], source[key]);
}
else {
target[key] = source[key];
}
});
return target;
};
/**
* Formats the number by separating each 3 digits with
* @memberof countlyCommon
* @param {number} x - number to format
* @returns {string} formatted number
* @example
* //outputs 1,234,567
* countlyCommon.formatNumber(1234567);
*/
countlyCommon.formatNumber = function(x) {
x = parseFloat(parseFloat(x).toFixed(2));
var parts = x.toString().split(".");
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
return parts.join(".");
};
/**
* Pad number with specified character from left to specified length
* @memberof countlyCommon
* @param {number} n - number to pad
* @param {number} width - pad to what length in symboles
* @param {string} z - character to pad with, default 0
* @returns {string} padded number
* @example
* //outputs 0012
* countlyCommon.pad(12, 4, "0");
*/
countlyCommon.pad = function(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
};
countlyCommon.getNoteDateIds = function(bucket) {
var _periodObj = countlyCommon.periodObj,
dateIds = [],
dotSplit = [],
tmpDateStr = "";
var i = 0;
var j = 0;
if (!_periodObj.isSpecialPeriod && !bucket) {
for (i = _periodObj.periodMin; i < (_periodObj.periodMax + 1); i++) {
dotSplit = (_periodObj.activePeriod + "." + i).split(".");
tmpDateStr = "";
for (j = 0; j < dotSplit.length; j++) {
if (dotSplit[j].length === 1) {
tmpDateStr += "0" + dotSplit[j];
}
else {
tmpDateStr += dotSplit[j];
}
}
dateIds.push(tmpDateStr);
}
}
else {
if (!_periodObj.currentPeriodArr && bucket === "daily") {
var tmpDate = new Date();
_periodObj.currentPeriodArr = [];
if (countlyCommon.getPeriod() === "month") {
for (i = 0; i < (tmpDate.getMonth() + 1); i++) {
var daysInMonth = moment().month(i).daysInMonth();
for (j = 0; j < daysInMonth; j++) {
_periodObj.currentPeriodArr.push(_periodObj.activePeriod + "." + (i + 1) + "." + (j + 1));
// If current day of current month, just break
if ((i === tmpDate.getMonth()) && (j === (tmpDate.getDate() - 1))) {
break;
}
}
}
}
else if (countlyCommon.getPeriod() === "day") {
for (i = 0; i < tmpDate.getDate(); i++) {
_periodObj.currentPeriodArr.push(_periodObj.activePeriod + "." + (i + 1));
}
}
else {
_periodObj.currentPeriodArr.push(_periodObj.activePeriod);
}
}
for (i = 0; i < (_periodObj.currentPeriodArr.length); i++) {
dotSplit = _periodObj.currentPeriodArr[i].split(".");
tmpDateStr = "";
for (j = 0; j < dotSplit.length; j++) {
if (dotSplit[j].length === 1) {
tmpDateStr += "0" + dotSplit[j];
}
else {
tmpDateStr += dotSplit[j];
}
}
dateIds.push(tmpDateStr);
}
}
var tmpDateIds = [];
switch (bucket) {
case "hourly":
for (i = 0; i < 25; i++) {
tmpDateIds.push(dateIds[0] + ((i < 10) ? "0" + i : i));
}
dateIds = tmpDateIds;
break;
case "monthly":
for (i = 0; i < dateIds.length; i++) {
countlyCommon.arrayAddUniq(tmpDateIds, moment(dateIds[i], "YYYYMMDD").format("YYYYMM"));
}
dateIds = tmpDateIds;
break;
}
return dateIds;
};
countlyCommon.getNotesForDateId = function(dateId, appIdsForNotes) {
var ret = [];
var notes = [];
appIdsForNotes && appIdsForNotes.forEach(function(appId) {
if (countlyGlobal.apps[appId] && countlyGlobal.apps[appId].notes) {
notes = notes.concat(countlyGlobal.apps[appId].notes);
}
});
if (notes.length === 0) {
return ret;
}
for (var i = 0; i < notes.length; i++) {
if (!notes[i].dateId) {
notes[i].dateId = moment(notes[i].ts).format("YYYYMMDDHHmm");
}
if (notes[i].dateId.indexOf(dateId) === 0) {
ret = ret.concat([notes[i]]);
}
}
return ret;
};
/**
* Add item or array to existing array only if values are not already in original array. given array is modified.
* @memberof countlyCommon
* @param {array} arr - original array where to add unique elements
* @param {string|number|array} item - item to add or array to merge
*/
countlyCommon.arrayAddUniq = function(arr, item) {
if (!arr) {
arr = [];
}
if (toString.call(item) === "[object Array]") {
for (var i = 0; i < item.length; i++) {
if (arr.indexOf(item[i]) === -1) {
arr[arr.length] = item[i];
}
}
}
else {
if (arr.indexOf(item) === -1) {
arr[arr.length] = item;
}
}
};
/**
* Format timestamp to twitter like time ago format with real date as tooltip and hidden data for exporting
* @memberof countlyCommon
* @param {number} timestamp - timestamp in seconds or miliseconds
* @returns {string} formated time ago
* @example
* //outputs <span title="Tue, 17 Jan 2017 13:54:26">3 days ago<a style="display: none;">|Tue, 17 Jan 2017 13:54:26</a></span>
* countlyCommon.formatTimeAgo(1484654066);
*/
countlyCommon.formatTimeAgo = function(timestamp) {
var meta = countlyCommon.formatTimeAgoText(timestamp);
var elem = $("<span>");
elem.prop("title", meta.tooltip);
if (meta.color) {
elem.css("color", meta.color);
}
elem.text(meta.text);
elem.append("<a style='display: none;'>|" + meta.tooltip + "</a>");
return elem.prop('outerHTML');
};
/**
* Format timestamp to twitter like time ago format with real date as tooltip and hidden data for exporting
* @memberof countlyCommon
* @param {number} timestamp - timestamp in seconds or miliseconds
* @returns {string} formated time ago
* @example
* //outputs ago time without html tags
* countlyCommon.formatTimeAgo(1484654066);
*/
countlyCommon.formatTimeAgoText = function(timestamp) {
if (Math.round(timestamp).toString().length === 10) {
timestamp *= 1000;
}
var target = new Date(timestamp);
var tooltip = moment(target).format("ddd, D MMM YYYY HH:mm:ss");
var text = tooltip;
var color = null;
var now = new Date();
var diff = Math.floor((now - target) / 1000);
if (diff <= -2592000) {
return tooltip;
}
else if (diff < -86400) {
text = jQuery.i18n.prop("common.in.days", Math.abs(Math.round(diff / 86400)));
}
else if (diff < -3600) {
text = jQuery.i18n.prop("common.in.hours", Math.abs(Math.round(diff / 3600)));
}
else if (diff < -60) {
text = jQuery.i18n.prop("common.in.minutes", Math.abs(Math.round(diff / 60)));
}
else if (diff <= -1) {
color = "#50C354";
text = (jQuery.i18n.prop("common.in.seconds", Math.abs(diff)));
}
else if (diff <= 1) {
color = "#50C354";
text = jQuery.i18n.map["common.ago.just-now"];
}
else if (diff < 20) {
color = "#50C354";
text = jQuery.i18n.prop("common.ago.seconds-ago", diff);
}
else if (diff < 40) {
color = "#50C354";
text = jQuery.i18n.map["common.ago.half-minute"];
}
else if (diff < 60) {
color = "#50C354";
text = jQuery.i18n.map["common.ago.less-minute"];
}
else if (diff <= 90) {
text = jQuery.i18n.map["common.ago.one-minute"];
}
else if (diff <= 3540) {
text = jQuery.i18n.prop("common.ago.minutes-ago", Math.round(diff / 60));
}
else if (diff <= 5400) {
text = jQuery.i18n.map["common.ago.one-hour"];
}
else if (diff <= 86400) {
text = jQuery.i18n.prop("common.ago.hours-ago", Math.round(diff / 3600));
}
else if (diff <= 129600) {
text = jQuery.i18n.map["common.ago.one-day"];
}
else if (diff < 604800) {
text = jQuery.i18n.prop("common.ago.days-ago", Math.round(diff / 86400));
}
else if (diff <= 777600) {
text = jQuery.i18n.map["common.ago.one-week"];
}
else if (diff <= 2592000) {
text = jQuery.i18n.prop("common.ago.days-ago", Math.round(diff / 86400));
}
else {
text = tooltip;
}
return {
text: text,
tooltip: tooltip,
color: color
};
};
/**
* Format duration to units of how much time have passed
* @memberof countlyCommon
* @param {number} timestamp - amount in seconds passed since some reference point
* @returns {string} formated time with how much units passed
* @example
* //outputs 47 year(s) 28 day(s) 11:54:26
* countlyCommon.formatTime(1484654066);
*/
countlyCommon.formatTime = function(timestamp) {
var str = "";
var seconds = timestamp % 60;
str = str + leadingZero(seconds);
timestamp -= seconds;
var minutes = timestamp % (60 * 60);
str = leadingZero(minutes / 60) + ":" + str;
timestamp -= minutes;
var hours = timestamp % (60 * 60 * 24);
str = leadingZero(hours / (60 * 60)) + ":" + str;
timestamp -= hours;
if (timestamp > 0) {
var days = timestamp % (60 * 60 * 24 * 365);
str = (days / (60 * 60 * 24)) + " day(s) " + str;
timestamp -= days;
if (timestamp > 0) {
str = (timestamp / (60 * 60 * 24 * 365)) + " year(s) " + str;
}
}
return str;
};
/**
* Format duration into highest unit of how much time have passed. Used in big numbers
* @memberof countlyCommon
* @param {number} timespent - amount in seconds passed since some reference point
* @returns {string} formated time with how much highest units passed
* @example
* //outputs 2824.7 yrs
* countlyCommon.timeString(1484654066);
*/
countlyCommon.timeString = function(timespent) {
var timeSpentString = (timespent.toFixed(1)) + " " + jQuery.i18n.map["common.minute.abrv"];
if (timespent >= 142560) {
timeSpentString = (timespent / 525600).toFixed(1) + " " + jQuery.i18n.map["common.year.abrv"];
}
else if (timespent >= 1440) {
timeSpentString = (timespent / 1440).toFixed(1) + " " + jQuery.i18n.map["common.day.abrv"];
}
else if (timespent >= 60) {
timeSpentString = (timespent / 60).toFixed(1) + " " + jQuery.i18n.map["common.hour.abrv"];
}
return timeSpentString;
/*var timeSpentString = "";
if(timespent > 1){
timeSpentString = Math.floor(timespent) + " " + jQuery.i18n.map["common.minute.abrv"]+" ";
var left = Math.floor((timespent - Math.floor(timespent))*60);
if(left > 0)
timeSpentString += left + " s";
}
else
timeSpentString += Math.floor((timespent - Math.floor(timespent))*60) + " s";
if (timespent >= 142560) {
timeSpentString = Math.floor(timespent / 525600) + " " + jQuery.i18n.map["common.year.abrv"];
var left = Math.floor((timespent - Math.floor(timespent / 525600)*525600)/1440);
if(left > 0)
timeSpentString += " "+left + " " + jQuery.i18n.map["common.day.abrv"];
} else if (timespent >= 1440) {
timeSpentString = Math.floor(timespent / 1440) + " " + jQuery.i18n.map["common.day.abrv"];
var left = Math.floor((timespent - Math.floor(timespent / 1440)*1440)/60);
if(left > 0)
timeSpentString += " "+left + " " + jQuery.i18n.map["common.hour.abrv"];
} else if (timespent >= 60) {
timeSpentString = Math.floor(timespent / 60) + " " + jQuery.i18n.map["common.hour.abrv"];
var left = Math.floor(timespent - Math.floor(timespent / 60)*60)
if(left > 0)
timeSpentString += " "+left + " " + jQuery.i18n.map["common.minute.abrv"];
}
return timeSpentString;*/
};
/**
* Get date from seconds timestamp
* @memberof countlyCommon
* @param {number} timestamp - timestamp in seconds or miliseconds
* @returns {string} formated date
* @example
* //outputs 17.01.2017
* countlyCommon.getDate(1484654066);
*/
countlyCommon.getDate = function(timestamp) {
if (Math.round(timestamp).toString().length === 10) {
timestamp *= 1000;
}
var d = new Date(timestamp);
return moment(d).format("ddd, D MMM YYYY");
//return leadingZero(d.getDate()) + "." + leadingZero(d.getMonth() + 1) + "." + d.getFullYear();
};
/**
* Get time from seconds timestamp
* @memberof countlyCommon
* @param {number} timestamp - timestamp in seconds or miliseconds
* @returns {string} formated time
* @example
* //outputs 13:54
* countlyCommon.getTime(1484654066);
*/
countlyCommon.getTime = function(timestamp) {
if (Math.round(timestamp).toString().length === 10) {
timestamp *= 1000;
}
var d = new Date(timestamp);
return leadingZero(d.getHours()) + ":" + leadingZero(d.getMinutes());
};
/**
* Round to provided number of digits
* @memberof countlyCommon
* @param {number} num - number to round
* @param {number} digits - amount of digits to round to
* @returns {number} rounded number
* @example
* //outputs 1.235
* countlyCommon.round(1.2345, 3);
*/
countlyCommon.round = function(num, digits) {
digits = Math.pow(10, digits || 0);
return Math.round(num * digits) / digits;
};
/**
* Get calculated totals for each property, usualy used as main dashboard data timeline data without metric segments
* @memberof countlyCommon
* @param {object} data - countly metric model data
* @param {array} properties - array of all properties to extract
* @param {array} unique - array of all properties that are unique from properties array. We need to apply estimation to them
* @param {object} estOverrideMetric - using unique property as key and total_users estimation property as value for all unique metrics that we want to have total user estimation overridden
* @param {function} clearObject - function to prefill all expected properties as u, t, n, etc with 0, so you would not have null in the result which won't work when drawing graphs
* @param {string=} segment - segment value for which to fetch metric data
* @returns {object} dashboard data object
* @example
* countlyCommon.getDashboardData(countlySession.getDb(), ["t", "n", "u", "d", "e", "p", "m"], ["u", "p", "m"], {u:"users"}, countlySession.clearObject);
* //outputs
* {
* "t":{"total":980,"prev-total":332,"change":"195.2%","trend":"u"},
* "n":{"total":402,"prev-total":255,"change":"57.6%","trend":"u"},
* "u":{"total":423,"prev-total":255,"change":"75.7%","trend":"u","isEstimate":false},
* "d":{"total":0,"prev-total":0,"change":"NA","trend":"u"},
* "e":{"total":980,"prev-total":332,"change":"195.2%","trend":"u"},
* "p":{"total":103,"prev-total":29,"change":"255.2%","trend":"u","isEstimate":true},
* "m":{"total":86,"prev-total":0,"change":"NA","trend":"u","isEstimate":true}
* }
*/
countlyCommon.getDashboardData = function(data, properties, unique, estOverrideMetric, clearObject, segment) {
if (segment) {
segment = "." + segment;
}
else {
segment = "";
}
var _periodObj = countlyCommon.periodObj,
dataArr = {},
tmp_x,
tmp_y,
tmpUniqObj,
tmpPrevUniqObj,
current = {},
previous = {},
currentCheck = {},
previousCheck = {},
change = {},
isEstimate = false;
var i = 0;
var j = 0;
for (i = 0; i < properties.length; i++) {
current[properties[i]] = 0;
previous[properties[i]] = 0;
currentCheck[properties[i]] = 0;
previousCheck[properties[i]] = 0;
}
if (_periodObj.isSpecialPeriod) {
isEstimate = true;
for (j = 0; j < (_periodObj.currentPeriodArr.length); j++) {
tmp_x = countlyCommon.getDescendantProp(data, _periodObj.currentPeriodArr[j] + segment);
tmp_x = clearObject(tmp_x);
for (i = 0; i < properties.length; i++) {
if (unique.indexOf(properties[i]) === -1) {
current[properties[i]] += tmp_x[properties[i]];
}
}
}
for (j = 0; j < (_periodObj.previousPeriodArr.length); j++) {
tmp_y = countlyCommon.getDescendantProp(data, _periodObj.previousPeriodArr[j] + segment);
tmp_y = clearObject(tmp_y);
for (i = 0; i < properties.length; i++) {
if (unique.indexOf(properties[i]) === -1) {
previous[properties[i]] += tmp_y[properties[i]];
}
}
}
//deal with unique values separately
for (j = 0; j < (_periodObj.uniquePeriodArr.length); j++) {
tmp_x = countlyCommon.getDescendantProp(data, _periodObj.uniquePeriodArr[j] + segment);
tmp_x = clearObject(tmp_x);
for (i = 0; i < unique.length; i++) {
current[unique[i]] += tmp_x[unique[i]];
}
}
for (j = 0; j < (_periodObj.previousUniquePeriodArr.length); j++) {
tmp_y = countlyCommon.getDescendantProp(data, _periodObj.previousUniquePeriodArr[j] + segment);
tmp_y = clearObject(tmp_y);
for (i = 0; i < unique.length; i++) {
previous[unique[i]] += tmp_y[unique[i]];
}
}
//recheck unique values with larger buckets
for (j = 0; j < (_periodObj.uniquePeriodCheckArr.length); j++) {
tmpUniqObj = countlyCommon.getDescendantProp(data, _periodObj.uniquePeriodCheckArr[j] + segment);
tmpUniqObj = clearObject(tmpUniqObj);
for (i = 0; i < unique.length; i++) {
currentCheck[unique[i]] += tmpUniqObj[unique[i]];
}
}
for (j = 0; j < (_periodObj.previousUniquePeriodArr.length); j++) {
tmpPrevUniqObj = countlyCommon.getDescendantProp(data, _periodObj.previousUniquePeriodArr[j] + segment);
tmpPrevUniqObj = clearObject(tmpPrevUniqObj);
for (i = 0; i < unique.length; i++) {
previousCheck[unique[i]] += tmpPrevUniqObj[unique[i]];
}
}
//check if we should overwrite uniques
for (i = 0; i < unique.length; i++) {
if (current[unique[i]] > currentCheck[unique[i]]) {
current[unique[i]] = currentCheck[unique[i]];
}
if (previous[unique[i]] > previousCheck[unique[i]]) {
previous[unique[i]] = previousCheck[unique[i]];
}
}
}
else {
tmp_x = countlyCommon.getDescendantProp(data, _periodObj.activePeriod + segment);
tmp_y = countlyCommon.getDescendantProp(data, _periodObj.previousPeriod + segment);
tmp_x = clearObject(tmp_x);
tmp_y = clearObject(tmp_y);
for (i = 0; i < properties.length; i++) {
current[properties[i]] = tmp_x[properties[i]];
previous[properties[i]] = tmp_y[properties[i]];
}
}
//check if we can correct data using total users correction
if (estOverrideMetric && countlyTotalUsers.isUsable()) {
for (i = 0; i < unique.length; i++) {
if (estOverrideMetric[unique[i]] && countlyTotalUsers.get(estOverrideMetric[unique[i]]).users) {
current[unique[i]] = countlyTotalUsers.get(estOverrideMetric[unique[i]]).users;
}
if (estOverrideMetric[unique[i]] && countlyTotalUsers.get(estOverrideMetric[unique[i]], true).users) {
previous[unique[i]] = countlyTotalUsers.get(estOverrideMetric[unique[i]], true).users;
}
}
}
// Total users can't be less than new users
if (typeof current.u !== "undefined" && typeof current.n !== "undefined" && current.u < current.n) {
if (estOverrideMetric && countlyTotalUsers.isUsable() && estOverrideMetric.u && countlyTotalUsers.get(estOverrideMetric.u).users) {
current.n = current.u;
}
else {
current.u = current.n;
}
}
// Total users can't be more than total sessions
if (typeof current.u !== "undefined" && typeof current.t !== "undefined" && current.u > current.t) {
current.u = current.t;
}
for (i = 0; i < properties.length; i++) {
change[properties[i]] = countlyCommon.getPercentChange(previous[properties[i]], current[properties[i]]);
dataArr[properties[i]] = {
"total": current[properties[i]],
"prev-total": previous[properties[i]],
"change": change[properties[i]].percent,
"trend": change[properties[i]].trend
};
if (unique.indexOf(properties[i]) !== -1) {
dataArr[properties[i]].isEstimate = isEstimate;
}
}
//check if we can correct data using total users correction
if (estOverrideMetric && countlyTotalUsers.isUsable()) {
for (i = 0; i < unique.length; i++) {
if (estOverrideMetric[unique[i]] && countlyTotalUsers.get(estOverrideMetric[unique[i]]).users) {
dataArr[unique[i]].isEstimate = false;
}
}
}
return dataArr;
};
/**
* Get total data for period's each time bucket as comma separated string to generate sparkle/small bar lines
* @memberof countlyCommon
* @param {object} data - countly metric model data
* @param {object} props - object where key is output property name and value could be string as key from data object or function to create new value based on existing ones
* @param {function} clearObject - function to prefill all expected properties as u, t, n, etc with 0, so you would not have null in the result which won't work when drawing graphs
* @returns {object} object with sparkleline data for each property
* @example
* var sparkLines = countlyCommon.getSparklineData(countlySession.getDb(), {
* "total-sessions": "t",
* "new-users": "n",
* "total-users": "u",
* "total-duration": "d",
* "events": "e",
* "returning-users": function(tmp_x){return Math.max(tmp_x["u"] - tmp_x["n"], 0);},
* "avg-duration-per-session": function(tmp_x){return (tmp_x["t"] == 0) ? 0 : (tmp_x["d"] / tmp_x["t"]);},
* "avg-events": function(tmp_x){return (tmp_x["u"] == 0) ? 0 : (tmp_x["e"] / tmp_x["u"]);}
* }, countlySession.clearObject);
* //outputs
* {
* "total-sessions":"73,84,80,72,61,18,11,7,17,27,66,39,41,36,39,36,6,11,6,16,22,30,33,34,32,41,29,9,2,2",
* "new-users":"24,30,25,20,16,18,11,7,17,18,20,18,17,11,15,15,6,11,6,16,13,14,12,10,7,4,8,9,2,2",
* "total-users":"45,54,50,44,37,18,11,7,17,27,36,39,41,36,39,36,6,11,6,16,22,30,33,34,32,29,29,9,2,2",
* "total-duration":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
* "events":"73,84,80,72,61,18,11,7,17,27,66,39,41,36,39,36,6,11,6,16,22,30,33,34,32,41,29,9,2,2",
* "returning-users":"21,24,25,24,21,0,0,0,0,9,16,21,24,25,24,21,0,0,0,0,9,16,21,24,25,25,21,0,0,0",
* "avg-duration-per-session":"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0",
* "avg-events":"1.6222222222222222,1.5555555555555556,1.6,1.6363636363636365,1.6486486486486487,1,1,1,1,1,1.8333333333333333,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1.4137931034482758,1,1,1,1"
* }
*/
countlyCommon.getSparklineData = function(data, props, clearObject) {
var _periodObj = countlyCommon.periodObj;
var sparkLines = {};
for (var pp in props) {
sparkLines[pp] = [];
}
var tmp_x = "";
var i = 0;
var p = 0;
if (!_periodObj.isSpecialPeriod) {
for (i = _periodObj.periodMin; i < (_periodObj.periodMax + 1); i++) {
tmp_x = countlyCommon.getDescendantProp(data, _periodObj.activePeriod + "." + i);
tmp_x = clearObject(tmp_x);
for (p in props) {
if (typeof props[p] === "string") {
sparkLines[p].push(tmp_x[props[p]]);
}
else if (typeof props[p] === "function") {
sparkLines[p].push(props[p](tmp_x));
}
}
}
}
else {
for (i = 0; i < (_periodObj.currentPeriodArr.length); i++) {
tmp_x = countlyCommon.getDescendantProp(data, _periodObj.currentPeriodArr[i]);
tmp_x = clearObject(tmp_x);
for (p in props) {
if (typeof props[p] === "string") {
sparkLines[p].push(tmp_x[props[p]]);
}
else if (typeof props[p] === "function") {
sparkLines[p].push(props[p](tmp_x));
}
}
}
}
for (var key in sparkLines) {
sparkLines[key] = sparkLines[key].join(",");
}
return sparkLines;
};
/**
* Format date based on some locale settings
* @memberof countlyCommon
* @param {moment} date - moment js object
* @param {string} format - format string to use
* @returns {string} date in formatted string
* @example
* //outputs Jan 20
* countlyCommon.formatDate(moment(), "MMM D");
*/
countlyCommon.formatDate = function(date, format) {
format = countlyCommon.getDateFormat(format);
return date.format(format);
};
countlyCommon.getDateFormat = function(format) {
if (countlyCommon.BROWSER_LANG_SHORT.toLowerCase() === "ko") {
format = format.replace("MMM D", "MMM D[일]").replace("D MMM", "MMM D[일]");
}
else if (countlyCommon.BROWSER_LANG_SHORT.toLowerCase() === "ja") {
format = format
.replace("D MMM YYYY", "YYYY年 MMM D")
.replace("MMM D, YYYY", "YYYY年 MMM D")
.replace("D MMM, YYYY", "YYYY年 MMM D")
.replace("MMM YYYY", "YYYY年 MMM")
.replace("MMM D", "MMM D[日]")
.replace("D MMM", "MMM D[日]");
}
else if (countlyCommon.BROWSER_LANG_SHORT.toLowerCase() === "zh") {
format = format.replace("MMMM", "M").replace("MMM", "M").replace("MM", "M").replace("DD", "D").replace("D M, YYYY", "YYYY M D").replace("D M", "M D").replace("D", "D[日]").replace("M", "M[月]").replace("YYYY", "YYYY[年]");
}
return format;
};
countlyCommon.showTooltip = function(args) {
showTooltip(args);
};
/**
* Getter for period object
* @memberof countlyCommon
* @returns {object} returns {@link countlyCommon.periodObj}
*/
countlyCommon.getPeriodObj = function() {
return countlyCommon.periodObj;
};
/**
* Getter for period object by providing period string value
* @memberof countlyCommon
* @param {object} period - given period
* @param {number} currentTimeStamp timestamp
* @returns {object} returns {@link countlyCommon.periodObj}
*/
countlyCommon.calcSpecificPeriodObj = function(period, currentTimeStamp) {
return calculatePeriodObject(period, currentTimeStamp);
};
/**
* Returns array with unique ticks for period
* @param {moment} startTimestamp - start of period
* @param {moment} endTimestamp - end of period
* @returns {array} unique array ticks for period
**/
function getTicksBetween(startTimestamp, endTimestamp) {
var dayIt = startTimestamp.clone(),
ticks = [];
while (dayIt < endTimestamp) {
var daysLeft = Math.ceil(moment.duration(endTimestamp - dayIt).asDays());
if (daysLeft >= dayIt.daysInMonth() && dayIt.date() === 1) {
ticks.push(dayIt.format("YYYY.M"));
dayIt.add(1 + dayIt.daysInMonth() - dayIt.date(), "days");
}
else if (daysLeft >= (7 - dayIt.day()) && dayIt.day() === 1) {
ticks.push(dayIt.format("gggg.[w]w"));
dayIt.add(8 - dayIt.day(), "days");
}
else {
ticks.push(dayIt.format("YYYY.M.D"));
dayIt.add(1, "day");
}
}
return ticks;
}
/**
* Returns array with more generalized unique ticks for period
* @param {moment} startTimestamp - start of period
* @param {moment} endTimestamp - end of period
* @returns {array} unique array ticks for period
**/
function getTicksCheckBetween(startTimestamp, endTimestamp) {
var dayIt = startTimestamp.clone(),
ticks = [];
while (dayIt < endTimestamp) {
var daysLeft = Math.ceil(moment.duration(endTimestamp - dayIt).asDays());
if (daysLeft >= (dayIt.daysInMonth() * 0.5 - dayIt.date())) {
ticks.push(dayIt.format("YYYY.M"));
dayIt.add(1 + dayIt.daysInMonth() - dayIt.date(), "days");
}
else {
ticks.push(dayIt.format("gggg.[w]w"));
dayIt.add(8 - dayIt.day(), "days");
}
}
return ticks;
}
/**
* Calculate period function
* @param {object} period - given period
* @param {number} currentTimestamp timestamp
* @returns {object} returns {@link countlyCommon.periodObj}
*/
function calculatePeriodObject(period, currentTimestamp) {
var startTimestamp, endTimestamp, periodObject, cycleDuration, nDays;
currentTimestamp = moment(currentTimestamp || undefined);
periodObject = {
activePeriod: undefined,
periodMax: undefined,
periodMin: undefined,
previousPeriod: undefined,
currentPeriodArr: [],
previousPeriodArr: [],
isSpecialPeriod: false,
dateString: undefined,
daysInPeriod: 0,
numberOfDays: 0, // new
uniquePeriodArr: [],
uniquePeriodCheckArr: [],
previousUniquePeriodArr: [],
previousUniquePeriodCheckArr: [],
periodContainsToday: true,
};
endTimestamp = currentTimestamp.clone().utc().endOf("day");
if (period && period.indexOf(",") !== -1) {
try {
period = JSON.parse(period);
}
catch (SyntaxError) {
period = "30days";
}
}
if (Array.isArray(period)) {
if ((period[0] + "").length === 10) {
period[0] *= 1000;
}
if ((period[1] + "").length === 10) {
period[1] *= 1000;
}
var fromDate, toDate;
if (Number.isInteger(period[0]) && Number.isInteger(period[1])) {
fromDate = moment(period[0]);
toDate = moment(period[1]);
}
else {
fromDate = moment(period[0], ["DD-MM-YYYY HH:mm:ss", "DD-MM-YYYY"]);
toDate = moment(period[1], ["DD-MM-YYYY HH:mm:ss", "DD-MM-YYYY"]);
}
startTimestamp = fromDate.clone().utc().startOf("day");
endTimestamp = toDate.clone().utc().endOf("day");
// fromDate.tz(_appTimezone);
// toDate.tz(_appTimezone);
if (fromDate.valueOf() === toDate.valueOf()) {
cycleDuration = moment.duration(1, "day");
Object.assign(periodObject, {
dateString: "D MMM, HH:mm",
periodMax: 23,
periodMin: 0,
activePeriod: fromDate.format("YYYY.M.D"),
previousPeriod: fromDate.clone().subtract(1, "day").format("YYYY.M.D")
});
}
else if (fromDate.valueOf() > toDate.valueOf()) {
//incorrect range - reset to 30 days
nDays = 30;
startTimestamp = currentTimestamp.clone().utc().startOf("day").subtract(nDays - 1, "days");
endTimestamp = currentTimestamp.clone().utc().endOf("day");
cycleDuration = moment.duration(nDays, "days");
Object.assign(periodObject, {
dateString: "D MMM",
isSpecialPeriod: true
});
}
else {
cycleDuration = moment.duration(moment.duration(endTimestamp - startTimestamp).asDays(), "days");
Object.assign(periodObject, {
dateString: "D MMM",
isSpecialPeriod: true
});
}
}
else if (period === "month") {
startTimestamp = currentTimestamp.clone().utc().startOf("year");
cycleDuration = moment.duration(1, "year");
periodObject.dateString = "MMM";
Object.assign(periodObject, {
dateString: "MMM",
periodMax: 12,
periodMin: 1,
activePeriod: currentTimestamp.year(),
previousPeriod: currentTimestamp.year() - 1
});
}
else if (period === "day") {
startTimestamp = currentTimestamp.clone().utc().startOf("month");
cycleDuration = moment.duration(1, "month");
periodObject.dateString = "D MMM";
Object.assign(periodObject, {
dateString: "D MMM",
periodMax: currentTimestamp.clone().endOf("month").date(),
periodMin: 1,
activePeriod: currentTimestamp.format("YYYY.M"),
previousPeriod: currentTimestamp.clone().subtract(1, "month").format("YYYY.M")
});
}
else if (period === "hour") {
startTimestamp = currentTimestamp.clone().utc().startOf("day");
cycleDuration = moment.duration(1, "day");
Object.assign(periodObject, {
dateString: "HH:mm",
periodMax: 23,
periodMin: 0,
activePeriod: currentTimestamp.format("YYYY.M.D"),
previousPeriod: currentTimestamp.clone().subtract(1, "day").format("YYYY.M.D")
});
}
else if (period === "yesterday") {
var yesterday = currentTimestamp.clone().subtract(1, "day");
startTimestamp = yesterday.clone().utc().startOf("day");
endTimestamp = yesterday.clone().utc().endOf("day");
cycleDuration = moment.duration(1, "day");
Object.assign(periodObject, {
dateString: "D MMM, HH:mm",
periodMax: 23,
periodMin: 0,
activePeriod: yesterday.format("YYYY.M.D"),
previousPeriod: yesterday.clone().subtract(1, "day").format("YYYY.M.D")
});
}
else if (/([0-9]+)days/.test(period)) {
nDays = parseInt(/([0-9]+)days/.exec(period)[1]);
if (nDays < 1) {
nDays = 30; //if there is less than 1 day
}
startTimestamp = currentTimestamp.clone().utc().startOf("day").subtract(nDays - 1, "days");
cycleDuration = moment.duration(nDays, "days");
Object.assign(periodObject, {
dateString: "D MMM",
isSpecialPeriod: true
});
}
else if (/([0-9]+)weeks/.test(period)) {
nDays = parseInt(/([0-9]+)weeks/.exec(period)[1]) * 7;
if (nDays < 1) {
nDays = 30; //if there is less than 1 day
}
startTimestamp = currentTimestamp.clone().utc().startOf("day").subtract(nDays - 1, "days");
cycleDuration = moment.duration(nDays, "days");
Object.assign(periodObject, {
dateString: "D MMM",
isSpecialPeriod: true
});
}
else if (/([0-9]+)months/.test(period)) {
nDays = parseInt(/([0-9]+)months/.exec(period)[1]) * 30;
if (nDays < 1) {
nDays = 30; //if there is less than 1 day
}
startTimestamp = currentTimestamp.clone().utc().startOf("day").subtract(nDays - 1, "days");
cycleDuration = moment.duration(nDays, "days");
Object.assign(periodObject, {
dateString: "D MMM",
isSpecialPeriod: true
});
}
//incorrect period, defaulting to 30 days
else {
nDays = 30;
startTimestamp = currentTimestamp.clone().utc().startOf("day").subtract(nDays - 1, "days");
cycleDuration = moment.duration(nDays, "days");
Object.assign(periodObject, {
dateString: "D MMM",
isSpecialPeriod: true
});
}
Object.assign(periodObject, {
start: startTimestamp.valueOf(),
end: endTimestamp.valueOf(),
daysInPeriod: Math.ceil(moment.duration(endTimestamp - startTimestamp).asDays()),
numberOfDays: Math.ceil(moment.duration(endTimestamp - startTimestamp).asDays()),
periodContainsToday: (startTimestamp <= currentTimestamp) && (currentTimestamp <= endTimestamp),
});
if (startTimestamp.weekYear() !== endTimestamp.weekYear()) {
Object.assign(periodObject, {
dateString: (periodObject.dateString + ", YYYY")
});
}
for (var dayIt = startTimestamp.clone(); dayIt < endTimestamp; dayIt.add(1, "day")) {
periodObject.currentPeriodArr.push(dayIt.format("YYYY.M.D"));
periodObject.previousPeriodArr.push(dayIt.clone().subtract(cycleDuration).format("YYYY.M.D"));
}
periodObject.uniquePeriodArr = getTicksBetween(startTimestamp, endTimestamp);
periodObject.uniquePeriodCheckArr = getTicksCheckBetween(startTimestamp, endTimestamp);
periodObject.previousUniquePeriodArr = getTicksBetween(startTimestamp.clone().subtract(cycleDuration), endTimestamp.clone().subtract(cycleDuration));
periodObject.previousUniquePeriodCheckArr = getTicksCheckBetween(startTimestamp.clone().subtract(cycleDuration), endTimestamp.clone().subtract(cycleDuration));
return periodObject;
}
var getPeriodObj = countlyCommon.getPeriodObj;
/** Function to show the tooltip when any data point in the graph is hovered on.
* @param {object} args - tooltip info
* @param {number} args.x - x position
* @param {number} args.y- y position
* @param {string} args.contents - content for tooltip
* @param {string} args.title - title
* @param {string} args.notes - notes
*/
function showTooltip(args) {
var x = args.x || 0,
y = args.y || 0,
contents = args.contents,
title = args.title,
notes = args.notes;
var tooltip = $('<div id="graph-tooltip" class="v2"></div>').append('<span class="graph-tooltip-content">' + contents + '</span>');
if (title) {
tooltip.prepend('<span id="graph-tooltip-title">' + title + '</span>');
}
if (notes) {
var noteLines = (notes + "").split("===");
for (var i = 0; i < noteLines.length; i++) {
tooltip.append("<div class='note-line'>– " + noteLines[i] + "</div>");
}
}
$("#content").append("<div id='tooltip-calc'>" + $('<div>').append(tooltip.clone()).html() + "</div>");
var widthVal = $("#graph-tooltip").outerWidth(),
heightVal = $("#graph-tooltip").outerHeight();
$("#tooltip-calc").remove();
var newLeft = (x - (widthVal / 2)),
xReach = (x + (widthVal / 2));
if (notes) {
newLeft += 10.5;
xReach += 10.5;
}
if (xReach > $(window).width()) {
newLeft = (x - widthVal);
}
else if (xReach < 340) {
newLeft = x;
}
tooltip.css({
top: y - heightVal - 20,
left: newLeft
}).appendTo("body").show();
}
/** function adds leading zero to value.
* @param {number} value - given value
* @returns {string|number} fixed value
*/
function leadingZero(value) {
if (value > 9) {
return value;
}
return "0" + value;
}
/**
* Correct timezone offset on the timestamp for current browser's timezone
* @memberof countlyCommon
* @param {number} inTS - second or milisecond timestamp
* @returns {number} corrected timestamp applying user's timezone offset
*/
countlyCommon.getOffsetCorrectionForTimestamp = function(inTS) {
var intLength = Math.round(inTS).toString().length,
timeZoneOffset = new Date((intLength === 13) ? inTS : inTS * 1000).getTimezoneOffset(),
tzAdjustment = 0;
if (timeZoneOffset !== 0) {
if (intLength === 13) {
tzAdjustment = timeZoneOffset * 60000;
}
else if (intLength === 10) {
tzAdjustment = timeZoneOffset * 60;
}
}
return tzAdjustment;
};
var __months = [];
/**
* Get array of localized short month names from moment js
* @memberof countlyCommon
* @param {boolean} reset - used to reset months cache when changing locale
* @returns {array} array of short localized month names used in moment js MMM formatting
* @example
* //outputs ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
* countlyCommon.getMonths();
*/
countlyCommon.getMonths = function(reset) {
if (reset) {
__months = [];
}
if (!__months.length) {
for (var i = 0; i < 12; i++) {
__months.push(moment.localeData().monthsShort(moment([0, i]), ""));
}
}
return __months;
};
/**
* Currently selected period
* @memberof countlyCommon
* @property {array=} currentPeriodArr - array with ticks for current period (available only for special periods), example ["2016.12.22","2016.12.23","2016.12.24", ...]
* @property {array=} previousPeriodArr - array with ticks for previous period (available only for special periods), example ["2016.12.22","2016.12.23","2016.12.24", ...]
* @property {string} dateString - date format to use when outputting date in graphs, example D MMM, YYYY
* @property {boolean} isSpecialPeriod - true if current period is special period, false if it is not
* @property {number} daysInPeriod - amount of full days in selected period, example 30
* @property {number} numberOfDays - number of days selected period consists of, example hour period has 1 day
* @property {boolean} periodContainsToday - true if period contains today, false if not
* @property {array} uniquePeriodArr - array with ticks for current period which contains data for unique values, like unique users, example ["2016.12.22","2016.w52","2016.12.30", ...]
* @property {array} uniquePeriodCheckArr - array with ticks for higher buckets to current period unique value estimation, example ["2016.w51","2016.w52","2016.w53","2017.1",...]
* @property {array} previousUniquePeriodArr - array with ticks for previous period which contains data for unique values, like unique users, example ["2016.12.22","2016.w52","2016.12.30"]
* @property {array} previousUniquePeriodCheckArr - array with ticks for higher buckets to previous period unique value estimation, example ["2016.w47","2016.w48","2016.12"]
* @property {string} activePeriod - period name formatted in dateString
* @property {string} previousPeriod - previous period name formatted in dateString
* @property {number} periodMax - max value of current period tick
* @property {number} periodMin - min value of current period tick
* @example <caption>Special period object (7days)</caption>
* {
* "currentPeriodArr":["2017.1.14","2017.1.15","2017.1.16","2017.1.17","2017.1.18","2017.1.19","2017.1.20"],
* "previousPeriodArr":["2017.1.7","2017.1.8","2017.1.9","2017.1.10","2017.1.11","2017.1.12","2017.1.13"],
* "isSpecialPeriod":true,
* "dateString":"D MMM",
* "daysInPeriod":7,
* "numberOfDays":7,
* "uniquePeriodArr":["2017.1.14","2017.w3"],
* "uniquePeriodCheckArr":["2017.w2","2017.w3"],
* "previousUniquePeriodArr":["2017.1.7","2017.1.8","2017.1.9","2017.1.10","2017.1.11","2017.1.12","2017.1.13"],
* "previousUniquePeriodCheckArr":["2017.w1","2017.w2"],
* "periodContainsToday":true
* }
* @example <caption>Simple period object (today period - hour)</caption>
* {
* "activePeriod":"2017.1.20",
* "periodMax":23,
* "periodMin":0,
* "previousPeriod":"2017.1.19",
* "isSpecialPeriod":false,
* "dateString":"HH:mm",
* "daysInPeriod":0,
* "numberOfDays":1,
* "uniquePeriodArr":[],
* "uniquePeriodCheckArr":[],
* "previousUniquePeriodArr":[],
* "previousUniquePeriodCheckArr":[],
* "periodContainsToday":true
* }
*/
countlyCommon.periodObj = calculatePeriodObject();
/**
* Parse second to standard time format
* @memberof countlyCommon
* @param {number} second number
* @returns {string} return format "HH:MM:SS"
*/
countlyCommon.formatSecond = function(second) {
var timeLeft = parseInt(second);
var dict = [
{k: 'year', v: 31536000},
{k: 'day', v: 86400},
{k: 'hour', v: 3600},
{k: 'minute', v: 60},
{k: 'second', v: 1}
];
var result = {year: 0, day: 0, hour: 0, minute: 0, second: 0};
var resultStrings = [];
for (var i = 0; i < dict.length && resultStrings.length < 3; i++) {
result[dict[i].k] = Math.floor(timeLeft / dict[i].v);
timeLeft = timeLeft % dict[i].v;
if (result[dict[i].k] > 0) {
if (result[dict[i].k] === 1) {
resultStrings.push(result[dict[i].k] + "" + jQuery.i18n.map["common." + dict[i].k + ".abrv2"]);
}
else {
resultStrings.push(result[dict[i].k] + "" + jQuery.i18n.map["common." + dict[i].k + ".abrv"]);
}
}
}
if (resultStrings.length === 0) {
return "0";
}
else {
return resultStrings.join(" ");
}
};
/**
* add one more column in chartDP[index].data to show string in dp
* @memberof countlyCommon
* @param {array} chartDPs - chart data points
* @param {string} labelName - label name
* @return {array} chartDPs
* @example
* for example:
* chartDPs = [
* {color:"#88BBC8", label:"duration", data:[[0, 23], [1, 22]}],
* {color:"#88BBC8", label:"count", data:[[0, 3], [1, 3]}],
* }
* lable = 'duration',
*
* will return
* chartDPs = [
* {color:"#88BBC8", label:"duration", data:[[0, 23, "00:00:23"], [1, 22, "00:00:22"]}],
* {color:"#88BBC8", label:"count", data:[[0, 3], [1, 3]}],
* }
*/
countlyCommon.formatSecondForDP = function(chartDPs, labelName) {
for (var k = 0; k < chartDPs.length; k++) {
if (chartDPs[k].label === labelName) {
var dp = chartDPs[k];
for (var i = 0; i < dp.data.length; i++) {
dp.data[i][2] = countlyCommon.formatSecond(dp.data[i][1]);
}
}
}
return chartDPs;
};
/**
* Getter/setter for dot notatons:
* @memberof countlyCommon
* @param {object} obj - object to use
* @param {string} is - path of properties to get
* @param {varies} value - value to set
* @returns {varies} value at provided path
* @example
* common.dot({a: {b: {c: 'string'}}}, 'a.b.c') === 'string'
* common.dot({a: {b: {c: 'string'}}}, ['a', 'b', 'c']) === 'string'
* common.dot({a: {b: {c: 'string'}}}, 'a.b.c', 5) === 5
* common.dot({a: {b: {c: 'string'}}}, 'a.b.c') === 5
*/
countlyCommon.dot = function(obj, is, value) {
if (typeof is === 'string') {
return countlyCommon.dot(obj, is.split('.'), value);
}
else if (is.length === 1 && value !== undefined) {
obj[is[0]] = value;
return value;
}
else if (is.length === 0) {
return obj;
}
else if (!obj) {
return obj;
}
else {
if (typeof obj[is[0]] === "undefined" && value !== undefined) {
obj[is[0]] = {};
}
return countlyCommon.dot(obj[is[0]], is.slice(1), value);
}
};
/**
* Save division, handling division by 0 and rounding up to 2 decimals
* @memberof countlyCommon
* @param {number} dividend - object to use
* @param {number} divisor - path of properties to get
* @returns {number} division
*/
countlyCommon.safeDivision = function(dividend, divisor) {
var tmpAvgVal;
tmpAvgVal = dividend / divisor;
if (!tmpAvgVal || tmpAvgVal === Number.POSITIVE_INFINITY) {
tmpAvgVal = 0;
}
return tmpAvgVal.toFixed(2);
};
/**
* Get timestamp range in format as [startTime, endTime] with period and base time
* @memberof countlyCommon
* @param {object} period - period has two format: array or string
* @param {number} baseTimeStamp - base timestamp to calc the period range
* @returns {array} period range
*/
countlyCommon.getPeriodRange = function(period, baseTimeStamp) {
var periodRange;
if (period && period.indexOf(",") !== -1) {
try {
period = JSON.parse(period);
}
catch (SyntaxError) {
period = countlyCommon.DEFAULT_PERIOD;
}
}
if (Object.prototype.toString.call(period) === '[object Array]' && period.length === 2) { //range
periodRange = [period[0] + countlyCommon.getOffsetCorrectionForTimestamp(period[0]), period[1] + countlyCommon.getOffsetCorrectionForTimestamp(period[1])];
return periodRange;
}
var endTimeStamp = baseTimeStamp;
var start;
switch (period) {
case 'hour':
start = moment(baseTimeStamp).hour(0).minute(0).second(0);
break;
case 'yesterday':
start = moment(baseTimeStamp).subtract(1, 'day').hour(0).minute(0).second(0);
endTimeStamp = moment(baseTimeStamp).subtract(1, 'day').hour(23).minute(59).second(59).toDate().getTime();
break;
case 'day':
start = moment(baseTimeStamp).date(1).hour(0).minute(0).second(0);
break;
case 'month':
start = moment(baseTimeStamp).month(0).date(1).hour(0).minute(0).second(0);
break;
default:
if (/([0-9]+)days/.test(period)) {
var match = /([0-9]+)days/.exec(period);
if (match[1] && (parseInt(match[1]) > 1)) {
start = moment(baseTimeStamp).subtract(parseInt(match[1]) - 1, 'day').hour(0).minute(0);
}
}
}
periodRange = [start.toDate().getTime(), endTimeStamp];
return periodRange;
};
/*
fast-levenshtein - Levenshtein algorithm in Javascript
(MIT License) Copyright (c) 2013 Ramesh Nair
https://github.com/hiddentao/fast-levenshtein
*/
var collator;
try {
collator = (typeof Intl !== "undefined" && typeof Intl.Collator !== "undefined") ? Intl.Collator("generic", { sensitivity: "base" }) : null;
}
catch (err) {
// console.log("Failed to initialize collator for Levenshtein\n" + err.stack);
}
// arrays to re-use
var prevRow = [],
str2Char = [];
/**
* Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance.
* @memberof countlyCommon
*/
countlyCommon.Levenshtein = {
/**
* Calculate levenshtein distance of the two strings.
*
* @param {string} str1 String the first string.
* @param {string} str2 String the second string.
* @param {object} [options] Additional options.
* @param {boolean} [options.useCollator] Use `Intl.Collator` for locale-sensitive string comparison.
* @return {number} Integer the levenshtein distance (0 and above).
*/
get: function(str1, str2, options) {
var useCollator = (options && collator && options.useCollator);
var str1Len = str1.length,
str2Len = str2.length;
// base cases
if (str1Len === 0) {
return str2Len;
}
if (str2Len === 0) {
return str1Len;
}
// two rows
var curCol, nextCol, i, j, tmp;
// initialise previous row
for (i = 0; i < str2Len; ++i) {
prevRow[i] = i;
str2Char[i] = str2.charCodeAt(i);
}
prevRow[str2Len] = str2Len;
var strCmp;
if (useCollator) {
// calculate current row distance from previous row using collator
for (i = 0; i < str1Len; ++i) {
nextCol = i + 1;
for (j = 0; j < str2Len; ++j) {
curCol = nextCol;
// substution
strCmp = 0 === collator.compare(str1.charAt(i), String.fromCharCode(str2Char[j]));
nextCol = prevRow[j] + (strCmp ? 0 : 1);
// insertion
tmp = curCol + 1;
if (nextCol > tmp) {
nextCol = tmp;
}
// deletion
tmp = prevRow[j + 1] + 1;
if (nextCol > tmp) {
nextCol = tmp;
}
// copy current col value into previous (in preparation for next iteration)
prevRow[j] = curCol;
}
// copy last col value into previous (in preparation for next iteration)
prevRow[j] = nextCol;
}
}
else {
// calculate current row distance from previous row without collator
for (i = 0; i < str1Len; ++i) {
nextCol = i + 1;
for (j = 0; j < str2Len; ++j) {
curCol = nextCol;
// substution
strCmp = str1.charCodeAt(i) === str2Char[j];
nextCol = prevRow[j] + (strCmp ? 0 : 1);
// insertion
tmp = curCol + 1;
if (nextCol > tmp) {
nextCol = tmp;
}
// deletion
tmp = prevRow[j + 1] + 1;
if (nextCol > tmp) {
nextCol = tmp;
}
// copy current col value into previous (in preparation for next iteration)
prevRow[j] = curCol;
}
// copy last col value into previous (in preparation for next iteration)
prevRow[j] = nextCol;
}
}
return nextCol;
}
};
countlyCommon.getNotesPopup = function(dateId, appIds) {
var notes = countlyCommon.getNotesForDateId(dateId, appIds);
var dialog = $("#cly-popup").clone().removeAttr("id").addClass('graph-notes-popup');
dialog.removeClass('black');
var content = dialog.find(".content");
var notesPopupHTML = Handlebars.compile($("#graph-notes-popup").html());
notes.forEach(function(n) {
n.ts_display = moment(n.ts).format("D MMM, YYYY, HH:mm");
var app = countlyGlobal.apps[n.app_id] || {};
n.app_name = app.name;
});
var noteDateFormat = "D MMM, YYYY";
if (countlyCommon.getPeriod() === "month") {
noteDateFormat = "MMM YYYY";
}
var notePopupTitleTime = moment(notes[0].ts).format(noteDateFormat);
content.html(notesPopupHTML({notes: notes, notePopupTitleTime: notePopupTitleTime}));
CountlyHelpers.revealDialog(dialog);
$(".close-note-popup-button").off("click").on("click", function() {
CountlyHelpers.removeDialog(dialog);
});
window.app.localize();
};
countlyCommon.getGraphNotes = function(appIds, callBack) {
if (!appIds) {
appIds = [];
}
return window.$.ajax({
type: "GET",
url: countlyCommon.API_PARTS.data.r,
data: {
"api_key": window.countlyGlobal.member.api_key,
"app_id": countlyCommon.ACTIVE_APP_ID,
"category": "session",
"notes_apps": JSON.stringify(appIds),
"period": countlyCommon.getPeriod(),
"method": "notes",
},
success: function(json) {
var notes = json && json.aaData || [];
var noteSortByApp = {};
notes.forEach(function(note) {
if (!noteSortByApp[note.app_id]) {
noteSortByApp[note.app_id] = [];
}
noteSortByApp[note.app_id].push(note);
});
appIds.forEach(function(appId) {
window.countlyGlobal.apps[appId].notes = noteSortByApp[appId] || [];
});
callBack && callBack(notes);
}
});
};
/**
* Compare two versions
* @memberof countlyCommon
* @param {String} a, First version
* @param {String} b, Second version
* @returns {Number} returns -1, 0 or 1 by result of comparing
*/
countlyCommon.compareVersions = function(a, b) {
var aParts = a.split('.');
var bParts = b.split('.');
for (var j = 0; j < aParts.length && j < bParts.length; j++) {
var aPartNum = parseInt(aParts[j], 10);
var bPartNum = parseInt(bParts[j], 10);
var cmp = Math.sign(aPartNum - bPartNum);
if (cmp !== 0) {
return cmp;
}
}
if (aParts.length === bParts.length) {
return 0;
}
var longestArray = aParts;
if (bParts.length > longestArray.length) {
longestArray = bParts;
}
var continueIndex = Math.min(aParts.length, bParts.length);
for (var i = continueIndex; i < longestArray.length; i += 1) {
if (parseInt(longestArray[i], 10) > 0) {
return longestArray === bParts ? -1 : +1;
}
}
return 0;
};
/**
* Converts cohort time period to string.
* @param {Object} obj Inferred time object. Must contain "value", "type" and optionally "level".
* @returns {Object} String fields
*/
countlyCommon.getTimePeriodDescriptions = function(obj) {
if (obj.type === "all-time") {
return { name: jQuery.i18n.map['common.all-time'], valueAsString: "0days" };
}
if (obj.type === "last-n") {
var level = obj.level || "days";
return {
name: jQuery.i18n.prop('common.in-last-' + level + (obj.value > 1 ? '-plural' : ''), obj.value),
valueAsString: obj.value + level
};
}
if (obj.type === "hour") {
return {
name: jQuery.i18n.map["common.today"],
valueAsString: "hour"
};
}
if (obj.type === "yesterday") {
return {
name: jQuery.i18n.map["common.yesterday"],
valueAsString: "yesterday"
};
}
if (obj.type === "day") {
return {
name: moment().format("MMMM, YYYY"),
valueAsString: "day"
};
}
if (obj.type === "month") {
return {
name: moment().year(),
valueAsString: "month"
};
}
var valueAsString = JSON.stringify(obj.value);
var name = valueAsString;
var formatDate = function(point, isShort) {
var format = "MMMM DD, YYYY";
if (isShort) {
format = "MMM DD, YYYY";
}
if (point.toString().length === 10) {
point *= 1000;
}
return countlyCommon.formatDate(moment(point), format);
};
if (Array.isArray(obj.value)) {
name = jQuery.i18n.prop('common.time-period-name.range', formatDate(obj.value[0], true), formatDate(obj.value[1], true));
}
else {
name = jQuery.i18n.prop('common.time-period-name.' + obj.type, formatDate(obj.value[obj.type]));
}
return {
name: name,
valueAsString: valueAsString
};
};
/**
* Cohort time period is a string (may still contain an array or an object). The needed
* meta data, however, is not included within the field. This function infers the meta data
* and returns as an object. Meta data is not persisted in db, just used in the UI.
*
* Example:
*
* Input: "[1561928400,1595203200]"
*
* // Other input forms:
* // "0days" (All Time)
* // "10days", "10weeks", etc. (In the Last)
* // "[1561928400,1595203200]" (In Between)
* // "{'on':1561928400}" (On)
* // "{'since':1561928400}" (Since)
*
* Output:
* {
* level: "days" // only effective when the type is "last-n"
* longName: "Jul 01, 2019-Jul 20, 2020"
* name: "Jul 01, 2019-Jul 20, 2020"
* type: "range"
* value: [1561928400, 1595203200]
* valueAsString: "[1561928400,1595203200]"
* }
*
* @param {string} period Period string
* @returns {Object} An object containing meta fields
*/
countlyCommon.convertToTimePeriodObj = function(period) {
var inferredLevel = "days",
inferredType = null,
inferredValue = null;
if (typeof period === "string" && (period.indexOf("{") > -1 || period.indexOf("[") > -1)) {
period = JSON.parse(period);
}
if (!period && period === 0) {
inferredType = "all-time";
inferredValue = 0;
}
else if (Array.isArray(period)) {
inferredType = "range";
}
else if (period === "hour") {
inferredType = "hour";
inferredValue = "hour";
}
else if (period === "yesterday") {
inferredType = "yesterday";
inferredValue = "yesterday";
}
else if (period === "day") {
inferredType = "day";
inferredValue = "day";
}
else if (period === "month") {
inferredType = "month";
inferredValue = "month";
}
else if (typeof period === "object") {
if (Object.prototype.hasOwnProperty.call(period, "since")) {
inferredType = "since";
}
else if (Object.prototype.hasOwnProperty.call(period, "on")) {
inferredType = "on";
}
}
else if (period.endsWith("days")) {
inferredLevel = "days";
inferredType = "last-n";
}
else if (period.endsWith("weeks")) {
inferredLevel = "weeks";
inferredType = "last-n";
}
else if (period.endsWith("months")) {
inferredLevel = "months";
inferredType = "last-n";
}
else {
inferredType = "all-time";
inferredValue = 0;
}
if (inferredValue !== 0 && inferredType === "last-n") {
inferredValue = parseInt((period.replace(inferredLevel, '')));
}
else if (inferredValue !== 0) {
var stringified = JSON.stringify(period);
inferredValue = JSON.parse(stringified);
}
var obj = {
value: inferredValue,
type: inferredType,
level: inferredLevel
};
var descriptions = countlyCommon.getTimePeriodDescriptions(obj);
obj.valueAsString = descriptions.valueAsString;
obj.name = obj.longName = descriptions.name;
return obj;
};
/**
* Function to change HEX to RGBA
* @param {String} h - hex code
* @returns {String} rgba string
*/
countlyCommon.hexToRgba = function(h) {
var r = 0, g = 0, b = 0, a = 1;
if (h.length === 4) {
r = "0x" + h[1] + h[1];
g = "0x" + h[2] + h[2];
b = "0x" + h[3] + h[3];
}
else if (h.length === 7) {
r = "0x" + h[1] + h[2];
g = "0x" + h[3] + h[4];
b = "0x" + h[5] + h[6];
}
return "rgba(" + +r + "," + +g + "," + +b + "," + a + ")";
};
/**
* Unescapes provided string.
* -- Please use carefully --
* Mainly for rendering purposes.
* @param {String} text - Arbitrary string
* @param {String} df - Default value
* @returns {String} rgba string
*/
countlyCommon.unescapeString = function(text, df) {
if (text === undefined && df === undefined) {
return undefined;
}
return _.unescape(text || df).replace(/'/g, "'");
};
};
window.CommonConstructor = CommonConstructor;
window.countlyCommon = new CommonConstructor();
}(window, jQuery)); | 1 | 14,504 | Hmmm not sure about this. Is it fine @ar2rsawseen? | Countly-countly-server | js |
@@ -7,5 +7,5 @@ public interface Installer {
/**
* runs the installer
*/
- void run();
+ void go();
} | 1 | package org.phoenicis.scripts;
/**
* interface which must be implemented by all installers in Javascript
*/
public interface Installer {
/**
* runs the installer
*/
void run();
}
| 1 | 13,776 | Why do you prefer `go` over `run`? | PhoenicisOrg-phoenicis | java |
@@ -822,7 +822,7 @@ namespace Microsoft.TestPlatform.VsTestConsole.TranslationLayer.UnitTests
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, completepayload);
-
+
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(message1));
mockLauncher.Setup(ml => ml.LaunchTestHost(It.IsAny<TestProcessStartInfo>()))
.Callback<TestProcessStartInfo>((startInfo) => | 1 | // Copyright (c) Microsoft. All rights reserved.
namespace Microsoft.TestPlatform.VsTestConsole.TranslationLayer.UnitTests
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.TestPlatform.VsTestConsole.TranslationLayer.Interfaces;
using Microsoft.TestPlatform.VsTestConsole.TranslationLayer.Payloads;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Interfaces;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.CommunicationUtilities.Serialization;
using Microsoft.VisualStudio.TestPlatform.ObjectModel;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Client;
using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using VisualStudio.TestPlatform.ObjectModel.Client.Interfaces;
using TestResult = Microsoft.VisualStudio.TestPlatform.ObjectModel.TestResult;
[TestClass]
public class VsTestConsoleRequestSenderTests
{
private ITranslationLayerRequestSender requestSender;
private Mock<ICommunicationManager> mockCommunicationManager;
private int WaitTimeout = 2000;
public VsTestConsoleRequestSenderTests()
{
this.mockCommunicationManager = new Mock<ICommunicationManager>();
this.requestSender = new VsTestConsoleRequestSender(this.mockCommunicationManager.Object, JsonDataSerializer.Instance);
}
#region Communication Tests
[TestMethod]
public void InitializeCommunicationShouldSucceed()
{
this.InitializeCommunication();
this.mockCommunicationManager.Verify(cm => cm.HostServer(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.AcceptClientAsync(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.WaitForClientConnection(Timeout.Infinite), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.ReceiveMessage(), Times.Exactly(2));
this.mockCommunicationManager.Verify(cm => cm.SendMessage(MessageType.VersionCheck), Times.Once);
}
[TestMethod]
public void InitializeCommunicationShouldReturnInvalidPortNumberIfHostServerFails()
{
this.mockCommunicationManager.Setup(cm => cm.HostServer()).Throws(new Exception("Fail"));
var portOutput = this.requestSender.InitializeCommunication();
Assert.IsTrue(portOutput < 0, "Negative port number must be returned if Hosting Server fails.");
var connectionSuccess = this.requestSender.WaitForRequestHandlerConnection(this.WaitTimeout);
Assert.IsFalse(connectionSuccess, "Connection must fail as server failed to host.");
this.mockCommunicationManager.Verify(cm => cm.HostServer(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.AcceptClientAsync(), Times.Never);
this.mockCommunicationManager.Verify(cm => cm.WaitForClientConnection(Timeout.Infinite), Times.Never);
this.mockCommunicationManager.Verify(cm => cm.ReceiveMessage(), Times.Never);
}
[TestMethod]
public void InitializeCommunicationShouldFailConnectionIfMessageReceiveFailed()
{
var dummyPortInput = 123;
this.mockCommunicationManager.Setup(cm => cm.HostServer()).Returns(dummyPortInput);
this.mockCommunicationManager.Setup(cm => cm.AcceptClientAsync()).Callback(() => { });
this.mockCommunicationManager.Setup(cm => cm.WaitForClientConnection(Timeout.Infinite))
.Callback((int timeout) => Task.Delay(200).Wait());
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessage()).Throws(new Exception("Fail"));
var portOutput = this.requestSender.InitializeCommunication();
// Hosting server didn't server, so port number should still be valid
Assert.AreEqual(dummyPortInput, portOutput, "Port number must return without changes.");
// Connection must not succeed as handshake failed
var connectionSuccess = this.requestSender.WaitForRequestHandlerConnection(this.WaitTimeout);
Assert.IsFalse(connectionSuccess, "Connection must fail if handshake failed.");
this.mockCommunicationManager.Verify(cm => cm.HostServer(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.AcceptClientAsync(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.WaitForClientConnection(Timeout.Infinite), Times.Once);
}
[TestMethod]
public void InitializeCommunicationShouldFailConnectionIfSessionConnectedDidNotComeFirst()
{
var dummyPortInput = 123;
this.mockCommunicationManager.Setup(cm => cm.HostServer()).Returns(dummyPortInput);
this.mockCommunicationManager.Setup(cm => cm.AcceptClientAsync()).Callback(() => { });
this.mockCommunicationManager.Setup(cm => cm.WaitForClientConnection(Timeout.Infinite))
.Callback((int timeout) => Task.Delay(200).Wait());
var discoveryMessage = new Message() { MessageType = MessageType.StartDiscovery };
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessage()).Returns(discoveryMessage);
var portOutput = this.requestSender.InitializeCommunication();
Assert.AreEqual(dummyPortInput, portOutput, "Port number must return without changes.");
var connectionSuccess = this.requestSender.WaitForRequestHandlerConnection(this.WaitTimeout);
Assert.IsFalse(connectionSuccess, "Connection must fail if version check failed.");
this.mockCommunicationManager.Verify(cm => cm.HostServer(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.AcceptClientAsync(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.WaitForClientConnection(Timeout.Infinite), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.ReceiveMessage(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.SendMessage(It.IsAny<string>()), Times.Never);
}
[TestMethod]
public void InitializeCommunicationShouldFailConnectionIfSendMessageFailed()
{
var dummyPortInput = 123;
this.mockCommunicationManager.Setup(cm => cm.HostServer()).Returns(dummyPortInput);
this.mockCommunicationManager.Setup(cm => cm.AcceptClientAsync()).Callback(() => { });
this.mockCommunicationManager.Setup(cm => cm.WaitForClientConnection(Timeout.Infinite))
.Callback((int timeout) => Task.Delay(200).Wait());
var sessionConnected = new Message() { MessageType = MessageType.SessionConnected };
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessage()).Returns(sessionConnected);
this.mockCommunicationManager.Setup(cm => cm.SendMessage(MessageType.VersionCheck)).Throws(new Exception("Fail"));
var portOutput = this.requestSender.InitializeCommunication();
Assert.AreEqual(dummyPortInput, portOutput, "Port number must return without changes.");
var connectionSuccess = this.requestSender.WaitForRequestHandlerConnection(this.WaitTimeout);
Assert.IsFalse(connectionSuccess, "Connection must fail if version check failed.");
this.mockCommunicationManager.Verify(cm => cm.HostServer(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.AcceptClientAsync(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.WaitForClientConnection(Timeout.Infinite), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.ReceiveMessage(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.SendMessage(It.IsAny<string>()), Times.Once);
}
[TestMethod]
public void InitializeCommunicationShouldFailConnectionIfVersionIsWrong()
{
var dummyPortInput = 123;
this.mockCommunicationManager.Setup(cm => cm.HostServer()).Returns(dummyPortInput);
this.mockCommunicationManager.Setup(cm => cm.AcceptClientAsync()).Callback(() => { });
this.mockCommunicationManager.Setup(cm => cm.WaitForClientConnection(Timeout.Infinite))
.Callback((int timeout) => Task.Delay(200).Wait());
var sessionConnected = new Message() { MessageType = MessageType.SessionConnected };
// Give wrong version
var versionCheck = new Message()
{
MessageType = MessageType.VersionCheck,
Payload = JToken.FromObject("2")
};
Action changedMessage =
() => { this.mockCommunicationManager.Setup(cm => cm.ReceiveMessage()).Returns(versionCheck); };
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessage()).Returns(sessionConnected);
this.mockCommunicationManager.Setup(cm => cm.SendMessage(MessageType.VersionCheck)).Callback(changedMessage);
var portOutput = this.requestSender.InitializeCommunication();
Assert.AreEqual(dummyPortInput, portOutput, "Port number must return without changes.");
var connectionSuccess = this.requestSender.WaitForRequestHandlerConnection(this.WaitTimeout);
Assert.IsFalse(connectionSuccess, "Connection must fail if version check failed.");
this.mockCommunicationManager.Verify(cm => cm.HostServer(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.AcceptClientAsync(), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.WaitForClientConnection(Timeout.Infinite), Times.Once);
this.mockCommunicationManager.Verify(cm => cm.ReceiveMessage(), Times.Exactly(2));
this.mockCommunicationManager.Verify(cm => cm.SendMessage(MessageType.VersionCheck), Times.Once);
}
#endregion
#region Discovery Tests
[TestMethod]
public void DiscoverTestsShouldCompleteWithZeroTests()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestDiscoveryEventsHandler>();
var payload = new DiscoveryCompletePayload() { TotalTests = 0, LastDiscoveredTests = null, IsAborted = false };
var discoveryComplete = new Message() { MessageType = MessageType.DiscoveryComplete,
Payload = JToken.FromObject(payload) };
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(discoveryComplete));
this.requestSender.DiscoverTests(new List<string>() { "1.dll" }, null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleDiscoveryComplete(0, null, false), Times.Once, "Discovery Complete must be called");
mockHandler.Verify(mh => mh.HandleDiscoveredTests(It.IsAny<IEnumerable<TestCase>>()), Times.Never, "DiscoveredTests must not be called");
mockHandler.Verify(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>()), Times.Never, "TestMessage event must not be called");
}
[TestMethod]
public void DiscoverTestsShouldCompleteWithSingleTest()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestDiscoveryEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
var testCaseList = new List<TestCase>() { testCase };
var testsFound = new Message()
{
MessageType = MessageType.TestCasesFound,
Payload = JToken.FromObject(testCaseList)
};
var payload = new DiscoveryCompletePayload() { TotalTests = 1, LastDiscoveredTests = null, IsAborted = false };
var discoveryComplete = new Message()
{
MessageType = MessageType.DiscoveryComplete,
Payload = JToken.FromObject(payload)
};
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(testsFound));
mockHandler.Setup(mh => mh.HandleDiscoveredTests(It.IsAny<IEnumerable<TestCase>>())).Callback(
() => this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(discoveryComplete)));
this.requestSender.DiscoverTests(new List<string>() { "1.dll" }, null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleDiscoveryComplete(1, null, false), Times.Once, "Discovery Complete must be called");
mockHandler.Verify(mh => mh.HandleDiscoveredTests(It.IsAny<IEnumerable<TestCase>>()), Times.Once, "DiscoveredTests must be called");
mockHandler.Verify(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>()), Times.Never, "TestMessage event must not be called");
}
[TestMethod]
public void DiscoverTestsShouldReportBackTestsWithTraitsInTestsFoundMessage()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestDiscoveryEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
testCase.Traits.Add(new Trait("a", "b"));
List<TestCase> receivedTestCases = null;
var testCaseList = new List<TestCase>() { testCase };
var testsFound = CreateMessage(MessageType.TestCasesFound, testCaseList);
var payload = new DiscoveryCompletePayload() { TotalTests = 1, LastDiscoveredTests = null, IsAborted = false };
var discoveryComplete = CreateMessage(MessageType.DiscoveryComplete, payload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(testsFound));
mockHandler.Setup(mh => mh.HandleDiscoveredTests(It.IsAny<IEnumerable<TestCase>>()))
.Callback(
(IEnumerable<TestCase> tests) =>
{
receivedTestCases = tests?.ToList();
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(discoveryComplete));
});
this.requestSender.DiscoverTests(new List<string>() { "1.dll" }, null, mockHandler.Object);
Assert.IsNotNull(receivedTestCases);
Assert.AreEqual(1, receivedTestCases.Count);
// Verify that the traits are passed through properly.
var traits = receivedTestCases.ToArray()[0].Traits;
Assert.IsNotNull(traits);
Assert.AreEqual(traits.ToArray()[0].Name, "a");
Assert.AreEqual(traits.ToArray()[0].Value, "b");
}
[TestMethod]
public void DiscoverTestsShouldReportBackTestsWithTraitsInDiscoveryCompleteMessage()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestDiscoveryEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
testCase.Traits.Add(new Trait("a", "b"));
List<TestCase> receivedTestCases = null;
var testCaseList = new List<TestCase>() { testCase };
var payload = new DiscoveryCompletePayload() { TotalTests = 1, LastDiscoveredTests = testCaseList, IsAborted = false };
var discoveryComplete = CreateMessage(MessageType.DiscoveryComplete, payload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(discoveryComplete));
mockHandler.Setup(mh => mh.HandleDiscoveryComplete(It.IsAny<long>(), It.IsAny<IEnumerable<TestCase>>(), It.IsAny<bool>()))
.Callback(
(long totalTests, IEnumerable<TestCase> tests, bool isAborted) =>
{
receivedTestCases = tests?.ToList();
});
this.requestSender.DiscoverTests(new List<string>() { "1.dll" }, null, mockHandler.Object);
Assert.IsNotNull(receivedTestCases);
Assert.AreEqual(1, receivedTestCases.Count);
// Verify that the traits are passed through properly.
var traits = receivedTestCases.ToArray()[0].Traits;
Assert.IsNotNull(traits);
Assert.AreEqual(traits.ToArray()[0].Name, "a");
Assert.AreEqual(traits.ToArray()[0].Value, "b");
}
[TestMethod]
public void DiscoverTestsShouldCompleteWithTestMessage()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestDiscoveryEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
var testCaseList = new List<TestCase>() { testCase };
var testsFound = CreateMessage(MessageType.TestCasesFound, testCaseList);
var payload = new DiscoveryCompletePayload() { TotalTests = 1, LastDiscoveredTests = null, IsAborted = false };
var discoveryComplete = CreateMessage(MessageType.DiscoveryComplete, payload);
var mpayload = new TestMessagePayload() { MessageLevel = TestMessageLevel.Informational, Message = "Hello" };
var message = CreateMessage(MessageType.TestMessage, mpayload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(testsFound));
mockHandler.Setup(mh => mh.HandleDiscoveredTests(It.IsAny<IEnumerable<TestCase>>())).Callback(
() => this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(message)));
mockHandler.Setup(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>())).Callback(
() => this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(discoveryComplete)));
this.requestSender.DiscoverTests(new List<string>() { "1.dll" }, null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleDiscoveryComplete(1, null, false), Times.Once, "Discovery Complete must be called");
mockHandler.Verify(mh => mh.HandleDiscoveredTests(It.IsAny<IEnumerable<TestCase>>()), Times.Once, "DiscoveredTests must be called");
mockHandler.Verify(mh => mh.HandleLogMessage(TestMessageLevel.Informational, "Hello"), Times.Once, "TestMessage event must be called");
}
[TestMethod]
public void DiscoverTestsShouldAbortOnExceptionInSendMessage()
{
var mockHandler = new Mock<ITestDiscoveryEventsHandler>();
var sources = new List<string> {"1.dll"};
var payload = new DiscoveryRequestPayload {Sources = sources, RunSettings = null};
this.mockCommunicationManager.Setup(cm => cm.SendMessage(MessageType.StartDiscovery, payload)).Throws(new IOException());
this.requestSender.DiscoverTests(sources, null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleDiscoveryComplete(-1, null, true), Times.Once, "Discovery Complete must be called");
mockHandler.Verify(mh => mh.HandleLogMessage(TestMessageLevel.Error, It.IsAny<string>()), Times.Once, "TestMessage event must be called");
}
[TestMethod]
public void DiscoverTestsShouldAbortWhenProcessExited()
{
var mockHandler = new Mock<ITestDiscoveryEventsHandler>();
var sources = new List<string> { "1.dll" };
var payload = new DiscoveryRequestPayload { Sources = sources, RunSettings = null };
var manualEvent = new ManualResetEvent(false);
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
var testCaseList = new List<TestCase>() { testCase };
var testsFound = CreateMessage(MessageType.TestCasesFound, testCaseList);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Callback(
(CancellationToken c) =>
{
Task.Run(() => this.requestSender.OnProcessExited()).Wait();
Assert.IsTrue(c.IsCancellationRequested);
}).Returns(Task.FromResult((Message)null));
mockHandler.Setup(mh => mh.HandleDiscoveryComplete(-1, null, true)).Callback(() => manualEvent.Set());
this.requestSender.DiscoverTests(sources, null, mockHandler.Object);
manualEvent.WaitOne();
mockHandler.Verify(mh => mh.HandleLogMessage(TestMessageLevel.Error, It.IsAny<string>()), Times.Once);
}
#endregion
#region RunTests
[TestMethod]
public void StartTestRunShouldCompleteWithZeroTests()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestRunEventsHandler>();
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, null, null);
var payload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, payload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
this.requestSender.StartTestRun(new List<string>() { "1.dll" }, null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleTestRunComplete(It.IsAny<TestRunCompleteEventArgs>(),
It.IsAny<TestRunChangedEventArgs>(), null, null), Times.Once, "Run Complete must be called");
mockHandler.Verify(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>()), Times.Never, "RunChangedArgs must not be called");
mockHandler.Verify(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>()), Times.Never, "TestMessage event must not be called");
}
[TestMethod]
public void StartTestRunShouldCompleteWithSingleTestAndMessage()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestRunEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
var testResult = new VisualStudio.TestPlatform.ObjectModel.TestResult(testCase);
testResult.Outcome = TestOutcome.Passed;
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, null, null);
var testsChangedArgs = new TestRunChangedEventArgs(null,
new List<TestResult>() { testResult }, null);
var testsPayload = CreateMessage(MessageType.TestRunStatsChange, testsChangedArgs);
var payload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, payload);
var mpayload = new TestMessagePayload() { MessageLevel = TestMessageLevel.Informational, Message = "Hello" };
var message = CreateMessage(MessageType.TestMessage, mpayload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(testsPayload));
mockHandler.Setup(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>())).Callback<TestRunChangedEventArgs>(
(testRunChangedArgs) =>
{
Assert.IsTrue(testRunChangedArgs.NewTestResults != null && testsChangedArgs.NewTestResults.Count() > 0, "TestResults must be passed properly");
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(message));
});
mockHandler.Setup(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>())).Callback(
() =>
{
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
});
this.requestSender.StartTestRun(new List<string>() { "1.dll" }, null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleTestRunComplete(It.IsAny<TestRunCompleteEventArgs>(),
It.IsAny<TestRunChangedEventArgs>(), null, null), Times.Once, "Run Complete must be called");
mockHandler.Verify(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>()), Times.Once, "RunChangedArgs must be called");
mockHandler.Verify(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>()), Times.Once, "TestMessage event must be called");
}
[TestMethod]
public void StartTestRunWithCustomHostShouldComplete()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestRunEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
var testResult = new VisualStudio.TestPlatform.ObjectModel.TestResult(testCase);
testResult.Outcome = TestOutcome.Passed;
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, null, null);
var testsChangedArgs = new TestRunChangedEventArgs(null, new List<TestResult>() { testResult }, null);
var testsPayload = CreateMessage(MessageType.TestRunStatsChange, testsChangedArgs);
var payload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, payload);
var mpayload = new TestMessagePayload() { MessageLevel = TestMessageLevel.Informational, Message = "Hello" };
var message = CreateMessage(MessageType.TestMessage, mpayload);
var runprocessInfoPayload = new Message()
{
MessageType = MessageType.CustomTestHostLaunch,
Payload = JToken.FromObject(new TestProcessStartInfo())
};
mockHandler.Setup(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>())).Callback<TestRunChangedEventArgs>(
(testRunChangedArgs) =>
{
Assert.IsTrue(testRunChangedArgs.NewTestResults != null && testsChangedArgs.NewTestResults.Count() > 0, "TestResults must be passed properly");
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(message));
});
mockHandler.Setup(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>())).Callback(
() =>
{
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
});
var mockLauncher = new Mock<ITestHostLauncher>();
mockLauncher.Setup(ml => ml.LaunchTestHost(It.IsAny<TestProcessStartInfo>())).Callback
(() => this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(testsPayload)));
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runprocessInfoPayload));
this.requestSender.StartTestRunWithCustomHost(new List<string>() { "1.dll" }, null, mockHandler.Object, mockLauncher.Object);
mockHandler.Verify(mh => mh.HandleTestRunComplete(It.IsAny<TestRunCompleteEventArgs>(),
It.IsAny<TestRunChangedEventArgs>(), null, null), Times.Once, "Run Complete must be called");
mockHandler.Verify(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>()), Times.Once, "RunChangedArgs must be called");
mockHandler.Verify(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>()), Times.Once, "TestMessage event must be called");
mockLauncher.Verify(ml => ml.LaunchTestHost(It.IsAny<TestProcessStartInfo>()), Times.Once, "Custom TestHostLauncher must be called");
}
[TestMethod]
public void StartTestRunWithSelectedTestsShouldCompleteWithZeroTests()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestRunEventsHandler>();
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, null, null);
var payload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, payload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
this.requestSender.StartTestRun(new List<TestCase>(), null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleTestRunComplete(It.IsAny<TestRunCompleteEventArgs>(),
It.IsAny<TestRunChangedEventArgs>(), null, null), Times.Once, "Run Complete must be called");
mockHandler.Verify(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>()), Times.Never, "RunChangedArgs must not be called");
mockHandler.Verify(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>()), Times.Never, "TestMessage event must not be called");
}
[TestMethod]
public void StartTestRunWithSelectedTestsShouldCompleteWithSingleTestAndMessage()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestRunEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
var testResult = new VisualStudio.TestPlatform.ObjectModel.TestResult(testCase);
testResult.Outcome = TestOutcome.Passed;
var testCaseList = new List<TestCase>() { testCase };
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, null, null);
var testsChangedArgs = new TestRunChangedEventArgs(null, new List<TestResult>() { testResult }, null);
var testsPayload = CreateMessage(MessageType.TestRunStatsChange, testsChangedArgs);
var payload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, payload);
var mpayload = new TestMessagePayload() { MessageLevel = TestMessageLevel.Informational, Message = "Hello" };
var message = CreateMessage(MessageType.TestMessage, mpayload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(testsPayload));
mockHandler.Setup(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>())).Callback<TestRunChangedEventArgs>(
(testRunChangedArgs) =>
{
Assert.IsTrue(testRunChangedArgs.NewTestResults != null && testsChangedArgs.NewTestResults.Count() > 0, "TestResults must be passed properly");
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(message));
});
mockHandler.Setup(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>())).Callback(
() =>
{
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
});
this.requestSender.StartTestRun(testCaseList, null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleTestRunComplete(It.IsAny<TestRunCompleteEventArgs>(),
It.IsAny<TestRunChangedEventArgs>(), null, null), Times.Once, "Run Complete must be called");
mockHandler.Verify(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>()), Times.Once, "RunChangedArgs must be called");
mockHandler.Verify(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>()), Times.Once, "TestMessage event must be called");
}
[TestMethod]
public void StartTestRunWithSelectedTestsHavingTraitsShouldReturnTestRunCompleteWithTraitsIntact()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestRunEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
testCase.Traits.Add(new Trait("a", "b"));
var testResult = new VisualStudio.TestPlatform.ObjectModel.TestResult(testCase);
testResult.Outcome = TestOutcome.Passed;
var testCaseList = new List<TestCase>() { testCase };
TestRunChangedEventArgs receivedChangeEventArgs = null;
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, new List<TestResult> { testResult }, null);
var payload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, payload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
mockHandler.Setup(mh => mh.HandleTestRunComplete(
It.IsAny<TestRunCompleteEventArgs>(),
It.IsAny<TestRunChangedEventArgs>(),
It.IsAny<ICollection<AttachmentSet>>(),
It.IsAny<ICollection<string>>()))
.Callback(
(TestRunCompleteEventArgs complete,
TestRunChangedEventArgs stats,
ICollection<AttachmentSet> attachments,
ICollection<string> executorUris) =>
{
receivedChangeEventArgs = stats;
});
this.requestSender.StartTestRun(testCaseList, null, mockHandler.Object);
Assert.IsNotNull(receivedChangeEventArgs);
Assert.IsTrue(receivedChangeEventArgs.NewTestResults.Count() > 0);
// Verify that the traits are passed through properly.
var traits = receivedChangeEventArgs.NewTestResults.ToArray()[0].TestCase.Traits;
Assert.IsNotNull(traits);
Assert.AreEqual(traits.ToArray()[0].Name, "a");
Assert.AreEqual(traits.ToArray()[0].Value, "b");
}
[TestMethod]
public void StartTestRunWithSelectedTestsHavingTraitsShouldReturnTestRunStatsWithTraitsIntact()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestRunEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
testCase.Traits.Add(new Trait("a", "b"));
var testResult = new VisualStudio.TestPlatform.ObjectModel.TestResult(testCase);
testResult.Outcome = TestOutcome.Passed;
var testCaseList = new List<TestCase>() { testCase };
TestRunChangedEventArgs receivedChangeEventArgs = null;
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, null, null);
var testsChangedArgs = new TestRunChangedEventArgs(
null,
new List<TestResult>() { testResult },
null);
var testsRunStatsPayload = CreateMessage(MessageType.TestRunStatsChange, testsChangedArgs);
var testRunCompletepayload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, testRunCompletepayload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(testsRunStatsPayload));
mockHandler.Setup(mh => mh.HandleTestRunStatsChange(
It.IsAny<TestRunChangedEventArgs>()))
.Callback(
(TestRunChangedEventArgs stats) =>
{
receivedChangeEventArgs = stats;
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
});
this.requestSender.StartTestRun(testCaseList, null, mockHandler.Object);
Assert.IsNotNull(receivedChangeEventArgs);
Assert.IsTrue(receivedChangeEventArgs.NewTestResults.Any());
// Verify that the traits are passed through properly.
var traits = receivedChangeEventArgs.NewTestResults.ToArray()[0].TestCase.Traits;
Assert.IsNotNull(traits);
Assert.AreEqual(traits.ToArray()[0].Name, "a");
Assert.AreEqual(traits.ToArray()[0].Value, "b");
}
[TestMethod]
public void StartTestRunWithSelectedTestsAndCustomHostShouldComplete()
{
this.InitializeCommunication();
var mockHandler = new Mock<ITestRunEventsHandler>();
var testCase = new TestCase("hello", new Uri("world://how"), "1.dll");
var testResult = new VisualStudio.TestPlatform.ObjectModel.TestResult(testCase);
testResult.Outcome = TestOutcome.Passed;
var testCaseList = new List<TestCase>() { testCase };
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, null, null);
var testsChangedArgs = new TestRunChangedEventArgs(null, new List<TestResult>() { testResult }, null);
var testsPayload = CreateMessage(MessageType.TestRunStatsChange, testsChangedArgs);
var payload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, payload);
var mpayload = new TestMessagePayload() { MessageLevel = TestMessageLevel.Informational, Message = "Hello" };
var message = CreateMessage(MessageType.TestMessage, mpayload);
var runprocessInfoPayload = CreateMessage(MessageType.CustomTestHostLaunch, new TestProcessStartInfo());
mockHandler.Setup(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>())).Callback<TestRunChangedEventArgs>(
(testRunChangedArgs) =>
{
Assert.IsTrue(testRunChangedArgs.NewTestResults != null && testsChangedArgs.NewTestResults.Count() > 0, "TestResults must be passed properly");
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(message));
});
mockHandler.Setup(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>())).Callback(
() =>
{
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
});
var mockLauncher = new Mock<ITestHostLauncher>();
mockLauncher.Setup(ml => ml.LaunchTestHost(It.IsAny<TestProcessStartInfo>())).Callback
(() => this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(testsPayload)));
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runprocessInfoPayload));
this.requestSender.StartTestRunWithCustomHost(testCaseList, null, mockHandler.Object, mockLauncher.Object);
mockHandler.Verify(mh => mh.HandleTestRunComplete(It.IsAny<TestRunCompleteEventArgs>(),
It.IsAny<TestRunChangedEventArgs>(), null, null), Times.Once, "Run Complete must be called");
mockHandler.Verify(mh => mh.HandleTestRunStatsChange(It.IsAny<TestRunChangedEventArgs>()), Times.Once, "RunChangedArgs must be called");
mockHandler.Verify(mh => mh.HandleLogMessage(It.IsAny<TestMessageLevel>(), It.IsAny<string>()), Times.Once, "TestMessage event must be called");
mockLauncher.Verify(ml => ml.LaunchTestHost(It.IsAny<TestProcessStartInfo>()), Times.Once, "Custom TestHostLauncher must be called");
}
[TestMethod]
public void StartTestRunWithCustomHostInParallelShouldCallCustomHostMultipleTimes()
{
var mockLauncher = new Mock<ITestHostLauncher>();
var mockHandler = new Mock<ITestRunEventsHandler>();
IEnumerable<string> sources = new List<string> { "1.dll" };
var p1 = new TestProcessStartInfo() { FileName = "X" };
var p2 = new TestProcessStartInfo() { FileName = "Y" };
var message1 = CreateMessage(MessageType.CustomTestHostLaunch, p1);
var message2 = CreateMessage(MessageType.CustomTestHostLaunch, p2);
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var completepayload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = null,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, completepayload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(message1));
mockLauncher.Setup(ml => ml.LaunchTestHost(It.IsAny<TestProcessStartInfo>()))
.Callback<TestProcessStartInfo>((startInfo) =>
{
if(startInfo.FileName.Equals(p1.FileName))
{
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(message2));
}
else if (startInfo.FileName.Equals(p2.FileName))
{
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>())).Returns(Task.FromResult(runComplete));
}
});
this.requestSender.StartTestRunWithCustomHost(sources, null, mockHandler.Object, mockLauncher.Object);
mockLauncher.Verify(ml => ml.LaunchTestHost(It.IsAny<TestProcessStartInfo>()), Times.Exactly(2));
}
[TestMethod]
public void StartTestRunShouldAbortOnExceptionInSendMessage()
{
var mockHandler = new Mock<ITestRunEventsHandler>();
var sources = new List<string> { "1.dll" };
var payload = new TestRunRequestPayload { Sources = sources, RunSettings = null };
var exception = new IOException();
this.mockCommunicationManager.Setup(cm => cm.SendMessage(MessageType.TestRunAllSourcesWithDefaultHost, payload)).Throws(exception);
this.requestSender.StartTestRun(sources, null, mockHandler.Object);
mockHandler.Verify(mh => mh.HandleTestRunComplete(It.IsAny<TestRunCompleteEventArgs>(), null, null, null), Times.Once, "Test Run Complete must be called");
mockHandler.Verify(mh => mh.HandleLogMessage(TestMessageLevel.Error, It.IsAny<string>()), Times.Once, "TestMessage event must be called");
}
[TestMethod]
public void StartRunTestsShouldAbortOnProcessExited()
{
var mockHandler = new Mock<ITestRunEventsHandler>();
var manualEvent = new ManualResetEvent(false);
var sources = new List<string> { "1.dll" };
var dummyCompleteArgs = new TestRunCompleteEventArgs(null, false, false, null, null, TimeSpan.FromMilliseconds(1));
var dummyLastRunArgs = new TestRunChangedEventArgs(null, null, null);
var payload = new TestRunCompletePayload()
{
ExecutorUris = null,
LastRunTests = dummyLastRunArgs,
RunAttachments = null,
TestRunCompleteArgs = dummyCompleteArgs
};
var runComplete = CreateMessage(MessageType.ExecutionComplete, payload);
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessageAsync(It.IsAny<CancellationToken>()))
.Callback((CancellationToken c) =>
{
Task.Run(() => this.requestSender.OnProcessExited()).Wait();
Assert.IsTrue(c.IsCancellationRequested);
}).Returns(Task.FromResult((Message)null));
mockHandler.Setup(mh => mh.HandleTestRunComplete(It.IsAny<TestRunCompleteEventArgs>(), null, null, null)).Callback(() => manualEvent.Set());
this.requestSender.StartTestRun(sources, null, mockHandler.Object);
manualEvent.WaitOne();
mockHandler.Verify(mh => mh.HandleLogMessage(TestMessageLevel.Error, It.IsAny<string>()), Times.Once);
}
#endregion
#region private methods
private static Message CreateMessage<T>(string messageType, T payload)
{
var message = new Message()
{
MessageType = messageType,
Payload = JToken.FromObject(
payload,
JsonSerializer.Create(
new JsonSerializerSettings
{
ContractResolver = new TestPlatformContractResolver(),
TypeNameHandling = TypeNameHandling.None
}))
};
return message;
}
private void InitializeCommunication()
{
var dummyPortInput = 123;
this.mockCommunicationManager.Setup(cm => cm.HostServer()).Returns(dummyPortInput);
this.mockCommunicationManager.Setup(cm => cm.AcceptClientAsync()).Callback(() => { });
this.mockCommunicationManager.Setup(cm => cm.WaitForClientConnection(Timeout.Infinite))
.Callback((int timeout) => Task.Delay(200).Wait());
var sessionConnected = new Message() { MessageType = MessageType.SessionConnected };
var versionCheck = new Message() { MessageType = MessageType.VersionCheck, Payload = JToken.FromObject("1") };
Action changedMessage = () =>
{
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessage()).Returns(versionCheck);
};
this.mockCommunicationManager.Setup(cm => cm.ReceiveMessage()).Returns(sessionConnected);
this.mockCommunicationManager.Setup(cm => cm.SendMessage(MessageType.VersionCheck)).Callback(changedMessage);
var portOutput = this.requestSender.InitializeCommunication();
Assert.AreEqual(dummyPortInput, portOutput, "Port number must return without changes.");
var connectionSuccess = this.requestSender.WaitForRequestHandlerConnection(this.WaitTimeout);
Assert.IsTrue(connectionSuccess, "Connection must succeed.");
}
#endregion
}
}
| 1 | 11,255 | Unintentional, please remove | microsoft-vstest | .cs |
@@ -18,6 +18,10 @@ class Subscription < ActiveRecord::Base
after_create :add_user_to_mailing_list
after_create :add_user_to_github_team
+ def self.active
+ where(deactivated_on: nil)
+ end
+
def self.deliver_welcome_emails
recent.each do |subscription|
subscription.deliver_welcome_email | 1 | # This class represents a user's subscription to Learn content
class Subscription < ActiveRecord::Base
MAILING_LIST = 'Active Subscribers'
GITHUB_TEAM = 516450
belongs_to :user
belongs_to :plan, polymorphic: true
belongs_to :team
delegate :includes_mentor?, to: :plan
delegate :includes_workshops?, to: :plan
delegate :stripe_customer_id, to: :user
validates :plan_id, presence: true
validates :plan_type, presence: true
validates :user_id, presence: true
after_create :add_user_to_mailing_list
after_create :add_user_to_github_team
def self.deliver_welcome_emails
recent.each do |subscription|
subscription.deliver_welcome_email
end
end
def self.paid
where(paid: true)
end
def self.canceled_in_last_30_days
canceled_within_period(30.days.ago, Time.zone.now)
end
def self.active_as_of(time)
where('deactivated_on is null OR deactivated_on > ?', time)
end
def self.created_before(time)
where('created_at <= ?', time)
end
def active?
deactivated_on.nil?
end
def deactivate
deactivate_subscription_purchases
remove_user_from_mailing_list
remove_user_from_github_team
update_column(:deactivated_on, Time.zone.today)
end
def change_plan(new_plan)
stripe_customer.update_subscription(plan: new_plan.sku)
self.plan = new_plan
save!
end
def downgraded?
plan == IndividualPlan.downgraded
end
def deliver_welcome_email
if includes_mentor?
SubscriptionMailer.welcome_to_prime_from_mentor(user).deliver
else
SubscriptionMailer.welcome_to_prime(user).deliver
end
end
private
def self.canceled_within_period(start_time, end_time)
where(deactivated_on: start_time...end_time)
end
def self.subscriber_emails
active.joins(:user).pluck(:email)
end
def self.active
where(deactivated_on: nil)
end
def self.recent
where('created_at > ?', 24.hours.ago)
end
def stripe_customer
Stripe::Customer.retrieve(stripe_customer_id)
end
def deactivate_subscription_purchases
user.subscription_purchases.each do |purchase|
PurchaseRefunder.new(purchase).refund
end
end
def add_user_to_mailing_list
MailchimpFulfillmentJob.enqueue(MAILING_LIST, user.email)
end
def remove_user_from_mailing_list
MailchimpRemovalJob.enqueue(MAILING_LIST, user.email)
end
def add_user_to_github_team
GithubFulfillmentJob.enqueue(GITHUB_TEAM, [user.github_username])
end
def remove_user_from_github_team
GithubRemovalJob.enqueue(GITHUB_TEAM, [user.github_username])
end
end
| 1 | 8,701 | What was the reason behind moving this? | thoughtbot-upcase | rb |
@@ -1,12 +1,8 @@
-<%= t "user_mailer.gpx_notification.your_gpx_file" %>
-<strong><%= @trace_name %></strong>
-<%= t "user_mailer.gpx_notification.with_description" %>
-<em><%= @trace_description %></em>
-<% if @trace_tags.length>0 %>
- <%= t "user_mailer.gpx_notification.and_the_tags" %>
- <em><% @trace_tags.each do |tag| %>
- <%= tag.tag.rstrip %>
- <% end %></em>
+<% trace_name = tag.strong(@trace_name) %>
+<% trace_description = tag.em(@trace_description) %>
+<% if @trace_tags.length > 0 %>
+ <% tags = @trace_tags.map { tag.tag.rstrip.join(" ") } %>
+ <%= t ".description_with_tags_html", :trace_name => trace_name, :trace_description => trace_description, :tags => tags %>
<% else %>
- <%= t "user_mailer.gpx_notification.and_no_tags" %>
+ <%= t ".description_with_no_tags_html", :trace_name => trace_name, :trace_description => trace_description %>
<% end %> | 1 | <%= t "user_mailer.gpx_notification.your_gpx_file" %>
<strong><%= @trace_name %></strong>
<%= t "user_mailer.gpx_notification.with_description" %>
<em><%= @trace_description %></em>
<% if @trace_tags.length>0 %>
<%= t "user_mailer.gpx_notification.and_the_tags" %>
<em><% @trace_tags.each do |tag| %>
<%= tag.tag.rstrip %>
<% end %></em>
<% else %>
<%= t "user_mailer.gpx_notification.and_no_tags" %>
<% end %>
| 1 | 13,098 | Did you mean to put that `join` after the `map` rather than inside it? Also should it be `safe_join` or is interpolating it into an `_html` resource going to have much the same effect> | openstreetmap-openstreetmap-website | rb |
@@ -72,6 +72,14 @@ class Realm {
*/
get isInTransaction() {}
+ /**
+ * Indicated is this Realm is closed.
+ * @type {boolean}
+ * @readonly
+ * @since 2.1.0
+ */
+ get isClosed() {}
+
/**
* Gets the sync session if this is a synced Realm
* @type {Session} | 1 | ////////////////////////////////////////////////////////////////////////////
//
// Copyright 2016 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////
/**
* A Realm instance represents a Realm database.
* ```js
* const Realm = require('realm');
* ```
*/
class Realm {
/**
* Indicates if this Realm contains any objects.
* @type {boolean}
* @readonly
* @since 1.10.0
*/
get empty() {}
/**
* The path to the file where this Realm is stored.
* @type {string}
* @readonly
* @since 0.12.0
*/
get path() {}
/**
* Indicates if this Realm was opened as read-only.
* @type {boolean}
* @readonly
* @since 0.12.0
*/
get readOnly() {}
/**
* A normalized representation of the schema provided in the
* {@link Realm~Configuration Configuration} when this Realm was constructed.
* @type {Realm~ObjectSchema[]}
* @readonly
* @since 0.12.0
*/
get schema() {}
/**
* The current schema version of this Realm.
* @type {number}
* @readonly
* @since 0.12.0
*/
get schemaVersion() {}
/**
* Indicates if this Realm is in a write transaction.
* @type {boolean}
* @readonly
* @since 1.10.3
*/
get isInTransaction() {}
/**
* Gets the sync session if this is a synced Realm
* @type {Session}
*/
get syncSession() {}
/**
* Create a new `Realm` instance using the provided `config`. If a Realm does not yet exist
* at `config.path` (or {@link Realm.defaultPath} if not provided), then this constructor
* will create it with the provided `config.schema` (which is _required_ in this case).
* Otherwise, the instance will access the existing Realm from the file at that path.
* In this case, `config.schema` is _optional_ or not have changed, unless
* `config.schemaVersion` is incremented, in which case the Realm will be automatically
* migrated to use the new schema.
* @param {Realm~Configuration} [config] - **Required** when first creating the Realm.
* @throws {Error} If anything in the provided `config` is invalid.
* @throws {IncompatibleSyncedRealmError} when an incompatible synced Realm is opened
*/
constructor(config) {}
/**
* Open a Realm asynchronously with a promise. If the Realm is synced, it will be fully
* synchronized before it is available.
* @param {Realm~Configuration} config
* @returns {ProgressPromise} - a promise that will be resolved with the Realm instance when it's available.
*/
static open(config) {}
/**
* Open a Realm asynchronously with a callback. If the Realm is synced, it will be fully
* synchronized before it is available.
* @param {Realm~Configuration} config
* @param {callback(error, realm)} - will be called when the Realm is ready.
* @param {callback(transferred, transferable)} [progressCallback] - an optional callback for download progress notifications
* @throws {Error} If anything in the provided `config` is invalid
* @throws {IncompatibleSyncedRealmError} when an incompatible synced Realm is opened
*/
static openAsync(config, callback, progressCallback) {}
/**
* Closes this Realm so it may be re-opened with a newer schema version.
* All objects and collections from this Realm are no longer valid after calling this method.
*/
close() {}
/**
* Create a new Realm object of the given type and with the specified properties.
* @param {Realm~ObjectType} type - The type of Realm object to create.
* @param {Object} properties - Property values for all required properties without a
* default value.
* @param {boolean} [update=false] - Signals that an existing object with matching primary key
* should be updated. Only the primary key property and properties which should be updated
* need to be specified. All missing property values will remain unchanged.
* @returns {Realm.Object}
*/
create(type, properties, update) {}
/**
* Deletes the provided Realm object, or each one inside the provided collection.
* @param {Realm.Object|Realm.Object[]|Realm.List|Realm.Results} object
*/
delete(object) {}
/**
* Deletes a Realm model, including all of its objects.
* @param {string} name - the model name
*/
deleteModel(name) {}
/**
* **WARNING:** This will delete **all** objects in the Realm!
*/
deleteAll() {}
/**
* Returns all objects of the given `type` in the Realm.
* @param {Realm~ObjectType} type - The type of Realm objects to retrieve.
* @throws {Error} If type passed into this method is invalid.
* @returns {Realm.Results} that will live-update as objects are created and destroyed.
*/
objects(type) {}
/**
* Searches for a Realm object by its primary key.
* @param {Realm~ObjectType} type - The type of Realm object to search for.
* @param {number|string} key - The primary key value of the object to search for.
* @throws {Error} If type passed into this method is invalid or if the object type did
* not have a `primaryKey` specified in its {@link Realm~ObjectSchema ObjectSchema}.
* @returns {Realm.Object|undefined} if no object is found.
* @since 0.14.0
*/
objectForPrimaryKey(type, key) {}
/**
* Add a listener `callback` for the specified event `name`.
* @param {string} name - The name of event that should cause the callback to be called.
* _Currently, only the "change" event supported_.
* @param {callback(Realm, string)} callback - Function to be called when the event occurs.
* Each callback will only be called once per event, regardless of the number of times
* it was added.
* @throws {Error} If an invalid event `name` is supplied, or if `callback` is not a function.
*/
addListener(name, callback) {}
/**
* Remove the listener `callback` for the specfied event `name`.
* @param {string} name - The event name.
* _Currently, only the "change" event supported_.
* @param {callback(Realm, string)} callback - Function that was previously added as a
* listener for this event through the {@link Realm#addListener addListener} method.
* @throws {Error} If an invalid event `name` is supplied, or if `callback` is not a function.
*/
removeListener(name, callback) {}
/**
* Remove all event listeners (restricted to the event `name`, if provided).
* @param {string} [name] - The name of the event whose listeners should be removed.
* _Currently, only the "change" event supported_.
* @throws {Error} When invalid event `name` is supplied
*/
removeAllListeners(name) {}
/**
* Synchronously call the provided `callback` inside a write transaction.
* @param {function()} callback
*/
write(callback) {}
/**
* Initiate a write transaction.
* @throws {Error} When already in write transaction
*/
beginTransaction() {}
/**
* Commit a write transaction.
*/
commitTransaction() {}
/**
* Cancel a write transaction.
*/
cancelTransaction() {}
/**
* Replaces all string columns in this Realm with a string enumeration column and compacts the
* database file.
*
* Cannot be called from a write transaction.
*
* Compaction will not occur if other `Realm` instances exist.
*
* While compaction is in progress, attempts by other threads or processes to open the database will
* wait.
*
* Be warned that resource requirements for compaction is proportional to the amount of live data in
* the database. Compaction works by writing the database contents to a temporary database file and
* then replacing the database with the temporary one.
* @returns {true} if compaction succeeds.
*/
compact() {}
/**
* If the Realm is a partially synchronized Realm, fetch and synchronize the objects
* of a given object type that match the given query (in string format).
*
* **Partial synchronization is a tech preview. Its APIs are subject to change.**
* @param {Realm~ObjectType} type - The type of Realm objects to retrieve.
* @param {string} query - Query used to filter objects.
* @return {Promise} - a promise that will be resolved with the Realm.Results instance when it's available.
*/
subscribeToObjects(className, query, callback) {}
}
/**
* Get the current schema version of the Realm at the given path.
* @param {string} path - The path to the file where the
* Realm database is stored.
* @param {ArrayBuffer|ArrayBufferView} [encryptionKey] - Required only when
* accessing encrypted Realms.
* @throws {Error} When passing an invalid or non-matching encryption key.
* @returns {number} version of the schema, or `-1` if no Realm exists at `path`.
*/
Realm.schemaVersion = function(path, encryptionKey) {};
/**
* Delete the Realm file for the given configuration.
* @param {Realm~Configuration} config
* @throws {Error} If anything in the provided `config` is invalid.
*/
Realm.deleteFile = function(config) {};
/**
* The default path where to create and access the Realm file.
* @type {string}
*/
Realm.defaultPath;
/**
* This describes the different options used to create a {@link Realm} instance.
* @typedef Realm~Configuration
* @type {Object}
* @property {ArrayBuffer|ArrayBufferView} [encryptionKey] - The 512-bit (64-byte) encryption
* key used to encrypt and decrypt all data in the Realm.
* @property {callback(Realm, Realm)} [migration] - The function to run if a migration is needed.
* This function should provide all the logic for converting data models from previous schemas
* to the new schema.
* This function takes two arguments:
* - `oldRealm` - The Realm before migration is performed.
* - `newRealm` - The Realm that uses the latest `schema`, which should be modified as necessary.
* @property {boolean} [deleteRealmIfMigrationNeeded=false] - Specifies if this Realm should be deleted
* if a migration is needed.
* @property {callback(number, number)} [shouldCompactOnLaunch] - The function called when opening
* a Realm for the first time during the life of a process to determine if it should be compacted
* before being returned to the user. The function takes two arguments:
* - `totalSize` - The total file size (data + free space)
* - `unusedSize` - The total bytes used by data in the file.
* It returns `true` to indicate that an attempt to compact the file should be made. The compaction
* will be skipped if another process is accessing it.
* @property {string} [path={@link Realm.defaultPath}] - The path to the file where the
* Realm database should be stored.
* @property {boolean} [inMemory=false] - Specifies if this Realm should be opened in-memory. This
* still requires a path (can be the default path) to identify the Realm so other processes can
* open the same Realm. The file will also be used as swap space if the Realm becomes bigger than
* what fits in memory, but it is not persistent and will be removed when the last instance
* is closed.
* @property {boolean} [readOnly=false] - Specifies if this Realm should be opened as read-only.
* @property {Array<Realm~ObjectClass|Realm~ObjectSchema>} [schema] - Specifies all the
* object types in this Realm. **Required** when first creating a Realm at this `path`.
* If omitted, the schema will be read from the existing Realm file.
* @property {number} [schemaVersion] - **Required** (and must be incremented) after
* changing the `schema`.
* @property {Object} [sync] - Sync configuration parameters with the following
* child properties:
* - `user` - A `User` object obtained by calling `Realm.Sync.User.login`
* - `url` - A `string` which contains a valid Realm Sync url
* - `error` - A callback function which is called in error situations.
* The `error` callback can take up to five optional arguments: `name`, `message`, `isFatal`,
* `category`, and `code`.
* - `validate_ssl` - Indicating if SSL certificates must be validated
* - `ssl_trust_certificate_path` - A path where to find trusted SSL certificates
* - `open_ssl_verify_callback` - A callback function used to accept or reject the server's
* SSL certificate. open_ssl_verify_callback is called with an object of type
* <code>
* {
* serverAddress: String,
* serverPort: Number,
* pemCertificate: String,
* acceptedByOpenSSL: Boolean,
* depth: Number
* }
* </code>
* The return value of open_ssl_verify_callback decides whether the certificate is accepted (true)
* or rejected (false). The open_ssl_verify_callback function is only respected on platforms where
* OpenSSL is used for the sync client, e.g. Linux. The open_ssl_verify_callback function is not
* allowed to throw exceptions. If the operations needed to verify the certificate lead to an exception,
* the exception must be caught explicitly before returning. The return value would typically be false
* in case of an exception.
*
* When the sync client has received the server's certificate chain, it presents every certificate in
* the chain to the open_ssl_verify_callback function. The depth argument specifies the position of the
* certificate in the chain. depth = 0 represents the actual server certificate. The root
* certificate has the highest depth. The certificate of highest depth will be presented first.
*
* acceptedByOpenSSL is true if OpenSSL has accepted the certificate, and false if OpenSSL has rejected it.
* It is generally safe to return true when acceptedByOpenSSL is true. If acceptedByOpenSSL is false, an
* independent verification should be made.
*
* One possible way of using the open_ssl_verify_callback function is to embed the known server certificate
* in the client and accept the presented certificate if and only if it is equal to the known certificate.
*
* The purpose of open_ssl_verify_callback is to enable custom certificate handling and to solve cases where
* OpenSSL erroneously rejects valid certificates possibly because OpenSSL doesn't have access to the
* proper trust certificates.
* - `partial` - Whether this Realm should be opened in 'partial synchronization' mode.
* Partial synchronisation only synchronizes those objects that match the query specified in contrast
* to the normal mode of operation that synchronises all objects in a remote Realm.
* **Partial synchronization is a tech preview. Its APIs are subject to change.**
*/
/**
* Realm objects will inherit methods, getters, and setters from the `prototype` of this
* constructor. It is **highly recommended** that this constructor inherit from
* {@link Realm.Object}.
* @typedef Realm~ObjectClass
* @type {Class}
* @property {Realm~ObjectSchema} schema - Static property specifying object schema information.
*/
/**
* @typedef Realm~ObjectSchema
* @type {Object}
* @property {string} name - Represents the object type.
* @property {string} [primaryKey] - The name of a `"string"` or `"int"` property
* that must be unique across all objects of this type within the same Realm.
* @property {Object<string, (Realm~PropertyType|Realm~ObjectSchemaProperty)>} properties -
* An object where the keys are property names and the values represent the property type.
*
* @example
* let MyClassSchema = {
* name: 'MyClass',
* primaryKey: 'pk',
* properties: {
* pk: 'int',
* optionalFloatValue: 'float?' // or {type: 'float', optional: true}
* listOfStrings: 'string[]',
* listOfOptionalDates: 'date?[]',
* indexedInt: {type: 'int', indexed: true}
*
* linkToObject: 'MyClass',
* listOfObjects: 'MyClass[]', // or {type: 'list', objectType: 'MyClass'}
* objectsLinkingToThisObject: {type: 'linkingObjects', objectType: 'MyClass', property: 'linkToObject'}
* }
* };
*/
/**
* @typedef Realm~ObjectSchemaProperty
* @type {Object}
* @property {Realm~PropertyType} type - The type of this property.
* @property {Realm~PropertyType} [objectType] - **Required** when `type` is `"list"` or `"linkingObjects"`,
* and must match the type of an object in the same schema, or, for `"list"`
* only, any other type which may be stored as a Realm property.
* @property {string} [property] - **Required** when `type` is `"linkingObjects"`, and must match
* the name of a property on the type specified in `objectType` that links to the type this property belongs to.
* @property {any} [default] - The default value for this property on creation when not
* otherwise specified.
* @property {boolean} [optional] - Signals if this property may be assigned `null` or `undefined`.
* For `"list"` properties of non-object types, this instead signals whether the values inside the list may be assigned `null` or `undefined`.
* This is not supported for `"list"` properties of object types and `"linkingObjects"` properties.
* @property {boolean} [indexed] - Signals if this property should be indexed. Only supported for
* `"string"`, `"int"`, and `"bool"` properties.
*/
/**
* The type of an object may either be specified as a string equal to the `name` in a
* {@link Realm~ObjectSchema ObjectSchema} definition, **or** a constructor that was specified
* in the {@link Realm~Configuration configuration} `schema`.
* @typedef Realm~ObjectType
* @type {string|Realm~ObjectClass}
*/
/**
* A property type may be specified as one of the standard builtin types, or as
* an object type inside the same schema.
*
* When specifying property types in an {@linkplain Realm~ObjectSchema object schema}, you
* may append `?` to any of the property types to indicate that it is optional
* (i.e. it can be `null` in addition to the normal values) and `[]` to
* indicate that it is instead a list of that type. For example,
* `optionalIntList: 'int?[]'` would declare a property which is a list of
* nullable integers. The property types reported by {@linkplain Realm.Collection
* collections} and in a Realm's schema will never
* use these forms.
*
* @typedef Realm~PropertyType
* @type {("bool"|"int"|"float"|"double"|"string"|"date"|"data"|"list"|"linkingObjects"|"<ObjectType>")}
*
* @property {boolean} "bool" - Property value may either be `true` or `false`.
* @property {number} "int" - Property may be assigned any number, but will be stored as a
* round integer, meaning anything after the decimal will be truncated.
* @property {number} "float" - Property may be assigned any number, but will be stored as a
* `float`, which may result in a loss of precision.
* @property {number} "double" - Property may be assigned any number, and will have no loss
* of precision.
* @property {string} "string" - Property value may be any arbitrary string.
* @property {Date} "date" - Property may be assigned any `Date` instance.
* @property {ArrayBuffer} "data" - Property may either be assigned an `ArrayBuffer`
* or `ArrayBufferView` (e.g. `DataView`, `Int8Array`, `Float32Array`, etc.) instance,
* but will always be returned as an `ArrayBuffer`.
* @property {Realm.List} "list" - Property may be assigned any ordered collection
* (e.g. `Array`, {@link Realm.List}, {@link Realm.Results}) of objects all matching the
* `objectType` specified in the {@link Realm~ObjectSchemaProperty ObjectSchemaProperty}.
* @property {Realm.Results} "linkingObjects" - Property is read-only and always returns a {@link Realm.Results}
* of all the objects matching the `objectType` that are linking to the current object
* through the `property` relationship specified in {@link Realm~ObjectSchemaProperty ObjectSchemaProperty}.
* @property {Realm.Object} "<ObjectType>" - A string that matches the `name` of an object in the
* same schema (see {@link Realm~ObjectSchema ObjectSchema}) – this property may be assigned
* any object of this type from inside the same Realm, and will always be _optional_
* (meaning it may also be assigned `null` or `undefined`).
*/
| 1 | 16,814 | `Indicates if this Realm has been closed.`? | realm-realm-js | js |
@@ -55,7 +55,6 @@ class _MissingPandasLikeSeries(object):
compress = unsupported_function('compress')
convert_objects = unsupported_function('convert_objects')
copy = unsupported_function('copy')
- corr = unsupported_function('corr')
cov = unsupported_function('cov')
cummax = unsupported_function('cummax')
cummin = unsupported_function('cummin') | 1 | #
# Copyright (C) 2019 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from databricks.koalas.missing import _unsupported_function
def unsupported_function(method_name):
return _unsupported_function(class_name='pd.Series', method_name=method_name)
class _MissingPandasLikeSeries(object):
add = unsupported_function('add')
add_prefix = unsupported_function('add_prefix')
add_suffix = unsupported_function('add_suffix')
agg = unsupported_function('agg')
aggregate = unsupported_function('aggregate')
align = unsupported_function('align')
all = unsupported_function('all')
any = unsupported_function('any')
append = unsupported_function('append')
apply = unsupported_function('apply')
argmax = unsupported_function('argmax')
argmin = unsupported_function('argmin')
argsort = unsupported_function('argsort')
as_blocks = unsupported_function('as_blocks')
as_matrix = unsupported_function('as_matrix')
asfreq = unsupported_function('asfreq')
asof = unsupported_function('asof')
at_time = unsupported_function('at_time')
autocorr = unsupported_function('autocorr')
between = unsupported_function('between')
between_time = unsupported_function('between_time')
bfill = unsupported_function('bfill')
bool = unsupported_function('bool')
clip = unsupported_function('clip')
clip_lower = unsupported_function('clip_lower')
clip_upper = unsupported_function('clip_upper')
combine = unsupported_function('combine')
combine_first = unsupported_function('combine_first')
compound = unsupported_function('compound')
compress = unsupported_function('compress')
convert_objects = unsupported_function('convert_objects')
copy = unsupported_function('copy')
corr = unsupported_function('corr')
cov = unsupported_function('cov')
cummax = unsupported_function('cummax')
cummin = unsupported_function('cummin')
cumprod = unsupported_function('cumprod')
cumsum = unsupported_function('cumsum')
describe = unsupported_function('describe')
diff = unsupported_function('diff')
div = unsupported_function('div')
divide = unsupported_function('divide')
divmod = unsupported_function('divmod')
dot = unsupported_function('dot')
drop = unsupported_function('drop')
drop_duplicates = unsupported_function('drop_duplicates')
droplevel = unsupported_function('droplevel')
duplicated = unsupported_function('duplicated')
eq = unsupported_function('eq')
equals = unsupported_function('equals')
ewm = unsupported_function('ewm')
expanding = unsupported_function('expanding')
factorize = unsupported_function('factorize')
ffill = unsupported_function('ffill')
fillna = unsupported_function('fillna')
filter = unsupported_function('filter')
first = unsupported_function('first')
first_valid_index = unsupported_function('first_valid_index')
floordiv = unsupported_function('floordiv')
ge = unsupported_function('ge')
get = unsupported_function('get')
get_dtype_counts = unsupported_function('get_dtype_counts')
get_ftype_counts = unsupported_function('get_ftype_counts')
get_value = unsupported_function('get_value')
get_values = unsupported_function('get_values')
groupby = unsupported_function('groupby')
gt = unsupported_function('gt')
hist = unsupported_function('hist')
idxmax = unsupported_function('idxmax')
idxmin = unsupported_function('idxmin')
infer_objects = unsupported_function('infer_objects')
interpolate = unsupported_function('interpolate')
isin = unsupported_function('isin')
item = unsupported_function('item')
items = unsupported_function('items')
iteritems = unsupported_function('iteritems')
keys = unsupported_function('keys')
last = unsupported_function('last')
last_valid_index = unsupported_function('last_valid_index')
le = unsupported_function('le')
lt = unsupported_function('lt')
mad = unsupported_function('mad')
map = unsupported_function('map')
mask = unsupported_function('mask')
median = unsupported_function('median')
memory_usage = unsupported_function('memory_usage')
mod = unsupported_function('mod')
mode = unsupported_function('mode')
mul = unsupported_function('mul')
multiply = unsupported_function('multiply')
ne = unsupported_function('ne')
nlargest = unsupported_function('nlargest')
nonzero = unsupported_function('nonzero')
nsmallest = unsupported_function('nsmallest')
nunique = unsupported_function('nunique')
pct_change = unsupported_function('pct_change')
pipe = unsupported_function('pipe')
pop = unsupported_function('pop')
pow = unsupported_function('pow')
prod = unsupported_function('prod')
product = unsupported_function('product')
ptp = unsupported_function('ptp')
put = unsupported_function('put')
quantile = unsupported_function('quantile')
radd = unsupported_function('radd')
rank = unsupported_function('rank')
ravel = unsupported_function('ravel')
rdiv = unsupported_function('rdiv')
rdivmod = unsupported_function('rdivmod')
reindex = unsupported_function('reindex')
reindex_axis = unsupported_function('reindex_axis')
reindex_like = unsupported_function('reindex_like')
rename_axis = unsupported_function('rename_axis')
reorder_levels = unsupported_function('reorder_levels')
repeat = unsupported_function('repeat')
replace = unsupported_function('replace')
resample = unsupported_function('resample')
rfloordiv = unsupported_function('rfloordiv')
rmod = unsupported_function('rmod')
rmul = unsupported_function('rmul')
rolling = unsupported_function('rolling')
round = unsupported_function('round')
rpow = unsupported_function('rpow')
rsub = unsupported_function('rsub')
rtruediv = unsupported_function('rtruediv')
sample = unsupported_function('sample')
searchsorted = unsupported_function('searchsorted')
select = unsupported_function('select')
sem = unsupported_function('sem')
set_axis = unsupported_function('set_axis')
set_value = unsupported_function('set_value')
shift = unsupported_function('shift')
slice_shift = unsupported_function('slice_shift')
sort_index = unsupported_function('sort_index')
sort_values = unsupported_function('sort_values')
squeeze = unsupported_function('squeeze')
sub = unsupported_function('sub')
subtract = unsupported_function('subtract')
swapaxes = unsupported_function('swapaxes')
swaplevel = unsupported_function('swaplevel')
tail = unsupported_function('tail')
take = unsupported_function('take')
to_clipboard = unsupported_function('to_clipboard')
to_csv = unsupported_function('to_csv')
to_dense = unsupported_function('to_dense')
to_dict = unsupported_function('to_dict')
to_excel = unsupported_function('to_excel')
to_frame = unsupported_function('to_frame')
to_hdf = unsupported_function('to_hdf')
to_json = unsupported_function('to_json')
to_latex = unsupported_function('to_latex')
to_list = unsupported_function('to_list')
to_msgpack = unsupported_function('to_msgpack')
to_numpy = unsupported_function('to_numpy')
to_period = unsupported_function('to_period')
to_pickle = unsupported_function('to_pickle')
to_sparse = unsupported_function('to_sparse')
to_sql = unsupported_function('to_sql')
to_string = unsupported_function('to_string')
to_timestamp = unsupported_function('to_timestamp')
to_xarray = unsupported_function('to_xarray')
tolist = unsupported_function('tolist')
transform = unsupported_function('transform')
transpose = unsupported_function('transpose')
truediv = unsupported_function('truediv')
truncate = unsupported_function('truncate')
tshift = unsupported_function('tshift')
tz_convert = unsupported_function('tz_convert')
tz_localize = unsupported_function('tz_localize')
unstack = unsupported_function('unstack')
update = unsupported_function('update')
valid = unsupported_function('valid')
view = unsupported_function('view')
where = unsupported_function('where')
xs = unsupported_function('xs')
| 1 | 8,500 | how is this change adding corr to Series? Do all the methods that are added to Frame automatically get added to Series? | databricks-koalas | py |
@@ -168,11 +168,11 @@ func (syncer *DefaultSyncer) tipSetState(ctx context.Context, tsKey types.Sorted
if !syncer.chainStore.HasTipSetAndState(ctx, tsKey.String()) {
return nil, errors.Wrap(ErrUnexpectedStoreState, "parent tipset must be in the store")
}
- tsas, err := syncer.chainStore.GetTipSetAndState(tsKey)
+ tssr, err := syncer.chainStore.GetTipSetStateRoot(tsKey)
if err != nil {
return nil, err
}
- st, err := state.LoadStateTree(ctx, syncer.stateStore, tsas.TipSetStateRoot, builtin.Actors)
+ st, err := state.LoadStateTree(ctx, syncer.stateStore, tssr, builtin.Actors)
if err != nil {
return nil, err
} | 1 | package chain
import (
"context"
"sync"
"time"
"github.com/ipfs/go-cid"
"github.com/ipfs/go-hamt-ipld"
logging "github.com/ipfs/go-log"
"github.com/pkg/errors"
"go.opencensus.io/trace"
"github.com/filecoin-project/go-filecoin/actor/builtin"
"github.com/filecoin-project/go-filecoin/consensus"
"github.com/filecoin-project/go-filecoin/metrics/tracing"
"github.com/filecoin-project/go-filecoin/sampling"
"github.com/filecoin-project/go-filecoin/state"
"github.com/filecoin-project/go-filecoin/types"
)
// The amount of time the syncer will wait while fetching the blocks of a
// tipset over the network.
var blkWaitTime = 30 * time.Second
var (
// ErrChainHasBadTipSet is returned when the syncer traverses a chain with a cached bad tipset.
ErrChainHasBadTipSet = errors.New("input chain contains a cached bad tipset")
// ErrNewChainTooLong is returned when processing a fork that split off from the main chain too many blocks ago.
ErrNewChainTooLong = errors.New("input chain forked from best chain too far in the past")
// ErrUnexpectedStoreState indicates that the syncer's chain store is violating expected invariants.
ErrUnexpectedStoreState = errors.New("the chain store is in an unexpected state")
)
var logSyncer = logging.Logger("chain.syncer")
type syncFetcher interface {
GetBlocks(context.Context, []cid.Cid) ([]*types.Block, error)
}
// DefaultSyncer updates its chain.Store according to the methods of its
// consensus.Protocol. It uses a bad tipset cache and a limit on new
// blocks to traverse during chain collection. The DefaultSyncer can query the
// network for blocks. The DefaultSyncer maintains the following invariant on
// its store: all tipsets that pass the syncer's validity checks are added to the
// chain store, and their state is added to stateStore.
//
// Ideally the code that syncs the chain according to consensus rules should
// be independent of any particular implementation of consensus. Currently the
// DefaultSyncer is coupled to details of Expected Consensus. This dependence
// exists in the widen function, the fact that widen is called on only one
// tipset in the incoming chain, and assumptions regarding the existence of
// grandparent state in the store.
type DefaultSyncer struct {
// This mutex ensures at most one call to HandleNewTipset executes at
// any time. This is important because at least two sections of the
// code otherwise have races:
// 1. syncOne assumes that chainStore.Head() does not change when
// comparing tipset weights and updating the store
// 2. HandleNewTipset assumes that calls to widen and then syncOne
// are not run concurrently with other calls to widen to ensure
// that the syncer always finds the heaviest existing tipset.
mu sync.Mutex
// fetcher is the networked block fetching service for fetching blocks
// and messages.
fetcher syncFetcher
// stateStore is the cborStore used for reading and writing state root
// to ipld object mappings.
stateStore *hamt.CborIpldStore
// badTipSetCache is used to filter out collections of invalid blocks.
badTipSets *badTipSetCache
consensus consensus.Protocol
chainStore Store
}
var _ Syncer = (*DefaultSyncer)(nil)
// NewDefaultSyncer constructs a DefaultSyncer ready for use.
func NewDefaultSyncer(cst *hamt.CborIpldStore, c consensus.Protocol, s Store, f syncFetcher) *DefaultSyncer {
return &DefaultSyncer{
fetcher: f,
stateStore: cst,
badTipSets: &badTipSetCache{
bad: make(map[string]struct{}),
},
consensus: c,
chainStore: s,
}
}
// getBlksMaybeFromNet resolves cids of blocks. It gets blocks through the
// fetcher. The fetcher wraps a bitswap session which wraps a bitswap exchange,
// and the bitswap exchange wraps the node's shared blockstore. So if blocks
// are available in the node's blockstore they will be resolved locally, and
// otherwise resolved over the network. This method will timeout if blocks
// are unavailable. This method is all or nothing, it will error if any of the
// blocks cannot be resolved.
func (syncer *DefaultSyncer) getBlksMaybeFromNet(ctx context.Context, blkCids []cid.Cid) ([]*types.Block, error) {
ctx, cancel := context.WithTimeout(ctx, blkWaitTime)
defer cancel()
return syncer.fetcher.GetBlocks(ctx, blkCids)
}
// collectChain resolves the cids of the head tipset and its ancestors to
// blocks until it resolves a tipset with a parent contained in the Store. It
// returns the chain of new incompletely validated tipsets and the id of the
// parent tipset already synced into the store. collectChain resolves cids
// from the syncer's fetcher. In production the fetcher wraps a bitswap
// session. collectChain errors if any set of cids in the chain resolves to
// blocks that do not form a tipset, or if any tipset has already been recorded
// as the head of an invalid chain. collectChain is the entrypoint to the code
// that interacts with the network. It does NOT add tipsets to the chainStore..
func (syncer *DefaultSyncer) collectChain(ctx context.Context, tipsetCids types.SortedCidSet) (ts []types.TipSet, err error) {
ctx, span := trace.StartSpan(ctx, "DefaultSyncer.collectChain")
span.AddAttributes(trace.StringAttribute("tipset", tipsetCids.String()))
defer tracing.AddErrorEndSpan(ctx, span, &err)
var chain []types.TipSet
var count uint64
fetchedHead := tipsetCids
defer logSyncer.Infof("chain fetch from network complete %v", fetchedHead)
for {
var blks []*types.Block
// check the cache for bad tipsets before doing anything
tsKey := tipsetCids.String()
// Finish traversal if the tipset made is tracked in the store.
if syncer.chainStore.HasTipSetAndState(ctx, tsKey) {
return chain, nil
}
logSyncer.Debugf("CollectChain next link: %s", tsKey)
if syncer.badTipSets.Has(tsKey) {
return nil, ErrChainHasBadTipSet
}
blks, err := syncer.getBlksMaybeFromNet(ctx, tipsetCids.ToSlice())
if err != nil {
return nil, err
}
ts, err := syncer.consensus.NewValidTipSet(ctx, blks)
if err != nil {
syncer.badTipSets.Add(tsKey)
syncer.badTipSets.AddChain(chain)
return nil, err
}
count++
if count%500 == 0 {
logSyncer.Infof("fetching the chain, %d blocks fetched", count)
}
// Update values to traverse next tipset
chain = append([]types.TipSet{ts}, chain...)
tipsetCids, err = ts.Parents()
if err != nil {
return nil, err
}
}
}
// tipSetState returns the state resulting from applying the input tipset to
// the chain. Precondition: the tipset must be in the store
func (syncer *DefaultSyncer) tipSetState(ctx context.Context, tsKey types.SortedCidSet) (state.Tree, error) {
if !syncer.chainStore.HasTipSetAndState(ctx, tsKey.String()) {
return nil, errors.Wrap(ErrUnexpectedStoreState, "parent tipset must be in the store")
}
tsas, err := syncer.chainStore.GetTipSetAndState(tsKey)
if err != nil {
return nil, err
}
st, err := state.LoadStateTree(ctx, syncer.stateStore, tsas.TipSetStateRoot, builtin.Actors)
if err != nil {
return nil, err
}
return st, nil
}
// syncOne syncs a single tipset with the chain store. syncOne calculates the
// parent state of the tipset and calls into consensus to run a state transition
// in order to validate the tipset. In the case the input tipset is valid,
// syncOne calls into consensus to check its weight, and then updates the head
// of the store if this tipset is the heaviest.
//
// Precondition: the caller of syncOne must hold the syncer's lock (syncer.mu) to
// ensure head is not modified by another goroutine during run.
func (syncer *DefaultSyncer) syncOne(ctx context.Context, parent, next types.TipSet) error {
head := syncer.chainStore.GetHead()
// if tipset is already head, we've been here before. do nothing.
if head.Equals(next.ToSortedCidSet()) {
return nil
}
// Lookup parent state. It is guaranteed by the syncer that it is in
// the chainStore.
st, err := syncer.tipSetState(ctx, parent.ToSortedCidSet())
if err != nil {
return err
}
// Gather ancestor chain needed to process state transition.
h, err := next.Height()
if err != nil {
return err
}
newBlockHeight := types.NewBlockHeight(h)
ancestorHeight := types.NewBlockHeight(consensus.AncestorRoundsNeeded)
ancestors, err := GetRecentAncestors(ctx, parent, syncer.chainStore, newBlockHeight, ancestorHeight, sampling.LookbackParameter)
if err != nil {
return err
}
// Run a state transition to validate the tipset and compute
// a new state to add to the store.
st, err = syncer.consensus.RunStateTransition(ctx, next, ancestors, st)
if err != nil {
return err
}
root, err := st.Flush(ctx)
if err != nil {
return err
}
err = syncer.chainStore.PutTipSetAndState(ctx, &TipSetAndState{
TipSet: next,
TipSetStateRoot: root,
})
if err != nil {
return err
}
logSyncer.Debugf("Successfully updated store with %s", next.String())
// TipSet is validated and added to store, now check if it is the heaviest.
// If it is the heaviest update the chainStore.
nextParentSt, err := syncer.tipSetState(ctx, parent.ToSortedCidSet()) // call again to get a copy
if err != nil {
return err
}
headTipSetAndState, err := syncer.chainStore.GetTipSetAndState(head)
if err != nil {
return err
}
headParentCids, err := headTipSetAndState.TipSet.Parents()
if err != nil {
return err
}
var headParentSt state.Tree
if headParentCids.Len() != 0 { // head is not genesis
headParentSt, err = syncer.tipSetState(ctx, headParentCids)
if err != nil {
return err
}
}
heavier, err := syncer.consensus.IsHeavier(ctx, next, headTipSetAndState.TipSet, nextParentSt, headParentSt)
if err != nil {
return err
}
if heavier {
// Gather the entire new chain for reorg comparison.
// See Issue #2151 for making this scalable.
iterator := IterAncestors(ctx, syncer.chainStore, parent)
newChain, err := CollectTipSetsOfHeightAtLeast(ctx, iterator, types.NewBlockHeight(uint64(0)))
if err != nil {
return err
}
newChain = append(newChain, next)
if IsReorg(headTipSetAndState.TipSet, newChain) {
logSyncer.Infof("reorg occurring while switching from %s to %s", headTipSetAndState.TipSet.String(), next.String())
}
if err = syncer.chainStore.SetHead(ctx, next); err != nil {
return err
}
}
return nil
}
// widen computes a tipset implied by the input tipset and the store that
// could potentially be the heaviest tipset. In the context of EC, widen
// returns the union of the input tipset and the biggest tipset with the same
// parents from the store.
// TODO: this leaks EC abstractions into the syncer, we should think about this.
func (syncer *DefaultSyncer) widen(ctx context.Context, ts types.TipSet) (types.TipSet, error) {
// Lookup tipsets with the same parents from the store.
parentSet, err := ts.Parents()
if err != nil {
return nil, err
}
height, err := ts.Height()
if err != nil {
return nil, err
}
if !syncer.chainStore.HasTipSetAndStatesWithParentsAndHeight(parentSet.String(), height) {
return nil, nil
}
candidates, err := syncer.chainStore.GetTipSetAndStatesByParentsAndHeight(parentSet.String(), height)
if err != nil {
return nil, err
}
if len(candidates) == 0 {
return nil, nil
}
// Only take the tipset with the most blocks (this is EC specific logic)
max := candidates[0]
for _, candidate := range candidates[0:] {
if len(candidate.TipSet) > len(max.TipSet) {
max = candidate
}
}
// Add blocks of the biggest tipset in the store to a copy of ts
wts := ts.Clone()
for _, blk := range max.TipSet {
if err = wts.AddBlock(blk); err != nil {
return nil, err
}
}
// check that the tipset is distinct from the input and tipsets from the store.
if wts.String() == ts.String() || wts.String() == max.TipSet.String() {
return nil, nil
}
return wts, nil
}
// HandleNewTipset extends the Syncer's chain store with the given tipset if they
// represent a valid extension. It limits the length of new chains it will
// attempt to validate and caches invalid blocks it has encountered to
// help prevent DOS.
func (syncer *DefaultSyncer) HandleNewTipset(ctx context.Context, tipsetCids types.SortedCidSet) (err error) {
logSyncer.Debugf("Begin fetch and sync of chain with head %v", tipsetCids)
ctx, span := trace.StartSpan(ctx, "DefaultSyncer.HandleNewTipset")
span.AddAttributes(trace.StringAttribute("tipset", tipsetCids.String()))
defer tracing.AddErrorEndSpan(ctx, span, &err)
// This lock could last a long time as we fetch all the blocks needed to block the chain.
// This is justified because the app is pretty useless until it is synced.
// It's better for multiple calls to wait here than to try to fetch the chain independently.
syncer.mu.Lock()
defer syncer.mu.Unlock()
// If the store already has all these blocks the syncer is finished.
if syncer.chainStore.HasAllBlocks(ctx, tipsetCids.ToSlice()) {
return nil
}
// Walk the chain given by the input blocks back to a known tipset in
// the store. This is the only code that may go to the network to
// resolve cids to blocks.
chain, err := syncer.collectChain(ctx, tipsetCids)
if err != nil {
return err
}
parentCids, err := chain[0].Parents()
if err != nil {
return err
}
parentTsas, err := syncer.chainStore.GetTipSetAndState(parentCids)
if err != nil {
return err
}
parent := parentTsas.TipSet
// Try adding the tipsets of the chain to the store, checking for new
// heaviest tipsets.
for i, ts := range chain {
// TODO: this "i==0" leaks EC specifics into syncer abstraction
// for the sake of efficiency, consider plugging up this leak.
if i == 0 {
wts, err := syncer.widen(ctx, ts)
if err != nil {
return err
}
if wts != nil {
logSyncer.Debug("attempt to sync after widen")
err = syncer.syncOne(ctx, parent, wts)
if err != nil {
return err
}
}
}
if err = syncer.syncOne(ctx, parent, ts); err != nil {
// While `syncOne` can indeed fail for reasons other than consensus,
// adding to the badTipSets at this point is the simplest, since we
// have access to the chain. If syncOne fails for non-consensus reasons,
// there is no assumption that the running node's data is valid at all,
// so we don't really lose anything with this simplification.
syncer.badTipSets.AddChain(chain[i:])
return err
}
if i%500 == 0 {
logSyncer.Infof("processing block %d of %v for chain with head at %v", i, len(chain), tipsetCids.String())
}
parent = ts
}
return nil
}
| 1 | 19,124 | Just a heads up for anyone else reviewing this, this logic and all the repetitions of it should be greatly simplified by subsequent work relating to issue #2552. | filecoin-project-venus | go |
@@ -11,11 +11,15 @@ using MicroBenchmarks;
namespace System.Collections
{
[BenchmarkCategory(Categories.CoreCLR, Categories.Collections, Categories.GenericCollections)]
- [GenericTypeArguments(typeof(int))] // value type
- [GenericTypeArguments(typeof(string))] // reference type
+ [GenericTypeArguments(typeof(int))] // value type, Array sort in native code
+ [GenericTypeArguments(typeof(IntStruct))] // custom value type, sort in managed code
+ [GenericTypeArguments(typeof(IntClass))] // custom reference type, sort in managed code, compare fast
+ [GenericTypeArguments(typeof(BigStruct))] // custom value type, sort in managed code
+ [GenericTypeArguments(typeof(string))] // reference type, compare slow
[InvocationCount(InvocationsPerIteration)]
- public class Sort<T>
+ public class Sort<T> where T : IComparable<T>
{
+ static readonly ComparableComparerClass _comparableComparerClass = new ComparableComparerClass();
private const int InvocationsPerIteration = 1000;
[Params(Utils.DefaultCollectionSize)] | 1 | // Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Extensions;
using MicroBenchmarks;
namespace System.Collections
{
[BenchmarkCategory(Categories.CoreCLR, Categories.Collections, Categories.GenericCollections)]
[GenericTypeArguments(typeof(int))] // value type
[GenericTypeArguments(typeof(string))] // reference type
[InvocationCount(InvocationsPerIteration)]
public class Sort<T>
{
private const int InvocationsPerIteration = 1000;
[Params(Utils.DefaultCollectionSize)]
public int Size;
private int _iterationIndex = 0;
private T[] _values;
private T[][] _arrays;
private List<T>[] _lists;
[GlobalSetup]
public void Setup() => _values = ValuesGenerator.ArrayOfUniqueValues<T>(Size);
[IterationCleanup]
public void CleanupIteration() => _iterationIndex = 0; // after every iteration end we set the index to 0
[IterationSetup(Target = nameof(Array))]
public void SetupArrayIteration() => Utils.FillArrays(ref _arrays, InvocationsPerIteration, _values);
[Benchmark]
public void Array() => System.Array.Sort(_arrays[_iterationIndex++], 0, Size);
[IterationSetup(Target = nameof(List))]
public void SetupListIteration() => Utils.FillCollections(ref _lists, InvocationsPerIteration, _values);
[Benchmark]
public void List() => _lists[_iterationIndex++].Sort();
[BenchmarkCategory(Categories.LINQ)]
[Benchmark]
public int LinqQuery()
{
int count = 0;
foreach (var _ in (from value in _values orderby value ascending select value))
count++;
return count;
}
[BenchmarkCategory(Categories.LINQ)]
[Benchmark]
public int LinqOrderByExtension()
{
int count = 0;
foreach (var _ in _values.OrderBy(value => value)) // we can't use .Count here because it has been optimized for icollection.OrderBy().Count()
count++;
return count;
}
}
} | 1 | 9,044 | @billwert I have kept the `1000` InvocationsPerIteration, but do note this is very small for the small types. | dotnet-performance | .cs |
@@ -31,7 +31,6 @@ from qutebrowser.config import config
class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
-
"""The commandline part of the statusbar.
Attributes: | 1 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <[email protected]>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# qutebrowser is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with qutebrowser. If not, see <http://www.gnu.org/licenses/>.
"""The commandline in the statusbar."""
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QSize
from PyQt5.QtWidgets import QSizePolicy
from qutebrowser.keyinput import modeman, modeparsers
from qutebrowser.commands import cmdexc, cmdutils
from qutebrowser.misc import cmdhistory, editor
from qutebrowser.misc import miscwidgets as misc
from qutebrowser.utils import usertypes, log, objreg, message, utils
from qutebrowser.config import config
class Command(misc.MinimalLineEditMixin, misc.CommandLineEdit):
"""The commandline part of the statusbar.
Attributes:
_win_id: The window ID this widget is associated with.
Signals:
got_cmd: Emitted when a command is triggered by the user.
arg: The command string and also potentially the count.
clear_completion_selection: Emitted before the completion widget is
hidden.
hide_completion: Emitted when the completion widget should be hidden.
update_completion: Emitted when the completion should be shown/updated.
show_cmd: Emitted when command input should be shown.
hide_cmd: Emitted when command input can be hidden.
"""
got_cmd = pyqtSignal([str], [str, int])
clear_completion_selection = pyqtSignal()
hide_completion = pyqtSignal()
update_completion = pyqtSignal()
show_cmd = pyqtSignal()
hide_cmd = pyqtSignal()
def __init__(self, *, win_id, private, parent=None):
misc.CommandLineEdit.__init__(self, parent=parent)
misc.MinimalLineEditMixin.__init__(self)
self._win_id = win_id
if not private:
command_history = objreg.get('command-history')
self.history.history = command_history.data
self.history.changed.connect(command_history.changed)
self.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.Ignored)
self.cursorPositionChanged.connect(self.update_completion)
self.textChanged.connect(self.update_completion)
self.textChanged.connect(self.updateGeometry)
self.textChanged.connect(self._incremental_search)
def prefix(self):
"""Get the currently entered command prefix."""
text = self.text()
if not text:
return ''
elif text[0] in modeparsers.STARTCHARS:
return text[0]
else:
return ''
def set_cmd_text(self, text):
"""Preset the statusbar to some text.
Args:
text: The text to set as string.
"""
self.setText(text)
log.modes.debug("Setting command text, focusing {!r}".format(self))
modeman.enter(self._win_id, usertypes.KeyMode.command, 'cmd focus')
self.setFocus()
self.show_cmd.emit()
@cmdutils.register(instance='status-command', name='set-cmd-text',
scope='window', maxsplit=0)
@cmdutils.argument('count', count=True)
def set_cmd_text_command(self, text, count=None, space=False, append=False,
run_on_count=False):
"""Preset the statusbar to some text.
//
Wrapper for set_cmd_text to check the arguments and allow multiple
strings which will get joined.
Args:
text: The commandline to set.
count: The count if given.
space: If given, a space is added to the end.
append: If given, the text is appended to the current text.
run_on_count: If given with a count, the command is run with the
given count rather than setting the command text.
"""
if space:
text += ' '
if append:
if not self.text():
raise cmdexc.CommandError("No current text!")
text = self.text() + text
if not text or text[0] not in modeparsers.STARTCHARS:
raise cmdexc.CommandError(
"Invalid command text '{}'.".format(text))
if run_on_count and count is not None:
self.got_cmd[str, int].emit(text, count)
else:
self.set_cmd_text(text)
@cmdutils.register(instance='status-command',
modes=[usertypes.KeyMode.command], scope='window')
def command_history_prev(self):
"""Go back in the commandline history."""
try:
if not self.history.is_browsing():
item = self.history.start(self.text().strip())
else:
item = self.history.previtem()
except (cmdhistory.HistoryEmptyError,
cmdhistory.HistoryEndReachedError):
return
if item:
self.set_cmd_text(item)
@cmdutils.register(instance='status-command',
modes=[usertypes.KeyMode.command], scope='window')
def command_history_next(self):
"""Go forward in the commandline history."""
if not self.history.is_browsing():
return
try:
item = self.history.nextitem()
except cmdhistory.HistoryEndReachedError:
return
if item:
self.set_cmd_text(item)
@cmdutils.register(instance='status-command',
modes=[usertypes.KeyMode.command], scope='window')
def command_accept(self, rapid=False):
"""Execute the command currently in the commandline.
Args:
rapid: Run the command without closing or clearing the command bar.
"""
prefixes = {
':': '',
'/': 'search -- ',
'?': 'search -r -- ',
}
text = self.text()
self.history.append(text)
if not rapid:
modeman.leave(self._win_id, usertypes.KeyMode.command,
'cmd accept')
self.got_cmd[str].emit(prefixes[text[0]] + text[1:])
@cmdutils.register(instance='status-command', scope='window')
def edit_command(self, run=False):
"""Open an editor to modify the current command.
Args:
run: Run the command if the editor exits successfully.
"""
ed = editor.ExternalEditor(parent=self)
def callback(text):
"""Set the commandline to the edited text."""
if not text or text[0] not in modeparsers.STARTCHARS:
message.error('command must start with one of {}'
.format(modeparsers.STARTCHARS))
return
self.set_cmd_text(text)
if run:
self.command_accept()
ed.editing_finished.connect(callback)
ed.edit(self.text())
@pyqtSlot(usertypes.KeyMode)
def on_mode_left(self, mode):
"""Clear up when command mode was left.
- Clear the statusbar text if it's explicitly unfocused.
- Clear completion selection
- Hide completion
Args:
mode: The mode which was left.
"""
if mode == usertypes.KeyMode.command:
self.setText('')
self.history.stop()
self.hide_cmd.emit()
self.clear_completion_selection.emit()
self.hide_completion.emit()
def setText(self, text):
"""Extend setText to set prefix and make sure the prompt is ok."""
if not text:
pass
elif text[0] in modeparsers.STARTCHARS:
super().set_prompt(text[0])
else:
raise utils.Unreachable("setText got called with invalid text "
"'{}'!".format(text))
super().setText(text)
def keyPressEvent(self, e):
"""Override keyPressEvent to ignore Return key presses.
If this widget is focused, we are in passthrough key mode, and
Enter/Shift+Enter/etc. will cause QLineEdit to think it's finished
without command_accept to be called.
"""
if e.key() == Qt.Key_Return:
e.ignore()
return
else:
super().keyPressEvent(e)
def sizeHint(self):
"""Dynamically calculate the needed size."""
height = super().sizeHint().height()
text = self.text()
if not text:
text = 'x'
width = self.fontMetrics().width(text)
return QSize(width, height)
@pyqtSlot(str)
def _incremental_search(self, text):
if not config.val.search.incremental:
return
search_prefixes = {
'/': 'search -- ',
'?': 'search -r -- ',
}
if self.prefix() in ['/', '?']:
self.got_cmd[str].emit(search_prefixes[text[0]] + text[1:])
| 1 | 20,413 | Unrelated whitespace change. | qutebrowser-qutebrowser | py |
@@ -133,8 +133,18 @@ bool rai::wallet_store::valid_password (MDB_txn * transaction_a)
return ok;
}
-bool rai::wallet_store::attempt_password (MDB_txn * transaction_a, std::string const & password_a)
+bool rai::wallet_store::attempt_password (rai::transaction * transaction_p, std::string const & password_a)
{
+ std::unique_ptr<rai::transaction> writeTransaction;
+
+ if (!transaction_p->open_for_write)
+ {
+ writeTransaction = std::make_unique<rai::transaction> (environment, nullptr, true);
+ transaction_p = writeTransaction.get ();
+ }
+
+ MDB_txn *transaction_a = *transaction_p;
+
bool result = false;
{
std::lock_guard<std::recursive_mutex> lock (mutex); | 1 | #include <rai/node/wallet.hpp>
#include <rai/lib/interface.h>
#include <rai/node/node.hpp>
#include <rai/node/xorshift.hpp>
#include <argon2.h>
#include <boost/filesystem.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <future>
#include <ed25519-donna/ed25519.h>
rai::uint256_union rai::wallet_store::check (MDB_txn * transaction_a)
{
rai::wallet_value value (entry_get_raw (transaction_a, rai::wallet_store::check_special));
return value.key;
}
rai::uint256_union rai::wallet_store::salt (MDB_txn * transaction_a)
{
rai::wallet_value value (entry_get_raw (transaction_a, rai::wallet_store::salt_special));
return value.key;
}
void rai::wallet_store::wallet_key (rai::raw_key & prv_a, MDB_txn * transaction_a)
{
std::lock_guard<std::recursive_mutex> lock (mutex);
rai::raw_key wallet_l;
wallet_key_mem.value (wallet_l);
rai::raw_key password_l;
password.value (password_l);
prv_a.decrypt (wallet_l.data, password_l, salt (transaction_a).owords[0]);
}
void rai::wallet_store::seed (rai::raw_key & prv_a, MDB_txn * transaction_a)
{
rai::wallet_value value (entry_get_raw (transaction_a, rai::wallet_store::seed_special));
rai::raw_key password_l;
wallet_key (password_l, transaction_a);
prv_a.decrypt (value.key, password_l, salt (transaction_a).owords[seed_iv_index]);
}
void rai::wallet_store::seed_set (MDB_txn * transaction_a, rai::raw_key const & prv_a)
{
rai::raw_key password_l;
wallet_key (password_l, transaction_a);
rai::uint256_union ciphertext;
ciphertext.encrypt (prv_a, password_l, salt (transaction_a).owords[seed_iv_index]);
entry_put_raw (transaction_a, rai::wallet_store::seed_special, rai::wallet_value (ciphertext, 0));
deterministic_clear (transaction_a);
}
rai::public_key rai::wallet_store::deterministic_insert (MDB_txn * transaction_a)
{
auto index (deterministic_index_get (transaction_a));
rai::raw_key prv;
deterministic_key (prv, transaction_a, index);
rai::public_key result;
ed25519_publickey (prv.data.bytes.data (), result.bytes.data ());
while (exists (transaction_a, result))
{
++index;
deterministic_key (prv, transaction_a, index);
ed25519_publickey (prv.data.bytes.data (), result.bytes.data ());
}
uint64_t marker (1);
marker <<= 32;
marker |= index;
entry_put_raw (transaction_a, result, rai::wallet_value (rai::uint256_union (marker), 0));
++index;
deterministic_index_set (transaction_a, index);
return result;
}
void rai::wallet_store::deterministic_key (rai::raw_key & prv_a, MDB_txn * transaction_a, uint32_t index_a)
{
assert (valid_password (transaction_a));
rai::raw_key seed_l;
seed (seed_l, transaction_a);
rai::deterministic_key (seed_l.data, index_a, prv_a.data);
}
uint32_t rai::wallet_store::deterministic_index_get (MDB_txn * transaction_a)
{
rai::wallet_value value (entry_get_raw (transaction_a, rai::wallet_store::deterministic_index_special));
return static_cast<uint32_t> (value.key.number () & static_cast<uint32_t> (-1));
}
void rai::wallet_store::deterministic_index_set (MDB_txn * transaction_a, uint32_t index_a)
{
rai::uint256_union index_l (index_a);
rai::wallet_value value (index_l, 0);
entry_put_raw (transaction_a, rai::wallet_store::deterministic_index_special, value);
}
void rai::wallet_store::deterministic_clear (MDB_txn * transaction_a)
{
rai::uint256_union key (0);
for (auto i (begin (transaction_a)), n (end ()); i != n;)
{
switch (key_type (rai::wallet_value (i->second)))
{
case rai::key_type::deterministic:
{
rai::uint256_union key (i->first.uint256 ());
erase (transaction_a, key);
i = begin (transaction_a, key);
break;
}
default:
{
++i;
break;
}
}
}
deterministic_index_set (transaction_a, 0);
}
bool rai::wallet_store::valid_password (MDB_txn * transaction_a)
{
rai::raw_key zero;
zero.data.clear ();
rai::raw_key wallet_key_l;
wallet_key (wallet_key_l, transaction_a);
rai::uint256_union check_l;
check_l.encrypt (zero, wallet_key_l, salt (transaction_a).owords[check_iv_index]);
bool ok = check (transaction_a) == check_l;
return ok;
}
bool rai::wallet_store::attempt_password (MDB_txn * transaction_a, std::string const & password_a)
{
bool result = false;
{
std::lock_guard<std::recursive_mutex> lock (mutex);
rai::raw_key password_l;
derive_key (password_l, transaction_a, password_a);
password.value_set (password_l);
result = !valid_password (transaction_a);
}
if (!result)
{
switch (version (transaction_a))
{
case version_1:
upgrade_v1_v2 ();
case version_2:
upgrade_v2_v3 ();
case version_3:
upgrade_v3_v4 ();
case version_4:
break;
default:
assert (false);
}
}
return result;
}
bool rai::wallet_store::rekey (MDB_txn * transaction_a, std::string const & password_a)
{
std::lock_guard<std::recursive_mutex> lock (mutex);
bool result (false);
if (valid_password (transaction_a))
{
rai::raw_key password_new;
derive_key (password_new, transaction_a, password_a);
rai::raw_key wallet_key_l;
wallet_key (wallet_key_l, transaction_a);
rai::raw_key password_l;
password.value (password_l);
password.value_set (password_new);
rai::uint256_union encrypted;
encrypted.encrypt (wallet_key_l, password_new, salt (transaction_a).owords[0]);
rai::raw_key wallet_enc;
wallet_enc.data = encrypted;
wallet_key_mem.value_set (wallet_enc);
entry_put_raw (transaction_a, rai::wallet_store::wallet_key_special, rai::wallet_value (encrypted, 0));
}
else
{
result = true;
}
return result;
}
void rai::wallet_store::derive_key (rai::raw_key & prv_a, MDB_txn * transaction_a, std::string const & password_a)
{
auto salt_l (salt (transaction_a));
kdf.phs (prv_a, password_a, salt_l);
}
rai::fan::fan (rai::uint256_union const & key, size_t count_a)
{
std::unique_ptr<rai::uint256_union> first (new rai::uint256_union (key));
for (auto i (1); i < count_a; ++i)
{
std::unique_ptr<rai::uint256_union> entry (new rai::uint256_union);
random_pool.GenerateBlock (entry->bytes.data (), entry->bytes.size ());
*first ^= *entry;
values.push_back (std::move (entry));
}
values.push_back (std::move (first));
}
void rai::fan::value (rai::raw_key & prv_a)
{
std::lock_guard<std::mutex> lock (mutex);
value_get (prv_a);
}
void rai::fan::value_get (rai::raw_key & prv_a)
{
assert (!mutex.try_lock ());
prv_a.data.clear ();
for (auto & i : values)
{
prv_a.data ^= *i;
}
}
void rai::fan::value_set (rai::raw_key const & value_a)
{
std::lock_guard<std::mutex> lock (mutex);
rai::raw_key value_l;
value_get (value_l);
*(values[0]) ^= value_l.data;
*(values[0]) ^= value_a.data;
}
rai::wallet_value::wallet_value (rai::mdb_val const & val_a)
{
assert (val_a.size () == sizeof (*this));
std::copy (reinterpret_cast<uint8_t const *> (val_a.data ()), reinterpret_cast<uint8_t const *> (val_a.data ()) + sizeof (key), key.chars.begin ());
std::copy (reinterpret_cast<uint8_t const *> (val_a.data ()) + sizeof (key), reinterpret_cast<uint8_t const *> (val_a.data ()) + sizeof (key) + sizeof (work), reinterpret_cast<char *> (&work));
}
rai::wallet_value::wallet_value (rai::uint256_union const & key_a, uint64_t work_a) :
key (key_a),
work (work_a)
{
}
rai::mdb_val rai::wallet_value::val () const
{
static_assert (sizeof (*this) == sizeof (key) + sizeof (work), "Class not packed");
return rai::mdb_val (sizeof (*this), const_cast<rai::wallet_value *> (this));
}
// Wallet version number
rai::uint256_union const rai::wallet_store::version_special (0);
// Random number used to salt private key encryption
rai::uint256_union const rai::wallet_store::salt_special (1);
// Key used to encrypt wallet keys, encrypted itself by the user password
rai::uint256_union const rai::wallet_store::wallet_key_special (2);
// Check value used to see if password is valid
rai::uint256_union const rai::wallet_store::check_special (3);
// Representative account to be used if we open a new account
rai::uint256_union const rai::wallet_store::representative_special (4);
// Wallet seed for deterministic key generation
rai::uint256_union const rai::wallet_store::seed_special (5);
// Current key index for deterministic keys
rai::uint256_union const rai::wallet_store::deterministic_index_special (6);
int const rai::wallet_store::special_count (7);
size_t const rai::wallet_store::check_iv_index (0);
size_t const rai::wallet_store::seed_iv_index (1);
rai::wallet_store::wallet_store (bool & init_a, rai::kdf & kdf_a, rai::transaction & transaction_a, rai::account representative_a, unsigned fanout_a, std::string const & wallet_a, std::string const & json_a) :
password (0, fanout_a),
wallet_key_mem (0, fanout_a),
kdf (kdf_a),
environment (transaction_a.environment)
{
init_a = false;
initialize (transaction_a, init_a, wallet_a);
if (!init_a)
{
MDB_val junk;
assert (mdb_get (transaction_a, handle, rai::mdb_val (version_special), &junk) == MDB_NOTFOUND);
boost::property_tree::ptree wallet_l;
std::stringstream istream (json_a);
try
{
boost::property_tree::read_json (istream, wallet_l);
}
catch (...)
{
init_a = true;
}
for (auto i (wallet_l.begin ()), n (wallet_l.end ()); i != n; ++i)
{
rai::uint256_union key;
init_a = key.decode_hex (i->first);
if (!init_a)
{
rai::uint256_union value;
init_a = value.decode_hex (wallet_l.get<std::string> (i->first));
if (!init_a)
{
entry_put_raw (transaction_a, key, rai::wallet_value (value, 0));
}
else
{
init_a = true;
}
}
else
{
init_a = true;
}
}
init_a |= mdb_get (transaction_a, handle, rai::mdb_val (version_special), &junk) != 0;
init_a |= mdb_get (transaction_a, handle, rai::mdb_val (wallet_key_special), &junk) != 0;
init_a |= mdb_get (transaction_a, handle, rai::mdb_val (salt_special), &junk) != 0;
init_a |= mdb_get (transaction_a, handle, rai::mdb_val (check_special), &junk) != 0;
init_a |= mdb_get (transaction_a, handle, rai::mdb_val (representative_special), &junk) != 0;
rai::raw_key key;
key.data.clear ();
password.value_set (key);
key.data = entry_get_raw (transaction_a, rai::wallet_store::wallet_key_special).key;
wallet_key_mem.value_set (key);
}
}
rai::wallet_store::wallet_store (bool & init_a, rai::kdf & kdf_a, rai::transaction & transaction_a, rai::account representative_a, unsigned fanout_a, std::string const & wallet_a) :
password (0, fanout_a),
wallet_key_mem (0, fanout_a),
kdf (kdf_a),
environment (transaction_a.environment)
{
init_a = false;
initialize (transaction_a, init_a, wallet_a);
if (!init_a)
{
int version_status;
MDB_val version_value;
version_status = mdb_get (transaction_a, handle, rai::mdb_val (version_special), &version_value);
if (version_status == MDB_NOTFOUND)
{
version_put (transaction_a, version_current);
rai::uint256_union salt_l;
random_pool.GenerateBlock (salt_l.bytes.data (), salt_l.bytes.size ());
entry_put_raw (transaction_a, rai::wallet_store::salt_special, rai::wallet_value (salt_l, 0));
// Wallet key is a fixed random key that encrypts all entries
rai::raw_key wallet_key;
random_pool.GenerateBlock (wallet_key.data.bytes.data (), sizeof (wallet_key.data.bytes));
rai::raw_key password_l;
password_l.data.clear ();
password.value_set (password_l);
rai::raw_key zero;
zero.data.clear ();
// Wallet key is encrypted by the user's password
rai::uint256_union encrypted;
encrypted.encrypt (wallet_key, zero, salt_l.owords[0]);
entry_put_raw (transaction_a, rai::wallet_store::wallet_key_special, rai::wallet_value (encrypted, 0));
rai::raw_key wallet_key_enc;
wallet_key_enc.data = encrypted;
wallet_key_mem.value_set (wallet_key_enc);
rai::uint256_union check;
check.encrypt (zero, wallet_key, salt_l.owords[check_iv_index]);
entry_put_raw (transaction_a, rai::wallet_store::check_special, rai::wallet_value (check, 0));
entry_put_raw (transaction_a, rai::wallet_store::representative_special, rai::wallet_value (representative_a, 0));
rai::raw_key seed;
random_pool.GenerateBlock (seed.data.bytes.data (), seed.data.bytes.size ());
seed_set (transaction_a, seed);
entry_put_raw (transaction_a, rai::wallet_store::deterministic_index_special, rai::wallet_value (rai::uint256_union (0), 0));
}
}
rai::raw_key key;
key.data = entry_get_raw (transaction_a, rai::wallet_store::wallet_key_special).key;
wallet_key_mem.value_set (key);
}
std::vector<rai::account> rai::wallet_store::accounts (MDB_txn * transaction_a)
{
std::vector<rai::account> result;
for (auto i (begin (transaction_a)), n (end ()); i != n; ++i)
{
rai::account account (i->first.uint256 ());
result.push_back (account);
}
return result;
}
void rai::wallet_store::initialize (MDB_txn * transaction_a, bool & init_a, std::string const & path_a)
{
assert (strlen (path_a.c_str ()) == path_a.size ());
auto error (0);
error |= mdb_dbi_open (transaction_a, path_a.c_str (), MDB_CREATE, &handle);
init_a = error != 0;
}
bool rai::wallet_store::is_representative (MDB_txn * transaction_a)
{
return exists (transaction_a, representative (transaction_a));
}
void rai::wallet_store::representative_set (MDB_txn * transaction_a, rai::account const & representative_a)
{
entry_put_raw (transaction_a, rai::wallet_store::representative_special, rai::wallet_value (representative_a, 0));
}
rai::account rai::wallet_store::representative (MDB_txn * transaction_a)
{
rai::wallet_value value (entry_get_raw (transaction_a, rai::wallet_store::representative_special));
return value.key;
}
rai::public_key rai::wallet_store::insert_adhoc (MDB_txn * transaction_a, rai::raw_key const & prv)
{
assert (valid_password (transaction_a));
rai::public_key pub;
ed25519_publickey (prv.data.bytes.data (), pub.bytes.data ());
rai::raw_key password_l;
wallet_key (password_l, transaction_a);
rai::uint256_union ciphertext;
ciphertext.encrypt (prv, password_l, pub.owords[0].number ());
entry_put_raw (transaction_a, pub, rai::wallet_value (ciphertext, 0));
return pub;
}
void rai::wallet_store::insert_watch (MDB_txn * transaction_a, rai::public_key const & pub)
{
entry_put_raw (transaction_a, pub, rai::wallet_value (rai::uint256_union (0), 0));
}
void rai::wallet_store::erase (MDB_txn * transaction_a, rai::public_key const & pub)
{
auto status (mdb_del (transaction_a, handle, rai::mdb_val (pub), nullptr));
assert (status == 0);
}
rai::wallet_value rai::wallet_store::entry_get_raw (MDB_txn * transaction_a, rai::public_key const & pub_a)
{
rai::wallet_value result;
rai::mdb_val value;
auto status (mdb_get (transaction_a, handle, rai::mdb_val (pub_a), value));
if (status == 0)
{
result = rai::wallet_value (value);
}
else
{
result.key.clear ();
result.work = 0;
}
return result;
}
void rai::wallet_store::entry_put_raw (MDB_txn * transaction_a, rai::public_key const & pub_a, rai::wallet_value const & entry_a)
{
auto status (mdb_put (transaction_a, handle, rai::mdb_val (pub_a), entry_a.val (), 0));
assert (status == 0);
}
rai::key_type rai::wallet_store::key_type (rai::wallet_value const & value_a)
{
auto number (value_a.key.number ());
rai::key_type result;
auto text (number.convert_to<std::string> ());
if (number > std::numeric_limits<uint64_t>::max ())
{
result = rai::key_type::adhoc;
}
else
{
if ((number >> 32).convert_to<uint32_t> () == 1)
{
result = rai::key_type::deterministic;
}
else
{
result = rai::key_type::unknown;
}
}
return result;
}
bool rai::wallet_store::fetch (MDB_txn * transaction_a, rai::public_key const & pub, rai::raw_key & prv)
{
auto result (false);
if (valid_password (transaction_a))
{
rai::wallet_value value (entry_get_raw (transaction_a, pub));
if (!value.key.is_zero ())
{
switch (key_type (value))
{
case rai::key_type::deterministic:
{
rai::raw_key seed_l;
seed (seed_l, transaction_a);
uint32_t index (static_cast<uint32_t> (value.key.number () & static_cast<uint32_t> (-1)));
deterministic_key (prv, transaction_a, index);
break;
}
case rai::key_type::adhoc:
{
// Ad-hoc keys
rai::raw_key password_l;
wallet_key (password_l, transaction_a);
prv.decrypt (value.key, password_l, pub.owords[0].number ());
break;
}
default:
{
result = true;
break;
}
}
}
else
{
result = true;
}
}
else
{
result = true;
}
if (!result)
{
rai::public_key compare;
ed25519_publickey (prv.data.bytes.data (), compare.bytes.data ());
if (!(pub == compare))
{
result = true;
}
}
return result;
}
bool rai::wallet_store::exists (MDB_txn * transaction_a, rai::public_key const & pub)
{
return !pub.is_zero () && find (transaction_a, pub) != end ();
}
void rai::wallet_store::serialize_json (MDB_txn * transaction_a, std::string & string_a)
{
boost::property_tree::ptree tree;
for (rai::store_iterator i (transaction_a, handle), n (nullptr); i != n; ++i)
{
tree.put (rai::uint256_union (i->first.uint256 ()).to_string (), rai::wallet_value (i->second).key.to_string ());
}
std::stringstream ostream;
boost::property_tree::write_json (ostream, tree);
string_a = ostream.str ();
}
void rai::wallet_store::write_backup (MDB_txn * transaction_a, boost::filesystem::path const & path_a)
{
std::ofstream backup_file;
backup_file.open (path_a.string ());
if (!backup_file.fail ())
{
// Set permissions to 600
boost::system::error_code ec;
boost::filesystem::permissions (path_a, boost::filesystem::perms::owner_read | boost::filesystem::perms::owner_write, ec);
std::string json;
serialize_json (transaction_a, json);
backup_file << json;
}
}
bool rai::wallet_store::move (MDB_txn * transaction_a, rai::wallet_store & other_a, std::vector<rai::public_key> const & keys)
{
assert (valid_password (transaction_a));
assert (other_a.valid_password (transaction_a));
auto result (false);
for (auto i (keys.begin ()), n (keys.end ()); i != n; ++i)
{
rai::raw_key prv;
auto error (other_a.fetch (transaction_a, *i, prv));
result = result | error;
if (!result)
{
insert_adhoc (transaction_a, prv);
other_a.erase (transaction_a, *i);
}
}
return result;
}
bool rai::wallet_store::import (MDB_txn * transaction_a, rai::wallet_store & other_a)
{
assert (valid_password (transaction_a));
assert (other_a.valid_password (transaction_a));
auto result (false);
for (auto i (other_a.begin (transaction_a)), n (end ()); i != n; ++i)
{
rai::raw_key prv;
auto error (other_a.fetch (transaction_a, i->first.uint256 (), prv));
result = result | error;
if (!result)
{
insert_adhoc (transaction_a, prv);
other_a.erase (transaction_a, i->first.uint256 ());
}
}
return result;
}
bool rai::wallet_store::work_get (MDB_txn * transaction_a, rai::public_key const & pub_a, uint64_t & work_a)
{
auto result (false);
auto entry (entry_get_raw (transaction_a, pub_a));
if (!entry.key.is_zero ())
{
work_a = entry.work;
}
else
{
result = true;
}
return result;
}
void rai::wallet_store::work_put (MDB_txn * transaction_a, rai::public_key const & pub_a, uint64_t work_a)
{
auto entry (entry_get_raw (transaction_a, pub_a));
assert (!entry.key.is_zero ());
entry.work = work_a;
entry_put_raw (transaction_a, pub_a, entry);
}
unsigned rai::wallet_store::version (MDB_txn * transaction_a)
{
rai::wallet_value value (entry_get_raw (transaction_a, rai::wallet_store::version_special));
auto entry (value.key);
auto result (static_cast<unsigned> (entry.bytes[31]));
return result;
}
void rai::wallet_store::version_put (MDB_txn * transaction_a, unsigned version_a)
{
rai::uint256_union entry (version_a);
entry_put_raw (transaction_a, rai::wallet_store::version_special, rai::wallet_value (entry, 0));
}
void rai::wallet_store::upgrade_v1_v2 ()
{
rai::transaction transaction (environment, nullptr, true);
assert (version (transaction) == 1);
rai::raw_key zero_password;
rai::wallet_value value (entry_get_raw (transaction, rai::wallet_store::wallet_key_special));
rai::raw_key kdf;
kdf.data.clear ();
zero_password.decrypt (value.key, kdf, salt (transaction).owords[0]);
derive_key (kdf, transaction, "");
rai::raw_key empty_password;
empty_password.decrypt (value.key, kdf, salt (transaction).owords[0]);
for (auto i (begin (transaction)), n (end ()); i != n; ++i)
{
rai::public_key key (i->first.uint256 ());
rai::raw_key prv;
if (fetch (transaction, key, prv))
{
// Key failed to decrypt despite valid password
rai::wallet_value data (entry_get_raw (transaction, key));
prv.decrypt (data.key, zero_password, salt (transaction).owords[0]);
rai::public_key compare;
ed25519_publickey (prv.data.bytes.data (), compare.bytes.data ());
if (compare == key)
{
// If we successfully decrypted it, rewrite the key back with the correct wallet key
insert_adhoc (transaction, prv);
}
else
{
// Also try the empty password
rai::wallet_value data (entry_get_raw (transaction, key));
prv.decrypt (data.key, empty_password, salt (transaction).owords[0]);
rai::public_key compare;
ed25519_publickey (prv.data.bytes.data (), compare.bytes.data ());
if (compare == key)
{
// If we successfully decrypted it, rewrite the key back with the correct wallet key
insert_adhoc (transaction, prv);
}
}
}
}
version_put (transaction, 2);
}
void rai::wallet_store::upgrade_v2_v3 ()
{
rai::transaction transaction (environment, nullptr, true);
assert (version (transaction) == 2);
rai::raw_key seed;
random_pool.GenerateBlock (seed.data.bytes.data (), seed.data.bytes.size ());
seed_set (transaction, seed);
entry_put_raw (transaction, rai::wallet_store::deterministic_index_special, rai::wallet_value (rai::uint256_union (0), 0));
version_put (transaction, 3);
}
void rai::wallet_store::upgrade_v3_v4 ()
{
rai::transaction transaction (environment, nullptr, true);
assert (version (transaction) == 3);
version_put (transaction, 4);
assert (valid_password (transaction));
rai::raw_key seed;
rai::wallet_value value (entry_get_raw (transaction, rai::wallet_store::seed_special));
rai::raw_key password_l;
wallet_key (password_l, transaction);
seed.decrypt (value.key, password_l, salt (transaction).owords[0]);
rai::uint256_union ciphertext;
ciphertext.encrypt (seed, password_l, salt (transaction).owords[seed_iv_index]);
entry_put_raw (transaction, rai::wallet_store::seed_special, rai::wallet_value (ciphertext, 0));
for (auto i (begin (transaction)), n (end ()); i != n; ++i)
{
rai::wallet_value value (i->second);
if (!value.key.is_zero ())
{
switch (key_type (i->second))
{
case rai::key_type::adhoc:
{
rai::raw_key key;
if (fetch (transaction, i->first.uint256 (), key))
{
// Key failed to decrypt despite valid password
key.decrypt (value.key, password_l, salt (transaction).owords[0]);
rai::uint256_union new_key_ciphertext;
new_key_ciphertext.encrypt (key, password_l, i->first.uint256 ().owords[0].number ());
rai::wallet_value new_value (new_key_ciphertext, value.work);
mdb_cursor_put (i.cursor, i->first, new_value.val (), MDB_CURRENT);
}
}
case rai::key_type::deterministic:
break;
default:
assert (false);
}
}
}
}
void rai::kdf::phs (rai::raw_key & result_a, std::string const & password_a, rai::uint256_union const & salt_a)
{
std::lock_guard<std::mutex> lock (mutex);
auto success (argon2_hash (1, rai::wallet_store::kdf_work, 1, password_a.data (), password_a.size (), salt_a.bytes.data (), salt_a.bytes.size (), result_a.data.bytes.data (), result_a.data.bytes.size (), NULL, 0, Argon2_d, 0x10));
assert (success == 0);
(void)success;
}
rai::wallet::wallet (bool & init_a, rai::transaction & transaction_a, rai::node & node_a, std::string const & wallet_a) :
lock_observer ([](bool, bool) {}),
store (init_a, node_a.wallets.kdf, transaction_a, node_a.config.random_representative (), node_a.config.password_fanout, wallet_a),
node (node_a)
{
}
rai::wallet::wallet (bool & init_a, rai::transaction & transaction_a, rai::node & node_a, std::string const & wallet_a, std::string const & json) :
lock_observer ([](bool, bool) {}),
store (init_a, node_a.wallets.kdf, transaction_a, node_a.config.random_representative (), node_a.config.password_fanout, wallet_a, json),
node (node_a)
{
}
void rai::wallet::enter_initial_password ()
{
std::lock_guard<std::recursive_mutex> lock (store.mutex);
rai::raw_key password_l;
store.password.value (password_l);
if (password_l.data.is_zero ())
{
if (valid_password ())
{
// Newly created wallets have a zero key
rai::transaction transaction (store.environment, nullptr, true);
store.rekey (transaction, "");
}
enter_password ("");
}
}
bool rai::wallet::valid_password ()
{
rai::transaction transaction (store.environment, nullptr, false);
auto result (store.valid_password (transaction));
return result;
}
bool rai::wallet::enter_password (std::string const & password_a)
{
rai::transaction transaction (store.environment, nullptr, false);
auto result (store.attempt_password (transaction, password_a));
if (!result)
{
auto this_l (shared_from_this ());
node.background ([this_l]() {
this_l->search_pending ();
});
}
lock_observer (result, password_a.empty ());
return result;
}
rai::public_key rai::wallet::deterministic_insert (MDB_txn * transaction_a, bool generate_work_a)
{
rai::public_key key (0);
if (store.valid_password (transaction_a))
{
key = store.deterministic_insert (transaction_a);
if (generate_work_a)
{
work_ensure (key, key);
}
}
return key;
}
rai::public_key rai::wallet::deterministic_insert (bool generate_work_a)
{
rai::transaction transaction (store.environment, nullptr, true);
auto result (deterministic_insert (transaction, generate_work_a));
return result;
}
rai::public_key rai::wallet::insert_adhoc (MDB_txn * transaction_a, rai::raw_key const & key_a, bool generate_work_a)
{
rai::public_key key (0);
if (store.valid_password (transaction_a))
{
key = store.insert_adhoc (transaction_a, key_a);
if (generate_work_a)
{
work_ensure (key, node.ledger.latest_root (transaction_a, key));
}
}
return key;
}
rai::public_key rai::wallet::insert_adhoc (rai::raw_key const & account_a, bool generate_work_a)
{
rai::transaction transaction (store.environment, nullptr, true);
auto result (insert_adhoc (transaction, account_a, generate_work_a));
return result;
}
void rai::wallet::insert_watch (MDB_txn * transaction_a, rai::public_key const & pub_a)
{
store.insert_watch (transaction_a, pub_a);
}
bool rai::wallet::exists (rai::public_key const & account_a)
{
rai::transaction transaction (store.environment, nullptr, false);
return store.exists (transaction, account_a);
}
bool rai::wallet::import (std::string const & json_a, std::string const & password_a)
{
auto error (false);
std::unique_ptr<rai::wallet_store> temp;
{
rai::transaction transaction (store.environment, nullptr, true);
rai::uint256_union id;
random_pool.GenerateBlock (id.bytes.data (), id.bytes.size ());
temp.reset (new rai::wallet_store (error, node.wallets.kdf, transaction, 0, 1, id.to_string (), json_a));
}
if (!error)
{
rai::transaction transaction (store.environment, nullptr, false);
error = temp->attempt_password (transaction, password_a);
}
rai::transaction transaction (store.environment, nullptr, true);
if (!error)
{
error = store.import (transaction, *temp);
}
temp->destroy (transaction);
return error;
}
void rai::wallet::serialize (std::string & json_a)
{
rai::transaction transaction (store.environment, nullptr, false);
store.serialize_json (transaction, json_a);
}
void rai::wallet_store::destroy (MDB_txn * transaction_a)
{
auto status (mdb_drop (transaction_a, handle, 1));
assert (status == 0);
}
std::shared_ptr<rai::block> rai::wallet::receive_action (rai::block const & send_a, rai::account const & representative_a, rai::uint128_union const & amount_a, bool generate_work_a)
{
rai::account account;
auto hash (send_a.hash ());
std::shared_ptr<rai::block> block;
if (node.config.receive_minimum.number () <= amount_a.number ())
{
rai::transaction transaction (node.ledger.store.environment, nullptr, false);
rai::pending_info pending_info;
if (node.store.block_exists (transaction, hash))
{
account = node.ledger.block_destination (transaction, send_a);
if (!node.ledger.store.pending_get (transaction, rai::pending_key (account, hash), pending_info))
{
rai::raw_key prv;
if (!store.fetch (transaction, account, prv))
{
uint64_t cached_work (0);
store.work_get (transaction, account, cached_work);
rai::account_info info;
auto new_account (node.ledger.store.account_get (transaction, account, info));
if (!new_account)
{
std::shared_ptr<rai::block> rep_block = node.ledger.store.block_get (transaction, info.rep_block);
assert (rep_block != nullptr);
block.reset (new rai::state_block (account, info.head, rep_block->representative (), info.balance.number () + pending_info.amount.number (), hash, prv, account, cached_work));
}
else
{
block.reset (new rai::state_block (account, 0, representative_a, pending_info.amount, hash, prv, account, cached_work));
}
}
else
{
BOOST_LOG (node.log) << "Unable to receive, wallet locked";
}
}
else
{
// Ledger doesn't have this marked as available to receive anymore
}
}
else
{
// Ledger doesn't have this block anymore.
}
}
else
{
BOOST_LOG (node.log) << boost::str (boost::format ("Not receiving block %1% due to minimum receive threshold") % hash.to_string ());
// Someone sent us something below the threshold of receiving
}
if (block != nullptr)
{
if (rai::work_validate (*block))
{
node.work_generate_blocking (*block);
}
node.process_active (block);
node.block_processor.flush ();
if (generate_work_a)
{
work_ensure (account, block->hash ());
}
}
return block;
}
std::shared_ptr<rai::block> rai::wallet::change_action (rai::account const & source_a, rai::account const & representative_a, bool generate_work_a)
{
std::shared_ptr<rai::block> block;
{
rai::transaction transaction (store.environment, nullptr, false);
if (store.valid_password (transaction))
{
auto existing (store.find (transaction, source_a));
if (existing != store.end () && !node.ledger.latest (transaction, source_a).is_zero ())
{
rai::account_info info;
auto error1 (node.ledger.store.account_get (transaction, source_a, info));
assert (!error1);
rai::raw_key prv;
auto error2 (store.fetch (transaction, source_a, prv));
assert (!error2);
uint64_t cached_work (0);
store.work_get (transaction, source_a, cached_work);
block.reset (new rai::state_block (source_a, info.head, representative_a, info.balance, 0, prv, source_a, cached_work));
}
}
}
if (block != nullptr)
{
if (rai::work_validate (*block))
{
node.work_generate_blocking (*block);
}
node.process_active (block);
node.block_processor.flush ();
if (generate_work_a)
{
work_ensure (source_a, block->hash ());
}
}
return block;
}
std::shared_ptr<rai::block> rai::wallet::send_action (rai::account const & source_a, rai::account const & account_a, rai::uint128_t const & amount_a, bool generate_work_a, boost::optional<std::string> id_a)
{
std::shared_ptr<rai::block> block;
boost::optional<rai::mdb_val> id_mdb_val;
if (id_a)
{
id_mdb_val = rai::mdb_val (id_a->size (), const_cast<char *> (id_a->data ()));
}
bool error = false;
bool cached_block = false;
{
rai::transaction transaction (store.environment, nullptr, (bool)id_mdb_val);
if (id_mdb_val)
{
rai::mdb_val result;
auto status (mdb_get (transaction, node.wallets.send_action_ids, *id_mdb_val, result));
if (status == 0)
{
auto hash (result.uint256 ());
block = node.store.block_get (transaction, hash);
if (block != nullptr)
{
cached_block = true;
node.network.republish_block (transaction, block);
}
}
else if (status != MDB_NOTFOUND)
{
error = true;
}
}
if (!error && block == nullptr)
{
if (store.valid_password (transaction))
{
auto existing (store.find (transaction, source_a));
if (existing != store.end ())
{
auto balance (node.ledger.account_balance (transaction, source_a));
if (!balance.is_zero () && balance >= amount_a)
{
rai::account_info info;
auto error1 (node.ledger.store.account_get (transaction, source_a, info));
assert (!error1);
rai::raw_key prv;
auto error2 (store.fetch (transaction, source_a, prv));
assert (!error2);
std::shared_ptr<rai::block> rep_block = node.ledger.store.block_get (transaction, info.rep_block);
assert (rep_block != nullptr);
uint64_t cached_work (0);
store.work_get (transaction, source_a, cached_work);
block.reset (new rai::state_block (source_a, info.head, rep_block->representative (), balance - amount_a, account_a, prv, source_a, cached_work));
if (id_mdb_val && block != nullptr)
{
auto status (mdb_put (transaction, node.wallets.send_action_ids, *id_mdb_val, rai::mdb_val (block->hash ()), 0));
if (status != 0)
{
block = nullptr;
error = true;
}
}
}
}
}
}
}
if (!error && block != nullptr && !cached_block)
{
if (rai::work_validate (*block))
{
node.work_generate_blocking (*block);
}
node.process_active (block);
node.block_processor.flush ();
if (generate_work_a)
{
work_ensure (source_a, block->hash ());
}
}
return block;
}
bool rai::wallet::change_sync (rai::account const & source_a, rai::account const & representative_a)
{
std::promise<bool> result;
change_async (source_a, representative_a, [&result](std::shared_ptr<rai::block> block_a) {
result.set_value (block_a == nullptr);
},
true);
return result.get_future ().get ();
}
void rai::wallet::change_async (rai::account const & source_a, rai::account const & representative_a, std::function<void(std::shared_ptr<rai::block>)> const & action_a, bool generate_work_a)
{
node.wallets.queue_wallet_action (rai::wallets::high_priority, [this, source_a, representative_a, action_a, generate_work_a]() {
auto block (change_action (source_a, representative_a, generate_work_a));
action_a (block);
});
}
bool rai::wallet::receive_sync (std::shared_ptr<rai::block> block_a, rai::account const & representative_a, rai::uint128_t const & amount_a)
{
std::promise<bool> result;
receive_async (block_a, representative_a, amount_a, [&result](std::shared_ptr<rai::block> block_a) {
result.set_value (block_a == nullptr);
},
true);
return result.get_future ().get ();
}
void rai::wallet::receive_async (std::shared_ptr<rai::block> block_a, rai::account const & representative_a, rai::uint128_t const & amount_a, std::function<void(std::shared_ptr<rai::block>)> const & action_a, bool generate_work_a)
{
//assert (dynamic_cast<rai::send_block *> (block_a.get ()) != nullptr);
node.wallets.queue_wallet_action (amount_a, [this, block_a, representative_a, amount_a, action_a, generate_work_a]() {
auto block (receive_action (*static_cast<rai::block *> (block_a.get ()), representative_a, amount_a, generate_work_a));
action_a (block);
});
}
rai::block_hash rai::wallet::send_sync (rai::account const & source_a, rai::account const & account_a, rai::uint128_t const & amount_a)
{
std::promise<rai::block_hash> result;
send_async (source_a, account_a, amount_a, [&result](std::shared_ptr<rai::block> block_a) {
result.set_value (block_a->hash ());
},
true);
return result.get_future ().get ();
}
void rai::wallet::send_async (rai::account const & source_a, rai::account const & account_a, rai::uint128_t const & amount_a, std::function<void(std::shared_ptr<rai::block>)> const & action_a, bool generate_work_a, boost::optional<std::string> id_a)
{
this->node.wallets.queue_wallet_action (rai::wallets::high_priority, [this, source_a, account_a, amount_a, action_a, generate_work_a, id_a]() {
auto block (send_action (source_a, account_a, amount_a, generate_work_a, id_a));
action_a (block);
});
}
// Update work for account if latest root is root_a
void rai::wallet::work_update (MDB_txn * transaction_a, rai::account const & account_a, rai::block_hash const & root_a, uint64_t work_a)
{
assert (!rai::work_validate (root_a, work_a));
assert (store.exists (transaction_a, account_a));
auto latest (node.ledger.latest_root (transaction_a, account_a));
if (latest == root_a)
{
store.work_put (transaction_a, account_a, work_a);
}
else
{
BOOST_LOG (node.log) << "Cached work no longer valid, discarding";
}
}
void rai::wallet::work_ensure (rai::account const & account_a, rai::block_hash const & hash_a)
{
auto this_l (shared_from_this ());
node.wallets.queue_wallet_action (rai::wallets::generate_priority, [this_l, account_a, hash_a] {
this_l->work_cache_blocking (account_a, hash_a);
});
}
bool rai::wallet::search_pending ()
{
rai::transaction transaction (store.environment, nullptr, false);
auto result (!store.valid_password (transaction));
if (!result)
{
BOOST_LOG (node.log) << "Beginning pending block search";
rai::transaction transaction (node.store.environment, nullptr, false);
for (auto i (store.begin (transaction)), n (store.end ()); i != n; ++i)
{
rai::account account (i->first.uint256 ());
// Don't search pending for watch-only accounts
if (!rai::wallet_value (i->second).key.is_zero ())
{
for (auto j (node.store.pending_begin (transaction, rai::pending_key (account, 0))), m (node.store.pending_begin (transaction, rai::pending_key (account.number () + 1, 0))); j != m; ++j)
{
rai::pending_key key (j->first);
auto hash (key.hash);
rai::pending_info pending (j->second);
auto amount (pending.amount.number ());
if (node.config.receive_minimum.number () <= amount)
{
BOOST_LOG (node.log) << boost::str (boost::format ("Found a pending block %1% for account %2%") % hash.to_string () % pending.source.to_account ());
node.block_confirm (node.store.block_get (transaction, hash));
}
}
}
}
BOOST_LOG (node.log) << "Pending block search phase complete";
}
else
{
BOOST_LOG (node.log) << "Stopping search, wallet is locked";
}
return result;
}
void rai::wallet::init_free_accounts (MDB_txn * transaction_a)
{
free_accounts.clear ();
for (auto i (store.begin (transaction_a)), n (store.end ()); i != n; ++i)
{
free_accounts.insert (i->first.uint256 ());
}
}
rai::public_key rai::wallet::change_seed (MDB_txn * transaction_a, rai::raw_key const & prv_a)
{
store.seed_set (transaction_a, prv_a);
auto account = deterministic_insert (transaction_a);
uint32_t count (0);
for (uint32_t i (1), n (64); i < n; ++i)
{
rai::raw_key prv;
store.deterministic_key (prv, transaction_a, i);
rai::keypair pair (prv.data.to_string ());
// Check if account received at least 1 block
auto latest (node.ledger.latest (transaction_a, pair.pub));
if (!latest.is_zero ())
{
count = i;
// i + 64 - Check additional 64 accounts
// i/64 - Check additional accounts for large wallets. I.e. 64000/64 = 1000 accounts to check
n = i + 64 + (i / 64);
}
else
{
// Check if there are pending blocks for account
rai::account end (pair.pub.number () + 1);
for (auto ii (node.store.pending_begin (transaction_a, rai::pending_key (pair.pub, 0))), nn (node.store.pending_begin (transaction_a, rai::pending_key (end, 0))); ii != nn; ++ii)
{
count = i;
n = i + 64 + (i / 64);
break;
}
}
}
for (uint32_t i (0); i < count; ++i)
{
// Generate work for first 4 accounts only to prevent weak CPU nodes stuck
account = deterministic_insert (transaction_a, i < 4);
}
return account;
}
void rai::wallet::work_cache_blocking (rai::account const & account_a, rai::block_hash const & root_a)
{
auto begin (std::chrono::steady_clock::now ());
auto work (node.work_generate_blocking (root_a));
if (node.config.logging.work_generation_time ())
{
BOOST_LOG (node.log) << "Work generation complete: " << (std::chrono::duration_cast<std::chrono::microseconds> (std::chrono::steady_clock::now () - begin).count ()) << " us";
}
rai::transaction transaction (store.environment, nullptr, true);
if (store.exists (transaction, account_a))
{
work_update (transaction, account_a, root_a, work);
}
}
rai::wallets::wallets (bool & error_a, rai::node & node_a) :
observer ([](bool) {}),
node (node_a),
stopped (false),
thread ([this]() { do_wallet_actions (); })
{
if (!error_a)
{
rai::transaction transaction (node.store.environment, nullptr, true);
auto status (mdb_dbi_open (transaction, nullptr, MDB_CREATE, &handle));
status |= mdb_dbi_open (transaction, "send_action_ids", MDB_CREATE, &send_action_ids);
assert (status == 0);
std::string beginning (rai::uint256_union (0).to_string ());
std::string end ((rai::uint256_union (rai::uint256_t (0) - rai::uint256_t (1))).to_string ());
for (rai::store_iterator i (transaction, handle, rai::mdb_val (beginning.size (), const_cast<char *> (beginning.c_str ()))), n (transaction, handle, rai::mdb_val (end.size (), const_cast<char *> (end.c_str ()))); i != n; ++i)
{
rai::uint256_union id;
std::string text (reinterpret_cast<char const *> (i->first.data ()), i->first.size ());
auto error (id.decode_hex (text));
assert (!error);
assert (items.find (id) == items.end ());
auto wallet (std::make_shared<rai::wallet> (error, transaction, node_a, text));
if (!error)
{
node_a.background ([wallet]() {
wallet->enter_initial_password ();
});
items[id] = wallet;
}
else
{
// Couldn't open wallet
}
}
}
}
rai::wallets::~wallets ()
{
stop ();
}
std::shared_ptr<rai::wallet> rai::wallets::open (rai::uint256_union const & id_a)
{
std::shared_ptr<rai::wallet> result;
auto existing (items.find (id_a));
if (existing != items.end ())
{
result = existing->second;
}
return result;
}
std::shared_ptr<rai::wallet> rai::wallets::create (rai::uint256_union const & id_a)
{
assert (items.find (id_a) == items.end ());
std::shared_ptr<rai::wallet> result;
bool error;
{
rai::transaction transaction (node.store.environment, nullptr, true);
result = std::make_shared<rai::wallet> (error, transaction, node, id_a.to_string ());
}
if (!error)
{
items[id_a] = result;
node.background ([result]() {
result->enter_initial_password ();
});
}
return result;
}
bool rai::wallets::search_pending (rai::uint256_union const & wallet_a)
{
auto result (false);
auto existing (items.find (wallet_a));
result = existing == items.end ();
if (!result)
{
auto wallet (existing->second);
result = wallet->search_pending ();
}
return result;
}
void rai::wallets::search_pending_all ()
{
for (auto i : items)
{
i.second->search_pending ();
}
}
void rai::wallets::destroy (rai::uint256_union const & id_a)
{
rai::transaction transaction (node.store.environment, nullptr, true);
auto existing (items.find (id_a));
assert (existing != items.end ());
auto wallet (existing->second);
items.erase (existing);
wallet->store.destroy (transaction);
}
void rai::wallets::do_wallet_actions ()
{
std::unique_lock<std::mutex> lock (mutex);
while (!stopped)
{
if (!actions.empty ())
{
auto first (actions.begin ());
auto current (std::move (first->second));
actions.erase (first);
lock.unlock ();
observer (true);
current ();
observer (false);
lock.lock ();
}
else
{
condition.wait (lock);
}
}
}
void rai::wallets::queue_wallet_action (rai::uint128_t const & amount_a, std::function<void()> const & action_a)
{
std::lock_guard<std::mutex> lock (mutex);
actions.insert (std::make_pair (amount_a, std::move (action_a)));
condition.notify_all ();
}
void rai::wallets::foreach_representative (MDB_txn * transaction_a, std::function<void(rai::public_key const & pub_a, rai::raw_key const & prv_a)> const & action_a)
{
for (auto i (items.begin ()), n (items.end ()); i != n; ++i)
{
auto & wallet (*i->second);
for (auto j (wallet.store.begin (transaction_a)), m (wallet.store.end ()); j != m; ++j)
{
rai::account account (j->first.uint256 ());
if (!node.ledger.weight (transaction_a, account).is_zero ())
{
if (wallet.store.valid_password (transaction_a))
{
rai::raw_key prv;
auto error (wallet.store.fetch (transaction_a, j->first.uint256 (), prv));
assert (!error);
action_a (j->first.uint256 (), prv);
}
else
{
static auto last_log = std::chrono::steady_clock::time_point ();
if (last_log < std::chrono::steady_clock::now () - std::chrono::seconds (60))
{
last_log = std::chrono::steady_clock::now ();
BOOST_LOG (node.log) << boost::str (boost::format ("Representative locked inside wallet %1%") % i->first.to_string ());
}
}
}
}
}
}
bool rai::wallets::exists (MDB_txn * transaction_a, rai::public_key const & account_a)
{
auto result (false);
for (auto i (items.begin ()), n (items.end ()); !result && i != n; ++i)
{
result = i->second->store.exists (transaction_a, account_a);
}
return result;
}
void rai::wallets::stop ()
{
{
std::lock_guard<std::mutex> lock (mutex);
stopped = true;
condition.notify_all ();
}
if (thread.joinable ())
{
thread.join ();
}
}
rai::uint128_t const rai::wallets::generate_priority = std::numeric_limits<rai::uint128_t>::max ();
rai::uint128_t const rai::wallets::high_priority = std::numeric_limits<rai::uint128_t>::max () - 1;
rai::store_iterator rai::wallet_store::begin (MDB_txn * transaction_a)
{
rai::store_iterator result (transaction_a, handle, rai::mdb_val (rai::uint256_union (special_count)));
return result;
}
rai::store_iterator rai::wallet_store::begin (MDB_txn * transaction_a, rai::uint256_union const & key)
{
rai::store_iterator result (transaction_a, handle, rai::mdb_val (key));
return result;
}
rai::store_iterator rai::wallet_store::find (MDB_txn * transaction_a, rai::uint256_union const & key)
{
auto result (begin (transaction_a, key));
rai::store_iterator end (nullptr);
if (result != end)
{
if (rai::uint256_union (result->first.uint256 ()) == key)
{
return result;
}
else
{
return end;
}
}
else
{
return end;
}
return result;
}
rai::store_iterator rai::wallet_store::end ()
{
return rai::store_iterator (nullptr);
}
| 1 | 14,062 | Slight formatting issue here. There should be a space after the asterisk. | nanocurrency-nano-node | cpp |
@@ -8,7 +8,8 @@
*/
axe.utils.isHidden = function isHidden(el, recursed) {
'use strict';
- var parent;
+ const node = axe.utils.getNodeFromTree(el);
+ let parent, isHidden;
// 9 === Node.DOCUMENT
if (el.nodeType === 9) { | 1 | /**
* Determine whether an element is visible
* @method isHidden
* @memberof axe.utils
* @param {HTMLElement} el The HTMLElement
* @param {Boolean} recursed
* @return {Boolean} The element's visibilty status
*/
axe.utils.isHidden = function isHidden(el, recursed) {
'use strict';
var parent;
// 9 === Node.DOCUMENT
if (el.nodeType === 9) {
return false;
}
// 11 === Node.DOCUMENT_FRAGMENT_NODE
if (el.nodeType === 11) {
el = el.host; // grab the host Node
}
var style = window.getComputedStyle(el, null);
if (
!style ||
(!el.parentNode ||
(style.getPropertyValue('display') === 'none' ||
(!recursed &&
// visibility is only accurate on the first element
style.getPropertyValue('visibility') === 'hidden') ||
el.getAttribute('aria-hidden') === 'true'))
) {
return true;
}
parent = el.assignedSlot ? el.assignedSlot : el.parentNode;
return axe.utils.isHidden(parent, true);
};
| 1 | 14,392 | Slight preference for declaring variables inline rather than at the top of the function. That way you can use const for both of these. | dequelabs-axe-core | js |
@@ -32,9 +32,9 @@ import org.slf4j.LoggerFactory;
* @since [产品/模块版本]
*/
public class TestMgr {
- private static Logger LOGGER = LoggerFactory.getLogger(TestMgr.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(TestMgr.class);
- private static List<Throwable> errorList = new ArrayList<>();
+ private static final List<Throwable> errorList = new ArrayList<>();
private static String msg = "";
| 1 | /*
* Copyright 2017 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.servicecomb.demo;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* <一句话功能简述>
* <功能详细描述>
*
* @author
* @version [版本号, 2017年2月23日]
* @see [相关类/方法]
* @since [产品/模块版本]
*/
public class TestMgr {
private static Logger LOGGER = LoggerFactory.getLogger(TestMgr.class);
private static List<Throwable> errorList = new ArrayList<>();
private static String msg = "";
public static void setMsg(String msg) {
TestMgr.msg = msg;
}
public static void setMsg(String microserviceName, String transport) {
TestMgr.msg = String.format("microservice=%s, transport=%s", microserviceName, transport);
}
public static void check(Object expect, Object real) {
String strExpect = String.valueOf(expect);
String strReal = String.valueOf(real);
if (!strExpect.equals(strReal)) {
errorList.add(new Error(msg + " | Expect " + strExpect + ", but " + strReal));
}
}
public static void summary() {
if (errorList.isEmpty()) {
LOGGER.info("............. test finished ............");
return;
}
LOGGER.info("............. test not finished ............");
for (Throwable e : errorList) {
LOGGER.info("", e);
}
}
}
| 1 | 6,322 | this is a duplicate file of the one in demo-schema. please remove this file. | apache-servicecomb-java-chassis | java |
@@ -153,6 +153,7 @@ var (
utils.Eth1SyncServiceEnable,
utils.Eth1CanonicalTransactionChainDeployHeightFlag,
utils.Eth1L1CrossDomainMessengerAddressFlag,
+ utils.Eth1L1FeeWalletAddressFlag,
utils.Eth1ETHGatewayAddressFlag,
utils.Eth1ChainIdFlag,
utils.RollupClientHttpFlag, | 1 | // Copyright 2014 The go-ethereum Authors
// This file is part of go-ethereum.
//
// go-ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// go-ethereum is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// geth is the official command-line client for Ethereum.
package main
import (
"fmt"
"math"
"os"
"runtime"
godebug "runtime/debug"
"sort"
"strconv"
"strings"
"time"
"github.com/elastic/gosigar"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/keystore"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/console"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/eth/downloader"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/les"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/metrics"
"github.com/ethereum/go-ethereum/node"
cli "gopkg.in/urfave/cli.v1"
)
const (
clientIdentifier = "geth" // Client identifier to advertise over the network
)
var (
// Git SHA1 commit hash of the release (set via linker flags)
gitCommit = ""
gitDate = ""
// The app that holds all commands and flags.
app = utils.NewApp(gitCommit, gitDate, "the go-ethereum command line interface")
// flags that configure the node
nodeFlags = []cli.Flag{
utils.IdentityFlag,
utils.UnlockedAccountFlag,
utils.PasswordFileFlag,
utils.BootnodesFlag,
utils.BootnodesV4Flag,
utils.BootnodesV5Flag,
utils.DataDirFlag,
utils.AncientFlag,
utils.KeyStoreDirFlag,
utils.ExternalSignerFlag,
utils.NoUSBFlag,
utils.SmartCardDaemonPathFlag,
utils.OverrideIstanbulFlag,
utils.OverrideMuirGlacierFlag,
utils.EthashCacheDirFlag,
utils.EthashCachesInMemoryFlag,
utils.EthashCachesOnDiskFlag,
utils.EthashDatasetDirFlag,
utils.EthashDatasetsInMemoryFlag,
utils.EthashDatasetsOnDiskFlag,
utils.TxPoolLocalsFlag,
utils.TxPoolNoLocalsFlag,
utils.TxPoolJournalFlag,
utils.TxPoolRejournalFlag,
utils.TxPoolPriceLimitFlag,
utils.TxPoolPriceBumpFlag,
utils.TxPoolAccountSlotsFlag,
utils.TxPoolGlobalSlotsFlag,
utils.TxPoolAccountQueueFlag,
utils.TxPoolGlobalQueueFlag,
utils.TxPoolLifetimeFlag,
utils.SyncModeFlag,
utils.ExitWhenSyncedFlag,
utils.GCModeFlag,
utils.LightServeFlag,
utils.LightLegacyServFlag,
utils.LightIngressFlag,
utils.LightEgressFlag,
utils.LightMaxPeersFlag,
utils.LightLegacyPeersFlag,
utils.LightKDFFlag,
utils.UltraLightServersFlag,
utils.UltraLightFractionFlag,
utils.UltraLightOnlyAnnounceFlag,
utils.WhitelistFlag,
utils.CacheFlag,
utils.CacheDatabaseFlag,
utils.CacheTrieFlag,
utils.CacheGCFlag,
utils.CacheNoPrefetchFlag,
utils.ListenPortFlag,
utils.MaxPeersFlag,
utils.MaxPendingPeersFlag,
utils.MiningEnabledFlag,
utils.MinerThreadsFlag,
utils.MinerLegacyThreadsFlag,
utils.MinerNotifyFlag,
utils.MinerGasTargetFlag,
utils.MinerLegacyGasTargetFlag,
utils.MinerGasLimitFlag,
utils.MinerGasPriceFlag,
utils.MinerLegacyGasPriceFlag,
utils.MinerEtherbaseFlag,
utils.MinerLegacyEtherbaseFlag,
utils.MinerExtraDataFlag,
utils.MinerLegacyExtraDataFlag,
utils.MinerRecommitIntervalFlag,
utils.MinerNoVerfiyFlag,
utils.NATFlag,
utils.NoDiscoverFlag,
utils.DiscoveryV5Flag,
utils.NetrestrictFlag,
utils.NodeKeyFileFlag,
utils.NodeKeyHexFlag,
utils.DeveloperFlag,
utils.DeveloperPeriodFlag,
utils.TestnetFlag,
utils.RinkebyFlag,
utils.GoerliFlag,
utils.VMEnableDebugFlag,
utils.NetworkIdFlag,
utils.ChainIdFlag,
utils.EthStatsURLFlag,
utils.FakePoWFlag,
utils.NoCompactionFlag,
utils.GpoBlocksFlag,
utils.GpoPercentileFlag,
utils.EWASMInterpreterFlag,
utils.EVMInterpreterFlag,
configFileFlag,
}
optimismFlags = []cli.Flag{
utils.Eth1SyncServiceEnable,
utils.Eth1CanonicalTransactionChainDeployHeightFlag,
utils.Eth1L1CrossDomainMessengerAddressFlag,
utils.Eth1ETHGatewayAddressFlag,
utils.Eth1ChainIdFlag,
utils.RollupClientHttpFlag,
utils.RollupEnableVerifierFlag,
utils.RollupAddressManagerOwnerAddressFlag,
utils.RollupTimstampRefreshFlag,
utils.RollupPollIntervalFlag,
utils.RollupStateDumpPathFlag,
utils.RollupDiffDbFlag,
utils.RollupMaxCalldataSizeFlag,
utils.RollupDataPriceFlag,
utils.RollupExecutionPriceFlag,
utils.RollupBackendFlag,
utils.RollupEnableL2GasPollingFlag,
utils.RollupGasPriceOracleAddressFlag,
utils.RollupEnforceFeesFlag,
}
rpcFlags = []cli.Flag{
utils.RPCEnabledFlag,
utils.RPCListenAddrFlag,
utils.RPCPortFlag,
utils.RPCCORSDomainFlag,
utils.RPCVirtualHostsFlag,
utils.GraphQLEnabledFlag,
utils.GraphQLListenAddrFlag,
utils.GraphQLPortFlag,
utils.GraphQLCORSDomainFlag,
utils.GraphQLVirtualHostsFlag,
utils.RPCApiFlag,
utils.WSEnabledFlag,
utils.WSListenAddrFlag,
utils.WSPortFlag,
utils.WSApiFlag,
utils.WSAllowedOriginsFlag,
utils.IPCDisabledFlag,
utils.IPCPathFlag,
utils.InsecureUnlockAllowedFlag,
utils.RPCGlobalGasCap,
}
whisperFlags = []cli.Flag{
utils.WhisperEnabledFlag,
utils.WhisperMaxMessageSizeFlag,
utils.WhisperMinPOWFlag,
utils.WhisperRestrictConnectionBetweenLightClientsFlag,
}
metricsFlags = []cli.Flag{
utils.MetricsEnabledFlag,
utils.MetricsEnabledExpensiveFlag,
utils.MetricsEnableInfluxDBFlag,
utils.MetricsInfluxDBEndpointFlag,
utils.MetricsInfluxDBDatabaseFlag,
utils.MetricsInfluxDBUsernameFlag,
utils.MetricsInfluxDBPasswordFlag,
utils.MetricsInfluxDBTagsFlag,
}
)
func init() {
// Initialize the CLI app and start Geth
app.Action = geth
app.HideVersion = true // we have a command to print the version
app.Copyright = "Copyright 2013-2020 The go-ethereum Authors"
app.Commands = []cli.Command{
// See chaincmd.go:
initCommand,
importCommand,
exportCommand,
importPreimagesCommand,
exportPreimagesCommand,
copydbCommand,
removedbCommand,
dumpCommand,
inspectCommand,
// See accountcmd.go:
accountCommand,
walletCommand,
// See consolecmd.go:
consoleCommand,
attachCommand,
javascriptCommand,
// See misccmd.go:
makecacheCommand,
makedagCommand,
versionCommand,
licenseCommand,
// See config.go
dumpConfigCommand,
// See retesteth.go
retestethCommand,
}
sort.Sort(cli.CommandsByName(app.Commands))
app.Flags = append(app.Flags, nodeFlags...)
app.Flags = append(app.Flags, optimismFlags...)
app.Flags = append(app.Flags, rpcFlags...)
app.Flags = append(app.Flags, consoleFlags...)
app.Flags = append(app.Flags, debug.Flags...)
app.Flags = append(app.Flags, whisperFlags...)
app.Flags = append(app.Flags, metricsFlags...)
app.Before = func(ctx *cli.Context) error {
return debug.Setup(ctx, "")
}
app.After = func(ctx *cli.Context) error {
debug.Exit()
console.Stdin.Close() // Resets terminal mode.
return nil
}
}
func main() {
if err := app.Run(os.Args); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
// prepare manipulates memory cache allowance and setups metric system.
// This function should be called before launching devp2p stack.
func prepare(ctx *cli.Context) {
// If we're a full node on mainnet without --cache specified, bump default cache allowance
if ctx.GlobalString(utils.SyncModeFlag.Name) != "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) && !ctx.GlobalIsSet(utils.NetworkIdFlag.Name) {
// Make sure we're not on any supported preconfigured testnet either
if !ctx.GlobalIsSet(utils.TestnetFlag.Name) && !ctx.GlobalIsSet(utils.RinkebyFlag.Name) && !ctx.GlobalIsSet(utils.GoerliFlag.Name) && !ctx.GlobalIsSet(utils.DeveloperFlag.Name) {
// Nope, we're really on mainnet. Bump that cache up!
log.Info("Bumping default cache on mainnet", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 4096)
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(4096))
}
}
// If we're running a light client on any network, drop the cache to some meaningfully low amount
if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" && !ctx.GlobalIsSet(utils.CacheFlag.Name) {
log.Info("Dropping default light client cache", "provided", ctx.GlobalInt(utils.CacheFlag.Name), "updated", 128)
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(128))
}
// Cap the cache allowance and tune the garbage collector
var mem gosigar.Mem
// Workaround until OpenBSD support lands into gosigar
// Check https://github.com/elastic/gosigar#supported-platforms
if runtime.GOOS != "openbsd" {
if err := mem.Get(); err == nil {
allowance := int(mem.Total / 1024 / 1024 / 3)
if cache := ctx.GlobalInt(utils.CacheFlag.Name); cache > allowance {
log.Warn("Sanitizing cache to Go's GC limits", "provided", cache, "updated", allowance)
ctx.GlobalSet(utils.CacheFlag.Name, strconv.Itoa(allowance))
}
}
}
// Ensure Go's GC ignores the database cache for trigger percentage
cache := ctx.GlobalInt(utils.CacheFlag.Name)
gogc := math.Max(20, math.Min(100, 100/(float64(cache)/1024)))
log.Debug("Sanitizing Go's GC trigger", "percent", int(gogc))
godebug.SetGCPercent(int(gogc))
// Start metrics export if enabled
utils.SetupMetrics(ctx)
// Start system runtime metrics collection
go metrics.CollectProcessMetrics(3 * time.Second)
}
// geth is the main entry point into the system if no special subcommand is ran.
// It creates a default node based on the command line arguments and runs it in
// blocking mode, waiting for it to be shut down.
func geth(ctx *cli.Context) error {
if args := ctx.Args(); len(args) > 0 {
return fmt.Errorf("invalid command: %q", args[0])
}
prepare(ctx)
node := makeFullNode(ctx)
defer node.Close()
startNode(ctx, node)
node.Wait()
return nil
}
// startNode boots up the system node and all registered protocols, after which
// it unlocks any requested accounts, and starts the RPC/IPC interfaces and the
// miner.
func startNode(ctx *cli.Context, stack *node.Node) {
debug.Memsize.Add("node", stack)
// Start up the node itself
utils.StartNode(stack)
// Unlock any account specifically requested
unlockAccounts(ctx, stack)
// Register wallet event handlers to open and auto-derive wallets
events := make(chan accounts.WalletEvent, 16)
stack.AccountManager().Subscribe(events)
// Create a client to interact with local geth node.
rpcClient, err := stack.Attach()
if err != nil {
utils.Fatalf("Failed to attach to self: %v", err)
}
ethClient := ethclient.NewClient(rpcClient)
// Set contract backend for ethereum service if local node
// is serving LES requests.
if ctx.GlobalInt(utils.LightLegacyServFlag.Name) > 0 || ctx.GlobalInt(utils.LightServeFlag.Name) > 0 {
var ethService *eth.Ethereum
if err := stack.Service(ðService); err != nil {
utils.Fatalf("Failed to retrieve ethereum service: %v", err)
}
ethService.SetContractBackend(ethClient)
}
// Set contract backend for les service if local node is
// running as a light client.
if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
var lesService *les.LightEthereum
if err := stack.Service(&lesService); err != nil {
utils.Fatalf("Failed to retrieve light ethereum service: %v", err)
}
lesService.SetContractBackend(ethClient)
}
go func() {
// Open any wallets already attached
for _, wallet := range stack.AccountManager().Wallets() {
if err := wallet.Open(""); err != nil {
log.Warn("Failed to open wallet", "url", wallet.URL(), "err", err)
}
}
// Listen for wallet event till termination
for event := range events {
switch event.Kind {
case accounts.WalletArrived:
if err := event.Wallet.Open(""); err != nil {
log.Warn("New wallet appeared, failed to open", "url", event.Wallet.URL(), "err", err)
}
case accounts.WalletOpened:
status, _ := event.Wallet.Status()
log.Info("New wallet appeared", "url", event.Wallet.URL(), "status", status)
var derivationPaths []accounts.DerivationPath
if event.Wallet.URL().Scheme == "ledger" {
derivationPaths = append(derivationPaths, accounts.LegacyLedgerBaseDerivationPath)
}
derivationPaths = append(derivationPaths, accounts.DefaultBaseDerivationPath)
event.Wallet.SelfDerive(derivationPaths, ethClient)
case accounts.WalletDropped:
log.Info("Old wallet dropped", "url", event.Wallet.URL())
event.Wallet.Close()
}
}
}()
// Spawn a standalone goroutine for status synchronization monitoring,
// close the node when synchronization is complete if user required.
if ctx.GlobalBool(utils.ExitWhenSyncedFlag.Name) {
go func() {
sub := stack.EventMux().Subscribe(downloader.DoneEvent{})
defer sub.Unsubscribe()
for {
event := <-sub.Chan()
if event == nil {
continue
}
done, ok := event.Data.(downloader.DoneEvent)
if !ok {
continue
}
if timestamp := time.Unix(int64(done.Latest.Time), 0); time.Since(timestamp) < 10*time.Minute {
log.Info("Synchronisation completed", "latestnum", done.Latest.Number, "latesthash", done.Latest.Hash(),
"age", common.PrettyAge(timestamp))
stack.Stop()
}
}
}()
}
// Start auxiliary services if enabled
if ctx.GlobalBool(utils.MiningEnabledFlag.Name) || ctx.GlobalBool(utils.DeveloperFlag.Name) {
// Mining only makes sense if a full Ethereum node is running
if ctx.GlobalString(utils.SyncModeFlag.Name) == "light" {
utils.Fatalf("Light clients do not support mining")
}
var ethereum *eth.Ethereum
if err := stack.Service(ðereum); err != nil {
utils.Fatalf("Ethereum service not running: %v", err)
}
// Set the gas price to the limits from the CLI and start mining
gasprice := utils.GlobalBig(ctx, utils.MinerLegacyGasPriceFlag.Name)
if ctx.IsSet(utils.MinerGasPriceFlag.Name) {
gasprice = utils.GlobalBig(ctx, utils.MinerGasPriceFlag.Name)
}
ethereum.TxPool().SetGasPrice(gasprice)
threads := ctx.GlobalInt(utils.MinerLegacyThreadsFlag.Name)
if ctx.GlobalIsSet(utils.MinerThreadsFlag.Name) {
threads = ctx.GlobalInt(utils.MinerThreadsFlag.Name)
}
if err := ethereum.StartMining(threads); err != nil {
utils.Fatalf("Failed to start mining: %v", err)
}
if ctx.GlobalBool(utils.Eth1SyncServiceEnable.Name) {
if err := ethereum.SyncService().Start(); err != nil {
utils.Fatalf("Failed to start syncservice: %v", err)
}
}
}
}
// unlockAccounts unlocks any account specifically requested.
func unlockAccounts(ctx *cli.Context, stack *node.Node) {
var unlocks []string
inputs := strings.Split(ctx.GlobalString(utils.UnlockedAccountFlag.Name), ",")
for _, input := range inputs {
if trimmed := strings.TrimSpace(input); trimmed != "" {
unlocks = append(unlocks, trimmed)
}
}
// Short circuit if there is no account to unlock.
if len(unlocks) == 0 {
return
}
// If insecure account unlocking is not allowed if node's APIs are exposed to external.
// Print warning log to user and skip unlocking.
if !stack.Config().InsecureUnlockAllowed && stack.Config().ExtRPCEnabled() {
utils.Fatalf("Account unlock with HTTP access is forbidden!")
}
ks := stack.AccountManager().Backends(keystore.KeyStoreType)[0].(*keystore.KeyStore)
passwords := utils.MakePasswordList(ctx)
for i, account := range unlocks {
unlockAccount(ks, account, i, passwords)
}
}
| 1 | 17,657 | Nit: unified names between geth and contracts | ethereum-optimism-optimism | go |
@@ -42,7 +42,9 @@ func TestClientToServerCommunication(t *testing.T) {
// Note that the ordering of things here is pretty important; we need to get the
// client connected & ready to receive events before we push them all into the
// server and shut it down again.
- serverState := core.NewBuildState(5, nil, 4, core.DefaultConfiguration())
+ config := core.DefaultConfiguration()
+ config.Please.NumThreads = 5
+ serverState := core.NewBuildState(config)
addr, shutdown := initialiseServer(serverState, 0)
// This is a bit awkward. We want to assert that we receive a matching set of | 1 | // Integration tests between the gRPC event server & client.
//
// It's a little limited in how much it can test due to extensive synchronisation
// issues (discussed ina little more detail below); essentially the scheme is designed
// for clients following a series of events in "human" time (i.e. a stream that runs
// for many seconds), without a hard requirement to observe all initial events
// correctly (there's an expectation that we'll catch up soon enough).
// That doesn't work so well for a test where everything happens on the scale of
// microseconds and we want to assert precise events, but we do the best we can.
package follow
import (
"fmt"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/thought-machine/please/src/cli"
"github.com/thought-machine/please/src/core"
)
const retries = 3
const delay = 10 * time.Millisecond
func init() {
cli.InitLogging(cli.MaxVerbosity)
// The usual 1 second is pretty annoying in this test.
disconnectTimeout = 1 * time.Millisecond
// As is half a second wait for this.
resourceUpdateFrequency = 1 * time.Millisecond
}
var (
l1 = core.ParseBuildLabel("//src/remote:target1", "")
l2 = core.ParseBuildLabel("//src/remote:target2", "")
l3 = core.ParseBuildLabel("//src/remote:target3", "")
)
func TestClientToServerCommunication(t *testing.T) {
// Note that the ordering of things here is pretty important; we need to get the
// client connected & ready to receive events before we push them all into the
// server and shut it down again.
serverState := core.NewBuildState(5, nil, 4, core.DefaultConfiguration())
addr, shutdown := initialiseServer(serverState, 0)
// This is a bit awkward. We want to assert that we receive a matching set of
// build events, but it's difficult to build strong synchronisation into this
// scheme which is really designed for builds taking a significant amount of
// real time in which remote clients have a chance to sync up.
// This test does the best it can to assert a reliable set of observable events.
// Dispatch the first round of build events now
serverState.LogBuildResult(0, l1, core.PackageParsed, fmt.Sprintf("Parsed %s", l1))
serverState.LogBuildResult(0, l1, core.TargetBuilding, fmt.Sprintf("Building %s", l1))
serverState.LogBuildResult(2, l2, core.TargetBuilding, fmt.Sprintf("Building %s", l2))
serverState.LogBuildResult(0, l1, core.TargetBuilt, fmt.Sprintf("Built %s", l1))
serverState.LogBuildResult(1, l3, core.TargetBuilding, fmt.Sprintf("Building %s", l3))
clientState := core.NewBuildState(1, nil, 4, core.DefaultConfiguration())
results := clientState.Results()
connectClient(clientState, addr, retries, delay)
// The client state should have synced up with the server's number of threads
assert.Equal(t, 5, clientState.Config.Please.NumThreads)
// We should be able to receive the latest build events for each thread.
// Note that they come out in thread order, not time order.
r := <-results
log.Info("Received first build event")
assert.Equal(t, "Built //src/remote:target1", r.Description)
r = <-results
assert.Equal(t, "Building //src/remote:target3", r.Description)
r = <-results
assert.Equal(t, "Building //src/remote:target2", r.Description)
// Here we hit a bit of a synchronisation problem, whereby we can't guarantee that
// the client is actually going to be ready to receive the events in time, which
// manifests by blocking when we try to receive below. Conversely, we also race between
// the client connecting and these results going in; we can miss them if it's still
// not really receiving. Finally, the server can block on shutdown() if the client
// isn't trying to read any pending events.
go func() {
defer func() {
recover() // Send on closed channel, can happen because shutdown() is out of sync.
}()
serverState.LogBuildResult(1, l3, core.TargetBuilt, fmt.Sprintf("Built %s", l3))
serverState.LogBuildResult(2, l2, core.TargetBuilt, fmt.Sprintf("Built %s", l2))
}()
go func() {
for r := range results {
log.Info("Received result from thread %d", r.ThreadID)
}
}()
log.Info("Shutting down server")
shutdown()
log.Info("Server shutdown")
}
func TestWithOutput(t *testing.T) {
serverState := core.NewBuildState(5, nil, 4, core.DefaultConfiguration())
addr, shutdown := initialiseServer(serverState, 0)
clientState := core.NewBuildState(1, nil, 4, core.DefaultConfiguration())
connectClient(clientState, addr, retries, delay)
go func() {
serverState.LogBuildResult(0, l1, core.PackageParsed, fmt.Sprintf("Parsed %s", l1))
serverState.LogBuildResult(0, l1, core.TargetBuilding, fmt.Sprintf("Building %s", l1))
serverState.LogBuildResult(2, l2, core.TargetBuilding, fmt.Sprintf("Building %s", l2))
serverState.LogBuildResult(0, l1, core.TargetBuilt, fmt.Sprintf("Built %s", l1))
serverState.LogBuildResult(1, l3, core.TargetBuilding, fmt.Sprintf("Building %s", l3))
serverState.LogBuildResult(1, l3, core.TargetBuilt, fmt.Sprintf("Built %s", l3))
serverState.LogBuildResult(2, l2, core.TargetBuilt, fmt.Sprintf("Built %s", l2))
log.Info("Shutting down server")
shutdown()
}()
assert.True(t, runOutput(clientState))
}
func TestResources(t *testing.T) {
serverState := core.NewBuildState(5, nil, 4, core.DefaultConfiguration())
go UpdateResources(serverState)
addr, shutdown := initialiseServer(serverState, 0)
defer shutdown()
clientState := core.NewBuildState(1, nil, 4, core.DefaultConfiguration())
connectClient(clientState, addr, retries, delay)
// Fortunately this is a lot less fiddly than the others, because we always
// receive updates eventually. On the downside it's hard to know when it'll
// be done since we can't observe the actual goroutines that are doing it.
for i := 0; i < 20; i++ {
time.Sleep(resourceUpdateFrequency)
if clientState.Stats.Memory.Used > 0.0 {
break
}
}
// Hard to know what any of the values should be, but of course we must be using
// *some* memory.
assert.True(t, clientState.Stats.Memory.Used > 0.0)
}
| 1 | 8,869 | Necessary? Could you just use DefaultBuildState here? | thought-machine-please | go |
@@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map; | 1 |
package org.twitter.zipkin.storage.cassandra;
import com.datastax.driver.core.BoundStatement;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.KeyspaceMetadata;
import com.datastax.driver.core.PreparedStatement;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.querybuilder.QueryBuilder;
import com.datastax.driver.core.utils.Bytes;
import com.google.common.base.Preconditions;
import com.google.common.io.CharStreams;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.TimeUnit;
public final class Repository implements AutoCloseable {
public static final String KEYSPACE = "zipkin";
public static final short BUCKETS = 10;
private static final Logger LOG = LoggerFactory.getLogger(Repository.class);
private static final Random RAND = new Random();
private static final List<Integer> ALL_BUCKETS = Collections.unmodifiableList(new ArrayList<Integer>() {{
for (int i = 0; i < BUCKETS; ++i) {
add(i);
}
}});
private static final long WRITTEN_NAMES_TTL
= Long.getLong("zipkin.store.cassandra.internal.writtenNamesTtl", 60 * 60 * 1000);
private final Session session;
private final PreparedStatement selectTraces;
private final PreparedStatement insertSpan;
private final PreparedStatement selectDependencies;
private final PreparedStatement insertDependencies;
private final PreparedStatement selectServiceNames;
private final PreparedStatement insertServiceName;
private final PreparedStatement selectSpanNames;
private final PreparedStatement insertSpanName;
private final PreparedStatement selectTraceIdsByServiceName;
private final PreparedStatement insertTraceIdByServiceName;
private final PreparedStatement selectTraceIdsBySpanName;
private final PreparedStatement insertTraceIdBySpanName;
private final PreparedStatement selectTraceIdsByAnnotations;
private final PreparedStatement insertTraceIdByAnnotation;
private final Map<String,String> metadata;
private final ThreadLocal<Set<String>> writtenNames = new ThreadLocal<Set<String>>() {
private long cacheInterval = toCacheInterval(System.currentTimeMillis());
@Override
protected Set<String> initialValue() {
return new HashSet<String>();
}
@Override
public Set<String> get() {
long newCacheInterval = toCacheInterval(System.currentTimeMillis());
if (cacheInterval != newCacheInterval) {
cacheInterval = newCacheInterval;
set(new HashSet<String>());
}
return super.get();
}
private long toCacheInterval(long ms) {
return ms / WRITTEN_NAMES_TTL;
}
};
public Repository(String keyspace, Cluster cluster) {
metadata = Schema.ensureExists(keyspace, cluster);
session = cluster.connect(keyspace);
insertSpan = session.prepare(
QueryBuilder
.insertInto("traces")
.value("trace_id", QueryBuilder.bindMarker("trace_id"))
.value("ts", QueryBuilder.bindMarker("ts"))
.value("span_name", QueryBuilder.bindMarker("span_name"))
.value("span", QueryBuilder.bindMarker("span"))
.using(QueryBuilder.ttl(QueryBuilder.bindMarker("ttl_"))));
selectTraces = session.prepare(
QueryBuilder.select("trace_id", "span")
.from("traces")
.where(QueryBuilder.in("trace_id", QueryBuilder.bindMarker("trace_id")))
.limit(QueryBuilder.bindMarker("limit_")));
selectDependencies = session.prepare(
QueryBuilder.select("dependencies")
.from("dependencies")
.where(QueryBuilder.in("day", QueryBuilder.bindMarker("days"))));
insertDependencies = session.prepare(
QueryBuilder
.insertInto("dependencies")
.value("day", QueryBuilder.bindMarker("day"))
.value("dependencies", QueryBuilder.bindMarker("dependencies")));
selectServiceNames = session.prepare(
QueryBuilder.select("service_name")
.from("service_names"));
insertServiceName = session.prepare(
QueryBuilder
.insertInto("service_names")
.value("service_name", QueryBuilder.bindMarker("service_name"))
.using(QueryBuilder.ttl(QueryBuilder.bindMarker("ttl_"))));
selectSpanNames = session.prepare(
QueryBuilder.select("span_name")
.from("span_names")
.where(QueryBuilder.eq("service_name", QueryBuilder.bindMarker("service_name")))
.and(QueryBuilder.eq("bucket", QueryBuilder.bindMarker("bucket"))));
insertSpanName = session.prepare(
QueryBuilder
.insertInto("span_names")
.value("service_name", QueryBuilder.bindMarker("service_name"))
.value("bucket", QueryBuilder.bindMarker("bucket"))
.value("span_name", QueryBuilder.bindMarker("span_name"))
.using(QueryBuilder.ttl(QueryBuilder.bindMarker("ttl_"))));
selectTraceIdsByServiceName = session.prepare(
QueryBuilder.select("ts", "trace_id")
.from("service_name_index")
.where(QueryBuilder.eq("service_name", QueryBuilder.bindMarker("service_name")))
.and(QueryBuilder.in("bucket", QueryBuilder.bindMarker("bucket")))
.and(QueryBuilder.lte("ts", QueryBuilder.bindMarker("ts")))
.limit(QueryBuilder.bindMarker("limit_"))
.orderBy(QueryBuilder.desc("ts")));
insertTraceIdByServiceName = session.prepare(
QueryBuilder
.insertInto("service_name_index")
.value("service_name", QueryBuilder.bindMarker("service_name"))
.value("bucket", QueryBuilder.bindMarker("bucket"))
.value("ts", QueryBuilder.bindMarker("ts"))
.value("trace_id", QueryBuilder.bindMarker("trace_id"))
.using(QueryBuilder.ttl(QueryBuilder.bindMarker("ttl_"))));
selectTraceIdsBySpanName = session.prepare(
QueryBuilder.select("ts", "trace_id")
.from("service_span_name_index")
.where(QueryBuilder.eq("service_span_name", QueryBuilder.bindMarker("service_span_name")))
.and(QueryBuilder.lte("ts", QueryBuilder.bindMarker("ts")))
.limit(QueryBuilder.bindMarker("limit_"))
.orderBy(QueryBuilder.desc("ts")));
insertTraceIdBySpanName = session.prepare(
QueryBuilder
.insertInto("service_span_name_index")
.value("service_span_name", QueryBuilder.bindMarker("service_span_name"))
.value("ts", QueryBuilder.bindMarker("ts"))
.value("trace_id", QueryBuilder.bindMarker("trace_id"))
.using(QueryBuilder.ttl(QueryBuilder.bindMarker("ttl_"))));
selectTraceIdsByAnnotations = session.prepare(
QueryBuilder.select("ts", "trace_id")
.from("annotations_index")
.where(QueryBuilder.eq("annotation", QueryBuilder.bindMarker("annotation")))
.and(QueryBuilder.in("bucket", QueryBuilder.bindMarker("bucket")))
.and(QueryBuilder.lte("ts", QueryBuilder.bindMarker("ts")))
.limit(QueryBuilder.bindMarker("limit_"))
.orderBy(QueryBuilder.desc("ts")));
insertTraceIdByAnnotation = session.prepare(
QueryBuilder
.insertInto("annotations_index")
.value("annotation", QueryBuilder.bindMarker("annotation"))
.value("bucket", QueryBuilder.bindMarker("bucket"))
.value("ts", QueryBuilder.bindMarker("ts"))
.value("trace_id", QueryBuilder.bindMarker("trace_id"))
.using(QueryBuilder.ttl(QueryBuilder.bindMarker("ttl_"))));
}
/**
* Store the span in the underlying storage for later retrieval.
*/
public void storeSpan(long traceId, long timestamp, String spanName, ByteBuffer span, int ttl) {
Preconditions.checkNotNull(spanName);
Preconditions.checkArgument(!spanName.isEmpty());
if (0 == timestamp && metadata.get("traces.compaction.class").contains("DateTieredCompactionStrategy")) {
LOG.warn("span with no first or last timestamp. "
+ "if this happens a lot consider switching back to SizeTieredCompactionStrategy for "
+ KEYSPACE + ".traces");
}
try {
BoundStatement bound = insertSpan.bind()
.setLong("trace_id", traceId)
.setDate("ts", new Date(timestamp))
.setString("span_name", spanName)
.setBytes("span", span)
.setInt("ttl_", ttl);
if (LOG.isDebugEnabled()) {
LOG.debug(debugInsertSpan(traceId, timestamp, spanName, span, ttl));
}
session.executeAsync(bound);
} catch (RuntimeException ex) {
LOG.error("failed " + debugInsertSpan(traceId, timestamp, spanName, span, ttl), ex);
throw ex;
}
}
private String debugInsertSpan(long traceId, long timestamp, String spanName, ByteBuffer span, int ttl) {
return insertSpan.getQueryString()
.replace(":trace_id", String.valueOf(traceId))
.replace(":ts", String.valueOf(timestamp))
.replace(":span_name", spanName)
.replace(":span", Bytes.toHexString(span))
.replace(":ttl_", String.valueOf(ttl));
}
/**
* Get the available trace information from the storage system.
* Spans in trace should be sorted by the first annotation timestamp
* in that span. First event should be first in the spans list.
*
* The return list will contain only spans that have been found, thus
* the return list may not match the provided list of ids.
*/
public Map<Long,List<ByteBuffer>> getSpansByTraceIds(Long[] traceIds, int limit) {
Preconditions.checkNotNull(traceIds);
try {
Map<Long,List<ByteBuffer>> spans = new HashMap<>();
if (0 < traceIds.length) {
BoundStatement bound = selectTraces.bind()
.setList("trace_id", Arrays.asList(traceIds))
.setInt("limit_", limit);
if (LOG.isDebugEnabled()) {
LOG.debug(debugSelectTraces(traceIds, limit));
}
for (Row row : session.execute(bound).all()) {
long traceId = row.getLong("trace_id");
if (!spans.containsKey(traceId)) {
spans.put(traceId, new ArrayList<ByteBuffer>());
}
spans.get(traceId).add(row.getBytes("span"));
}
}
return spans;
} catch (RuntimeException ex) {
LOG.error("failed " + debugSelectTraces(traceIds, limit), ex);
throw ex;
}
}
private String debugSelectTraces(Long[] traceIds, int limit) {
return selectTraces.getQueryString()
.replace(":trace_id", Arrays.toString(traceIds))
.replace(":limit_", String.valueOf(limit));
}
public void storeDependencies(long epochDayMillis, ByteBuffer dependencies) {
Date startFlooredToDay = new Date(epochDayMillis);
try {
BoundStatement bound = insertDependencies.bind()
.setDate("day", startFlooredToDay)
.setBytes("dependencies", dependencies);
if (LOG.isDebugEnabled()) {
LOG.debug(debugInsertDependencies(startFlooredToDay, dependencies));
}
session.execute(bound);
} catch (RuntimeException ex) {
LOG.error("failed " + debugInsertDependencies(startFlooredToDay, dependencies), ex);
throw ex;
}
}
private String debugInsertDependencies(Date startFlooredToDay, ByteBuffer dependencies) {
return insertDependencies.getQueryString()
.replace(":day", startFlooredToDay.toString())
.replace(":dependencies", Bytes.toHexString(dependencies));
}
public List<ByteBuffer> getDependencies(long startEpochDayMillis, long endEpochDayMillis) {
List<Date> days = getDays(startEpochDayMillis, endEpochDayMillis);
try {
BoundStatement bound = selectDependencies.bind().setList("days", days);
if (LOG.isDebugEnabled()) {
LOG.debug(debugSelectDependencies(days));
}
List<ByteBuffer> dependencies = new ArrayList<>();
for (Row row : session.execute(bound).all()) {
dependencies.add(row.getBytes("dependencies"));
}
return dependencies;
} catch (RuntimeException ex) {
LOG.error("failed " + debugSelectDependencies(days), ex);
throw ex;
}
}
private String debugSelectDependencies(List<Date> days) {
return selectDependencies.getQueryString().replace(":days", Arrays.toString(days.toArray()));
}
public Set<String> getServiceNames() {
try {
Set<String> serviceNames = new HashSet<>();
BoundStatement bound = selectServiceNames.bind();
if (LOG.isDebugEnabled()) {
LOG.debug(selectServiceNames.getQueryString());
}
for (Row row : session.execute(bound).all()) {
serviceNames.add(row.getString("service_name"));
}
return serviceNames;
} catch (RuntimeException ex) {
LOG.error("failed " + selectServiceNames.getQueryString(), ex);
throw ex;
}
}
public void storeServiceName(String serviceName, int ttl) {
Preconditions.checkNotNull(serviceName);
Preconditions.checkArgument(!serviceName.isEmpty());
if (writtenNames.get().add(serviceName)) {
try {
BoundStatement bound = insertServiceName.bind()
.setString("service_name", serviceName)
.setInt("ttl_", ttl);
if (LOG.isDebugEnabled()) {
LOG.debug(debugInsertServiceName(serviceName, ttl));
}
session.executeAsync(bound);
} catch (RuntimeException ex) {
LOG.error("failed " + debugInsertServiceName(serviceName, ttl), ex);
writtenNames.get().remove(serviceName);
throw ex;
}
}
}
private String debugInsertServiceName(String serviceName, int ttl) {
return insertServiceName.getQueryString()
.replace(":service_name", serviceName)
.replace(":ttl_", String.valueOf(ttl));
}
public Set<String> getSpanNames(String serviceName) {
Preconditions.checkNotNull(serviceName);
try {
Set<String> spanNames = new HashSet<>();
if (!serviceName.isEmpty()) {
BoundStatement bound = selectSpanNames.bind()
.setString("service_name", serviceName)
.setInt("bucket", 0);
if (LOG.isDebugEnabled()) {
LOG.debug(debugSelectSpanNames(serviceName));
}
for (Row row : session.execute(bound).all()) {
spanNames.add(row.getString("span_name"));
}
}
return spanNames;
} catch (RuntimeException ex) {
LOG.error("failed " + debugSelectSpanNames(serviceName), ex);
throw ex;
}
}
private String debugSelectSpanNames(String serviceName) {
return selectSpanNames.getQueryString().replace(':' + "service_name", serviceName);
}
public void storeSpanName(String serviceName, String spanName, int ttl) {
Preconditions.checkNotNull(serviceName);
Preconditions.checkArgument(!serviceName.isEmpty());
Preconditions.checkNotNull(spanName);
Preconditions.checkArgument(!spanName.isEmpty());
if (writtenNames.get().add(serviceName + "––" + spanName)) {
try {
BoundStatement bound = insertSpanName.bind()
.setString("service_name", serviceName)
.setInt("bucket", 0)
.setString("span_name", spanName)
.setInt("ttl_", ttl);
if (LOG.isDebugEnabled()) {
LOG.debug(debugInsertSpanName(serviceName, spanName, ttl));
}
session.executeAsync(bound);
} catch (RuntimeException ex) {
LOG.error("failed " + debugInsertSpanName(serviceName, spanName, ttl), ex);
writtenNames.get().remove(serviceName + "––" + spanName);
throw ex;
}
}
}
private String debugInsertSpanName(String serviceName, String spanName, int ttl) {
return insertSpanName.getQueryString()
.replace(":service_name", serviceName)
.replace(":span_name", spanName)
.replace(":ttl_", String.valueOf(ttl));
}
public Map<Long,Long> getTraceIdsByServiceName(String serviceName, long to, int limit) {
Preconditions.checkNotNull(serviceName);
Preconditions.checkArgument(!serviceName.isEmpty());
try {
BoundStatement bound = selectTraceIdsByServiceName.bind()
.setString("service_name", serviceName)
.setList("bucket", ALL_BUCKETS)
.setDate("ts", new Date(to))
.setInt("limit_", limit);
if (LOG.isDebugEnabled()) {
LOG.debug(debugSelectTraceIdsByServiceName(serviceName, to, limit));
}
Map<Long,Long> traceIdsToTimestamps = new HashMap<>();
for (Row row : session.execute(bound).all()) {
traceIdsToTimestamps.put(row.getLong("trace_id"), row.getDate("ts").getTime());
}
return traceIdsToTimestamps;
} catch (RuntimeException ex) {
LOG.error("failed " + debugSelectTraceIdsByServiceName(serviceName, to, limit), ex);
throw ex;
}
}
private String debugSelectTraceIdsByServiceName(String serviceName, long to, int limit) {
return selectTraceIdsByServiceName.getQueryString()
.replace(":service_name", serviceName)
.replace(":ts", new Date(to).toString())
.replace(":limit_", String.valueOf(limit));
}
public void storeTraceIdByServiceName(String serviceName, long timestamp, long traceId, int ttl) {
Preconditions.checkNotNull(serviceName);
Preconditions.checkArgument(!serviceName.isEmpty());
try {
BoundStatement bound = insertTraceIdByServiceName.bind()
.setString("service_name", serviceName)
.setInt("bucket", RAND.nextInt(BUCKETS))
.setDate("ts", new Date(timestamp))
.setLong("trace_id", traceId)
.setInt("ttl_", ttl);
if (LOG.isDebugEnabled()) {
LOG.debug(debugInsertTraceIdByServiceName(serviceName, timestamp, traceId, ttl));
}
session.executeAsync(bound);
} catch (RuntimeException ex) {
LOG.error("failed " + debugInsertTraceIdByServiceName(serviceName, timestamp, traceId, ttl), ex);
throw ex;
}
}
private String debugInsertTraceIdByServiceName(String serviceName, long timestamp, long traceId, int ttl) {
return insertTraceIdByServiceName.getQueryString()
.replace(":service_name", serviceName)
.replace(":ts", new Date(timestamp).toString())
.replace(":trace_id", new Date(traceId).toString())
.replace(":ttl_", String.valueOf(ttl));
}
public Map<Long,Long> getTraceIdsBySpanName(String serviceName, String spanName, long to, int limit) {
Preconditions.checkNotNull(serviceName);
Preconditions.checkArgument(!serviceName.isEmpty());
Preconditions.checkNotNull(spanName);
Preconditions.checkArgument(!spanName.isEmpty());
String serviceSpanName = serviceName + "." + spanName;
try {
BoundStatement bound = selectTraceIdsBySpanName.bind()
.setString("service_span_name", serviceSpanName)
.setDate("ts", new Date(to))
.setInt("limit_", limit);
if (LOG.isDebugEnabled()) {
LOG.debug(debugSelectTraceIdsBySpanName(serviceSpanName, to, limit));
}
Map<Long,Long> traceIdsToTimestamps = new HashMap<>();
for (Row row : session.execute(bound).all()) {
traceIdsToTimestamps.put(row.getLong("trace_id"), row.getDate("ts").getTime());
}
return traceIdsToTimestamps;
} catch (RuntimeException ex) {
LOG.error("failed " + debugSelectTraceIdsBySpanName(serviceSpanName, to, limit), ex);
throw ex;
}
}
private String debugSelectTraceIdsBySpanName(String serviceSpanName, long to, int limit) {
return selectTraceIdsByServiceName.getQueryString()
.replace(":service_span_name", serviceSpanName)
.replace(":ts", new Date(to).toString())
.replace(":limit_", String.valueOf(limit));
}
public void storeTraceIdBySpanName(String serviceName, String spanName, long timestamp, long traceId, int ttl) {
Preconditions.checkNotNull(serviceName);
Preconditions.checkArgument(!serviceName.isEmpty());
Preconditions.checkNotNull(spanName);
Preconditions.checkArgument(!spanName.isEmpty());
try {
String serviceSpanName = serviceName + "." + spanName;
BoundStatement bound = insertTraceIdBySpanName.bind()
.setString("service_span_name", serviceSpanName)
.setDate("ts", new Date(timestamp))
.setLong("trace_id", traceId)
.setInt("ttl_", ttl);
if (LOG.isDebugEnabled()) {
LOG.debug(debugInsertTraceIdBySpanName(serviceSpanName, timestamp, traceId, ttl));
}
session.executeAsync(bound);
} catch (RuntimeException ex) {
LOG.error("failed " + debugInsertTraceIdBySpanName(serviceName, timestamp, traceId, ttl), ex);
throw ex;
}
}
private String debugInsertTraceIdBySpanName(String serviceSpanName, long timestamp, long traceId, int ttl) {
return insertTraceIdBySpanName.getQueryString()
.replace(":service_span_name", serviceSpanName)
.replace(":ts", String.valueOf(timestamp))
.replace(":trace_id", String.valueOf(traceId))
.replace(":ttl_", String.valueOf(ttl));
}
public Map<Long,Long> getTraceIdsByAnnotation(ByteBuffer annotationKey, long from, int limit) {
try {
BoundStatement bound = selectTraceIdsByAnnotations.bind()
.setBytes("annotation", annotationKey)
.setList("bucket", ALL_BUCKETS)
.setDate("ts", new Date(from))
.setInt("limit_", limit);
if (LOG.isDebugEnabled()) {
LOG.debug(debugSelectTraceIdsByAnnotations(annotationKey, from, limit));
}
Map<Long,Long> traceIdsToTimestamps = new HashMap<>();
for (Row row : session.execute(bound).all()) {
traceIdsToTimestamps.put(row.getLong("trace_id"), row.getDate("ts").getTime());
}
return traceIdsToTimestamps;
} catch (RuntimeException ex) {
LOG.error("failed " + debugSelectTraceIdsByAnnotations(annotationKey, from, limit), ex);
throw ex;
}
}
private String debugSelectTraceIdsByAnnotations(ByteBuffer annotationKey, long from, int limit) {
return selectTraceIdsByAnnotations.getQueryString()
.replace(":annotation", new String(Bytes.getArray(annotationKey)))
.replace(":ts", new Date(from).toString())
.replace(":limit_", String.valueOf(limit));
}
public void storeTraceIdByAnnotation(ByteBuffer annotationKey, long timestamp, long traceId, int ttl) {
try {
BoundStatement bound = insertTraceIdByAnnotation.bind()
.setBytes("annotation", annotationKey)
.setInt("bucket", RAND.nextInt(BUCKETS))
.setDate("ts", new Date(timestamp))
.setLong("trace_id", traceId)
.setInt("ttl_", ttl);
if (LOG.isDebugEnabled()) {
LOG.debug(debugInsertTraceIdByAnnotation(annotationKey, timestamp, traceId, ttl));
}
session.executeAsync(bound);
} catch (RuntimeException ex) {
LOG.error("failed " + debugInsertTraceIdByAnnotation(annotationKey, timestamp, traceId, ttl), ex);
throw ex;
}
}
private String debugInsertTraceIdByAnnotation(ByteBuffer annotationKey, long timestamp, long traceId, int ttl) {
return insertTraceIdByAnnotation.getQueryString()
.replace(":annotation", new String(Bytes.getArray(annotationKey)))
.replace(":ts", new Date(timestamp).toString())
.replace(":trace_id", String.valueOf(traceId))
.replace(":ttl_", String.valueOf(ttl));
}
private static List<Date> getDays(long from, long to) {
List<Date> days = new ArrayList<>();
for (long time = from; time <= to; time += TimeUnit.DAYS.toMillis(1)) {
days.add(new Date(time));
}
return days;
}
@Override
public void close() {
session.close();
}
private static class Schema {
private static final String SCHEMA = "/cassandra-schema-cql3.txt";
static Map<String,String> ensureExists(String keyspace, Cluster cluster) {
Map<String,String> metadata = new HashMap<>();
try (Session session = cluster.connect()) {
try (Reader reader = new InputStreamReader(Schema.class.getResourceAsStream(SCHEMA))) {
for (String cmd : String.format(CharStreams.toString(reader)).split(";")) {
cmd = cmd.trim().replace(" " + KEYSPACE, " " + keyspace);
if (!cmd.isEmpty()) {
session.execute(cmd);
}
}
}
KeyspaceMetadata keyspaceMetadata = cluster.getMetadata().getKeyspace(keyspace);
Map<String,String> replicatn = keyspaceMetadata.getReplication();
if("SimpleStrategy".equals(replicatn.get("class")) && "1".equals(replicatn.get("replication_factor"))) {
LOG.warn("running with RF=1, this is not suitable for production. Optimal is 3+");
}
Map<String,String> tracesCompaction = keyspaceMetadata.getTable("traces").getOptions().getCompaction();
metadata.put("traces.compaction.class", tracesCompaction.get("class"));
} catch (IOException ex) {
LOG.error(ex.getMessage(), ex);
}
return metadata;
}
private Schema() {}
}
}
| 1 | 10,324 | linked hashmap retains order | openzipkin-zipkin | java |
@@ -20,12 +20,12 @@
#include <wlr/render/matrix.h>
#include <wlr/render/gles2.h>
#include <wlr/render.h>
-#include "backend/drm.h"
-#include "backend/drm-util.h"
+#include "backend/drm/drm.h"
+#include "backend/drm/util.h"
bool wlr_drm_check_features(struct wlr_drm_backend *backend) {
- extern const struct wlr_drm_interface legacy_iface;
- extern const struct wlr_drm_interface atomic_iface;
+ extern const struct wlr_drm_interface iface_legacy;
+ extern const struct wlr_drm_interface iface_atomic;
if (drmSetClientCap(backend->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1)) {
wlr_log(L_ERROR, "DRM universal planes unsupported"); | 1 | #include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <errno.h>
#include <time.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include <drm_mode.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <gbm.h>
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <wayland-server.h>
#include <wlr/backend/interface.h>
#include <wlr/interfaces/wlr_output.h>
#include <wlr/util/log.h>
#include <wlr/render/matrix.h>
#include <wlr/render/gles2.h>
#include <wlr/render.h>
#include "backend/drm.h"
#include "backend/drm-util.h"
bool wlr_drm_check_features(struct wlr_drm_backend *backend) {
extern const struct wlr_drm_interface legacy_iface;
extern const struct wlr_drm_interface atomic_iface;
if (drmSetClientCap(backend->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1)) {
wlr_log(L_ERROR, "DRM universal planes unsupported");
return false;
}
if (getenv("WLR_DRM_NO_ATOMIC")) {
wlr_log(L_DEBUG, "WLR_DRM_NO_ATOMIC set, forcing legacy DRM interface");
backend->iface = &legacy_iface;
} else if (drmSetClientCap(backend->fd, DRM_CLIENT_CAP_ATOMIC, 1)) {
wlr_log(L_DEBUG, "Atomic modesetting unsupported, using legacy DRM interface");
backend->iface = &legacy_iface;
} else {
wlr_log(L_DEBUG, "Using atomic DRM interface");
backend->iface = &atomic_iface;
}
return true;
}
static int cmp_plane(const void *arg1, const void *arg2) {
const struct wlr_drm_plane *a = arg1;
const struct wlr_drm_plane *b = arg2;
return (int)a->type - (int)b->type;
}
static bool init_planes(struct wlr_drm_backend *backend) {
drmModePlaneRes *plane_res = drmModeGetPlaneResources(backend->fd);
if (!plane_res) {
wlr_log_errno(L_ERROR, "Failed to get DRM plane resources");
return false;
}
wlr_log(L_INFO, "Found %"PRIu32" DRM planes", plane_res->count_planes);
if (plane_res->count_planes == 0) {
drmModeFreePlaneResources(plane_res);
return true;
}
backend->num_planes = plane_res->count_planes;
backend->planes = calloc(backend->num_planes, sizeof(*backend->planes));
if (!backend->planes) {
wlr_log_errno(L_ERROR, "Allocation failed");
goto error_res;
}
for (size_t i = 0; i < backend->num_planes; ++i) {
struct wlr_drm_plane *p = &backend->planes[i];
drmModePlane *plane = drmModeGetPlane(backend->fd, plane_res->planes[i]);
if (!plane) {
wlr_log_errno(L_ERROR, "Failed to get DRM plane");
goto error_planes;
}
p->id = plane->plane_id;
p->possible_crtcs = plane->possible_crtcs;
uint64_t type;
if (!wlr_drm_get_plane_props(backend->fd, p->id, &p->props) ||
!wlr_drm_get_prop(backend->fd, p->id, p->props.type, &type)) {
drmModeFreePlane(plane);
goto error_planes;
}
p->type = type;
backend->num_type_planes[type]++;
drmModeFreePlane(plane);
}
wlr_log(L_INFO, "(%zu overlay, %zu primary, %zu cursor)",
backend->num_overlay_planes,
backend->num_primary_planes,
backend->num_cursor_planes);
qsort(backend->planes, backend->num_planes,
sizeof(*backend->planes), cmp_plane);
backend->overlay_planes = backend->planes;
backend->primary_planes = backend->overlay_planes
+ backend->num_overlay_planes;
backend->cursor_planes = backend->primary_planes
+ backend->num_primary_planes;
drmModeFreePlaneResources(plane_res);
return true;
error_planes:
free(backend->planes);
error_res:
drmModeFreePlaneResources(plane_res);
return false;
}
bool wlr_drm_resources_init(struct wlr_drm_backend *backend) {
drmModeRes *res = drmModeGetResources(backend->fd);
if (!res) {
wlr_log_errno(L_ERROR, "Failed to get DRM resources");
return false;
}
wlr_log(L_INFO, "Found %d DRM CRTCs", res->count_crtcs);
backend->num_crtcs = res->count_crtcs;
backend->crtcs = calloc(backend->num_crtcs, sizeof(backend->crtcs[0]));
if (!backend->crtcs) {
wlr_log_errno(L_ERROR, "Allocation failed");
goto error_res;
}
for (size_t i = 0; i < backend->num_crtcs; ++i) {
struct wlr_drm_crtc *crtc = &backend->crtcs[i];
crtc->id = res->crtcs[i];
wlr_drm_get_crtc_props(backend->fd, crtc->id, &crtc->props);
}
if (!init_planes(backend)) {
goto error_crtcs;
}
drmModeFreeResources(res);
return true;
error_crtcs:
free(backend->crtcs);
error_res:
drmModeFreeResources(res);
return false;
}
void wlr_drm_resources_free(struct wlr_drm_backend *backend) {
if (!backend) {
return;
}
for (size_t i = 0; i < backend->num_crtcs; ++i) {
struct wlr_drm_crtc *crtc = &backend->crtcs[i];
drmModeAtomicFree(crtc->atomic);
if (crtc->mode_id) {
drmModeDestroyPropertyBlob(backend->fd, crtc->mode_id);
}
}
free(backend->crtcs);
free(backend->planes);
}
bool wlr_drm_renderer_init(struct wlr_drm_renderer *renderer, int fd) {
renderer->gbm = gbm_create_device(fd);
if (!renderer->gbm) {
wlr_log(L_ERROR, "Failed to create GBM device: %s", strerror(errno));
return false;
}
if (!wlr_egl_init(&renderer->egl, EGL_PLATFORM_GBM_MESA,
GBM_FORMAT_ARGB8888, renderer->gbm)) {
gbm_device_destroy(renderer->gbm);
return false;
}
renderer->fd = fd;
return true;
}
void wlr_drm_renderer_free(struct wlr_drm_renderer *renderer) {
if (!renderer) {
return;
}
wlr_egl_free(&renderer->egl);
gbm_device_destroy(renderer->gbm);
}
static bool wlr_drm_plane_renderer_init(struct wlr_drm_renderer *renderer,
struct wlr_drm_plane *plane, uint32_t width, uint32_t height, uint32_t format, uint32_t flags) {
if (plane->width == width && plane->height == height) {
return true;
}
plane->width = width;
plane->height = height;
plane->gbm = gbm_surface_create(renderer->gbm, width, height,
format, GBM_BO_USE_RENDERING | flags);
if (!plane->gbm) {
wlr_log_errno(L_ERROR, "Failed to create GBM surface for plane");
return false;
}
plane->egl = wlr_egl_create_surface(&renderer->egl, plane->gbm);
if (plane->egl == EGL_NO_SURFACE) {
wlr_log(L_ERROR, "Failed to create EGL surface for plane");
return false;
}
return true;
}
static void wlr_drm_plane_renderer_free(struct wlr_drm_renderer *renderer,
struct wlr_drm_plane *plane) {
if (!renderer || !plane) {
return;
}
eglMakeCurrent(renderer->egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (plane->front) {
gbm_surface_release_buffer(plane->gbm, plane->front);
}
if (plane->back) {
gbm_surface_release_buffer(plane->gbm, plane->back);
}
if (plane->egl) {
eglDestroySurface(renderer->egl.display, plane->egl);
}
if (plane->gbm) {
gbm_surface_destroy(plane->gbm);
}
if (plane->wlr_tex) {
wlr_texture_destroy(plane->wlr_tex);
}
if (plane->wlr_rend) {
wlr_renderer_destroy(plane->wlr_rend);
}
if (plane->cursor_bo) {
gbm_bo_destroy(plane->cursor_bo);
}
plane->width = 0;
plane->height = 0;
plane->egl = EGL_NO_SURFACE;
plane->gbm = NULL;
plane->front = NULL;
plane->back = NULL;
plane->wlr_rend = NULL;
plane->wlr_tex = NULL;
plane->cursor_bo = NULL;
}
static void wlr_drm_plane_make_current(struct wlr_drm_renderer *renderer,
struct wlr_drm_plane *plane) {
eglMakeCurrent(renderer->egl.display, plane->egl, plane->egl,
renderer->egl.context);
}
static void wlr_drm_plane_swap_buffers(struct wlr_drm_renderer *renderer,
struct wlr_drm_plane *plane) {
if (plane->front) {
gbm_surface_release_buffer(plane->gbm, plane->front);
}
eglSwapBuffers(renderer->egl.display, plane->egl);
plane->front = plane->back;
plane->back = gbm_surface_lock_front_buffer(plane->gbm);
}
static void wlr_drm_output_make_current(struct wlr_output *_output) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
wlr_drm_plane_make_current(output->renderer, output->crtc->primary);
}
static void wlr_drm_output_swap_buffers(struct wlr_output *_output) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
struct wlr_drm_backend *backend =
wl_container_of(output->renderer, backend, renderer);
struct wlr_drm_renderer *renderer = output->renderer;
struct wlr_drm_crtc *crtc = output->crtc;
struct wlr_drm_plane *plane = crtc->primary;
wlr_drm_plane_swap_buffers(renderer, plane);
uint32_t fb_id = get_fb_for_bo(plane->back);
if (backend->iface->crtc_pageflip(backend, output, crtc, fb_id, NULL)) {
output->pageflip_pending = true;
} else {
wl_event_source_timer_update(output->retry_pageflip,
1000.0f / output->output.current_mode->refresh);
}
}
static void wlr_drm_output_set_gamma(struct wlr_output *_output,
uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
struct wlr_drm_backend *backend =
wl_container_of(output->renderer, backend, renderer);
drmModeCrtcSetGamma(backend->fd, output->crtc->id, size, r, g, b);
}
static uint16_t wlr_drm_output_get_gamma_size(struct wlr_output *_output) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
drmModeCrtc *crtc = output->old_crtc;
if (!crtc) {
return 0;
}
return crtc->gamma_size;
}
void wlr_drm_output_start_renderer(struct wlr_drm_output *output) {
if (output->state != WLR_DRM_OUTPUT_CONNECTED) {
return;
}
struct wlr_drm_backend *backend =
wl_container_of(output->renderer, backend, renderer);
struct wlr_drm_renderer *renderer = output->renderer;
struct wlr_drm_crtc *crtc = output->crtc;
struct wlr_drm_plane *plane = crtc->primary;
struct gbm_bo *bo = plane->front;
if (!bo) {
// Render a black frame to start the rendering loop
wlr_drm_plane_make_current(renderer, plane);
glViewport(0, 0, plane->width, plane->height);
glClearColor(0.0, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
wlr_drm_plane_swap_buffers(renderer, plane);
bo = plane->back;
}
struct wlr_drm_output_mode *_mode =
(struct wlr_drm_output_mode *)output->output.current_mode;
drmModeModeInfo *mode = &_mode->mode;
if (backend->iface->crtc_pageflip(backend, output, crtc, get_fb_for_bo(bo), mode)) {
output->pageflip_pending = true;
} else {
wl_event_source_timer_update(output->retry_pageflip,
1000.0f / output->output.current_mode->refresh);
}
}
static void wlr_drm_output_enable(struct wlr_output *_output, bool enable) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
struct wlr_drm_backend *backend =
wl_container_of(output->renderer, backend, renderer);
if (output->state != WLR_DRM_OUTPUT_CONNECTED) {
return;
}
backend->iface->conn_enable(backend, output, enable);
if (enable) {
wlr_drm_output_start_renderer(output);
}
}
static void realloc_planes(struct wlr_drm_backend *backend, const uint32_t *crtc_in) {
// overlay, primary, cursor
for (int type = 0; type < 3; ++type) {
if (backend->num_type_planes[type] == 0) {
continue;
}
uint32_t possible[backend->num_type_planes[type]];
uint32_t crtc[backend->num_crtcs];
uint32_t crtc_res[backend->num_crtcs];
for (size_t i = 0; i < backend->num_type_planes[type]; ++i) {
possible[i] = backend->type_planes[type][i].possible_crtcs;
}
for (size_t i = 0; i < backend->num_crtcs; ++i) {
if (crtc_in[i] == UNMATCHED) {
crtc[i] = SKIP;
} else if (backend->crtcs[i].planes[type]) {
crtc[i] = backend->crtcs[i].planes[type]
- backend->type_planes[type];
} else {
crtc[i] = UNMATCHED;
}
}
match_obj(backend->num_type_planes[type], possible,
backend->num_crtcs, crtc, crtc_res);
for (size_t i = 0; i < backend->num_crtcs; ++i) {
if (crtc_res[i] == UNMATCHED || crtc_res[i] == SKIP) {
continue;
}
struct wlr_drm_crtc *c = &backend->crtcs[i];
struct wlr_drm_plane **old = &c->planes[type];
struct wlr_drm_plane *new = &backend->type_planes[type][crtc_res[i]];
if (*old != new) {
wlr_drm_plane_renderer_free(&backend->renderer, *old);
wlr_drm_plane_renderer_free(&backend->renderer, new);
*old = new;
}
}
}
}
static void realloc_crtcs(struct wlr_drm_backend *backend,
struct wlr_drm_output *output) {
uint32_t crtc[backend->num_crtcs];
uint32_t crtc_res[backend->num_crtcs];
uint32_t possible_crtc[backend->outputs->length];
for (size_t i = 0; i < backend->num_crtcs; ++i) {
crtc[i] = UNMATCHED;
}
memset(possible_crtc, 0, sizeof(possible_crtc));
ssize_t index = -1;
for (size_t i = 0; i < backend->outputs->length; ++i) {
struct wlr_drm_output *o = backend->outputs->items[i];
if (o == output) {
index = i;
}
if (o->state != WLR_DRM_OUTPUT_CONNECTED) {
continue;
}
possible_crtc[i] = o->possible_crtc;
crtc[o->crtc - backend->crtcs] = i;
}
assert(index != -1);
possible_crtc[index] = output->possible_crtc;
match_obj(backend->outputs->length, possible_crtc,
backend->num_crtcs, crtc, crtc_res);
bool matched = false;
for (size_t i = 0; i < backend->num_crtcs; ++i) {
// We don't want any of the current monitors to be deactivated.
if (crtc[i] != UNMATCHED && crtc_res[i] == UNMATCHED) {
return;
}
if (crtc_res[i] == index) {
matched = true;
}
}
// There is no point doing anything if this monitor doesn't get activated
if (!matched) {
return;
}
for (size_t i = 0; i < backend->num_crtcs; ++i) {
if (crtc_res[i] == UNMATCHED) {
continue;
}
if (crtc_res[i] != crtc[i]) {
struct wlr_drm_output *o = backend->outputs->items[crtc_res[i]];
o->crtc = &backend->crtcs[i];
}
}
realloc_planes(backend, crtc_res);
}
static bool wlr_drm_output_set_mode(struct wlr_output *_output,
struct wlr_output_mode *mode) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
struct wlr_drm_backend *backend
= wl_container_of(output->renderer, backend, renderer);
wlr_log(L_INFO, "Modesetting '%s' with '%ux%u@%u mHz'", output->output.name,
mode->width, mode->height, mode->refresh);
drmModeConnector *conn = drmModeGetConnector(backend->fd, output->connector);
if (!conn) {
wlr_log_errno(L_ERROR, "Failed to get DRM connector");
goto error_output;
}
if (conn->connection != DRM_MODE_CONNECTED || conn->count_modes == 0) {
wlr_log(L_ERROR, "%s is not connected", output->output.name);
goto error_output;
}
drmModeEncoder *enc = NULL;
for (int i = 0; !enc && i < conn->count_encoders; ++i) {
enc = drmModeGetEncoder(backend->fd, conn->encoders[i]);
}
if (!enc) {
wlr_log(L_ERROR, "Failed to get DRM encoder");
goto error_conn;
}
output->possible_crtc = enc->possible_crtcs;
realloc_crtcs(backend, output);
if (!output->crtc) {
wlr_log(L_ERROR, "Unable to match %s with a CRTC", output->output.name);
goto error_enc;
}
struct wlr_drm_crtc *crtc = output->crtc;
wlr_log(L_DEBUG, "%s: crtc=%ju ovr=%jd pri=%jd cur=%jd", output->output.name,
crtc - backend->crtcs,
crtc->overlay ? crtc->overlay - backend->overlay_planes : -1,
crtc->primary ? crtc->primary - backend->primary_planes : -1,
crtc->cursor ? crtc->cursor - backend->cursor_planes : -1);
output->state = WLR_DRM_OUTPUT_CONNECTED;
output->width = output->output.width = mode->width;
output->height = output->output.height = mode->height;
output->output.current_mode = mode;
wl_signal_emit(&output->output.events.resolution, &output->output);
// Since realloc_crtcs can deallocate planes on OTHER outputs,
// we actually need to reinitalise all of them
for (size_t i = 0; i < backend->outputs->length; ++i) {
struct wlr_drm_output *output = backend->outputs->items[i];
struct wlr_output_mode *mode = output->output.current_mode;
struct wlr_drm_crtc *crtc = output->crtc;
if (output->state != WLR_DRM_OUTPUT_CONNECTED) {
continue;
}
if (!wlr_drm_plane_renderer_init(&backend->renderer, crtc->primary,
mode->width, mode->height, GBM_FORMAT_XRGB8888,
GBM_BO_USE_SCANOUT)) {
wlr_log(L_ERROR, "Failed to initalise renderer for plane");
goto error_enc;
}
wlr_drm_output_start_renderer(output);
}
drmModeFreeEncoder(enc);
drmModeFreeConnector(conn);
return true;
error_enc:
drmModeFreeEncoder(enc);
error_conn:
drmModeFreeConnector(conn);
error_output:
wlr_drm_output_cleanup(output);
return false;
}
static void wlr_drm_output_transform(struct wlr_output *output,
enum wl_output_transform transform) {
output->transform = transform;
}
static bool wlr_drm_output_set_cursor(struct wlr_output *_output,
const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
struct wlr_drm_backend *backend
= wl_container_of(output->renderer, backend, renderer);
struct wlr_drm_renderer *renderer = output->renderer;
struct wlr_drm_crtc *crtc = output->crtc;
struct wlr_drm_plane *plane = crtc->cursor;
if (!buf) {
return backend->iface->crtc_set_cursor(backend, crtc, NULL);
}
// We don't have a real cursor plane, so we make a fake one
if (!plane) {
plane = calloc(1, sizeof(*plane));
if (!plane) {
wlr_log_errno(L_ERROR, "Allocation failed");
return false;
}
crtc->cursor = plane;
}
if (!plane->gbm) {
int ret;
uint64_t w, h;
ret = drmGetCap(backend->fd, DRM_CAP_CURSOR_WIDTH, &w);
w = ret ? 64 : w;
ret = drmGetCap(backend->fd, DRM_CAP_CURSOR_HEIGHT, &h);
h = ret ? 64 : h;
if (width > w || height > h) {
wlr_log(L_INFO, "Cursor too large (max %dx%d)", (int)w, (int)h);
return false;
}
if (!wlr_drm_plane_renderer_init(renderer, plane, w, h, GBM_FORMAT_ARGB8888, 0)) {
wlr_log(L_ERROR, "Cannot allocate cursor resources");
return false;
}
plane->cursor_bo = gbm_bo_create(renderer->gbm, w, h, GBM_FORMAT_ARGB8888,
GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE);
if (!plane->cursor_bo) {
wlr_log_errno(L_ERROR, "Failed to create cursor bo");
return false;
}
// OpenGL will read the pixels out upside down,
// so we need to flip the image vertically
wlr_matrix_texture(plane->matrix, plane->width, plane->height,
output->output.transform ^ WL_OUTPUT_TRANSFORM_FLIPPED_180);
// TODO the image needs to be rotated depending on the output rotation
plane->wlr_rend = wlr_gles2_renderer_create(&backend->backend);
if (!plane->wlr_rend) {
return false;
}
plane->wlr_tex = wlr_render_texture_create(plane->wlr_rend);
if (!plane->wlr_tex) {
return false;
}
}
struct gbm_bo *bo = plane->cursor_bo;
uint32_t bo_width = gbm_bo_get_width(bo);
uint32_t bo_height = gbm_bo_get_height(bo);
uint32_t bo_stride;
void *bo_data;
if (!gbm_bo_map(bo, 0, 0, bo_width, bo_height,
GBM_BO_TRANSFER_WRITE, &bo_stride, &bo_data)) {
wlr_log_errno(L_ERROR, "Unable to map buffer");
return false;
}
wlr_drm_plane_make_current(renderer, plane);
wlr_texture_upload_pixels(plane->wlr_tex, WL_SHM_FORMAT_ARGB8888,
stride, width, height, buf);
glViewport(0, 0, plane->width, plane->height);
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
float matrix[16];
wlr_texture_get_matrix(plane->wlr_tex, &matrix, &plane->matrix, 0, 0);
wlr_render_with_matrix(plane->wlr_rend, plane->wlr_tex, &matrix);
glFinish();
glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, bo_stride);
glReadPixels(0, 0, plane->width, plane->height, GL_BGRA_EXT, GL_UNSIGNED_BYTE, bo_data);
glPixelStorei(GL_UNPACK_ROW_LENGTH_EXT, 0);
wlr_drm_plane_swap_buffers(renderer, plane);
gbm_bo_unmap(bo, bo_data);
return backend->iface->crtc_set_cursor(backend, crtc, bo);
}
static bool wlr_drm_output_move_cursor(struct wlr_output *_output,
int x, int y) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
struct wlr_drm_backend *backend =
wl_container_of(output->renderer, backend, renderer);
int width, height, tmp;
wlr_output_effective_resolution(_output, &width, &height);
switch (_output->transform) {
case WL_OUTPUT_TRANSFORM_NORMAL:
// nothing to do
break;
case WL_OUTPUT_TRANSFORM_270:
tmp = x;
x = y;
y = -(tmp - width);
break;
case WL_OUTPUT_TRANSFORM_90:
tmp = x;
x = -(y - height);
y = tmp;
break;
default:
// TODO other transformations
wlr_log(L_ERROR, "TODO: handle surface to crtc for transformation = %d",
_output->transform);
break;
}
return backend->iface->crtc_move_cursor(backend, output->crtc, x, y);
}
static void wlr_drm_output_destroy(struct wlr_output *_output) {
struct wlr_drm_output *output = (struct wlr_drm_output *)_output;
wlr_drm_output_cleanup(output);
wl_event_source_remove(output->retry_pageflip);
free(output);
}
static struct wlr_output_impl output_impl = {
.enable = wlr_drm_output_enable,
.set_mode = wlr_drm_output_set_mode,
.transform = wlr_drm_output_transform,
.set_cursor = wlr_drm_output_set_cursor,
.move_cursor = wlr_drm_output_move_cursor,
.destroy = wlr_drm_output_destroy,
.make_current = wlr_drm_output_make_current,
.swap_buffers = wlr_drm_output_swap_buffers,
.set_gamma = wlr_drm_output_set_gamma,
.get_gamma_size = wlr_drm_output_get_gamma_size,
};
static int retry_pageflip(void *data) {
struct wlr_drm_output *output = data;
wlr_log(L_INFO, "%s: Retrying pageflip", output->output.name);
wlr_drm_output_start_renderer(output);
return 0;
}
static int find_id(const void *item, const void *cmp_to) {
const struct wlr_drm_output *output = item;
const uint32_t *id = cmp_to;
if (output->connector < *id) {
return -1;
} else if (output->connector > *id) {
return 1;
} else {
return 0;
}
}
static const int32_t subpixel_map[] = {
[DRM_MODE_SUBPIXEL_UNKNOWN] = WL_OUTPUT_SUBPIXEL_UNKNOWN,
[DRM_MODE_SUBPIXEL_HORIZONTAL_RGB] = WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB,
[DRM_MODE_SUBPIXEL_HORIZONTAL_BGR] = WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR,
[DRM_MODE_SUBPIXEL_VERTICAL_RGB] = WL_OUTPUT_SUBPIXEL_VERTICAL_RGB,
[DRM_MODE_SUBPIXEL_VERTICAL_BGR] = WL_OUTPUT_SUBPIXEL_VERTICAL_BGR,
[DRM_MODE_SUBPIXEL_NONE] = WL_OUTPUT_SUBPIXEL_NONE,
};
void wlr_drm_scan_connectors(struct wlr_drm_backend *backend) {
wlr_log(L_INFO, "Scanning DRM connectors");
drmModeRes *res = drmModeGetResources(backend->fd);
if (!res) {
wlr_log_errno(L_ERROR, "Failed to get DRM resources");
return;
}
size_t seen_len = backend->outputs->length;
// +1 so it can never be 0
bool seen[seen_len + 1];
memset(seen, 0, sizeof(seen));
for (int i = 0; i < res->count_connectors; ++i) {
drmModeConnector *conn = drmModeGetConnector(backend->fd,
res->connectors[i]);
if (!conn) {
wlr_log_errno(L_ERROR, "Failed to get DRM connector");
continue;
}
struct wlr_drm_output *output;
int index = list_seq_find(backend->outputs, find_id, &conn->connector_id);
if (index == -1) {
output = calloc(1, sizeof(*output));
if (!output) {
wlr_log_errno(L_ERROR, "Allocation failed");
drmModeFreeConnector(conn);
continue;
}
wlr_output_init(&output->output, &output_impl);
struct wl_event_loop *ev = wl_display_get_event_loop(backend->display);
output->retry_pageflip = wl_event_loop_add_timer(ev, retry_pageflip,
output);
output->renderer = &backend->renderer;
output->state = WLR_DRM_OUTPUT_DISCONNECTED;
output->connector = conn->connector_id;
drmModeEncoder *curr_enc = drmModeGetEncoder(backend->fd,
conn->encoder_id);
if (curr_enc) {
output->old_crtc = drmModeGetCrtc(backend->fd, curr_enc->crtc_id);
drmModeFreeEncoder(curr_enc);
}
output->output.phys_width = conn->mmWidth;
output->output.phys_height = conn->mmHeight;
output->output.subpixel = subpixel_map[conn->subpixel];
snprintf(output->output.name, sizeof(output->output.name), "%s-%"PRIu32,
conn_get_name(conn->connector_type),
conn->connector_type_id);
wlr_drm_get_connector_props(backend->fd,
output->connector, &output->props);
size_t edid_len = 0;
uint8_t *edid = wlr_drm_get_prop_blob(backend->fd,
output->connector, output->props.edid, &edid_len);
parse_edid(&output->output, edid_len, edid);
free(edid);
if (list_add(backend->outputs, output) == -1) {
wlr_log_errno(L_ERROR, "Allocation failed");
drmModeFreeConnector(conn);
wl_event_source_remove(output->retry_pageflip);
free(output);
continue;
}
wlr_output_create_global(&output->output, backend->display);
wlr_log(L_INFO, "Found display '%s'", output->output.name);
} else {
output = backend->outputs->items[index];
seen[index] = true;
}
if (output->state == WLR_DRM_OUTPUT_DISCONNECTED &&
conn->connection == DRM_MODE_CONNECTED) {
wlr_log(L_INFO, "'%s' connected", output->output.name);
wlr_log(L_INFO, "Detected modes:");
for (int i = 0; i < conn->count_modes; ++i) {
struct wlr_drm_output_mode *mode = calloc(1,
sizeof(struct wlr_drm_output_mode));
if (!mode) {
wlr_log_errno(L_ERROR, "Allocation failed");
continue;
}
mode->mode = conn->modes[i];
mode->wlr_mode.width = mode->mode.hdisplay;
mode->wlr_mode.height = mode->mode.vdisplay;
mode->wlr_mode.refresh = calculate_refresh_rate(&mode->mode);
wlr_log(L_INFO, " %"PRId32"@%"PRId32"@%"PRId32,
mode->wlr_mode.width, mode->wlr_mode.height,
mode->wlr_mode.refresh);
if (list_add(output->output.modes, mode) == -1) {
wlr_log_errno(L_ERROR, "Allocation failed");
free(mode);
continue;
}
}
output->state = WLR_DRM_OUTPUT_NEEDS_MODESET;
wlr_log(L_INFO, "Sending modesetting signal for '%s'", output->output.name);
wl_signal_emit(&backend->backend.events.output_add, &output->output);
} else if (output->state == WLR_DRM_OUTPUT_CONNECTED &&
conn->connection != DRM_MODE_CONNECTED) {
wlr_log(L_INFO, "'%s' disconnected", output->output.name);
wlr_drm_output_cleanup(output);
}
drmModeFreeConnector(conn);
}
drmModeFreeResources(res);
for (size_t i = seen_len; i-- > 0;) {
if (seen[i]) {
continue;
}
struct wlr_drm_output *output = backend->outputs->items[i];
wlr_log(L_INFO, "'%s' disappeared", output->output.name);
wlr_drm_output_cleanup(output);
drmModeFreeCrtc(output->old_crtc);
wl_event_source_remove(output->retry_pageflip);
free(output);
list_del(backend->outputs, i);
}
}
static void page_flip_handler(int fd, unsigned seq,
unsigned tv_sec, unsigned tv_usec, void *user) {
struct wlr_drm_output *output = user;
struct wlr_drm_backend *backend =
wl_container_of(output->renderer, backend, renderer);
output->pageflip_pending = false;
if (output->state != WLR_DRM_OUTPUT_CONNECTED) {
return;
}
struct wlr_drm_plane *plane = output->crtc->primary;
if (plane->front) {
gbm_surface_release_buffer(plane->gbm, plane->front);
plane->front = NULL;
}
if (backend->session->active) {
wl_signal_emit(&output->output.events.frame, &output->output);
}
}
int wlr_drm_event(int fd, uint32_t mask, void *data) {
drmEventContext event = {
.version = DRM_EVENT_CONTEXT_VERSION,
.page_flip_handler = page_flip_handler,
};
drmHandleEvent(fd, &event);
return 1;
}
void wlr_drm_restore_outputs(struct wlr_drm_backend *drm) {
uint64_t to_close = (1 << drm->outputs->length) - 1;
for (size_t i = 0; i < drm->outputs->length; ++i) {
struct wlr_drm_output *output = drm->outputs->items[i];
if (output->state == WLR_DRM_OUTPUT_CONNECTED) {
output->state = WLR_DRM_OUTPUT_CLEANUP;
}
}
time_t timeout = time(NULL) + 5;
while (to_close && time(NULL) < timeout) {
wlr_drm_event(drm->fd, 0, NULL);
for (size_t i = 0; i < drm->outputs->length; ++i) {
struct wlr_drm_output *output = drm->outputs->items[i];
if (output->state != WLR_DRM_OUTPUT_CLEANUP || !output->pageflip_pending) {
to_close &= ~(1 << i);
}
}
}
if (to_close) {
wlr_log(L_ERROR, "Timed out stopping output renderers");
}
for (size_t i = 0; i < drm->outputs->length; ++i) {
struct wlr_drm_output *output = drm->outputs->items[i];
drmModeCrtc *crtc = output->old_crtc;
if (!crtc) {
continue;
}
drmModeSetCrtc(drm->fd, crtc->crtc_id, crtc->buffer_id, crtc->x, crtc->y,
&output->connector, 1, &crtc->mode);
drmModeFreeCrtc(crtc);
}
}
void wlr_drm_output_cleanup(struct wlr_drm_output *output) {
if (!output) {
return;
}
struct wlr_drm_renderer *renderer = output->renderer;
struct wlr_drm_backend *backend =
wl_container_of(renderer, backend, renderer);
switch (output->state) {
case WLR_DRM_OUTPUT_CONNECTED:
case WLR_DRM_OUTPUT_CLEANUP:;
struct wlr_drm_crtc *crtc = output->crtc;
for (int i = 0; i < 3; ++i) {
wlr_drm_plane_renderer_free(renderer, crtc->planes[i]);
if (crtc->planes[i] && crtc->planes[i]->id == 0) {
free(crtc->planes[i]);
crtc->planes[i] = NULL;
}
}
output->crtc = NULL;
output->possible_crtc = 0;
/* Fallthrough */
case WLR_DRM_OUTPUT_NEEDS_MODESET:
wlr_log(L_INFO, "Emmiting destruction signal for '%s'",
output->output.name);
wl_signal_emit(&backend->backend.events.output_remove, &output->output);
break;
case WLR_DRM_OUTPUT_DISCONNECTED:
break;
}
output->state = WLR_DRM_OUTPUT_DISCONNECTED;
}
| 1 | 8,149 | And the old names for these variables made more sense imo. | swaywm-wlroots | c |
@@ -473,7 +473,7 @@ func GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, err
return nil, fmt.Errorf("Unable to find group %s", ag)
}
// Ensure gid is inside gid range.
- if gid < minId || gid > maxId {
+ if gid < minId || gid >= maxId {
return nil, ErrRange
}
gidMap[gid] = struct{}{} | 1 | package user
import (
"bufio"
"fmt"
"io"
"os"
"os/user"
"strconv"
"strings"
)
const (
minId = 0
maxId = 1<<31 - 1 //for 32-bit systems compatibility
)
var (
ErrRange = fmt.Errorf("uids and gids must be in range %d-%d", minId, maxId)
)
type User struct {
Name string
Pass string
Uid int
Gid int
Gecos string
Home string
Shell string
}
// userFromOS converts an os/user.(*User) to local User
//
// (This does not include Pass, Shell or Gecos)
func userFromOS(u *user.User) (User, error) {
newUser := User{
Name: u.Username,
Home: u.HomeDir,
}
id, err := strconv.Atoi(u.Uid)
if err != nil {
return newUser, err
}
newUser.Uid = id
id, err = strconv.Atoi(u.Gid)
if err != nil {
return newUser, err
}
newUser.Gid = id
return newUser, nil
}
type Group struct {
Name string
Pass string
Gid int
List []string
}
// groupFromOS converts an os/user.(*Group) to local Group
//
// (This does not include Pass, Shell or Gecos)
func groupFromOS(g *user.Group) (Group, error) {
newGroup := Group{
Name: g.Name,
}
id, err := strconv.Atoi(g.Gid)
if err != nil {
return newGroup, err
}
newGroup.Gid = id
return newGroup, nil
}
// SubID represents an entry in /etc/sub{u,g}id
type SubID struct {
Name string
SubID int64
Count int64
}
// IDMap represents an entry in /proc/PID/{u,g}id_map
type IDMap struct {
ID int64
ParentID int64
Count int64
}
func parseLine(line string, v ...interface{}) {
parseParts(strings.Split(line, ":"), v...)
}
func parseParts(parts []string, v ...interface{}) {
if len(parts) == 0 {
return
}
for i, p := range parts {
// Ignore cases where we don't have enough fields to populate the arguments.
// Some configuration files like to misbehave.
if len(v) <= i {
break
}
// Use the type of the argument to figure out how to parse it, scanf() style.
// This is legit.
switch e := v[i].(type) {
case *string:
*e = p
case *int:
// "numbers", with conversion errors ignored because of some misbehaving configuration files.
*e, _ = strconv.Atoi(p)
case *int64:
*e, _ = strconv.ParseInt(p, 10, 64)
case *[]string:
// Comma-separated lists.
if p != "" {
*e = strings.Split(p, ",")
} else {
*e = []string{}
}
default:
// Someone goof'd when writing code using this function. Scream so they can hear us.
panic(fmt.Sprintf("parseLine only accepts {*string, *int, *int64, *[]string} as arguments! %#v is not a pointer!", e))
}
}
}
func ParsePasswdFile(path string) ([]User, error) {
passwd, err := os.Open(path)
if err != nil {
return nil, err
}
defer passwd.Close()
return ParsePasswd(passwd)
}
func ParsePasswd(passwd io.Reader) ([]User, error) {
return ParsePasswdFilter(passwd, nil)
}
func ParsePasswdFileFilter(path string, filter func(User) bool) ([]User, error) {
passwd, err := os.Open(path)
if err != nil {
return nil, err
}
defer passwd.Close()
return ParsePasswdFilter(passwd, filter)
}
func ParsePasswdFilter(r io.Reader, filter func(User) bool) ([]User, error) {
if r == nil {
return nil, fmt.Errorf("nil source for passwd-formatted data")
}
var (
s = bufio.NewScanner(r)
out = []User{}
)
for s.Scan() {
if err := s.Err(); err != nil {
return nil, err
}
line := strings.TrimSpace(s.Text())
if line == "" {
continue
}
// see: man 5 passwd
// name:password:UID:GID:GECOS:directory:shell
// Name:Pass:Uid:Gid:Gecos:Home:Shell
// root:x:0:0:root:/root:/bin/bash
// adm:x:3:4:adm:/var/adm:/bin/false
p := User{}
parseLine(line, &p.Name, &p.Pass, &p.Uid, &p.Gid, &p.Gecos, &p.Home, &p.Shell)
if filter == nil || filter(p) {
out = append(out, p)
}
}
return out, nil
}
func ParseGroupFile(path string) ([]Group, error) {
group, err := os.Open(path)
if err != nil {
return nil, err
}
defer group.Close()
return ParseGroup(group)
}
func ParseGroup(group io.Reader) ([]Group, error) {
return ParseGroupFilter(group, nil)
}
func ParseGroupFileFilter(path string, filter func(Group) bool) ([]Group, error) {
group, err := os.Open(path)
if err != nil {
return nil, err
}
defer group.Close()
return ParseGroupFilter(group, filter)
}
func ParseGroupFilter(r io.Reader, filter func(Group) bool) ([]Group, error) {
if r == nil {
return nil, fmt.Errorf("nil source for group-formatted data")
}
var (
s = bufio.NewScanner(r)
out = []Group{}
)
for s.Scan() {
if err := s.Err(); err != nil {
return nil, err
}
text := s.Text()
if text == "" {
continue
}
// see: man 5 group
// group_name:password:GID:user_list
// Name:Pass:Gid:List
// root:x:0:root
// adm:x:4:root,adm,daemon
p := Group{}
parseLine(text, &p.Name, &p.Pass, &p.Gid, &p.List)
if filter == nil || filter(p) {
out = append(out, p)
}
}
return out, nil
}
type ExecUser struct {
Uid int
Gid int
Sgids []int
Home string
}
// GetExecUserPath is a wrapper for GetExecUser. It reads data from each of the
// given file paths and uses that data as the arguments to GetExecUser. If the
// files cannot be opened for any reason, the error is ignored and a nil
// io.Reader is passed instead.
func GetExecUserPath(userSpec string, defaults *ExecUser, passwdPath, groupPath string) (*ExecUser, error) {
var passwd, group io.Reader
if passwdFile, err := os.Open(passwdPath); err == nil {
passwd = passwdFile
defer passwdFile.Close()
}
if groupFile, err := os.Open(groupPath); err == nil {
group = groupFile
defer groupFile.Close()
}
return GetExecUser(userSpec, defaults, passwd, group)
}
// GetExecUser parses a user specification string (using the passwd and group
// readers as sources for /etc/passwd and /etc/group data, respectively). In
// the case of blank fields or missing data from the sources, the values in
// defaults is used.
//
// GetExecUser will return an error if a user or group literal could not be
// found in any entry in passwd and group respectively.
//
// Examples of valid user specifications are:
// * ""
// * "user"
// * "uid"
// * "user:group"
// * "uid:gid
// * "user:gid"
// * "uid:group"
//
// It should be noted that if you specify a numeric user or group id, they will
// not be evaluated as usernames (only the metadata will be filled). So attempting
// to parse a user with user.Name = "1337" will produce the user with a UID of
// 1337.
func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) (*ExecUser, error) {
if defaults == nil {
defaults = new(ExecUser)
}
// Copy over defaults.
user := &ExecUser{
Uid: defaults.Uid,
Gid: defaults.Gid,
Sgids: defaults.Sgids,
Home: defaults.Home,
}
// Sgids slice *cannot* be nil.
if user.Sgids == nil {
user.Sgids = []int{}
}
// Allow for userArg to have either "user" syntax, or optionally "user:group" syntax
var userArg, groupArg string
parseLine(userSpec, &userArg, &groupArg)
// Convert userArg and groupArg to be numeric, so we don't have to execute
// Atoi *twice* for each iteration over lines.
uidArg, uidErr := strconv.Atoi(userArg)
gidArg, gidErr := strconv.Atoi(groupArg)
// Find the matching user.
users, err := ParsePasswdFilter(passwd, func(u User) bool {
if userArg == "" {
// Default to current state of the user.
return u.Uid == user.Uid
}
if uidErr == nil {
// If the userArg is numeric, always treat it as a UID.
return uidArg == u.Uid
}
return u.Name == userArg
})
// If we can't find the user, we have to bail.
if err != nil && passwd != nil {
if userArg == "" {
userArg = strconv.Itoa(user.Uid)
}
return nil, fmt.Errorf("unable to find user %s: %v", userArg, err)
}
var matchedUserName string
if len(users) > 0 {
// First match wins, even if there's more than one matching entry.
matchedUserName = users[0].Name
user.Uid = users[0].Uid
user.Gid = users[0].Gid
user.Home = users[0].Home
} else if userArg != "" {
// If we can't find a user with the given username, the only other valid
// option is if it's a numeric username with no associated entry in passwd.
if uidErr != nil {
// Not numeric.
return nil, fmt.Errorf("unable to find user %s: %v", userArg, ErrNoPasswdEntries)
}
user.Uid = uidArg
// Must be inside valid uid range.
if user.Uid < minId || user.Uid > maxId {
return nil, ErrRange
}
// Okay, so it's numeric. We can just roll with this.
}
// On to the groups. If we matched a username, we need to do this because of
// the supplementary group IDs.
if groupArg != "" || matchedUserName != "" {
groups, err := ParseGroupFilter(group, func(g Group) bool {
// If the group argument isn't explicit, we'll just search for it.
if groupArg == "" {
// Check if user is a member of this group.
for _, u := range g.List {
if u == matchedUserName {
return true
}
}
return false
}
if gidErr == nil {
// If the groupArg is numeric, always treat it as a GID.
return gidArg == g.Gid
}
return g.Name == groupArg
})
if err != nil && group != nil {
return nil, fmt.Errorf("unable to find groups for spec %v: %v", matchedUserName, err)
}
// Only start modifying user.Gid if it is in explicit form.
if groupArg != "" {
if len(groups) > 0 {
// First match wins, even if there's more than one matching entry.
user.Gid = groups[0].Gid
} else {
// If we can't find a group with the given name, the only other valid
// option is if it's a numeric group name with no associated entry in group.
if gidErr != nil {
// Not numeric.
return nil, fmt.Errorf("unable to find group %s: %v", groupArg, ErrNoGroupEntries)
}
user.Gid = gidArg
// Must be inside valid gid range.
if user.Gid < minId || user.Gid > maxId {
return nil, ErrRange
}
// Okay, so it's numeric. We can just roll with this.
}
} else if len(groups) > 0 {
// Supplementary group ids only make sense if in the implicit form.
user.Sgids = make([]int, len(groups))
for i, group := range groups {
user.Sgids[i] = group.Gid
}
}
}
return user, nil
}
// GetAdditionalGroups looks up a list of groups by name or group id
// against the given /etc/group formatted data. If a group name cannot
// be found, an error will be returned. If a group id cannot be found,
// or the given group data is nil, the id will be returned as-is
// provided it is in the legal range.
func GetAdditionalGroups(additionalGroups []string, group io.Reader) ([]int, error) {
var groups = []Group{}
if group != nil {
var err error
groups, err = ParseGroupFilter(group, func(g Group) bool {
for _, ag := range additionalGroups {
if g.Name == ag || strconv.Itoa(g.Gid) == ag {
return true
}
}
return false
})
if err != nil {
return nil, fmt.Errorf("Unable to find additional groups %v: %v", additionalGroups, err)
}
}
gidMap := make(map[int]struct{})
for _, ag := range additionalGroups {
var found bool
for _, g := range groups {
// if we found a matched group either by name or gid, take the
// first matched as correct
if g.Name == ag || strconv.Itoa(g.Gid) == ag {
if _, ok := gidMap[g.Gid]; !ok {
gidMap[g.Gid] = struct{}{}
found = true
break
}
}
}
// we asked for a group but didn't find it. let's check to see
// if we wanted a numeric group
if !found {
gid, err := strconv.Atoi(ag)
if err != nil {
return nil, fmt.Errorf("Unable to find group %s", ag)
}
// Ensure gid is inside gid range.
if gid < minId || gid > maxId {
return nil, ErrRange
}
gidMap[gid] = struct{}{}
}
}
gids := []int{}
for gid := range gidMap {
gids = append(gids, gid)
}
return gids, nil
}
// GetAdditionalGroupsPath is a wrapper around GetAdditionalGroups
// that opens the groupPath given and gives it as an argument to
// GetAdditionalGroups.
func GetAdditionalGroupsPath(additionalGroups []string, groupPath string) ([]int, error) {
var group io.Reader
if groupFile, err := os.Open(groupPath); err == nil {
group = groupFile
defer groupFile.Close()
}
return GetAdditionalGroups(additionalGroups, group)
}
func ParseSubIDFile(path string) ([]SubID, error) {
subid, err := os.Open(path)
if err != nil {
return nil, err
}
defer subid.Close()
return ParseSubID(subid)
}
func ParseSubID(subid io.Reader) ([]SubID, error) {
return ParseSubIDFilter(subid, nil)
}
func ParseSubIDFileFilter(path string, filter func(SubID) bool) ([]SubID, error) {
subid, err := os.Open(path)
if err != nil {
return nil, err
}
defer subid.Close()
return ParseSubIDFilter(subid, filter)
}
func ParseSubIDFilter(r io.Reader, filter func(SubID) bool) ([]SubID, error) {
if r == nil {
return nil, fmt.Errorf("nil source for subid-formatted data")
}
var (
s = bufio.NewScanner(r)
out = []SubID{}
)
for s.Scan() {
if err := s.Err(); err != nil {
return nil, err
}
line := strings.TrimSpace(s.Text())
if line == "" {
continue
}
// see: man 5 subuid
p := SubID{}
parseLine(line, &p.Name, &p.SubID, &p.Count)
if filter == nil || filter(p) {
out = append(out, p)
}
}
return out, nil
}
func ParseIDMapFile(path string) ([]IDMap, error) {
r, err := os.Open(path)
if err != nil {
return nil, err
}
defer r.Close()
return ParseIDMap(r)
}
func ParseIDMap(r io.Reader) ([]IDMap, error) {
return ParseIDMapFilter(r, nil)
}
func ParseIDMapFileFilter(path string, filter func(IDMap) bool) ([]IDMap, error) {
r, err := os.Open(path)
if err != nil {
return nil, err
}
defer r.Close()
return ParseIDMapFilter(r, filter)
}
func ParseIDMapFilter(r io.Reader, filter func(IDMap) bool) ([]IDMap, error) {
if r == nil {
return nil, fmt.Errorf("nil source for idmap-formatted data")
}
var (
s = bufio.NewScanner(r)
out = []IDMap{}
)
for s.Scan() {
if err := s.Err(); err != nil {
return nil, err
}
line := strings.TrimSpace(s.Text())
if line == "" {
continue
}
// see: man 7 user_namespaces
p := IDMap{}
parseParts(strings.Fields(line), &p.ID, &p.ParentID, &p.Count)
if filter == nil || filter(p) {
out = append(out, p)
}
}
return out, nil
}
| 1 | 16,526 | Are you sure this change is correct? | opencontainers-runc | go |
@@ -9,8 +9,7 @@ def test_view_image():
"mitmproxy/data/image.png",
"mitmproxy/data/image.gif",
"mitmproxy/data/all.jpeg",
- # https://bugs.python.org/issue21574
- # "mitmproxy/data/image.ico",
+ "mitmproxy/data/image.ico",
]:
with open(tutils.test_data.path(img), "rb") as f:
viewname, lines = v(f.read()) | 1 | from mitmproxy.contentviews import image
from mitmproxy.test import tutils
from .. import full_eval
def test_view_image():
v = full_eval(image.ViewImage())
for img in [
"mitmproxy/data/image.png",
"mitmproxy/data/image.gif",
"mitmproxy/data/all.jpeg",
# https://bugs.python.org/issue21574
# "mitmproxy/data/image.ico",
]:
with open(tutils.test_data.path(img), "rb") as f:
viewname, lines = v(f.read())
assert img.split(".")[-1].upper() in viewname
assert v(b"flibble") == ('Unknown Image', [[('header', 'Image Format: '), ('text', 'unknown')]])
| 1 | 13,343 | The previously linked bug does not apply anymore? If so, this is LGTM! | mitmproxy-mitmproxy | py |
@@ -84,7 +84,7 @@ func assertNotEqual(t *testing.T, a interface{}, b interface{}) {
}
}
-func TestFailOver(t *testing.T) {
+func Test_FailOver(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "lb-test")
if err != nil {
assertEqual(t, err, nil) | 1 | package loadbalancer
import (
"bufio"
"context"
"errors"
"fmt"
"io/ioutil"
"net"
"net/url"
"os"
"strings"
"testing"
"time"
"github.com/rancher/k3s/pkg/cli/cmds"
)
type server struct {
listener net.Listener
conns []net.Conn
prefix string
}
func createServer(prefix string) (*server, error) {
listener, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
return nil, err
}
s := &server{
prefix: prefix,
listener: listener,
}
go s.serve()
return s, nil
}
func (s *server) serve() {
for {
conn, err := s.listener.Accept()
if err != nil {
return
}
s.conns = append(s.conns, conn)
go s.echo(conn)
}
}
func (s *server) close() {
s.listener.Close()
for _, conn := range s.conns {
conn.Close()
}
}
func (s *server) echo(conn net.Conn) {
for {
result, err := bufio.NewReader(conn).ReadString('\n')
if err != nil {
return
}
conn.Write([]byte(s.prefix + ":" + result))
}
}
func ping(conn net.Conn) (string, error) {
fmt.Fprintf(conn, "ping\n")
result, err := bufio.NewReader(conn).ReadString('\n')
if err != nil {
return "", err
}
return strings.TrimSpace(result), nil
}
func assertEqual(t *testing.T, a interface{}, b interface{}) {
if a != b {
t.Fatalf("[ %v != %v ]", a, b)
}
}
func assertNotEqual(t *testing.T, a interface{}, b interface{}) {
if a == b {
t.Fatalf("[ %v == %v ]", a, b)
}
}
func TestFailOver(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "lb-test")
if err != nil {
assertEqual(t, err, nil)
}
defer os.RemoveAll(tmpDir)
ogServe, err := createServer("og")
if err != nil {
assertEqual(t, err, nil)
}
lbServe, err := createServer("lb")
if err != nil {
assertEqual(t, err, nil)
}
cfg := cmds.Agent{
ServerURL: fmt.Sprintf("http://%s/", ogServe.listener.Addr().String()),
DataDir: tmpDir,
}
lb, err := New(context.TODO(), cfg.DataDir, SupervisorServiceName, cfg.ServerURL, RandomPort)
if err != nil {
assertEqual(t, err, nil)
}
parsedURL, err := url.Parse(lb.LoadBalancerServerURL())
if err != nil {
assertEqual(t, err, nil)
}
localAddress := parsedURL.Host
lb.Update([]string{lbServe.listener.Addr().String()})
conn1, err := net.Dial("tcp", localAddress)
if err != nil {
assertEqual(t, err, nil)
}
result1, err := ping(conn1)
if err != nil {
assertEqual(t, err, nil)
}
assertEqual(t, result1, "lb:ping")
lbServe.close()
_, err = ping(conn1)
assertNotEqual(t, err, nil)
conn2, err := net.Dial("tcp", localAddress)
if err != nil {
assertEqual(t, err, nil)
}
result2, err := ping(conn2)
if err != nil {
assertEqual(t, err, nil)
}
assertEqual(t, result2, "og:ping")
}
func TestFailFast(t *testing.T) {
tmpDir, err := ioutil.TempDir("", "lb-test")
if err != nil {
assertEqual(t, err, nil)
}
defer os.RemoveAll(tmpDir)
cfg := cmds.Agent{
ServerURL: "http://127.0.0.1:0/",
DataDir: tmpDir,
}
lb, err := New(context.TODO(), cfg.DataDir, SupervisorServiceName, cfg.ServerURL, RandomPort)
if err != nil {
assertEqual(t, err, nil)
}
conn, err := net.Dial("tcp", lb.localAddress)
if err != nil {
assertEqual(t, err, nil)
}
done := make(chan error)
go func() {
_, err = ping(conn)
done <- err
}()
timeout := time.After(10 * time.Millisecond)
select {
case err := <-done:
assertNotEqual(t, err, nil)
case <-timeout:
t.Fatal(errors.New("time out"))
}
}
| 1 | 9,896 | Why are we renaming all of the tests? | k3s-io-k3s | go |
@@ -24,8 +24,9 @@ import (
var defaultRFC2136Port = "53"
-// This function make a valid nameserver as per RFC2136
+// This function returns a valid nameserver (in the form <host>:<port>) for the RFC2136 provider
func ValidNameserver(nameserver string) (string, error) {
+ nameserver = strings.TrimSpace(nameserver)
if nameserver == "" {
return "", fmt.Errorf("RFC2136 nameserver missing") | 1 | /*
Copyright 2019 The Jetstack cert-manager contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package util
import (
"fmt"
"net"
"strings"
)
var defaultRFC2136Port = "53"
// This function make a valid nameserver as per RFC2136
func ValidNameserver(nameserver string) (string, error) {
if nameserver == "" {
return "", fmt.Errorf("RFC2136 nameserver missing")
}
// SplitHostPort Behavior
// nameserver host port err
// 8.8.8.8 "" "" missing port in address
// 8.8.8.8: "8.8.8.8" "" <nil>
// 8.8.8.8.8:53 "8.8.8.8" 53 <nil>
// nameserver.com "" "" missing port in address
// nameserver.com: "nameserver.com" "" <nil>
// nameserver.com:53 "nameserver.com" 53 <nil>
// :53 "" 53 <nil>
host, port, err := net.SplitHostPort(strings.TrimSpace(nameserver))
if err != nil {
if strings.Contains(err.Error(), "missing port") {
host = nameserver
}
}
if port == "" {
port = defaultRFC2136Port
}
if host != "" {
if ipaddr := net.ParseIP(host); ipaddr == nil {
return "", fmt.Errorf("RFC2136 nameserver must be a valid IP Address, not %v", host)
}
} else {
return "", fmt.Errorf("RFC2136 nameserver has no IP Address defined, %v", nameserver)
}
nameserver = host + ":" + port
return nameserver, nil
}
| 1 | 20,768 | Instead of having this logic, would it make sense to require *users* to encompass the specified IPv6 address within `[` and `]`? Why the magic handling here? | jetstack-cert-manager | go |
@@ -142,9 +142,15 @@ PyObject *GetMolConformers(ROMol &mol) {
template <class T>
T MolGetProp(const ROMol &mol, const char *key) {
T res;
- if (!mol.getPropIfPresent(key, res)) {
- PyErr_SetString(PyExc_KeyError, key);
- throw python::error_already_set();
+ try {
+ if (!mol.getPropIfPresent(key, res)) {
+ PyErr_SetString(PyExc_KeyError, key);
+ throw python::error_already_set();
+ }
+ return res;
+ } catch ( const boost::bad_any_cast &e ) {
+ throw ValueErrorException(std::string("key `") + key + "` exists but does not result in a " +
+ GetTypeName<T>());
}
return res;
} | 1 | // $Id$
//
// Copyright (C) 2003-2009 Greg Landrum and Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#define NO_IMPORT_ARRAY
#include <RDBoost/python.h>
#include <string>
#include "rdchem.h"
#include "seqs.hpp"
#include "props.hpp"
// ours
#include <RDBoost/pyint_api.h>
#include <RDBoost/Wrap.h>
#include <GraphMol/RDKitBase.h>
#include <GraphMol/QueryOps.h>
#include <GraphMol/MolPickler.h>
#include <GraphMol/Substruct/SubstructMatch.h>
#include <boost/python/iterator.hpp>
#include <boost/python/copy_non_const_reference.hpp>
namespace python = boost::python;
namespace RDKit {
python::object MolToBinary(const ROMol &self) {
std::string res;
{
NOGIL gil;
MolPickler::pickleMol(self, res);
}
python::object retval = python::object(
python::handle<>(PyBytes_FromStringAndSize(res.c_str(), res.length())));
return retval;
}
//
// allows molecules to be pickled.
// since molecules have a constructor that takes a binary string
// we only need to provide getinitargs()
//
struct mol_pickle_suite : python::pickle_suite {
static python::tuple getinitargs(const ROMol &self) {
return python::make_tuple(MolToBinary(self));
};
};
bool HasSubstructMatchStr(std::string pkl, const ROMol &query,
bool recursionPossible = true,
bool useChirality = false,
bool useQueryQueryMatches = false) {
NOGIL gil;
ROMol *mol;
try {
mol = new ROMol(pkl);
} catch (...) {
mol = NULL;
}
if (!mol) {
throw ValueErrorException("Null Molecule");
}
MatchVectType res;
bool hasM = SubstructMatch(*mol, query, res, recursionPossible, useChirality,
useQueryQueryMatches);
delete mol;
return hasM;
}
bool HasSubstructMatch(const ROMol &mol, const ROMol &query,
bool recursionPossible = true, bool useChirality = false,
bool useQueryQueryMatches = false) {
NOGIL gil;
MatchVectType res;
return SubstructMatch(mol, query, res, recursionPossible, useChirality,
useQueryQueryMatches);
}
PyObject *convertMatches(MatchVectType &matches) {
PyObject *res = PyTuple_New(matches.size());
MatchVectType::const_iterator i;
for (i = matches.begin(); i != matches.end(); i++) {
PyTuple_SetItem(res, i->first, PyInt_FromLong(i->second));
}
return res;
}
PyObject *GetSubstructMatch(const ROMol &mol, const ROMol &query,
bool useChirality = false,
bool useQueryQueryMatches = false) {
MatchVectType matches;
{
NOGIL gil;
SubstructMatch(mol, query, matches, true, useChirality,
useQueryQueryMatches);
}
return convertMatches(matches);
}
PyObject *GetSubstructMatches(const ROMol &mol, const ROMol &query,
bool uniquify = true, bool useChirality = false,
bool useQueryQueryMatches = false,
unsigned int maxMatches = 1000) {
std::vector<MatchVectType> matches;
int matched;
{
NOGIL gil;
matched = SubstructMatch(mol, query, matches, uniquify, true, useChirality,
useQueryQueryMatches, maxMatches);
}
PyObject *res = PyTuple_New(matched);
for (int idx = 0; idx < matched; idx++) {
PyTuple_SetItem(res, idx, convertMatches(matches[idx]));
}
return res;
}
unsigned int AddMolConformer(ROMol &mol, Conformer *conf,
bool assignId = false) {
Conformer *nconf = new Conformer(*conf);
return mol.addConformer(nconf, assignId);
}
Conformer *GetMolConformer(ROMol &mol, int id = -1) {
return &(mol.getConformer(id));
}
PyObject *GetMolConformers(ROMol &mol) {
PyObject *res = PyTuple_New(mol.getNumConformers());
ROMol::ConformerIterator ci;
unsigned int i = 0;
for (ci = mol.beginConformers(); ci != mol.endConformers(); ci++) {
PyTuple_SetItem(res, i, python::converter::shared_ptr_to_python(*ci));
i++;
}
return res;
}
template <class T>
T MolGetProp(const ROMol &mol, const char *key) {
T res;
if (!mol.getPropIfPresent(key, res)) {
PyErr_SetString(PyExc_KeyError, key);
throw python::error_already_set();
}
return res;
}
int MolHasProp(const ROMol &mol, const char *key) {
int res = mol.hasProp(key);
// std::cout << "key: " << key << ": " << res << std::endl;
return res;
}
template<class T>
void MolSetProp(const ROMol &mol, const char *key, const T &val,
bool computed = false) {
mol.setProp<T>(key, val, computed);
}
void MolClearProp(const ROMol &mol, const char *key) {
if (!mol.hasProp(key)) {
return;
}
mol.clearProp(key);
}
// specialized for include private/computed...
boost::python::dict MolGetPropsAsDict(const ROMol &mol,
bool includePrivate=false,
bool includeComputed=false) {
boost::python::dict dict;
// precedence double, int, unsigned, std::vector<double>,
// std::vector<int>, std::vector<unsigned>, string
STR_VECT keys = mol.getPropList(includePrivate, includeComputed);
for(size_t i=0;i<keys.size();++i) {
if (AddToDict<double>(mol, dict, keys[i])) continue;
if (AddToDict<int>(mol, dict, keys[i])) continue;
if (AddToDict<unsigned int>(mol, dict, keys[i])) continue;
if (AddToDict<bool>(mol, dict, keys[i])) continue;
if (AddToDict<std::vector<double> >(mol, dict, keys[i])) continue;
if (AddToDict<std::vector<int> >(mol, dict, keys[i])) continue;
if (AddToDict<std::vector<unsigned int> >(mol, dict, keys[i])) continue;
// if (AddToDict<std::vector<bool> >(mol, dict, keys[i])) continue;
if (AddToDict<std::string>(mol, dict, keys[i])) continue;
if (AddToDict<std::vector<std::string> >(mol, dict, keys[i])) continue;
}
return dict;
}
void MolClearComputedProps(const ROMol &mol) { mol.clearComputedProps(); }
void MolDebug(const ROMol &mol) { mol.debugMol(std::cout); }
// FIX: we should eventually figure out how to do iterators properly
AtomIterSeq *MolGetAtoms(ROMol *mol) {
AtomIterSeq *res = new AtomIterSeq(mol->beginAtoms(), mol->endAtoms());
return res;
}
QueryAtomIterSeq *MolGetAromaticAtoms(ROMol *mol) {
QueryAtom *qa = new QueryAtom();
qa->setQuery(makeAtomAromaticQuery());
QueryAtomIterSeq *res =
new QueryAtomIterSeq(mol->beginQueryAtoms(qa), mol->endQueryAtoms());
return res;
}
QueryAtomIterSeq *MolGetQueryAtoms(ROMol *mol, QueryAtom *qa) {
QueryAtomIterSeq *res =
new QueryAtomIterSeq(mol->beginQueryAtoms(qa), mol->endQueryAtoms());
return res;
}
// AtomIterSeq *MolGetHeteros(ROMol *mol){
// AtomIterSeq *res = new AtomIterSeq(mol->beginHeteros(),
// mol->endHeteros());
// return res;
//}
BondIterSeq *MolGetBonds(ROMol *mol) {
BondIterSeq *res = new BondIterSeq(mol->beginBonds(), mol->endBonds());
return res;
}
int getMolNumAtoms(const ROMol &mol, int onlyHeavy, bool onlyExplicit) {
if (onlyHeavy > -1) {
BOOST_LOG(rdWarningLog)
<< "WARNING: the onlyHeavy argument to mol.GetNumAtoms() has been "
"deprecated. Please use the onlyExplicit argument instead or "
"mol.GetNumHeavyAtoms() if you want the heavy atom count."
<< std::endl;
return mol.getNumAtoms(onlyHeavy);
}
return mol.getNumAtoms(onlyExplicit);
}
class ReadWriteMol : public RWMol {
public:
ReadWriteMol(const ROMol &m, bool quickCopy = false, int confId = -1)
: RWMol(m, quickCopy, confId){};
void RemoveAtom(unsigned int idx) { removeAtom(idx); };
void RemoveBond(unsigned int idx1, unsigned int idx2) {
removeBond(idx1, idx2);
};
int AddBond(unsigned int begAtomIdx, unsigned int endAtomIdx,
Bond::BondType order = Bond::UNSPECIFIED) {
return addBond(begAtomIdx, endAtomIdx, order);
};
int AddAtom(Atom *atom) {
PRECONDITION(atom, "bad atom");
return addAtom(atom, true, false);
};
void ReplaceAtom(unsigned int idx, Atom *atom) { replaceAtom(idx, atom); };
ROMol *GetMol() const {
ROMol *res = new ROMol(*this);
return res;
}
};
std::string molClassDoc =
"The Molecule class.\n\n\
In addition to the expected Atoms and Bonds, molecules contain:\n\
- a collection of Atom and Bond bookmarks indexed with integers\n\
that can be used to flag and retrieve particular Atoms or Bonds\n\
using the {get|set}{Atom|Bond}Bookmark() methods.\n\n\
- a set of string-valued properties. These can have arbitrary string\n\
labels and can be set and retrieved using the {set|get}Prop() methods\n\
Molecular properties can be tagged as being *computed*, in which case\n\
they will be automatically cleared under certain circumstances (when the\n\
molecule itself is modified, for example).\n\
Molecules also have the concept of *private* properties, which are tagged\n\
by beginning the property name with an underscore (_).\n";
std::string rwmolClassDoc =
"The RW molecule class (read/write)\n\n\
This class is a more-performant version of the EditableMolecule class in that\n\
it is a 'live' molecule and shares the interface from the Mol class.\n\
All changes are performed without the need to create a copy of the\n\
molecule using GetMol() (this is still available, however).\n\
\n\
n.b. Eventually this class may become a direct replacement for EditableMol";
struct mol_wrapper {
static void wrap() {
python::register_exception_translator<ConformerException>(
&rdExceptionTranslator);
python::class_<ROMol, ROMOL_SPTR, boost::noncopyable>(
"Mol", molClassDoc.c_str(),
python::init<>("Constructor, takes no arguments"))
.def(python::init<const std::string &>())
.def(python::init<const ROMol &>())
.def(python::init<const ROMol &, bool>())
.def(python::init<const ROMol &, bool, int>())
.def("__copy__", &generic__copy__<ROMol>)
.def("__deepcopy__", &generic__deepcopy__<ROMol>)
.def("GetNumAtoms", getMolNumAtoms,
(python::arg("onlyHeavy") = -1,
python::arg("onlyExplicit") = true),
"Returns the number of atoms in the molecule.\n\n"
" ARGUMENTS:\n"
" - onlyExplicit: (optional) include only explicit atoms "
"(atoms in the molecular graph)\n"
" defaults to 1.\n"
" NOTE: the onlyHeavy argument is deprecated\n"
)
.def("GetNumHeavyAtoms", &ROMol::getNumHeavyAtoms,
"Returns the number of heavy atoms (atomic number >1) in the "
"molecule.\n\n")
.def("GetAtomWithIdx",
(Atom * (ROMol::*)(unsigned int)) & ROMol::getAtomWithIdx,
python::return_internal_reference<
1, python::with_custodian_and_ward_postcall<0, 1> >(),
"Returns a particular Atom.\n\n"
" ARGUMENTS:\n"
" - idx: which Atom to return\n\n"
" NOTE: atom indices start at 0\n")
.def("GetNumBonds", &ROMol::getNumBonds,
(python::arg("onlyHeavy") = true),
"Returns the number of Bonds in the molecule.\n\n"
" ARGUMENTS:\n"
" - onlyHeavy: (optional) include only bonds to heavy atoms "
"(not Hs)\n"
" defaults to 1.\n")
.def("GetBondWithIdx",
(Bond * (ROMol::*)(unsigned int)) & ROMol::getBondWithIdx,
python::return_internal_reference<
1, python::with_custodian_and_ward_postcall<0, 1> >(),
"Returns a particular Bond.\n\n"
" ARGUMENTS:\n"
" - idx: which Bond to return\n\n"
" NOTE: bond indices start at 0\n")
.def("GetNumConformers", &ROMol::getNumConformers,
"Return the number of conformations on the molecule")
.def("AddConformer", AddMolConformer,
(python::arg("self"), python::arg("conf"),
python::arg("assignId") = false),
"Add a conformer to the molecule and return the conformer ID")
.def("GetConformer", GetMolConformer,
(python::arg("self"), python::arg("id") = -1),
"Get the conformer with a specified ID",
python::return_internal_reference<
1, python::with_custodian_and_ward_postcall<0, 1> >())
.def("GetConformers", GetMolConformers,
"Get all the conformers as a tuple")
.def("RemoveAllConformers", &ROMol::clearConformers,
"Remove all the conformations on the molecule")
.def("RemoveConformer", &ROMol::removeConformer,
"Remove the conformer with the specified ID")
.def("GetBondBetweenAtoms",
(Bond * (ROMol::*)(unsigned int, unsigned int)) &
ROMol::getBondBetweenAtoms,
python::return_internal_reference<
1, python::with_custodian_and_ward_postcall<0, 1> >(),
"Returns the bond between two atoms, if there is one.\n\n"
" ARGUMENTS:\n"
" - idx1,idx2: the Atom indices\n\n"
" Returns:\n"
" The Bond between the two atoms, if such a bond exists.\n"
" If there is no Bond between the atoms, None is returned "
"instead.\n\n"
" NOTE: bond indices start at 0\n")
// substructures
.def("HasSubstructMatch", HasSubstructMatch,
(python::arg("self"), python::arg("query"),
python::arg("recursionPossible") = true,
python::arg("useChirality") = false,
python::arg("useQueryQueryMatches") = false),
"Queries whether or not the molecule contains a particular "
"substructure.\n\n"
" ARGUMENTS:\n"
" - query: a Molecule\n\n"
" - recursionPossible: (optional)\n\n"
" - useChirality: enables the use of stereochemistry in the "
"matching\n\n"
" - useQueryQueryMatches: use query-query matching logic\n\n"
" RETURNS: True or False\n")
.def("GetSubstructMatch", GetSubstructMatch,
(python::arg("self"), python::arg("query"),
python::arg("useChirality") = false,
python::arg("useQueryQueryMatches") = false),
"Returns the indices of the molecule's atoms that match a "
"substructure query.\n\n"
" ARGUMENTS:\n"
" - query: a Molecule\n\n"
" - useChirality: enables the use of stereochemistry in the "
"matching\n\n"
" - useQueryQueryMatches: use query-query matching logic\n\n"
" RETURNS: a tuple of integers\n\n"
" NOTES:\n"
" - only a single match is returned\n"
" - the ordering of the indices corresponds to the atom "
"ordering\n"
" in the query. For example, the first index is for the "
"atom in\n"
" this molecule that matches the first atom in the "
"query.\n")
.def("GetSubstructMatches", GetSubstructMatches,
(python::arg("self"), python::arg("query"),
python::arg("uniquify") = true,
python::arg("useChirality") = false,
python::arg("useQueryQueryMatches") = false,
python::arg("maxMatches") = 1000),
"Returns tuples of the indices of the molecule's atoms that match "
"a substructure query.\n\n"
" ARGUMENTS:\n"
" - query: a Molecule.\n"
" - uniquify: (optional) determines whether or not the matches "
"are uniquified.\n"
" Defaults to 1.\n\n"
" - useChirality: enables the use of stereochemistry in the "
"matching\n\n"
" - useQueryQueryMatches: use query-query matching logic\n\n"
" - maxMatches: The maximum number of matches that will be "
"returned.\n"
" In high-symmetry cases with medium-sized "
"molecules, it is\n"
" very easy to end up with a combinatorial "
"explosion in the\n"
" number of possible matches. This argument "
"prevents that from\n"
" having unintended consequences\n\n"
" RETURNS: a tuple of tuples of integers\n\n"
" NOTE:\n"
" - the ordering of the indices corresponds to the atom "
"ordering\n"
" in the query. For example, the first index is for the "
"atom in\n"
" this molecule that matches the first atom in the "
"query.\n")
// properties
.def("SetProp", MolSetProp<std::string>,
(python::arg("self"), python::arg("key"), python::arg("val"),
python::arg("computed") = false),
"Sets a molecular property\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to be set (a string).\n"
" - value: the property value (a string).\n"
" - computed: (optional) marks the property as being "
"computed.\n"
" Defaults to 0.\n\n")
.def("SetDoubleProp", MolSetProp<double>,
(python::arg("self"), python::arg("key"), python::arg("val"),
python::arg("computed") = false),
"Sets a double valued molecular property\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to be set (a string).\n"
" - value: the property value as a double.\n"
" - computed: (optional) marks the property as being "
"computed.\n"
" Defaults to 0.\n\n")
.def("SetIntProp", MolSetProp<int>,
(python::arg("self"), python::arg("key"), python::arg("val"),
python::arg("computed") = false),
"Sets an integer valued molecular property\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to be set (an unsigned number).\n"
" - value: the property value as an integer.\n"
" - computed: (optional) marks the property as being "
"computed.\n"
" Defaults to 0.\n\n")
.def("SetUnsignedProp", MolSetProp<unsigned int>,
(python::arg("self"), python::arg("key"), python::arg("val"),
python::arg("computed") = false),
"Sets an unsigned integer valued molecular property\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to be set (a string).\n"
" - value: the property value as an unsigned integer.\n"
" - computed: (optional) marks the property as being "
"computed.\n"
" Defaults to 0.\n\n")
.def("SetBoolProp", MolSetProp<bool>,
(python::arg("self"), python::arg("key"), python::arg("val"),
python::arg("computed") = false),
"Sets a boolean valued molecular property\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to be set (a string).\n"
" - value: the property value as a bool.\n"
" - computed: (optional) marks the property as being "
"computed.\n"
" Defaults to 0.\n\n")
.def("HasProp", MolHasProp,
"Queries a molecule to see if a particular property has been "
"assigned.\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to check for (a string).\n")
.def("GetProp", MolGetProp<std::string>,
"Returns the value of the property.\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to return (a string).\n\n"
" RETURNS: a string\n\n"
" NOTE:\n"
" - If the property has not been set, a KeyError exception "
"will be raised.\n")
.def("GetDoubleProp", MolGetProp<double>,
"Returns the double value of the property if possible.\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to return (a string).\n\n"
" RETURNS: a double\n\n"
" NOTE:\n"
" - If the property has not been set, a KeyError exception "
"will be raised.\n")
.def("GetIntProp", MolGetProp<int>,
"Returns the integer value of the property if possible.\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to return (a string).\n\n"
" RETURNS: an integer\n\n"
" NOTE:\n"
" - If the property has not been set, a KeyError exception "
"will be raised.\n")
.def("GetUnsignedProp", MolGetProp<unsigned int>,
"Returns the unsigned int value of the property if possible.\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to return (a string).\n\n"
" RETURNS: an unsigned integer\n\n"
" NOTE:\n"
" - If the property has not been set, a KeyError exception "
"will be raised.\n")
.def("GetBoolProp", MolGetProp<bool>,
"Returns the double value of the property if possible.\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to return (a string).\n\n"
" RETURNS: a bool\n\n"
" NOTE:\n"
" - If the property has not been set, a KeyError exception "
"will be raised.\n")
.def("ClearProp", MolClearProp,
"Removes a property from the molecule.\n\n"
" ARGUMENTS:\n"
" - key: the name of the property to clear (a string).\n")
.def("ClearComputedProps", MolClearComputedProps,
"Removes all computed properties from the molecule.\n\n")
.def("UpdatePropertyCache", &ROMol::updatePropertyCache,
(python::arg("self"), python::arg("strict") = true),
"Regenerates computed properties like implicit valence and ring "
"information.\n\n")
.def("NeedsUpdatePropertyCache", &ROMol::needsUpdatePropertyCache,
(python::arg("self")),
"Returns true or false depending on whether implicit and explicit "
"valence of the molecule have already been calculated.\n\n")
.def("GetPropNames", &ROMol::getPropList,
(python::arg("self"), python::arg("includePrivate") = false,
python::arg("includeComputed") = false),
"Returns a tuple with all property names for this molecule.\n\n"
" ARGUMENTS:\n"
" - includePrivate: (optional) toggles inclusion of private "
"properties in the result set.\n"
" Defaults to 0.\n"
" - includeComputed: (optional) toggles inclusion of computed "
"properties in the result set.\n"
" Defaults to 0.\n\n"
" RETURNS: a tuple of strings\n")
.def("GetPropsAsDict", MolGetPropsAsDict,
(python::arg("self"), python::arg("includePrivate") = false,
python::arg("includeComputed") = false),
"Returns a dictionary populated with the molecules properties.\n"
" n.b. Some properties are not able to be converted to python types.\n\n"
" ARGUMENTS:\n"
" - includePrivate: (optional) toggles inclusion of private "
"properties in the result set.\n"
" Defaults to False.\n"
" - includeComputed: (optional) toggles inclusion of computed "
"properties in the result set.\n"
" Defaults to False.\n\n"
" RETURNS: a dictionary\n")
.def("GetAtoms", MolGetAtoms,
python::return_value_policy<
python::manage_new_object,
python::with_custodian_and_ward_postcall<0, 1> >(),
"Returns a read-only sequence containing all of the molecule's "
"Atoms.\n")
.def("GetAromaticAtoms", MolGetAromaticAtoms,
python::return_value_policy<
python::manage_new_object,
python::with_custodian_and_ward_postcall<0, 1> >(),
"Returns a read-only sequence containing all of the molecule's "
"aromatic Atoms.\n")
.def("GetAtomsMatchingQuery", MolGetQueryAtoms,
python::return_value_policy<
python::manage_new_object,
python::with_custodian_and_ward_postcall<0, 1> >(),
"Returns a read-only sequence containing all of the atoms in a "
"molecule that match the query atom.\n")
.def("GetBonds", MolGetBonds,
python::return_value_policy<
python::manage_new_object,
python::with_custodian_and_ward_postcall<0, 1> >(),
"Returns a read-only sequence containing all of the molecule's "
"Bonds.\n")
// enable pickle support
.def_pickle(mol_pickle_suite())
.def("Debug", MolDebug,
"Prints debugging information about the molecule.\n")
.def("ToBinary", MolToBinary,
"Returns a binary string representation of the molecule.\n")
.def("GetRingInfo", &ROMol::getRingInfo,
python::return_value_policy<python::reference_existing_object>(),
"Returns the number of molecule's RingInfo object.\n\n");
// ---------------------------------------------------------------------------------------------
python::def("_HasSubstructMatchStr", HasSubstructMatchStr,
(python::arg("pkl"), python::arg("query"),
python::arg("recursionPossible") = true,
python::arg("useChirality") = false,
python::arg("useQueryQueryMatches") = false),
"This function is included to speed substructure queries from "
"databases, \n"
"it's probably not of\n"
"general interest.\n\n"
" ARGUMENTS:\n"
" - pkl: a Molecule pickle\n\n"
" - query: a Molecule\n\n"
" - recursionPossible: (optional)\n\n"
" - useChirality: (optional)\n\n"
" - useQueryQueryMatches: use query-query matching logic\n\n"
" RETURNS: True or False\n");
python::class_<ReadWriteMol, python::bases<ROMol> >(
"RWMol", rwmolClassDoc.c_str(),
python::init<const ROMol &>("Construct from a Mol"))
.def(python::init<const ROMol &, bool>())
.def(python::init<const ROMol &, bool, int>())
.def("__copy__", &generic__copy__<ReadWriteMol>)
.def("__deepcopy__", &generic__deepcopy__<ReadWriteMol>)
.def("RemoveAtom", &ReadWriteMol::RemoveAtom,
"Remove the specified atom from the molecule")
.def("RemoveBond", &ReadWriteMol::RemoveBond,
"Remove the specified bond from the molecule")
.def("AddBond", &ReadWriteMol::AddBond,
(python::arg("mol"), python::arg("beginAtomIdx"),
python::arg("endAtomIdx"),
python::arg("order") = Bond::UNSPECIFIED),
"add a bond, returns the new number of bonds")
.def("AddAtom", &ReadWriteMol::AddAtom,
(python::arg("mol"), python::arg("atom")),
"add an atom, returns the index of the newly added atom")
.def("ReplaceAtom", &ReadWriteMol::ReplaceAtom,
(python::arg("mol"), python::arg("index"), python::arg("newAtom")),
"replaces the specified atom with the provided one")
.def("GetMol", &ReadWriteMol::GetMol,
"Returns a Mol (a normal molecule)",
python::return_value_policy<python::manage_new_object>());
};
};
} // end of namespace
void wrap_mol() { RDKit::mol_wrapper::wrap(); }
| 1 | 14,447 | Why not also replace this one with calls to `GetProp<ROMol,T>`? | rdkit-rdkit | cpp |
@@ -259,6 +259,7 @@ class KNNClassifier(object):
if doWinners:
if (self.numWinners>0) and (self.numWinners < (inputPattern > 0).sum()):
sparseInput = numpy.zeros(inputPattern.shape)
+
# Don't consider strongly negative numbers as winners.
sorted = inputPattern.argsort()[0:self.numWinners]
sparseInput[sorted] += inputPattern[sorted] | 1 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-15, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero Public License for more details.
#
# You should have received a copy of the GNU Affero Public License
# along with this program. If not, see http://www.gnu.org/licenses.
#
# http://numenta.org/licenses/
# ----------------------------------------------------------------------
"""This module implements a k nearest neighbor classifier."""
import numpy
from nupic.bindings.math import (NearestNeighbor, min_score_per_category)
g_debugPrefix = "KNN"
KNNCLASSIFIER_VERSION = 1
def _labeledInput(activeInputs, cellsPerCol=32):
"""Print the list of [column, cellIdx] indices for each of the active
cells in activeInputs.
"""
if cellsPerCol == 0:
cellsPerCol = 1
cols = activeInputs.size / cellsPerCol
activeInputs = activeInputs.reshape(cols, cellsPerCol)
(cols, cellIdxs) = activeInputs.nonzero()
if len(cols) == 0:
return "NONE"
items = ["(%d): " % (len(cols))]
prevCol = -1
for (col,cellIdx) in zip(cols, cellIdxs):
if col != prevCol:
if prevCol != -1:
items.append("] ")
items.append("Col %d: [" % col)
prevCol = col
items.append("%d," % cellIdx)
items.append("]")
return " ".join(items)
class KNNClassifier(object):
"""
This class implements NuPIC's k Nearest Neighbor Classifier. KNN is very
useful as a basic classifier for many situations. This implementation contains
many enhancements that are useful for HTM experiments. These enhancements
include an optimized C++ class for sparse vectors, support for continuous
online learning, support for various distance methods (including Lp-norm and
raw overlap), support for performing SVD on the input vectors (very useful for
large vectors), support for a fixed-size KNN, and a mechanism to store custom
ID's for each vector.
"""
def __init__(self, k=1,
exact=False,
distanceNorm=2.0,
distanceMethod="norm",
distThreshold=0,
doBinarization=False,
binarizationThreshold=0.5,
useSparseMemory=True,
sparseThreshold=0.1,
relativeThreshold=False,
numWinners=0,
numSVDSamples=None,
numSVDDims=None,
fractionOfMax=None,
verbosity=0,
maxStoredPatterns=-1,
replaceDuplicates=False,
cellsPerCol=0):
"""Constructor for the kNN classifier.
@param k (int) The number of nearest neighbors used in the classification of
patterns. Must be odd
@param exact (boolean) If true, patterns must match exactly when assigning
class labels
@param distanceNorm (int) When distance method is "norm", this specifies
the p value of the Lp-norm
@param distanceMethod (string) The method used to compute distance between
input patterns and prototype patterns. The possible options are:
"norm": When distanceNorm is 2, this is the euclidean distance,
When distanceNorm is 1, this is the manhattan distance
In general: sum(abs(x-proto) ^ distanceNorm) ^ (1/distanceNorm)
The distances are normalized such that farthest prototype from
a given input is 1.0.
"rawOverlap": Only appropriate when inputs are binary. This computes:
(width of the input) - (# bits of overlap between input
and prototype).
"pctOverlapOfInput": Only appropriate for binary inputs. This computes
1.0 - (# bits overlap between input and prototype) /
(# ON bits in input)
"pctOverlapOfProto": Only appropriate for binary inputs. This computes
1.0 - (# bits overlap between input and prototype) /
(# ON bits in prototype)
"pctOverlapOfLarger": Only appropriate for binary inputs. This computes
1.0 - (# bits overlap between input and prototype) /
max(# ON bits in input, # ON bits in prototype)
@param distThreshold (float) A threshold on the distance between learned
patterns and a new pattern proposed to be learned. The distance must be
greater than this threshold in order for the new pattern to be added to
the classifier's memory
@param doBinarization (boolean) If True, then scalar inputs will be
binarized.
@param binarizationThreshold (float) If doBinarization is True, this
specifies the threshold for the binarization of inputs
@param useSparseMemory (boolean) If True, classifier will use a sparse
memory matrix
@param sparseThreshold (float) If useSparseMemory is True, input variables
whose absolute values are less than this threshold will be stored as
zero
@param relativeThreshold (boolean) Flag specifying whether to multiply
sparseThreshold by max value in input
@param numWinners (int) Number of elements of the input that are stored. If
0, all elements are stored
@param numSVDSamples (int) Number of samples the must occur before a SVD
(Singular Value Decomposition) transformation will be performed. If 0,
the transformation will never be performed
@param numSVDDims (string) Controls dimensions kept after SVD
transformation. If "adaptive", the number is chosen automatically
@param fractionOfMax (float) If numSVDDims is "adaptive", this controls the
smallest singular value that is retained as a fraction of the largest
singular value
@param verbosity (int) Console verbosity level where 0 is no output and
larger integers provide increasing levels of verbosity
@param maxStoredPatterns (int) Limits the maximum number of the training
patterns stored. When KNN learns in a fixed capacity mode, the unused
patterns are deleted once the number of stored patterns is greater than
maxStoredPatterns. A value of -1 is no limit
@param replaceDuplicates (bool) A boolean flag that determines whether,
during learning, the classifier replaces duplicates that match exactly,
even if distThreshold is 0. Should be True for online learning
@param cellsPerCol (int) If >= 1, input is assumed to be organized into
columns, in the same manner as the temporal pooler AND whenever a new
prototype is stored, only the start cell (first cell) is stored in any
bursting column
"""
self.version = KNNCLASSIFIER_VERSION
self.k = k
self.exact = exact
self.distanceNorm = distanceNorm
assert (distanceMethod in ("norm", "rawOverlap", "pctOverlapOfLarger",
"pctOverlapOfProto", "pctOverlapOfInput"))
self.distanceMethod = distanceMethod
self.distThreshold = distThreshold
self.doBinarization = doBinarization
self.binarizationThreshold = binarizationThreshold
self.useSparseMemory = useSparseMemory
self.sparseThreshold = sparseThreshold
self.relativeThreshold = relativeThreshold
self.numWinners = numWinners
self.numSVDSamples = numSVDSamples
self.numSVDDims = numSVDDims
self.fractionOfMax = fractionOfMax
if self.numSVDDims=="adaptive":
self._adaptiveSVDDims = True
else:
self._adaptiveSVDDims = False
self.verbosity = verbosity
self.replaceDuplicates = replaceDuplicates
self.cellsPerCol = cellsPerCol
self.maxStoredPatterns = maxStoredPatterns
self.clear()
def clear(self):
"""Clears the state of the KNNClassifier."""
self._Memory = None
self._numPatterns = 0
self._M = None
self._categoryList = []
self._partitionIdList = []
self._partitionIdMap = {}
self._finishedLearning = False
self._iterationIdx = -1
# Fixed capacity KNN
if self.maxStoredPatterns > 0:
assert self.useSparseMemory, ("Fixed capacity KNN is implemented only "
"in the sparse memory mode")
self.fixedCapacity = True
self._categoryRecencyList = []
else:
self.fixedCapacity = False
# Cached value of the store prototype sizes
self._protoSizes = None
# Used by PCA
self._s = None
self._vt = None
self._nc = None
self._mean = None
# Used by Network Builder
self._specificIndexTraining = False
self._nextTrainingIndices = None
def _doubleMemoryNumRows(self):
m = 2 * self._Memory.shape[0]
n = self._Memory.shape[1]
self._Memory = numpy.resize(self._Memory,(m,n))
self._M = self._Memory[:self._numPatterns]
def _sparsifyVector(self, inputPattern, doWinners=False):
# Do sparsification, using a relative or absolute threshold
if not self.relativeThreshold:
inputPattern = inputPattern*(abs(inputPattern) > self.sparseThreshold)
elif self.sparseThreshold > 0:
inputPattern = inputPattern * \
(abs(inputPattern) > (self.sparseThreshold * abs(inputPattern).max()))
# Do winner-take-all
if doWinners:
if (self.numWinners>0) and (self.numWinners < (inputPattern > 0).sum()):
sparseInput = numpy.zeros(inputPattern.shape)
# Don't consider strongly negative numbers as winners.
sorted = inputPattern.argsort()[0:self.numWinners]
sparseInput[sorted] += inputPattern[sorted]
inputPattern = sparseInput
# Do binarization
if self.doBinarization:
# Don't binarize negative numbers to positive 1.
inputPattern = (inputPattern > self.binarizationThreshold).astype(float)
return inputPattern
def prototypeSetCategory(self, idToRelabel, newCategory):
if idToRelabel not in self._categoryRecencyList:
return
recordIndex = self._categoryRecencyList.index(idToRelabel)
self._categoryList[recordIndex] = newCategory
def removeIds(self, idsToRemove):
# Form a list of all categories to remove
rowsToRemove = [k for k, rowID in enumerate(self._categoryRecencyList) \
if rowID in idsToRemove]
# Remove rows from the classifier
self._removeRows(rowsToRemove)
def removeCategory(self, categoryToRemove):
removedRows = 0
if self._Memory is None:
return removedRows
# The internal category indices are stored in float
# format, so we should compare with a float
catToRemove = float(categoryToRemove)
# Form a list of all categories to remove
rowsToRemove = [k for k, catID in enumerate(self._categoryList) \
if catID == catToRemove]
# Remove rows from the classifier
self._removeRows(rowsToRemove)
assert catToRemove not in self._categoryList
def _removeRows(self, rowsToRemove):
"""
A list of row indices to remove. There are two caveats. First, this is
a potentially slow operation. Second, pattern indices will shift if
patterns before them are removed.
"""
# Form a numpy array of row indices to be removed
removalArray = numpy.array(rowsToRemove)
# Remove categories
self._categoryList = numpy.delete(numpy.array(self._categoryList),
removalArray).tolist()
if self.fixedCapacity:
self._categoryRecencyList = numpy.delete(
numpy.array(self._categoryRecencyList), removalArray).tolist()
# Remove the partition ID, if any for these rows and rebuild the id map.
for row in reversed(rowsToRemove): # Go backwards
# Remove these patterns from partitionList
self._partitionIdList.pop(row)
self._rebuildPartitionIdMap(self._partitionIdList)
# Remove actual patterns
if self.useSparseMemory:
# Delete backwards
for rowIndex in rowsToRemove[::-1]:
self._Memory.deleteRow(rowIndex)
else:
self._M = numpy.delete(self._M, removalArray, 0)
numRemoved = len(rowsToRemove)
# Sanity checks
numRowsExpected = self._numPatterns - numRemoved
if self.useSparseMemory:
if self._Memory is not None:
assert self._Memory.nRows() == numRowsExpected
else:
assert self._M.shape[0] == numRowsExpected
assert len(self._categoryList) == numRowsExpected
self._numPatterns -= numRemoved
return numRemoved
def doIteration(self):
"""Utility method to increment the iteration index. Intended for models that
don't learn each timestep.
"""
self._iterationIdx += 1
def learn(self, inputPattern, inputCategory, partitionId=None, isSparse=0,
rowID=None):
"""Train the classifier to associate specified input pattern with a
particular category.
@param inputPattern (list) The pattern to be assigned a category. If
isSparse is 0, this should be a dense array (both ON and OFF bits
present). Otherwise, if isSparse > 0, this should be a list of the
indices of the non-zero bits in sorted order
@param inputCategory (int) The category to be associated to the training
pattern
@param partitionId (int) partitionID allows you to associate an id with each
input vector. It can be used to associate input patterns stored in the
classifier with an external id. This can be useful for debugging or
visualizing. Another use case is to ignore vectors with a specific id
during inference (see description of infer() for details). There can be
at most one partitionId per stored pattern (i.e. if two patterns are
within distThreshold, only the first partitionId will be stored). This
is an optional parameter.
@param isSparse (int) If 0, the input pattern is a dense representation. If
isSparse > 0, the input pattern is a list of non-zero indices and
isSparse is the length of the dense representation
@param rowID (int) UNKNOWN
@return The number of patterns currently stored in the classifier
"""
if self.verbosity >= 1:
print "%s learn:" % g_debugPrefix
print " category:", int(inputCategory)
print " active inputs:", _labeledInput(inputPattern,
cellsPerCol=self.cellsPerCol)
if rowID is None:
rowID = self._iterationIdx
# Dense vectors
if not self.useSparseMemory:
# Not supported
assert self.cellsPerCol == 0, "not implemented for dense vectors"
# If the input was given in sparse form, convert it to dense
if isSparse > 0:
denseInput = numpy.zeros(isSparse)
denseInput[inputPattern] = 1.0
inputPattern = denseInput
if self._specificIndexTraining and not self._nextTrainingIndices:
# Specific index mode without any index provided - skip training
return self._numPatterns
if self._Memory is None:
# Initialize memory with 100 rows and numPatterns = 0
inputWidth = len(inputPattern)
self._Memory = numpy.zeros((100,inputWidth))
self._numPatterns = 0
self._M = self._Memory[:self._numPatterns]
addRow = True
if self._vt is not None:
# Compute projection
inputPattern = numpy.dot(self._vt, inputPattern - self._mean)
if self.distThreshold > 0:
# Check if input is too close to an existing input to be accepted
dist = self._calcDistance(inputPattern)
minDist = dist.min()
addRow = (minDist >= self.distThreshold)
if addRow:
self._protoSizes = None # need to re-compute
if self._numPatterns == self._Memory.shape[0]:
# Double the size of the memory
self._doubleMemoryNumRows()
if not self._specificIndexTraining:
# Normal learning - append the new input vector
self._Memory[self._numPatterns] = inputPattern
self._numPatterns += 1
self._categoryList.append(int(inputCategory))
else:
# Specific index training mode - insert vector in specified slot
vectorIndex = self._nextTrainingIndices.pop(0)
while vectorIndex >= self._Memory.shape[0]:
self._doubleMemoryNumRows()
self._Memory[vectorIndex] = inputPattern
self._numPatterns = max(self._numPatterns, vectorIndex + 1)
if vectorIndex >= len(self._categoryList):
self._categoryList += [-1] * (vectorIndex -
len(self._categoryList) + 1)
self._categoryList[vectorIndex] = int(inputCategory)
# Set _M to the "active" part of _Memory
self._M = self._Memory[0:self._numPatterns]
self._addPartitionId(self._numPatterns-1, partitionId)
# Sparse vectors
else:
# If the input was given in sparse form, convert it to dense if necessary
if isSparse > 0 and (self._vt is not None or self.distThreshold > 0 \
or self.numSVDDims is not None or self.numSVDSamples is not None \
or self.numWinners > 0):
denseInput = numpy.zeros(isSparse)
denseInput[inputPattern] = 1.0
inputPattern = denseInput
isSparse = 0
# Get the input width
if isSparse > 0:
inputWidth = isSparse
else:
inputWidth = len(inputPattern)
# Allocate storage if this is the first training vector
if self._Memory is None:
self._Memory = NearestNeighbor(0, inputWidth)
# Support SVD if it is on
if self._vt is not None:
inputPattern = numpy.dot(self._vt, inputPattern - self._mean)
# Threshold the input, zeroing out entries that are too close to 0.
# This is only done if we are given a dense input.
if isSparse == 0:
thresholdedInput = self._sparsifyVector(inputPattern, True)
addRow = True
# If given the layout of the cells, then turn on the logic that stores
# only the start cell for bursting columns.
if self.cellsPerCol >= 1:
burstingCols = thresholdedInput.reshape(-1,
self.cellsPerCol).min(axis=1).nonzero()[0]
for col in burstingCols:
thresholdedInput[(col * self.cellsPerCol) + 1 :
(col * self.cellsPerCol) + self.cellsPerCol] = 0
# Don't learn entries that are too close to existing entries.
if self._Memory.nRows() > 0:
dist = None
# if this vector is a perfect match for one we already learned, then
# replace the category - it may have changed with online learning on.
if self.replaceDuplicates:
dist = self._calcDistance(thresholdedInput, distanceNorm=1)
if dist.min() == 0:
rowIdx = dist.argmin()
self._categoryList[rowIdx] = int(inputCategory)
if self.fixedCapacity:
self._categoryRecencyList[rowIdx] = rowID
addRow = False
# Don't add this vector if it matches closely with another we already
# added
if self.distThreshold > 0:
if dist is None or self.distanceNorm != 1:
dist = self._calcDistance(thresholdedInput)
minDist = dist.min()
addRow = (minDist >= self.distThreshold)
if not addRow:
if self.fixedCapacity:
rowIdx = dist.argmin()
self._categoryRecencyList[rowIdx] = rowID
# Add the new sparse vector to our storage
if addRow:
self._protoSizes = None # need to re-compute
if isSparse == 0:
self._Memory.addRow(thresholdedInput)
else:
self._Memory.addRowNZ(inputPattern, [1]*len(inputPattern))
self._numPatterns += 1
self._categoryList.append(int(inputCategory))
self._addPartitionId(self._numPatterns-1, partitionId)
if self.fixedCapacity:
self._categoryRecencyList.append(rowID)
if self._numPatterns > self.maxStoredPatterns and \
self.maxStoredPatterns > 0:
leastRecentlyUsedPattern = numpy.argmin(self._categoryRecencyList)
self._Memory.deleteRow(leastRecentlyUsedPattern)
self._categoryList.pop(leastRecentlyUsedPattern)
self._categoryRecencyList.pop(leastRecentlyUsedPattern)
self._numPatterns -= 1
if self.numSVDDims is not None and self.numSVDSamples is not None \
and self._numPatterns == self.numSVDSamples:
self.computeSVD()
return self._numPatterns
def getOverlaps(self, inputPattern):
"""Return the degree of overlap between an input pattern and each category
stored in the classifier. The overlap is computed by compuing:
logical_and(inputPattern != 0, trainingPattern != 0).sum()
@param inputPattern pattern to check overlap of
@return (overlaps, categories) Two numpy arrays of the same length:
overlaps: an integer overlap amount for each category
categories: category index for each element of overlaps
"""
assert self.useSparseMemory, "Not implemented yet for dense storage"
overlaps = self._Memory.rightVecSumAtNZ(inputPattern)
return (overlaps, self._categoryList)
def getDistances(self, inputPattern):
"""Return the distances between the input pattern and all other
stored patterns.
@param inputPattern pattern to check distance with
@return (distances, categories) numpy arrays of the same length:
overlaps: an integer overlap amount for each category
categories: category index for each element of distances
"""
dist = self._getDistances(inputPattern)
return (dist, self._categoryList)
def infer(self, inputPattern, computeScores=True, overCategories=True,
partitionId=None):
"""Finds the category that best matches the input pattern. Returns the
winning category index as well as a distribution over all categories.
@param inputPattern (list) A pattern to be classified
@param computeScores NO EFFECT
@param overCategories NO EFFECT
@param partitionId (int) If provided, all training vectors with partitionId
equal to that of the input pattern are ignored.
For example, this may be used to perform k-fold cross validation
without repopulating the classifier. First partition all the data into
k equal partitions numbered 0, 1, 2, ... and then call learn() for each
vector passing in its partitionId. Then, during inference, by passing
in the partition ID in the call to infer(), all other vectors with the
same partitionId are ignored simulating the effect of repopulating the
classifier while ommitting the training vectors in the same partition.
This method returns a 4-tuple: (winner, inferenceResult, dist, categoryDist)
winner: The category with the greatest number of nearest
neighbors within the kth nearest neighbors. If the
inferenceResult contains no neighbors, the value of
winner is None; this applies to the case of exact
matching.
inferenceResult: A list of length numCategories, each entry contains the
number of neighbors within the top k neighbors that
are in that category.
dist: A list of length numPrototypes. Each entry is the
distance from the unknown to that prototype. All
distances are between 0.0 and 1.0
categoryDist: A list of length numCategories. Each entry is the
distance from the unknown to the nearest prototype of
that category. All distances are between 0 and 1.0.
"""
if len(self._categoryList) == 0:
# No categories learned yet; i.e. first inference w/ online learning.
winner = 0
inferenceResult = numpy.zeros(1)
dist = numpy.ones(1)
categoryDist = numpy.ones(1)
else:
maxCategoryIdx = max(self._categoryList)
inferenceResult = numpy.zeros(maxCategoryIdx+1)
dist = self._getDistances(inputPattern, partitionId=partitionId)
validVectorCount = len(self._categoryList) - self._categoryList.count(-1)
# Loop through the indices of the nearest neighbors.
if self.exact:
# Is there an exact match in the distances?
exactMatches = numpy.where(dist<0.00001)[0]
if len(exactMatches) > 0:
for i in exactMatches[:min(self.k, validVectorCount)]:
inferenceResult[self._categoryList[i]] += 1.0
else:
sorted = dist.argsort()
for j in sorted[:min(self.k, validVectorCount)]:
inferenceResult[self._categoryList[j]] += 1.0
# Prepare inference results.
if inferenceResult.any():
winner = inferenceResult.argmax()
inferenceResult /= inferenceResult.sum()
else:
winner = None
categoryDist = min_score_per_category(maxCategoryIdx,
self._categoryList, dist)
categoryDist.clip(0, 1.0, categoryDist)
if self.verbosity >= 1:
print "%s infer:" % (g_debugPrefix)
print " active inputs:", _labeledInput(inputPattern,
cellsPerCol=self.cellsPerCol)
print " winner category:", winner
print " pct neighbors of each category:", inferenceResult
print " dist of each prototype:", dist
print " dist of each category:", categoryDist
result = (winner, inferenceResult, dist, categoryDist)
return result
def getClosest(self, inputPattern, topKCategories=3):
"""Returns the index of the pattern that is closest to inputPattern,
the distances of all patterns to inputPattern, and the indices of the k
closest categories.
"""
inferenceResult = numpy.zeros(max(self._categoryList)+1)
dist = self._getDistances(inputPattern)
sorted = dist.argsort()
validVectorCount = len(self._categoryList) - self._categoryList.count(-1)
for j in sorted[:min(self.k, validVectorCount)]:
inferenceResult[self._categoryList[j]] += 1.0
winner = inferenceResult.argmax()
topNCats = []
for i in range(topKCategories):
topNCats.append((self._categoryList[sorted[i]], dist[sorted[i]] ))
return winner, dist, topNCats
def closestTrainingPattern(self, inputPattern, cat):
"""Returns the closest training pattern to inputPattern that belongs to
category "cat".
@param inputPattern The pattern whose closest neighbor is sought
@param cat The required category of closest neighbor
@return A dense version of the closest training pattern, or None if no such
patterns exist
"""
dist = self._getDistances(inputPattern)
sorted = dist.argsort()
for patIdx in sorted:
patternCat = self._categoryList[patIdx]
# If closest pattern belongs to desired category, return it
if patternCat == cat:
if self.useSparseMemory:
closestPattern = self._Memory.getRow(int(patIdx))
else:
closestPattern = self._M[patIdx]
return closestPattern
# No patterns were found!
return None
def closestOtherTrainingPattern(self, inputPattern, cat):
"""Return the closest training pattern that is *not* of the given
category "cat".
@param inputPattern The pattern whose closest neighbor is sought
@param cat Training patterns of this category will be ignored no matter
their distance to inputPattern
@return A dense version of the closest training pattern, or None if no such
patterns exist
"""
dist = self._getDistances(inputPattern)
sorted = dist.argsort()
for patIdx in sorted:
patternCat = self._categoryList[patIdx]
# If closest pattern does not belong to specified category, return it
if patternCat != cat:
if self.useSparseMemory:
closestPattern = self._Memory.getRow(int(patIdx))
else:
closestPattern = self._M[patIdx]
return closestPattern
# No patterns were found!
return None
def getPattern(self, idx, sparseBinaryForm=False, cat=None):
"""Gets a training pattern either by index or category number.
@param idx Index of the training pattern
@param sparseBinaryForm If true, returns a list of the indices of the
non-zero bits in the training pattern
@param cat If not None, get the first pattern belonging to category cat. If
this is specified, idx must be None.
@return The training pattern with specified index
"""
if cat is not None:
assert idx is None
idx = self._categoryList.index(cat)
if not self.useSparseMemory:
pattern = self._Memory[idx]
if sparseBinaryForm:
pattern = pattern.nonzero()[0]
else:
(nz, values) = self._Memory.rowNonZeros(idx)
if not sparseBinaryForm:
pattern = numpy.zeros(self._Memory.nCols())
numpy.put(pattern, nz, 1)
else:
pattern = nz
return pattern
def getPartitionId(self, i):
"""
Returns the partition Id associated with pattern i. Returns None
if no Id is associated with it.
"""
if (i < 0) or (i >= self._numPatterns):
raise RuntimeError("index out of bounds")
partitionId = self._partitionIdList[i]
if partitionId == numpy.inf:
return None
else:
return partitionId
def getPartitionIdPerPattern(self):
"""
Returns a list of numPatterns elements where the i'th position contains
the integer partition Id associated with pattern i. If pattern i had no
partition Id, it's value will be numpy.inf
"""
return self._partitionIdList
def getNumPartitionIds(self):
"""
Return the number of unique partition Ids stored.
"""
return len(self._partitionIdMap)
def getPartitionIdList(self):
"""
Return a list containing unique (non-None) partition Ids
"""
return self._partitionIdMap.keys()
def getPatternIndicesWithPartitionId(self, partitionId):
"""
Returns a list of pattern indices corresponding to this partitionId.
Return an empty list if there are none
"""
return self._partitionIdMap.get(partitionId, [])
def _addPartitionId(self, index, partitionId=None):
"""
Adds partition id for pattern index
"""
if partitionId is None:
self._partitionIdList.append(numpy.inf)
else:
self._partitionIdList.append(partitionId)
indices = self._partitionIdMap.get(partitionId, [])
indices.append(index)
self._partitionIdMap[partitionId] = indices
def _rebuildPartitionIdMap(self, partitionIdList):
"""
Rebuilds the partition Id map using the given partitionIdList
"""
self._partitionIdMap = {}
for row, partitionId in enumerate(partitionIdList):
indices = self._partitionIdMap.get(partitionId, [])
indices.append(row)
self._partitionIdMap[partitionId] = indices
def _calcDistance(self, inputPattern, distanceNorm=None):
"""Calculate the distances from inputPattern to all stored patterns. All
distances are between 0.0 and 1.0
@param inputPattern The pattern from which distances to all other patterns
are calculated
@param distanceNorm Degree of the distance norm
"""
if distanceNorm is None:
distanceNorm = self.distanceNorm
# Sparse memory
if self.useSparseMemory:
if self._protoSizes is None:
self._protoSizes = self._Memory.rowSums()
overlapsWithProtos = self._Memory.rightVecSumAtNZ(inputPattern)
inputPatternSum = inputPattern.sum()
if self.distanceMethod == "rawOverlap":
dist = inputPattern.sum() - overlapsWithProtos
elif self.distanceMethod == "pctOverlapOfInput":
dist = inputPatternSum - overlapsWithProtos
if inputPatternSum > 0:
dist /= inputPatternSum
elif self.distanceMethod == "pctOverlapOfProto":
overlapsWithProtos /= self._protoSizes
dist = 1.0 - overlapsWithProtos
elif self.distanceMethod == "pctOverlapOfLarger":
maxVal = numpy.maximum(self._protoSizes, inputPatternSum)
if maxVal.all() > 0:
overlapsWithProtos /= maxVal
dist = 1.0 - overlapsWithProtos
elif self.distanceMethod == "norm":
dist = self._Memory.vecLpDist(self.distanceNorm, inputPattern)
distMax = dist.max()
if distMax > 0:
dist /= distMax
else:
raise RuntimeError("Unimplemented distance method %s" %
self.distanceMethod)
# Dense memory
else:
if self.distanceMethod == "norm":
dist = numpy.power(numpy.abs(self._M - inputPattern), self.distanceNorm)
dist = dist.sum(1)
dist = numpy.power(dist, 1.0/self.distanceNorm)
dist /= dist.max()
else:
raise RuntimeError ("Not implemented yet for dense storage....")
return dist
def _getDistances(self, inputPattern, partitionId=None):
"""Return the distances from inputPattern to all stored patterns.
@param inputPattern The pattern from which distances to all other patterns
are returned
@param partitionId If provided, ignore all training vectors with this
partitionId.
"""
if not self._finishedLearning:
self.finishLearning()
self._finishedLearning = True
if self._vt is not None and len(self._vt) > 0:
inputPattern = numpy.dot(self._vt, inputPattern - self._mean)
sparseInput = self._sparsifyVector(inputPattern)
# Compute distances
dist = self._calcDistance(sparseInput)
# Invalidate results where category is -1
if self._specificIndexTraining:
dist[numpy.array(self._categoryList) == -1] = numpy.inf
# Ignore vectors with this partition id by setting their distances to inf
if partitionId is not None:
dist[self._partitionIdMap.get(partitionId, [])] = numpy.inf
return dist
def finishLearning(self):
if self.numSVDDims is not None and self._vt is None:
self.computeSVD()
def computeSVD(self, numSVDSamples=None, finalize=True):
if numSVDSamples is None:
numSVDSamples = self._numPatterns
if not self.useSparseMemory:
self._a = self._Memory[:self._numPatterns]
else:
self._a = self._Memory.toDense()[:self._numPatterns]
self._mean = numpy.mean(self._a, axis=0)
self._a -= self._mean
u,self._s,self._vt = numpy.linalg.svd(self._a[:numSVDSamples])
if finalize:
self.finalizeSVD()
return self._s
def getAdaptiveSVDDims(self, singularValues, fractionOfMax=0.001):
v = singularValues/singularValues[0]
idx = numpy.where(v<fractionOfMax)[0]
if len(idx):
print "Number of PCA dimensions chosen: ", idx[0], "out of ", len(v)
return idx[0]
else:
print "Number of PCA dimensions chosen: ", len(v)-1, "out of ", len(v)
return len(v)-1
def finalizeSVD(self, numSVDDims=None):
if numSVDDims is not None:
self.numSVDDims = numSVDDims
if self.numSVDDims=="adaptive":
if self.fractionOfMax is not None:
self.numSVDDims = self.getAdaptiveSVDDims(self._s, self.fractionOfMax)
else:
self.numSVDDims = self.getAdaptiveSVDDims(self._s)
if self._vt.shape[0] < self.numSVDDims:
print "******************************************************************"
print ("Warning: The requested number of PCA dimensions is more than "
"the number of pattern dimensions.")
print "Setting numSVDDims = ", self._vt.shape[0]
print "******************************************************************"
self.numSVDDims = self._vt.shape[0]
self._vt = self._vt[:self.numSVDDims]
# Added when svd is not able to decompose vectors - uses raw spare vectors
if len(self._vt) == 0:
return
self._Memory = numpy.zeros((self._numPatterns,self.numSVDDims))
self._M = self._Memory
self.useSparseMemory = False
for i in range(self._numPatterns):
self._Memory[i] = numpy.dot(self._vt, self._a[i])
self._a = None
def leaveOneOutTest(self):
"""Run leave-one-out testing.
Returns the total number of samples and the number correctly classified.
Ignores invalid vectors (those with a category of -1).
Uses partitionIdList, if non-empty, to avoid matching a vector against
other vectors that came from the same training sequence.
"""
if self.useSparseMemory:
raise Exception("leaveOneOutTest only works with dense memory right now")
# The basic test is simple, but we need to prepare some data structures to
# handle _specificIndexTraining and _partitionIdList
categoryListArray = numpy.array(self._categoryList[:self._M.shape[0]])
invalidIndices = []
if self._specificIndexTraining:
# Find valid and invalid vectors using the category list
validIndices = (categoryListArray != -1)
invalidIndices = (categoryListArray == -1)
# Convert list of partitions to numpy array if we haven't
# already done so.
# Find the winning vector for each cache vector, excluding itself,
# excluding invalid vectors, and excluding other vectors with the
# same partition id
winners = numpy.zeros(self._M.shape[0], numpy.int32)
for i in xrange(self._M.shape[0]):
if self._specificIndexTraining \
and categoryListArray[i] == -1: # This is an invalid vector
continue
# Calculate distance between this vector and all others
distances = numpy.power(numpy.abs(self._M - self._M[i,:]),
self.distanceNorm)
distances = distances.sum(1)
# Invalidate certain vectors by setting their distance to infinity
if self._specificIndexTraining:
distances[invalidIndices] = numpy.inf # Ignore invalid vectors
# Ignore vectors with same partition id as i
distances[self._partitionIdMap.get(
self._partitionIdList[i], [])] = numpy.inf
# Don't match vector with itself
distances[i] = numpy.inf
if self.k == 1:
# Take the closest vector as the winner (k=1)
winners[i] = distances.argmin()
else:
# Have the top k winners vote on the category
categoryScores = numpy.zeros(categoryListArray.max() + 1)
for j in xrange(self.k):
winner = distances.argmin()
distances[winner] = numpy.inf
categoryScores[categoryListArray[winner]] += 1
winners[i] = categoryScores.argmax()
if self.k == 1:
# Convert the winners (vector IDs) to their category indices
# For k > 1, the winners are already category indices
winners = categoryListArray[winners]
if self._specificIndexTraining:
# Count the number of correct categories, ignoring invalid vectors
matches = (winners[validIndices] == categoryListArray[validIndices])
else:
# Count the number of correct categories
matches = (winners == categoryListArray)
# number of samples, number correct
return float(matches.shape[0]), matches.sum()
def remapCategories(self, mapping):
"""Change the category indices.
Used by the Network Builder to keep the category indices in sync with the
ImageSensor categoryInfo when the user renames or removes categories.
@param mapping List of new category indices. For example, mapping=[2,0,1]
would change all vectors of category 0 to be category 2, category 1 to
0, and category 2 to 1
"""
categoryArray = numpy.array(self._categoryList)
newCategoryArray = numpy.zeros(categoryArray.shape[0])
newCategoryArray.fill(-1)
for i in xrange(len(mapping)):
newCategoryArray[categoryArray==i] = mapping[i]
self._categoryList = list(newCategoryArray)
def setCategoryOfVectors(self, vectorIndices, categoryIndices):
"""Change the category associated with this vector(s).
Used by the Network Builder to move vectors between categories, to enable
categories, and to invalidate vectors by setting the category to -1.
@param vectorIndices Single index or list of indices
@param categoryIndices Single index or list of indices. Can also be a
single index when vectorIndices is a list, in which case the same
category will be used for all vectors
"""
if not hasattr(vectorIndices, "__iter__"):
vectorIndices = [vectorIndices]
categoryIndices = [categoryIndices]
elif not hasattr(categoryIndices, "__iter__"):
categoryIndices = [categoryIndices] * len(vectorIndices)
for i in xrange(len(vectorIndices)):
vectorIndex = vectorIndices[i]
categoryIndex = categoryIndices[i]
# Out-of-bounds is not an error, because the KNN may not have seen the
# vector yet
if vectorIndex < len(self._categoryList):
self._categoryList[vectorIndex] = categoryIndex
def __getstate__(self):
"""Return serializable state.
This function will return a version of the __dict__.
"""
state = self.__dict__.copy()
return state
def __setstate__(self, state):
"""Set the state of this object from a serialized state."""
if "version" not in state:
pass
elif state["version"] == 1:
pass
elif state["version"] == 2:
raise RuntimeError("Invalid deserialization of invalid KNNClassifier"
"Verison")
# Backward compatibility
if "_partitionIdArray" in state:
state.pop("_partitionIdArray")
self.__dict__.update(state)
# Backward compatibility
if "_partitionIdMap" not in state:
self._rebuildPartitionIdMap(self._partitionIdList)
# Set to new version
self.version = KNNCLASSIFIER_VERSION
| 1 | 20,430 | Still need to remove trailing spaces on this line | numenta-nupic | py |
@@ -0,0 +1,19 @@
+/*
+ * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
+ */
+
+package net.sourceforge.pmd.lang.apex.ast;
+
+import apex.jorje.semantic.ast.AstNode;
+
+/**
+ * Interface for nodes that can contain comments. Because comments are for the most part lost, the tree builder only
+ * captures whether the node did contain comments of any sort in the source code and not the actual contents of those
+ * comments. This is useful for rules which need to know whether a node did contain comments.
+ */
+public interface ASTCommentContainer<T extends AstNode> extends ApexNode<T> {
+
+ void setContainsComment(boolean containsComment);
+
+ boolean getContainsComment();
+} | 1 | 1 | 19,099 | Please use the `@Experimental` annotation on this | pmd-pmd | java |
|
@@ -77,7 +77,7 @@ func (s *LimitedReaderSlurper) Read(reader io.Reader) error {
// if we received err == nil and n == 0, we should retry calling the Read function.
continue
default:
- // if we recieved a non-io.EOF error, return it.
+ // if we received a non-io.EOF error, return it.
return err
}
} | 1 | // Copyright (C) 2019-2021 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// go-algorand is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with go-algorand. If not, see <https://www.gnu.org/licenses/>.
package network
import (
"errors"
"io"
)
// ErrIncomingMsgTooLarge is returned when an incoming message is too large
var ErrIncomingMsgTooLarge = errors.New("read limit exceeded")
// allocationStep is the amount of memory allocated at any single time we don't have enough memory allocated.
const allocationStep = uint64(64 * 1024)
// LimitedReaderSlurper collects bytes from an io.Reader, but stops if a limit is reached.
type LimitedReaderSlurper struct {
// remainedUnallocatedSpace is how much more memory we are allowed to allocate for this reader beyond the base allocation.
remainedUnallocatedSpace uint64
// the buffers array contain the memory buffers used to store the data. The first level array is preallocated
// dependening on the desired base allocation. The rest of the levels are dynamically allocated on demand.
buffers [][]byte
// lastBuffer is the index of the last filled buffer, or the first one if no buffer was ever filled.
lastBuffer int
}
// MakeLimitedReaderSlurper creates a LimitedReaderSlurper instance with the provided base and max memory allocations.
func MakeLimitedReaderSlurper(baseAllocation, maxAllocation uint64) *LimitedReaderSlurper {
if baseAllocation > maxAllocation {
baseAllocation = maxAllocation
}
lrs := &LimitedReaderSlurper{
remainedUnallocatedSpace: maxAllocation - baseAllocation,
lastBuffer: 0,
buffers: make([][]byte, 1+(maxAllocation-baseAllocation+allocationStep-1)/allocationStep),
}
lrs.buffers[0] = make([]byte, 0, baseAllocation)
return lrs
}
// Read does repeated Read()s on the io.Reader until it gets io.EOF.
// Returns underlying error or ErrIncomingMsgTooLarge if limit reached.
// Returns a nil error if the underlying io.Reader returned io.EOF.
func (s *LimitedReaderSlurper) Read(reader io.Reader) error {
var readBuffer []byte
for {
// do we have more room in the current buffer ?
if len(s.buffers[s.lastBuffer]) == cap(s.buffers[s.lastBuffer]) {
// current buffer is full, try to expand buffers
if s.remainedUnallocatedSpace == 0 {
// we ran out of memory, but is there any more data ?
n, err := reader.Read(make([]byte, 1))
switch {
case n > 0:
// yes, there was at least one extra byte - return ErrIncomingMsgTooLarge
return ErrIncomingMsgTooLarge
case err == io.EOF:
// no, no more data. just return nil
return nil
case err == nil:
// if we received err == nil and n == 0, we should retry calling the Read function.
continue
default:
// if we recieved a non-io.EOF error, return it.
return err
}
}
// make another buffer
s.allocateNextBuffer()
}
readBuffer = s.buffers[s.lastBuffer]
// the entireBuffer is the same underlying buffer as readBuffer, but the length was moved to the maximum buffer capacity.
entireBuffer := readBuffer[:cap(readBuffer)]
// read the data into the unused area of the read buffer.
n, err := reader.Read(entireBuffer[len(readBuffer):])
if err != nil {
if err == io.EOF {
s.buffers[s.lastBuffer] = readBuffer[:len(readBuffer)+n]
return nil
}
return err
}
s.buffers[s.lastBuffer] = readBuffer[:len(readBuffer)+n]
}
}
// Size returs the current total size of contained chunks read from io.Reader
func (s *LimitedReaderSlurper) Size() (size uint64) {
for i := 0; i <= s.lastBuffer; i++ {
size += uint64(len(s.buffers[i]))
}
return
}
// Reset clears the buffered data
func (s *LimitedReaderSlurper) Reset() {
for i := 1; i <= s.lastBuffer; i++ {
s.remainedUnallocatedSpace += uint64(cap(s.buffers[i]))
s.buffers[i] = nil
}
s.buffers[0] = s.buffers[0][:0]
s.lastBuffer = 0
}
// Bytes returns a copy of all the collected data
func (s *LimitedReaderSlurper) Bytes() []byte {
out := make([]byte, s.Size())
offset := 0
for i := 0; i <= s.lastBuffer; i++ {
copy(out[offset:], s.buffers[i])
offset += len(s.buffers[i])
}
return out
}
// allocateNextBuffer allocates the next buffer and places it in the buffers array.
func (s *LimitedReaderSlurper) allocateNextBuffer() {
s.lastBuffer++
allocationSize := allocationStep
if allocationSize > s.remainedUnallocatedSpace {
allocationSize = s.remainedUnallocatedSpace
}
s.buffers[s.lastBuffer] = make([]byte, 0, allocationSize)
s.remainedUnallocatedSpace -= allocationSize
}
| 1 | 42,226 | I found ~10 more instances of this typo. we can fix those in subsequent PRs. | algorand-go-algorand | go |
@@ -49,7 +49,7 @@ type InitRes struct {
// it returns a result object that contains useful artifacts for later use.
// Unlike sharedmain.Main, Init is meant to be run as a helper function in any main
// functions, while sharedmain.Main runs controllers with predefined method signatures.
-func Init(component string, opts ...InitOption) (context.Context, *InitRes) {
+func Init(component string, metricNamespace string, opts ...InitOption) (context.Context, *InitRes) {
args := newInitArgs(component, opts...)
ctx := args.ctx
ProcessEnvConfigOrDie(args.env) | 1 | /*
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package mainhelper provides helper functions for common boilerplate code in
// writing a main function such as setting up kube informers.
package mainhelper
import (
"context"
"log"
"net/http"
"github.com/google/knative-gcp/pkg/observability"
"github.com/kelseyhightower/envconfig"
"go.uber.org/zap"
"golang.org/x/sync/errgroup"
"k8s.io/client-go/kubernetes"
kubeclient "knative.dev/pkg/client/injection/kube/client"
"knative.dev/pkg/configmap"
"knative.dev/pkg/controller"
"knative.dev/pkg/injection/sharedmain"
"knative.dev/pkg/logging"
"knative.dev/pkg/profiling"
)
// InitRes holds a collection of objects after init for convenient access by
// other custom logic in the main function.
type InitRes struct {
Logger *zap.SugaredLogger
KubeClient kubernetes.Interface
CMPWatcher configmap.Watcher
Cleanup func()
}
// Similar to sharedmain.Main, Init runs common logic in starting a main function,
// it returns a result object that contains useful artifacts for later use.
// Unlike sharedmain.Main, Init is meant to be run as a helper function in any main
// functions, while sharedmain.Main runs controllers with predefined method signatures.
func Init(component string, opts ...InitOption) (context.Context, *InitRes) {
args := newInitArgs(component, opts...)
ctx := args.ctx
ProcessEnvConfigOrDie(args.env)
log.Printf("Registering %d clients", len(args.injection.GetClients()))
log.Printf("Registering %d informer factories", len(args.injection.GetInformerFactories()))
log.Printf("Registering %d informers", len(args.injection.GetInformers()))
ctx, informers := args.injection.SetupInformers(ctx, args.kubeConfig)
ctx, cmw, profilingHandler, flush := observability.SetupDynamicConfigOrDie(ctx, component)
logger := logging.FromContext(ctx)
RunProfilingServer(ctx, logger, profilingHandler)
// This is currently a workaround for testing where k8s APIServer is not properly setup.
if !args.skipK8sVersionCheck {
sharedmain.CheckK8sClientMinimumVersionOrDie(ctx, logger)
}
logger.Info("Starting informers...")
if err := controller.StartInformers(ctx.Done(), informers...); err != nil {
logger.Desugar().Fatal("Failed to start informers", zap.Error(err))
}
return ctx, &InitRes{
Logger: logger,
KubeClient: kubeclient.Get(ctx),
CMPWatcher: cmw,
Cleanup: flush,
}
}
// ProcessEnvConfigOrDie retrieves environment variables.
func ProcessEnvConfigOrDie(env interface{}) {
if env == nil {
return
}
if err := envconfig.Process("", env); err != nil {
log.Fatal("Failed to process env var", err)
}
log.Printf("Running with env: %+v", env)
}
// RunProfilingServer starts a profiling server.
func RunProfilingServer(ctx context.Context, logger *zap.SugaredLogger, h *profiling.Handler) {
profilingServer := profiling.NewServer(h)
eg, egCtx := errgroup.WithContext(ctx)
eg.Go(profilingServer.ListenAndServe)
go func() {
// This will block until either a signal arrives or one of the grouped functions
// returns an error.
<-egCtx.Done()
profilingServer.Shutdown(context.Background())
if err := eg.Wait(); err != nil && err != http.ErrServerClosed {
logger.Error("Error while running server", zap.Error(err))
}
}()
}
| 1 | 14,702 | How about making metricNamespace an option, and by default it's the same as `component`? e.g.m Init(component, WithMetricNamespace("trigger")) | google-knative-gcp | go |
@@ -163,6 +163,8 @@ public class NodeJSSampleMethodToViewTransformer implements SampleMethodToViewTr
symbolTable.getNewSymbol(namer.localVarName(Name.lowerCamel("handlePage"))));
builder.pageVarName(
symbolTable.getNewSymbol(namer.localVarName(Name.lowerCamel(fieldInfo.name(), "page"))));
+ builder.pageTokenName(methodInfo.requestPageTokenName());
+ builder.nextPageTokenName(methodInfo.responsePageTokenName());
return builder.build();
}
} | 1 | /* Copyright 2016 Google Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.api.codegen.discovery.transformer.nodejs;
import com.google.api.codegen.discovery.config.FieldInfo;
import com.google.api.codegen.discovery.config.MethodInfo;
import com.google.api.codegen.discovery.config.SampleConfig;
import com.google.api.codegen.discovery.transformer.SampleMethodToViewTransformer;
import com.google.api.codegen.discovery.transformer.SampleNamer;
import com.google.api.codegen.discovery.transformer.SampleTransformerContext;
import com.google.api.codegen.discovery.transformer.SampleTypeTable;
import com.google.api.codegen.discovery.viewmodel.SampleAuthView;
import com.google.api.codegen.discovery.viewmodel.SampleFieldView;
import com.google.api.codegen.discovery.viewmodel.SamplePageStreamingView;
import com.google.api.codegen.discovery.viewmodel.SampleView;
import com.google.api.codegen.util.Name;
import com.google.api.codegen.util.SymbolTable;
import com.google.api.codegen.util.nodejs.NodeJSNameFormatter;
import com.google.api.codegen.util.nodejs.NodeJSTypeTable;
import com.google.api.codegen.viewmodel.ViewModel;
import com.google.protobuf.Field.Cardinality;
import com.google.protobuf.Method;
import java.util.ArrayList;
import java.util.List;
public class NodeJSSampleMethodToViewTransformer implements SampleMethodToViewTransformer {
private static final String TEMPLATE_FILENAME = "nodejs/sample.snip";
public NodeJSSampleMethodToViewTransformer() {}
@Override
public ViewModel transform(Method method, SampleConfig sampleConfig) {
SampleTypeTable sampleTypeTable =
new SampleTypeTable(new NodeJSTypeTable(""), new NodeJSSampleTypeNameConverter());
NodeJSSampleNamer nodeJsSampleNamer = new NodeJSSampleNamer();
SampleTransformerContext context =
SampleTransformerContext.create(
sampleConfig, sampleTypeTable, nodeJsSampleNamer, method.getName());
return createSampleView(context);
}
private SampleView createSampleView(SampleTransformerContext context) {
SampleConfig config = context.getSampleConfig();
MethodInfo methodInfo = config.methods().get(context.getMethodName());
SampleNamer namer = context.getSampleNamer();
SampleTypeTable typeTable = context.getSampleTypeTable();
SymbolTable symbolTable = SymbolTable.fromSeed(NodeJSNameFormatter.RESERVED_IDENTIFIER_SET);
SampleView.Builder builder = SampleView.newBuilder();
String serviceVarName = symbolTable.getNewSymbol(namer.getServiceVarName(config.apiTypeName()));
String serviceTypeName = typeTable.getAndSaveNicknameForServiceType(config.apiTypeName());
String requestVarName = symbolTable.getNewSymbol(namer.getRequestVarName());
if (methodInfo.isPageStreaming()) {
builder.pageStreaming(createSamplePageStreamingView(context, symbolTable));
}
// Created before the fields in case there are naming conflicts in the symbol table.
SampleAuthView sampleAuthView = createSampleAuthView(context, symbolTable);
List<SampleFieldView> fields = new ArrayList<>();
for (FieldInfo field : methodInfo.fields().values()) {
String name = field.name();
// Since the requestBody is named `resource`, all fields named `resource`
// are renamed by the Node.js client library generator to `resource_`.
if (name.equals("resource")) {
name = "resource_";
}
fields.add(
SampleFieldView.newBuilder()
.name(name)
.defaultValue(typeTable.getZeroValueAndSaveNicknameFor(field.type()))
.example(field.example())
.description(field.description())
.build());
}
boolean hasResponse = methodInfo.responseType() != null;
if (hasResponse) {
builder.responseVarName(symbolTable.getNewSymbol(namer.getResponseVarName()));
}
return builder
.templateFileName(TEMPLATE_FILENAME)
.outputPath(context.getMethodName() + ".frag.njs")
.apiTitle(config.apiTitle())
.apiName(config.apiName())
.apiVersion(config.apiVersion())
.auth(sampleAuthView)
.serviceVarName(serviceVarName)
.serviceTypeName(serviceTypeName)
.methodVerb(methodInfo.verb())
.methodNameComponents(methodInfo.nameComponents())
.requestVarName(requestVarName)
.hasRequestBody(methodInfo.requestBodyType() != null)
.hasResponse(hasResponse)
.fields(fields)
.isPageStreaming(methodInfo.isPageStreaming())
.hasMediaUpload(methodInfo.hasMediaUpload())
.hasMediaDownload(methodInfo.hasMediaDownload())
.googleImportVarName(
symbolTable.getNewSymbol(namer.localVarName(Name.lowerCamel("google"))))
.build();
}
private SampleAuthView createSampleAuthView(
SampleTransformerContext context, SymbolTable symbolTable) {
SampleConfig config = context.getSampleConfig();
MethodInfo methodInfo = config.methods().get(context.getMethodName());
SampleNamer namer = context.getSampleNamer();
String authVarName = "";
switch (config.authType()) {
case API_KEY:
authVarName = "apiKey";
break;
default:
authVarName = "authClient";
}
return SampleAuthView.newBuilder()
.type(config.authType())
.instructionsUrl(config.authInstructionsUrl())
.scopes(methodInfo.authScopes())
.isScopesSingular(methodInfo.authScopes().size() == 1)
.authFuncName(
symbolTable.getNewSymbol(namer.staticFunctionName(Name.lowerCamel("authorize"))))
.authVarName(symbolTable.getNewSymbol(namer.localVarName(Name.lowerCamel(authVarName))))
.build();
}
private SamplePageStreamingView createSamplePageStreamingView(
SampleTransformerContext context, SymbolTable symbolTable) {
MethodInfo methodInfo = context.getSampleConfig().methods().get(context.getMethodName());
FieldInfo fieldInfo = methodInfo.pageStreamingResourceField();
SampleNamer namer = context.getSampleNamer();
SamplePageStreamingView.Builder builder = SamplePageStreamingView.newBuilder();
if (fieldInfo.type().isMap()) {
builder.resourceKeyVarName(
symbolTable.getNewSymbol(namer.localVarName(Name.lowerCamel("name"))));
}
builder.resourceFieldName(namer.getFieldVarName(fieldInfo.name()));
builder.isResourceRepeated(fieldInfo.cardinality() == Cardinality.CARDINALITY_REPEATED);
builder.isResourceMap(fieldInfo.type().isMap());
builder.handlePageVarName(
symbolTable.getNewSymbol(namer.localVarName(Name.lowerCamel("handlePage"))));
builder.pageVarName(
symbolTable.getNewSymbol(namer.localVarName(Name.lowerCamel(fieldInfo.name(), "page"))));
return builder.build();
}
}
| 1 | 20,432 | Just checking: no need for case manipulation? | googleapis-gapic-generator | java |
@@ -94,7 +94,7 @@ public class GrpcMetadataGeneratorTool {
private static void generate(
String descriptorSet,
- String[] apiConfigs,
+ String[] configs,
String inputDir,
String outputDir,
String languageString, | 1 | /* Copyright 2016 Google Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.api.codegen.grpcmetadatagen;
import com.google.api.codegen.TargetLanguage;
import com.google.api.tools.framework.tools.ToolOptions;
import com.google.common.collect.Lists;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
/** Tool to generate package metadata. */
public class GrpcMetadataGeneratorTool {
public static void main(String[] args) throws Exception {
Options options = new Options();
options.addOption("h", "help", false, "show usage");
options.addOption(
Option.builder()
.longOpt("descriptor_set")
.desc("The descriptor set representing the compiled input protos.")
.hasArg()
.argName("DESCRIPTOR-SET")
.required(true)
.build());
options.addOption(
Option.builder()
.longOpt("service_yaml")
.desc("The service YAML configuration file or files.")
.hasArg()
.argName("SERVICE-YAML")
.required(false)
.build());
options.addOption(
Option.builder("i")
.longOpt("input")
.desc("The input directory containing the gRPC package.")
.hasArg()
.argName("INPUT-DIR")
.required(true)
.build());
options.addOption(
Option.builder("o")
.longOpt("output")
.desc("The directory in which to output the generated config.")
.hasArg()
.argName("OUTPUT-DIR")
.required(true)
.build());
options.addOption(
Option.builder("l")
.longOpt("language")
.desc("The language for which to generate package metadata.")
.hasArg()
.argName("LANGUAGE")
.required(true)
.build());
options.addOption(
Option.builder("c")
.longOpt("metadata_config")
.desc("The YAML file configuring the package metadata.")
.hasArg()
.argName("METADATA-CONFIG")
.required(true)
.build());
CommandLine cl = (new DefaultParser()).parse(options, args);
if (cl.hasOption("help")) {
HelpFormatter formater = new HelpFormatter();
formater.printHelp("ConfigGeneratorTool", options);
}
generate(
cl.getOptionValue("descriptor_set"),
cl.getOptionValues("service_yaml"),
cl.getOptionValue("input"),
cl.getOptionValue("output"),
cl.getOptionValue("language"),
cl.getOptionValue("metadata_config"));
}
private static void generate(
String descriptorSet,
String[] apiConfigs,
String inputDir,
String outputDir,
String languageString,
String metadataConfig) {
TargetLanguage language = TargetLanguage.fromString(languageString);
ToolOptions options = ToolOptions.create();
options.set(GrpcMetadataGenerator.INPUT_DIR, inputDir);
options.set(GrpcMetadataGenerator.OUTPUT_DIR, outputDir);
options.set(ToolOptions.DESCRIPTOR_SET, descriptorSet);
if (apiConfigs != null) {
options.set(ToolOptions.CONFIG_FILES, Lists.newArrayList(apiConfigs));
}
options.set(GrpcMetadataGenerator.METADATA_CONFIG_FILE, metadataConfig);
options.set(GrpcMetadataGenerator.LANGUAGE, languageString);
GrpcMetadataGenerator generator = new GrpcMetadataGenerator(options);
generator.run();
}
}
| 1 | 22,017 | Same as above, not that descriptive | googleapis-gapic-generator | java |
@@ -5494,10 +5494,12 @@ emit_special_ibl_xfer(dcontext_t *dcontext, byte *pc, generated_code_t *code, ui
reg_id_t stub_reg = IF_AARCH64_ELSE(SCRATCH_REG0, SCRATCH_REG1);
ushort stub_slot = IF_AARCH64_ELSE(TLS_REG0_SLOT, TLS_REG1_SLOT);
IF_X86(size_t len;)
- byte *ibl_tgt = special_ibl_xfer_tgt(dcontext, code, IBL_LINKED, ibl_type);
+ byte *ibl_linked_tgt = special_ibl_xfer_tgt(dcontext, code, IBL_LINKED, ibl_type);
+ byte *ibl_unlinked_tgt = special_ibl_xfer_tgt(dcontext, code, IBL_UNLINKED, ibl_type);
bool absolute = !code->thread_shared;
- ASSERT(ibl_tgt != NULL);
+ ASSERT(ibl_linked_tgt != NULL);
+ ASSERT(ibl_unlinked_tgt != NULL);
instrlist_init(&ilist);
init_patch_list(&patch, absolute ? PATCH_TYPE_ABSOLUTE : PATCH_TYPE_INDIRECT_FS);
| 1 | /* **********************************************************
* Copyright (c) 2010-2021 Google, Inc. All rights reserved.
* Copyright (c) 2000-2010 VMware, Inc. All rights reserved.
* **********************************************************/
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of VMware, Inc. nor the names of its contributors may be
* used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*/
/* Copyright (c) 2003-2007 Determina Corp. */
/* Copyright (c) 2001-2003 Massachusetts Institute of Technology */
/* Copyright (c) 2000-2001 Hewlett-Packard Company */
/* file "emit_utils_shared.c" */
/* The Pentium processors maintain cache consistency in hardware, so we don't
* worry about getting stale cache entries.
*/
/* FIXME i#1551: flush code cache after update it on ARM because the hardware
* does not maintain cache consistency in hardware.
*/
#include "../globals.h"
#include "../link.h"
#include "../fragment.h"
#include "../fcache.h"
#include "../emit.h"
#include "arch.h"
#include "instr.h"
#include "instr_create.h"
#include "instrlist.h"
#include "instrument.h" /* for dr_insert_call() */
#include "proc.h"
#include "decode.h"
#include "decode_fast.h"
#include "x86/decode_private.h"
#ifdef DEBUG
# include "disassemble.h"
#endif
#include <limits.h> /* for UCHAR_MAX */
#include "../perscache.h"
#ifdef VMX86_SERVER
# include "vmkuw.h"
#endif
/* fragment_t fields */
/* CAUTION: if TAG_OFFS changes from 0, must change indirect exit stub! */
#define FRAGMENT_START_PC_OFFS (offsetof(fragment_t, start_pc))
#define FRAGMENT_COUNTER_OFFS (offsetof(fragment_t, hot_counter))
#define FRAGMENT_PREFIX_SIZE_OFFS (offsetof(fragment_t, prefix_size))
#ifdef TRACE_HEAD_CACHE_INCR
/* linkstub_t field */
# define LINKSTUB_TARGET_FRAG_OFFS (offsetof(direct_linkstub_t, target_fragment))
#endif
/* N.B.: I decided to not keep supporting DCONTEXT_IN_EDI
* If we really want it later we can add it, it's a pain to keep
* maintaining it with every change here
*/
#ifdef DCONTEXT_IN_EDI
# error DCONTEXT_IN_EDI Not Implemented
#endif
/* make code more readable by shortening long lines
* we mark all as meta to avoid client interface asserts
*/
#define POST instrlist_meta_postinsert
#define PRE instrlist_meta_preinsert
#define APP instrlist_meta_append
/**
** CAUTION!
**
** The following definitions and routines are highly dependent upon
** dcontext and TLS offsets.
**
**/
/* FIXME i#1551: update remaining comments in this file to not be x86-specific */
/***************************************************************************
***************************************************************************
** EXIT STUB
**
** N.B.: all exit stubs must support atomic linking and unlinking,
** meaning a link/unlink operation must involve a single store!
**/
/* The general flow of a direct exit stub is:
*
* spill xax/r0 -> TLS
* move &linkstub -> xax/r0
* jmp fcache_return
*
* The general flow of an indirect exit stub (only used if -indirect_stubs) is:
*
* spill xbx/r1 -> TLS
* move &linkstub -> xbx/r1
* jmp indirect_branch_lookup
*/
/* DIRECT_EXIT_STUB_SIZE is in arch_exports.h */
#define STUB_DIRECT_SIZE(flags) DIRECT_EXIT_STUB_SIZE(flags)
#ifdef X86
/* for -thread_private, we're relying on the fact that
* SIZE32_MOV_XBX_TO_TLS == SIZE32_MOV_XBX_TO_ABS, and that
* x64 always uses tls
*/
# define STUB_INDIRECT_SIZE32 \
(SIZE32_MOV_XBX_TO_TLS + SIZE32_MOV_PTR_IMM_TO_XAX + JMP_LONG_LENGTH)
# define STUB_INDIRECT_SIZE64 \
(SIZE64_MOV_XBX_TO_TLS + SIZE64_MOV_PTR_IMM_TO_XAX + JMP_LONG_LENGTH)
# define STUB_INDIRECT_SIZE(flags) \
(FRAG_IS_32(flags) ? STUB_INDIRECT_SIZE32 : STUB_INDIRECT_SIZE64)
#elif defined(AARCH64)
# define STUB_INDIRECT_SIZE(flags) (7 * AARCH64_INSTR_SIZE)
#else
/* indirect stub is parallel to the direct one minus the data slot */
# define STUB_INDIRECT_SIZE(flags) \
(DIRECT_EXIT_STUB_SIZE(flags) - DIRECT_EXIT_STUB_DATA_SZ)
#endif
/* STUB_COARSE_DIRECT_SIZE is in arch_exports.h */
#define STUB_COARSE_INDIRECT_SIZE(flags) (STUB_INDIRECT_SIZE(flags))
/* Return size in bytes required for an exit stub with specified
* target and FRAG_ flags
*/
int
exit_stub_size(dcontext_t *dcontext, cache_pc target, uint flags)
{
if (TEST(FRAG_COARSE_GRAIN, flags)) {
/* For coarse: bb building points at bb ibl, and then insert_exit_stub
* changes that to the appropriate coarse prefix. So the emit() calls to
* this routine pass in a real ibl. But any later calls, e.g. for
* disassembly, that ask linkstub_size() will call EXIT_TARGET_TAG() which
* calls indirect_linkstub_target() which returns get_coarse_ibl_prefix():
* which then is not recognized as indirect by this routine!
* Note that coarse_indirect_stub_jmp_target() derefs the prefix:
* should we require callers who have stub pc to call that instead of us
* de-referencing?
*/
target = coarse_deref_ibl_prefix(dcontext, target);
}
if (is_indirect_branch_lookup_routine(dcontext, target)) {
/* indirect branch */
/* FIXME: Since we don't have the stub flags we'll lookup the
* target routine's template in a very roundabout fashion here
* by dispatching on the ibl_routine entry point
*/
ibl_code_t *ibl_code;
ibl_type_t ibl_type;
IF_X86_64(gencode_mode_t mode;)
DEBUG_DECLARE(bool is_ibl =)
get_ibl_routine_type_ex(dcontext, target, &ibl_type _IF_X86_64(&mode));
ASSERT(is_ibl);
IF_X86_64(ASSERT(mode == FRAGMENT_GENCODE_MODE(flags) ||
(DYNAMO_OPTION(x86_to_x64) && mode == GENCODE_X86_TO_X64)));
ibl_code = get_ibl_routine_code_ex(dcontext, ibl_type.branch_type,
flags _IF_X86_64(mode));
if (!EXIT_HAS_STUB(ibltype_to_linktype(ibl_code->branch_type),
IBL_FRAG_FLAGS(ibl_code)))
return 0;
if (TEST(FRAG_COARSE_GRAIN, flags)) {
IF_WINDOWS(ASSERT(!is_shared_syscall_routine(dcontext, target)));
/* keep in synch w/ coarse_indirect_stub_size() */
return (STUB_COARSE_INDIRECT_SIZE(flags));
}
#ifdef WINDOWS
if (is_shared_syscall_routine(dcontext, target)) {
return INTERNAL_OPTION(shared_syscalls_fastpath) ? 5
: STUB_INDIRECT_SIZE(flags);
}
#endif
if (ibl_code->ibl_head_is_inlined)
return ibl_code->inline_stub_length;
else
return (STUB_INDIRECT_SIZE(flags));
} else {
/* direct branch */
if (TEST(FRAG_COARSE_GRAIN, flags))
return (STUB_COARSE_DIRECT_SIZE(flags));
else
return (STUB_DIRECT_SIZE(flags));
}
}
static bool
is_patchable_exit_stub_helper(dcontext_t *dcontext, cache_pc ltarget, ushort lflags,
uint fflags)
{
if (LINKSTUB_INDIRECT(lflags)) {
/*indirect */
if (!DYNAMO_OPTION(indirect_stubs))
return false;
if (
#ifdef WINDOWS
!is_shared_syscall_routine(dcontext, ltarget) &&
#endif
get_ibl_routine_code(dcontext, extract_branchtype(lflags), fflags)
->ibl_head_is_inlined) {
return !DYNAMO_OPTION(atomic_inlined_linking);
} else {
return true;
}
} else {
/* direct */
ASSERT(LINKSTUB_DIRECT(lflags));
#ifdef TRACE_HEAD_CACHE_INCR
return true;
#else
return false;
#endif
}
}
bool
is_patchable_exit_stub(dcontext_t *dcontext, linkstub_t *l, fragment_t *f)
{
return is_patchable_exit_stub_helper(dcontext, EXIT_TARGET_TAG(dcontext, f, l),
l->flags, f->flags);
}
bool
is_exit_cti_stub_patchable(dcontext_t *dcontext, instr_t *inst, uint frag_flags)
{
app_pc target;
/* we figure out what the linkstub flags should be
* N.B.: we have to be careful to match the LINKSTUB_ macros
*/
ushort lflags = (ushort)instr_exit_branch_type(inst);
ASSERT_TRUNCATE(lflags, ushort, instr_exit_branch_type(inst));
ASSERT(instr_is_exit_cti(inst));
target = instr_get_branch_target_pc(inst);
if (is_indirect_branch_lookup_routine(dcontext, target)) {
lflags |= LINK_INDIRECT;
} else {
lflags |= LINK_DIRECT;
}
return is_patchable_exit_stub_helper(dcontext, target, lflags, frag_flags);
}
uint
bytes_for_exitstub_alignment(dcontext_t *dcontext, linkstub_t *l, fragment_t *f,
byte *startpc)
{
if (is_patchable_exit_stub(dcontext, l, f)) {
/* assumption - we only hot patch the ending jmp of the exit stub
* (and that exit stub size returns the right values) */
ptr_uint_t shift = ALIGN_SHIFT_SIZE(
startpc +
exit_stub_size(dcontext, EXIT_TARGET_TAG(dcontext, f, l), f->flags) -
EXIT_STUB_PATCH_OFFSET,
EXIT_STUB_PATCH_SIZE, PAD_JMPS_ALIGNMENT);
IF_X64(ASSERT(CHECK_TRUNCATE_TYPE_uint(shift)));
return (uint)shift;
}
return 0;
}
/* Returns an upper bound on the number of bytes that will be needed to add
* this fragment to a trace */
uint
extend_trace_pad_bytes(fragment_t *add_frag)
{
/* To estimate we count the number of exit ctis by counting the linkstubs. */
bool inline_ibl_head = TEST(FRAG_IS_TRACE, add_frag->flags)
? DYNAMO_OPTION(inline_trace_ibl)
: DYNAMO_OPTION(inline_bb_ibl);
int num_patchables = 0;
for (linkstub_t *l = FRAGMENT_EXIT_STUBS(add_frag); l != NULL;
l = LINKSTUB_NEXT_EXIT(l)) {
num_patchables++;
if (LINKSTUB_INDIRECT(l->flags) && inline_ibl_head)
num_patchables += 2;
/* We ignore cbr_fallthrough: only one of them should need nops. */
}
return num_patchables * MAX_PAD_SIZE;
}
/* return startpc shifted by the necessary bytes to pad patchable jmps of the
* exit stub to proper alignment */
byte *
pad_for_exitstub_alignment(dcontext_t *dcontext, linkstub_t *l, fragment_t *f,
byte *startpc)
{
uint shift;
ASSERT(PAD_FRAGMENT_JMPS(f->flags)); /* shouldn't call this otherwise */
shift = bytes_for_exitstub_alignment(dcontext, l, f, startpc);
if (shift > 0) {
/* Pad with 1 byte instructions so looks nice in debuggers.
* decode_fragment also checks for this as a sanity check. Note,
* while these instructions can never be reached, they will be decoded
* by shift fcache pointers so must put something valid here. */
SET_TO_DEBUG(startpc, shift);
startpc += shift;
STATS_PAD_JMPS_ADD(f->flags, num_shifted_stubs, 1);
STATS_PAD_JMPS_ADD(f->flags, shifted_stub_bytes, shift);
} else {
STATS_PAD_JMPS_ADD(f->flags, num_stubs_no_shift, 1);
}
return startpc;
}
/* Only used if -no_pad_jmps_shift_{bb,trace}. FIXME this routine is expensive (the
* instr_expand) and we may end up removing app nops (an optimizations but
* not really what we're after here). */
void
remove_nops_from_ilist(dcontext_t *dcontext,
instrlist_t *ilist _IF_DEBUG(bool recreating))
{
instr_t *inst, *next_inst;
for (inst = instrlist_first(ilist); inst != NULL; inst = next_inst) {
/* FIXME : expensive, just expand instr before cti, function not used
* if -no_pad_jmps_shift_{bb,trace} */
inst = instr_expand(dcontext, ilist, inst);
next_inst = instr_get_next(inst);
if (instr_is_nop(inst)) {
instrlist_remove(ilist, inst);
DOSTATS({
if (!recreating) {
STATS_INC(num_nops_removed);
STATS_ADD(num_nop_bytes_removed, instr_length(dcontext, inst));
}
});
instr_destroy(dcontext, inst);
}
}
}
cache_pc
get_direct_exit_target(dcontext_t *dcontext, uint flags)
{
if (FRAG_DB_SHARED(flags)) {
if (TEST(FRAG_COARSE_GRAIN, flags)) {
/* note that entrance stubs should target their unit's prefix,
* who will then target this routine
*/
return fcache_return_coarse_routine(IF_X86_64(FRAGMENT_GENCODE_MODE(flags)));
} else
return fcache_return_shared_routine(IF_X86_64(FRAGMENT_GENCODE_MODE(flags)));
} else {
return fcache_return_routine_ex(
dcontext _IF_X86_64(FRAGMENT_GENCODE_MODE(flags)));
}
}
int
insert_exit_stub(dcontext_t *dcontext, fragment_t *f, linkstub_t *l, cache_pc stub_pc)
{
return insert_exit_stub_other_flags(dcontext, f, l, stub_pc, l->flags);
}
/* Returns true if the exit cti is ever dynamically modified */
bool
is_exit_cti_patchable(dcontext_t *dcontext, instr_t *inst, uint frag_flags)
{
app_pc target;
if (TEST(FRAG_COARSE_GRAIN, frag_flags)) {
/* Case 8647: coarse grain fragment bodies always link through stubs
* until frozen, so their ctis are never patched except at freeze time
* when we suspend the world.
*/
ASSERT(!TEST(FRAG_IS_TRACE, frag_flags));
return false;
}
ASSERT(instr_is_exit_cti(inst));
target = instr_get_branch_target_pc(inst);
if (is_indirect_branch_lookup_routine(dcontext, target)) {
/* whether has an inline stub or not, cti is always
* patched if -no_indirect_stubs
*/
if (!DYNAMO_OPTION(indirect_stubs))
return true;
#ifdef WINDOWS
if (target != shared_syscall_routine(dcontext)) {
#endif
return get_ibl_routine_code(
dcontext, extract_branchtype((ushort)instr_exit_branch_type(inst)),
frag_flags)
->ibl_head_is_inlined;
#ifdef WINDOWS
}
return false;
#endif
} else {
/* direct exit */
if (instr_branch_special_exit(inst))
return false;
return true;
}
}
/* returns true if exit cti no longer points at stub
* (certain situations, like profiling or TRACE_HEAD_CACHE_INCR, go
* through the stub even when linked)
*/
bool
link_direct_exit(dcontext_t *dcontext, fragment_t *f, linkstub_t *l, fragment_t *targetf,
bool hot_patch)
{
#ifdef TRACE_HEAD_CACHE_INCR
byte *stub_pc = (byte *)(EXIT_STUB_PC(dcontext, f, l));
#endif
ASSERT(linkstub_owned_by_fragment(dcontext, f, l));
ASSERT(LINKSTUB_DIRECT(l->flags));
STATS_INC(num_direct_links);
#ifdef TRACE_HEAD_CACHE_INCR
if ((targetf->flags & FRAG_IS_TRACE_HEAD) != 0) {
LOG(THREAD, LOG_LINKS, 4,
"\tlinking F%d." PFX " to incr routine b/c F%d is trace head\n", f->id,
EXIT_CTI_PC(f, l), targetf->id);
/* FIXME: more efficient way than multiple calls to get size-5? */
ASSERT(linkstub_size(dcontext, f, l) == DIRECT_EXIT_STUB_SIZE(f->flags));
patch_branch(FRAG_ISA_MODE(f->flags),
stub_pc + DIRECT_EXIT_STUB_SIZE(f->flags) - 5,
trace_head_incr_routine(dcontext), hot_patch);
return false; /* going through stub */
}
#endif
/* change jmp target to point to the passed-in target */
if (exit_cti_reaches_target(dcontext, f, l, (cache_pc)FCACHE_ENTRY_PC(targetf))) {
/* TODO i#1911: Patching the exit_cti to point to the linked fragment is
* theoretically not sound. Architecture specifications do not guarantee
* any bound on when these changes will be visible to other processor
* elements.
*/
patch_branch(FRAG_ISA_MODE(f->flags), EXIT_CTI_PC(f, l), FCACHE_ENTRY_PC(targetf),
hot_patch);
return true; /* do not need stub anymore */
} else {
/* Branch to the stub and use a longer-reaching branch from there.
* XXX i#1611: add support for load-into-PC as an exit cti to eliminate
* this stub-requiring scheme.
*/
patch_stub(f, (cache_pc)EXIT_STUB_PC(dcontext, f, l),
(cache_pc)FCACHE_ENTRY_PC(targetf),
(cache_pc)FCACHE_PREFIX_ENTRY_PC(targetf), hot_patch);
STATS_INC(num_far_direct_links);
/* Exit cti should already be pointing to the top of the exit stub */
return false; /* still need stub */
}
}
void
unlink_direct_exit(dcontext_t *dcontext, fragment_t *f, linkstub_t *l)
{
cache_pc stub_pc = (cache_pc)EXIT_STUB_PC(dcontext, f, l);
#ifdef TRACE_HEAD_CACHE_INCR
direct_linkstub_t *dl = (direct_linkstub_t *)l;
#endif
ASSERT(linkstub_owned_by_fragment(dcontext, f, l));
ASSERT(LINKSTUB_DIRECT(l->flags));
#ifdef TRACE_HEAD_CACHE_INCR
if (dl->target_fragment != NULL) { /* HACK to tell if targeted trace head */
byte *pc = (byte *)(EXIT_STUB_PC(dcontext, f, l));
/* FIXME: more efficient way than multiple calls to get size-5? */
ASSERT(linkstub_size(dcontext, f, l) == DIRECT_EXIT_STUB_SIZE(f->flags));
patch_branch(FRAG_ISA_MODE(f->flags), pc + DIRECT_EXIT_STUB_SIZE(f->flags) - 5,
get_direct_exit_target(dcontext, f->flags), HOT_PATCHABLE);
}
#endif
/* XXX: should we store a flag, or try to have the prior target's cache pc,
* to determine if exit_cti_reaches_target()? For now we blindly unlink
* both near and far styles.
*/
/* change jmp target to point to top of exit stub */
patch_branch(FRAG_ISA_MODE(f->flags), EXIT_CTI_PC(f, l), stub_pc, HOT_PATCHABLE);
unpatch_stub(dcontext, f, stub_pc, HOT_PATCHABLE);
}
/* NOTE : for inlined indirect branches linking is !NOT! atomic with respect
* to a thread executing in the cache unless using the atomic_inlined_linking
* option (unlike unlinking)
*/
void
link_indirect_exit(dcontext_t *dcontext, fragment_t *f, linkstub_t *l, bool hot_patch)
{
app_pc target_tag = EXIT_TARGET_TAG(dcontext, f, l);
/* w/ indirect exits now having their stub pcs computed based
* on the cti targets, we must calculate them at a consistent
* state (we do have multi-stage modifications for inlined stubs)
*/
byte *stub_pc = (byte *)EXIT_STUB_PC(dcontext, f, l);
ASSERT(!TEST(FRAG_COARSE_GRAIN, f->flags));
ASSERT(linkstub_owned_by_fragment(dcontext, f, l));
ASSERT(LINKSTUB_INDIRECT(l->flags));
/* target is always the same, so if it's already linked, this is a nop */
if ((l->flags & LINK_LINKED) != 0) {
STATS_INC(num_indirect_already_linked);
return;
}
STATS_INC(num_indirect_links);
if (IF_WINDOWS_ELSE(!is_shared_syscall_routine(dcontext, target_tag), true)) {
ibl_code_t *ibl_code =
get_ibl_routine_code(dcontext, extract_branchtype(l->flags), f->flags);
if (ibl_code->ibl_head_is_inlined) {
/* need to make branch target the top of the exit stub */
patch_branch(FRAG_ISA_MODE(f->flags), EXIT_CTI_PC(f, l), stub_pc, hot_patch);
if (DYNAMO_OPTION(atomic_inlined_linking)) {
return;
}
}
}
link_indirect_exit_arch(dcontext, f, l, hot_patch, target_tag);
}
int
linkstub_unlink_entry_offset(dcontext_t *dcontext, fragment_t *f, linkstub_t *l)
{
ibl_code_t *ibl_code;
ASSERT(linkstub_owned_by_fragment(dcontext, f, l));
if (!LINKSTUB_INDIRECT(l->flags))
return 0;
#ifdef WINDOWS
if (is_shared_syscall_routine(dcontext, EXIT_TARGET_TAG(dcontext, f, l)))
return 0;
#endif
ibl_code = get_ibl_routine_code(dcontext, extract_branchtype(l->flags), f->flags);
if (ibl_code->ibl_head_is_inlined)
return ibl_code->inline_unlink_offs;
else
return 0;
}
cache_pc
indirect_linkstub_target(dcontext_t *dcontext, fragment_t *f, linkstub_t *l)
{
ASSERT(LINKSTUB_INDIRECT(l->flags));
ASSERT(!TESTANY(LINK_NI_SYSCALL_ALL, l->flags));
#ifdef WINDOWS
if (EXIT_TARGETS_SHARED_SYSCALL(l->flags)) {
/* currently this is the only way to distinguish shared_syscall
* exit from other indirect exits and from other exits in
* a fragment containing ignorable or non-ignorable syscalls
*/
ASSERT(TEST(FRAG_HAS_SYSCALL, f->flags));
return shared_syscall_routine_ex(
dcontext _IF_X86_64(FRAGMENT_GENCODE_MODE(f->flags)));
}
#endif
if (TEST(FRAG_COARSE_GRAIN, f->flags)) {
/* Need to target the ibl prefix. Passing in cti works as well as stub,
* and avoids a circular dependence where linkstub_unlink_entry_offset()
* call this routine to get the target and then this routine asks for
* the stub which calls linkstub_unlink_entry_offset()...
*/
return get_coarse_ibl_prefix(dcontext, EXIT_CTI_PC(f, l),
extract_branchtype(l->flags));
} else {
return get_ibl_routine_ex(dcontext, get_ibl_entry_type(l->flags),
get_source_fragment_type(dcontext, f->flags),
extract_branchtype(l->flags)
_IF_X86_64(FRAGMENT_GENCODE_MODE(f->flags)));
}
}
/* based on machine state, returns which of cbr l1 and fall-through l2
* must have been taken
*/
linkstub_t *
linkstub_cbr_disambiguate(dcontext_t *dcontext, fragment_t *f, linkstub_t *l1,
linkstub_t *l2)
{
instr_t instr;
linkstub_t *taken;
bool inverted = false;
instr_init(dcontext, &instr);
decode(dcontext, EXIT_CTI_PC(f, l1), &instr);
ASSERT(instr_is_cbr(&instr));
/* On ARM, we invert the logic of OP_cb{,n}z when we mangle it */
IF_ARM(inverted = instr_is_cti_short_rewrite(&instr, EXIT_CTI_PC(f, l1)));
if (instr_cbr_taken(&instr, get_mcontext(dcontext), false /*post-state*/))
taken = inverted ? l2 : l1;
else
taken = inverted ? l1 : l2;
instr_free(dcontext, &instr);
return taken;
}
/*******************************************************************************
* COARSE-GRAIN FRAGMENT SUPPORT
*/
/* FIXME: case 10334: pass in info? */
bool
coarse_is_trace_head(cache_pc stub)
{
if (coarse_is_entrance_stub(stub)) {
cache_pc tgt = entrance_stub_jmp_target(stub);
/* FIXME: could see if tgt is a jmp and deref and cmp to
* trace_head_return_coarse_routine() to avoid the vmvector
* lookup required to find the prefix
*/
return tgt == trace_head_return_coarse_prefix(stub, NULL);
}
return false;
}
cache_pc
entrance_stub_jmp_target(cache_pc stub)
{
cache_pc jmp = entrance_stub_jmp(stub);
cache_pc tgt;
ASSERT(jmp != NULL);
tgt = (cache_pc)PC_RELATIVE_TARGET(jmp + 1);
#ifdef X86
ASSERT(*jmp == JMP_OPCODE);
#elif defined(ARM)
/* FIXMED i#1551: NYI on ARM */
ASSERT_NOT_IMPLEMENTED(false);
#endif /* X86/ARM */
return tgt;
}
app_pc
entrance_stub_target_tag(cache_pc stub, coarse_info_t *info)
{
cache_pc jmp = entrance_stub_jmp(stub);
app_pc tag;
/* find the immed that is put into tls: at end of pre-jmp instr */
#if defined(X86) && defined(X64)
/* To identify whether 32-bit: we could look up the coarse_info_t
* this is part of but that's expensive so we check whether the
* tls offset has 2 high byte 0's (we always use addr16 for 32-bit).
* 32-bit:
* 67 64 c7 06 e0 0e 02 99 4e 7d addr16 mov $0x7d4e9902 -> %fs:0x0ee0
* 64-bit is split into high and low dwords:
* 65 c7 04 25 20 16 00 00 02 99 4e 7d mov $0x7d4e9902 -> %gs:0x1620
* 65 c7 04 25 24 16 00 00 00 00 00 00 mov $0x00000000 -> %gs:0x1624
* both are followed by a direct jmp.
*/
if (*((ushort *)(jmp - 6)) == 0) { /* 64-bit has 2 0's for high 2 bytes of tls offs */
ptr_uint_t high32 = (ptr_uint_t) * ((uint *)(jmp - 4));
ptr_uint_t low32 =
(ptr_uint_t) * ((uint *)(jmp - (SIZE64_MOV_PTR_IMM_TO_TLS / 2) - 4));
tag = (cache_pc)((high32 << 32) | low32);
} else { /* else fall-through to 32-bit case */
#endif
tag = *((cache_pc *)(jmp - 4));
#if defined(X86) && defined(X64)
}
#endif
/* if frozen, this could be a persist-time app pc (i#670).
* we take in info so we can know mod_shift (we can decode to find it
* for unlinked but not for linked)
*/
if (info == NULL)
info = get_stub_coarse_info(stub);
if (info->mod_shift != 0 && tag >= info->persist_base &&
tag < info->persist_base + (info->end_pc - info->base_pc))
tag -= info->mod_shift;
return tag;
}
bool
coarse_is_indirect_stub(cache_pc pc)
{
/* match insert_jmp_to_ibl */
return instr_raw_is_tls_spill(pc, SCRATCH_REG1 /*xbx/r1*/, INDIRECT_STUB_SPILL_SLOT);
}
/* caller should call fragment_coarse_entry_pclookup() ahead of time
* to avoid deadlock if caller holds info->lock
*/
bool
coarse_cti_is_intra_fragment(dcontext_t *dcontext, coarse_info_t *info, instr_t *inst,
cache_pc start_pc)
{
/* We don't know the size of the fragment but we want to support
* intra-fragment ctis for clients (i#665) so we use some
* heuristics. A real cti is either linked to a target within the
* same coarse unit (where its target will be an entry point) or
* points at a stub of some kind (frozen exit prefix or separate
* entrance stub or inlined indirect stub).
*/
cache_pc tgt = opnd_get_pc(instr_get_target(inst));
if (tgt < start_pc || tgt >= start_pc + MAX_FRAGMENT_SIZE)
return false;
/* If tgt is an entry, then it's a linked exit cti.
* XXX: This may acquire info->lock if it's never been called before.
*/
if (fragment_coarse_entry_pclookup(dcontext, info, tgt) != NULL) {
/* i#1032: To handle an intra cti that targets the final instr in the bb which
* was a jmp and elided, we rely on the assumption that a coarse bb exit
* cti is either 1 indirect or 2 direct with no code past it.
* Thus, the instr after an exit cti must either be an entry point for
* an adjacent fragment, or the 2nd cti for a direct.
*/
cache_pc post_inst_pc = instr_get_raw_bits(inst) + instr_length(dcontext, inst);
instr_t post_inst_instr;
bool intra = true;
instr_init(dcontext, &post_inst_instr);
if (post_inst_pc >= info->cache_end_pc ||
fragment_coarse_entry_pclookup(dcontext, info, post_inst_pc) != NULL ||
(decode_cti(dcontext, post_inst_pc, &post_inst_instr) != NULL &&
instr_is_cti(&post_inst_instr))) {
intra = false;
}
instr_free(dcontext, &post_inst_instr);
if (!intra)
return false;
}
/* These lookups can get expensive but should only hit them when have
* clients adding intra-fragment ctis.
* XXX: is there a min distance we could use to rule out being in stubs?
* For frozen though prefixes are right after cache.
*/
if (coarse_is_indirect_stub(tgt) || in_coarse_stubs(tgt) ||
in_coarse_stub_prefixes(tgt))
return false;
return true;
}
cache_pc
coarse_indirect_stub_jmp_target(cache_pc stub)
{
#ifdef X86
cache_pc prefix_tgt, tgt;
cache_pc jmp;
size_t stub_size;
# ifdef X64
/* See the stub sequences in entrance_stub_target_tag(): 32-bit always has
* an addr prefix while 64-bit does not
*/
/* FIXME: PR 209709: test perf and remove if outweighs space */
if (*stub == ADDR_PREFIX_OPCODE)
stub_size = STUB_COARSE_INDIRECT_SIZE(FRAG_32_BIT);
else /* default */
# endif
stub_size = STUB_COARSE_INDIRECT_SIZE(0);
jmp = stub + stub_size - JMP_LONG_LENGTH;
ASSERT(*jmp == JMP_OPCODE);
prefix_tgt = (cache_pc)PC_RELATIVE_TARGET(jmp + 1);
ASSERT(*prefix_tgt == JMP_OPCODE);
tgt = (cache_pc)PC_RELATIVE_TARGET(prefix_tgt + 1);
return tgt;
#elif defined(AARCHXX)
/* FIXME i#1551, i#1569: NYI on ARM/AArch64 */
ASSERT_NOT_IMPLEMENTED(false);
return NULL;
#endif /* X86/ARM */
}
uint
coarse_indirect_stub_size(coarse_info_t *info)
{
/* Keep in synch w/ exit_stub_size(). We export this separately since
* it's difficult to get the target to pass to exit_stub_size().
*/
return STUB_COARSE_INDIRECT_SIZE(COARSE_32_FLAG(info));
}
/* Passing in stub's info avoids a vmvector lookup */
bool
entrance_stub_linked(cache_pc stub, coarse_info_t *info /*OPTIONAL*/)
{
/* entrance stubs are of two types:
* - targeting trace heads: always point to trace_head_return_coarse,
* whether target exists or not, so are always unlinked;
* - targeting non-trace-heads: if linked, point to fragment; if unlinked,
* point to fcache_return_coarse
*/
cache_pc tgt = entrance_stub_jmp_target(stub);
/* FIXME: do vmvector just once instead of for each call */
return (tgt != trace_head_return_coarse_prefix(stub, info) &&
tgt != fcache_return_coarse_prefix(stub, info));
}
/* Returns whether it had to change page protections */
static bool
patch_coarse_branch(dcontext_t *dcontext, cache_pc stub, cache_pc tgt, bool hot_patch,
coarse_info_t *info /*OPTIONAL*/)
{
bool stubs_readonly = false;
bool stubs_restore = false;
if (DYNAMO_OPTION(persist_protect_stubs)) {
if (info == NULL)
info = get_stub_coarse_info(stub);
ASSERT(info != NULL);
if (info->stubs_readonly) {
stubs_readonly = true;
stubs_restore = true;
/* if we don't preserve mapped-in COW state the protection change
* will fail (case 10570)
*/
make_copy_on_writable((byte *)PAGE_START(entrance_stub_jmp(stub)),
/* stub jmp can't cross page boundary (can't
* cross cache line in fact) */
PAGE_SIZE);
if (DYNAMO_OPTION(persist_protect_stubs_limit) > 0) {
info->stubs_write_count++;
if (info->stubs_write_count >
DYNAMO_OPTION(persist_protect_stubs_limit)) {
SYSLOG_INTERNAL_WARNING_ONCE("pcache stubs over write limit");
STATS_INC(pcache_unprot_over_limit);
stubs_restore = false;
info->stubs_readonly = false;
}
}
}
}
/* FIXME i#1551: for proper ARM support we'll need the ISA mode of the coarse unit */
patch_branch(dr_get_isa_mode(dcontext), entrance_stub_jmp(stub), tgt, HOT_PATCHABLE);
if (stubs_restore)
make_unwritable((byte *)PAGE_START(entrance_stub_jmp(stub)), PAGE_SIZE);
return stubs_readonly;
}
/* Passing in stub's info avoids a vmvector lookup */
void
link_entrance_stub(dcontext_t *dcontext, cache_pc stub, cache_pc tgt, bool hot_patch,
coarse_info_t *info /*OPTIONAL*/)
{
ASSERT(DYNAMO_OPTION(coarse_units));
ASSERT(self_owns_recursive_lock(&change_linking_lock));
LOG(THREAD, LOG_LINKS, 5, "link_entrance_stub " PFX "\n", stub);
if (patch_coarse_branch(dcontext, stub, tgt, hot_patch, info))
STATS_INC(pcache_unprot_link);
/* We check this afterward since this link may be what makes it consistent
* FIXME: pass in arg to not check target? Then call before and after */
ASSERT(coarse_is_entrance_stub(stub));
}
/* Passing in stub's info avoids a vmvector lookup */
void
unlink_entrance_stub(dcontext_t *dcontext, cache_pc stub, uint flags,
coarse_info_t *info /*OPTIONAL*/)
{
cache_pc tgt;
ASSERT(DYNAMO_OPTION(coarse_units));
ASSERT(coarse_is_entrance_stub(stub));
ASSERT(self_owns_recursive_lock(&change_linking_lock));
LOG(THREAD, LOG_LINKS, 5, "unlink_entrance_stub " PFX "\n", stub);
if (TESTANY(FRAG_IS_TRACE_HEAD | FRAG_IS_TRACE, flags))
tgt = trace_head_return_coarse_prefix(stub, info);
else
tgt = fcache_return_coarse_prefix(stub, info);
if (patch_coarse_branch(dcontext, stub, tgt, HOT_PATCHABLE, info))
STATS_INC(pcache_unprot_unlink);
}
cache_pc
entrance_stub_from_cti(cache_pc cti)
{
cache_pc disp = exit_cti_disp_pc(cti);
cache_pc tgt = (cache_pc)PC_RELATIVE_TARGET(disp);
return tgt;
}
/*******************************************************************************/
/* Patch list support routines */
void
init_patch_list(patch_list_t *patch, patch_list_type_t type)
{
patch->num_relocations = 0;
/* Cast to int to avoid a tautological comparison warning from clang. */
ASSERT_TRUNCATE(patch->type, ushort, (int)type);
patch->type = (ushort)type;
}
/* add an instruction to patch list and address of location for future updates */
/* Use the type checked wrappers add_patch_entry or add_patch_marker */
void
add_patch_entry_internal(patch_list_t *patch, instr_t *instr, ushort patch_flags,
short instruction_offset, ptr_uint_t value_location_offset)
{
uint i = patch->num_relocations;
ASSERT(patch->num_relocations < MAX_PATCH_ENTRIES);
/* Since in debug build we have the extra slots for stats, it's important
* to provide a useful release build message
*/
if (patch->num_relocations >= MAX_PATCH_ENTRIES) {
SYSLOG_CUSTOM_NOTIFY(SYSLOG_CRITICAL, MSG_EXCEPTION, 4,
"Maximum patch entries exceeded", get_application_name(),
get_application_pid(), "<maxpatch>",
"Maximum patch entries exceeded");
os_terminate(get_thread_private_dcontext(), TERMINATE_PROCESS);
ASSERT_NOT_REACHED();
}
LOG(THREAD_GET, LOG_EMIT, 4, "add_patch_entry[%d] value_location_offset=" PFX "\n", i,
value_location_offset);
patch->entry[i].where.instr = instr;
patch->entry[i].patch_flags = patch_flags;
patch->entry[i].value_location_offset = value_location_offset;
patch->entry[i].instr_offset = instruction_offset;
patch->num_relocations++;
}
/* add an instruction to patch list to retrieve its offset later.
Takes an instruction and an offset within the instruction.
Result: The offset within an encoded instruction stream will
be stored in target_offset by encode_with_patch_list
*/
void
add_patch_marker(patch_list_t *patch, instr_t *instr, ushort patch_flags,
short instr_offset, ptr_uint_t *target_offset /* OUT */)
{
add_patch_entry_internal(patch, instr, (ushort)(patch_flags | PATCH_MARKER),
instr_offset, (ptr_uint_t)target_offset);
}
/* remove PATCH_MARKER entries since not needed for dynamic updates */
static INLINE_ONCE void
remove_assembled_patch_markers(dcontext_t *dcontext, patch_list_t *patch)
{
ushort i = 0, j = 0;
/* we can remove the PATCH_MARKER entries after encoding,
and so patch_emitted_code won't even need to check for PATCH_MARKER
*/
while (j < patch->num_relocations) {
if (TEST(PATCH_MARKER, patch->entry[j].patch_flags)) {
LOG(THREAD, LOG_EMIT, 4,
"remove_assembled_patch_markers: removing marker %d\n", j);
} else {
patch->entry[i] = patch->entry[j];
i++;
}
j++;
}
LOG(THREAD, LOG_EMIT, 3,
"remove_assembled_patch_markers: relocations %d, left only %d\n",
patch->num_relocations, i);
patch->num_relocations = i;
}
/* Indirect all instructions instead of later patching */
static void
relocate_patch_list(dcontext_t *dcontext, patch_list_t *patch, instrlist_t *ilist)
{
instr_t *inst;
uint cur = 0;
LOG(THREAD, LOG_EMIT, 3, "relocate_patch_list [" PFX "]\n", patch);
/* go through the instructions and "relocate" by indirectly using XDI */
for (inst = instrlist_first(ilist); inst; inst = instr_get_next(inst)) {
if (cur < patch->num_relocations && inst == patch->entry[cur].where.instr) {
ASSERT(!TEST(PATCH_OFFSET_VALID, patch->entry[cur].patch_flags));
if (!TEST(PATCH_MARKER, patch->entry[cur].patch_flags)) {
opnd_t opnd;
ASSERT(instr_num_srcs(inst) > 0);
opnd = instr_get_src(inst, 0);
DOLOG(4, LOG_EMIT, {
LOG(THREAD, LOG_EMIT, 2,
"encode_with_patch_list: patch_entry_t[%d] before update \n");
instr_disassemble(dcontext, inst, THREAD);
LOG(THREAD, LOG_EMIT, 2, "\n");
});
/* we assume that per_thread_t will be in XDI,
and the displacement is in value_location_offset */
IF_X64(ASSERT(
CHECK_TRUNCATE_TYPE_int(patch->entry[cur].value_location_offset)));
if (opnd_is_near_base_disp(opnd)) {
/* indirect through XDI and update displacement */
opnd_set_disp(&opnd, (int)patch->entry[cur].value_location_offset);
opnd_replace_reg(&opnd, REG_NULL, SCRATCH_REG5 /*xdi/r5*/);
} else if (opnd_is_immed_int(opnd)) {
/* indirect through XDI and set displacement */
/* converting AND $0x00003fff, %xcx -> %xcx
into AND mask(%xdi), %xcx -> %xcx
*/
opnd = opnd_create_base_disp(
SCRATCH_REG5 /*xdi/r5*/, REG_NULL, 0,
(int)patch->entry[cur].value_location_offset, OPSZ_4);
}
instr_set_src(inst, 0, opnd);
DOLOG(3, LOG_EMIT, {
LOG(THREAD, LOG_EMIT, 2,
"encode_with_patch_list: patch_entry_t[%d] after update \n");
instr_disassemble(dcontext, inst, THREAD);
LOG(THREAD, LOG_EMIT, 2, "\n");
});
}
cur++;
}
}
}
/* Updates patch list with offsets in assembled instruction list */
/* Cf: instrlist_encode which does not support a patch list */
/* Returns length of emitted code */
int
encode_with_patch_list(dcontext_t *dcontext, patch_list_t *patch, instrlist_t *ilist,
cache_pc start_pc)
{
instr_t *inst;
uint len;
uint cur;
cache_pc pc = start_pc;
ASSERT(patch->num_relocations < MAX_PATCH_ENTRIES);
if (patch->type == PATCH_TYPE_INDIRECT_XDI) {
relocate_patch_list(dcontext, patch, ilist);
}
/* now encode the instructions */
/* must set note fields first with offset */
len = 0;
for (inst = instrlist_first(ilist); inst; inst = instr_get_next(inst)) {
instr_set_note(inst, (void *)(ptr_uint_t)len);
len += instr_length(dcontext, inst);
}
cur = 0;
/* after instruction list is assembled we collect the offsets */
for (inst = instrlist_first(ilist); inst; inst = instr_get_next(inst)) {
short offset_in_instr = patch->entry[cur].instr_offset;
byte *nxt_writable_pc =
instr_encode_to_copy(dcontext, inst, vmcode_get_writable_addr(pc), pc);
byte *nxt_pc = vmcode_get_executable_addr(nxt_writable_pc);
ASSERT(nxt_pc != NULL);
len = (int)(nxt_pc - pc);
pc = nxt_pc;
if (cur < patch->num_relocations && inst == patch->entry[cur].where.instr) {
ASSERT(!TEST(PATCH_OFFSET_VALID, patch->entry[cur].patch_flags));
/* support positive offsets from beginning and negative -
* from end of instruction
*/
if (offset_in_instr < 0) {
/* grab offset offset_in_instr bytes from the end of instruction */
/* most commonly -4 for a 32bit immediate */
patch->entry[cur].where.offset = ((pc + offset_in_instr) - start_pc);
} else {
/* grab offset after skipping offset_in_instr from beginning of
* instruction
*/
patch->entry[cur].where.offset =
((pc - len + offset_in_instr) - start_pc);
}
patch->entry[cur].patch_flags |= PATCH_OFFSET_VALID;
LOG(THREAD, LOG_EMIT, 4,
"encode_with_patch_list: patch_entry_t[%d] offset=" PFX "\n", cur,
patch->entry[cur].where.offset);
if (TEST(PATCH_MARKER, patch->entry[cur].patch_flags)) {
/* treat value_location_offset as an output argument
and store there the computed offset,
*/
ptr_uint_t *output_value =
(ptr_uint_t *)patch->entry[cur].value_location_offset;
ptr_uint_t output_offset = patch->entry[cur].where.offset;
if (TEST(PATCH_ASSEMBLE_ABSOLUTE, patch->entry[cur].patch_flags)) {
ASSERT(!TEST(PATCH_UINT_SIZED, patch->entry[cur].patch_flags));
output_offset += (ptr_uint_t)vmcode_get_executable_addr(start_pc);
}
if (TEST(PATCH_UINT_SIZED, patch->entry[cur].patch_flags)) {
IF_X64(ASSERT(CHECK_TRUNCATE_TYPE_uint(output_offset)));
*((uint *)output_value) = (uint)output_offset;
} else
*output_value = output_offset;
}
LOG(THREAD, LOG_EMIT, 4,
"encode_with_patch_list [%d] extras patch_flags=0x%x value_offset=" PFX
"\n",
cur, patch->entry[cur].patch_flags,
patch->entry[cur].value_location_offset);
cur++;
}
}
/* assuming patchlist is in the same order as ilist, we should have seen all */
LOG(THREAD, LOG_EMIT, 4, "cur %d, num %d", cur, patch->num_relocations);
ASSERT(cur == patch->num_relocations);
remove_assembled_patch_markers(dcontext, patch);
ASSERT(CHECK_TRUNCATE_TYPE_int(pc - start_pc));
return (int)(pc - start_pc);
}
#ifdef DEBUG
void
print_patch_list(patch_list_t *patch)
{
uint i;
LOG(THREAD_GET, LOG_EMIT, 4, "patch=" PFX " num_relocations=%d\n", patch,
patch->num_relocations);
for (i = 0; i < patch->num_relocations; i++) {
ASSERT(TEST(PATCH_OFFSET_VALID, patch->entry[i].patch_flags));
LOG(THREAD_GET, LOG_EMIT, 4,
"patch_list [%d] offset=" PFX " patch_flags=%d value_offset=" PFX "\n", i,
patch->entry[i].where.offset, patch->entry[i].patch_flags,
patch->entry[i].value_location_offset);
}
}
# ifdef INTERNAL
/* disassembles code adding patch list labels */
static void
disassemble_with_annotations(dcontext_t *dcontext, patch_list_t *patch, byte *start_pc,
byte *end_pc)
{
byte *pc = start_pc;
uint cur = 0;
do {
if (cur < patch->num_relocations &&
pc >= start_pc + patch->entry[cur].where.offset) {
ASSERT(TEST(PATCH_OFFSET_VALID, patch->entry[cur].patch_flags));
/* this is slightly off - we'll mark next instruction,
but is good enough for this purpose */
LOG(THREAD, LOG_EMIT, 2, "%d:", cur);
cur++;
} else {
LOG(THREAD, LOG_EMIT, 2, " ");
}
pc = disassemble_with_bytes(dcontext, pc, THREAD);
} while (pc < end_pc);
LOG(THREAD, LOG_EMIT, 2, "\n");
}
# endif
#endif
/* updates emitted code according to patch list */
static void
patch_emitted_code(dcontext_t *dcontext, patch_list_t *patch, byte *start_pc)
{
uint i;
/* FIXME: can get this as a patch list entry through indirection */
per_thread_t *pt = (per_thread_t *)dcontext->fragment_field;
ASSERT(dcontext != GLOBAL_DCONTEXT && dcontext != NULL);
LOG(THREAD, LOG_EMIT, 2, "patch_emitted_code start_pc=" PFX " pt=" PFX "\n",
start_pc);
if (patch->type != PATCH_TYPE_ABSOLUTE) {
LOG(THREAD, LOG_EMIT, 2,
"patch_emitted_code type=%d indirected, nothing to patch\n", patch->type);
/* FIXME: propagate the check earlier to save the extraneous calls
to update_indirect_exit_stub and update_indirect_branch_lookup
*/
return;
}
DOLOG(4, LOG_EMIT, { print_patch_list(patch); });
for (i = 0; i < patch->num_relocations; i++) {
byte *pc = start_pc + patch->entry[i].where.offset;
/* value address, (think for example of pt->trace.hash_mask) */
ptr_uint_t value;
char *vaddr = NULL;
if (TEST(PATCH_PER_THREAD, patch->entry[i].patch_flags)) {
vaddr = (char *)pt + patch->entry[i].value_location_offset;
} else if (TEST(PATCH_UNPROT_STAT, patch->entry[i].patch_flags)) {
/* separate the two parts of the stat */
uint unprot_offs = (uint)(patch->entry[i].value_location_offset) >> 16;
uint field_offs = (uint)(patch->entry[i].value_location_offset) & 0xffff;
IF_X64(
ASSERT(CHECK_TRUNCATE_TYPE_uint(patch->entry[i].value_location_offset)));
vaddr = (*((char **)((char *)pt + unprot_offs))) + field_offs;
LOG(THREAD, LOG_EMIT, 4,
"patch_emitted_code [%d] value " PFX " => 0x%x 0x%x => " PFX "\n", i,
patch->entry[i].value_location_offset, unprot_offs, field_offs, vaddr);
} else
ASSERT_NOT_REACHED();
ASSERT(TEST(PATCH_OFFSET_VALID, patch->entry[i].patch_flags));
ASSERT(!TEST(PATCH_MARKER, patch->entry[i].patch_flags));
if (!TEST(PATCH_TAKE_ADDRESS, patch->entry[i].patch_flags)) {
/* use value pointed by computed address */
if (TEST(PATCH_UINT_SIZED, patch->entry[i].patch_flags))
value = (ptr_uint_t) * ((uint *)vaddr);
else
value = *(ptr_uint_t *)vaddr;
} else {
ASSERT(!TEST(PATCH_UINT_SIZED, patch->entry[i].patch_flags));
value = (ptr_uint_t)vaddr; /* use computed address */
}
LOG(THREAD, LOG_EMIT, 4,
"patch_emitted_code [%d] offset=" PFX " patch_flags=%d value_offset=" PFX
" vaddr=" PFX " value=" PFX "\n",
i, patch->entry[i].where.offset, patch->entry[i].patch_flags,
patch->entry[i].value_location_offset, vaddr, value);
if (TEST(PATCH_UINT_SIZED, patch->entry[i].patch_flags)) {
IF_X64(ASSERT(CHECK_TRUNCATE_TYPE_uint(value)));
*((uint *)pc) = (uint)value;
} else
*((ptr_uint_t *)pc) = value;
LOG(THREAD, LOG_EMIT, 4, "patch_emitted_code: updated pc *" PFX " = " PFX "\n",
pc, value);
}
STATS_INC(emit_patched_fragments);
DOSTATS({
/* PR 217008: avoid gcc warning from truncation assert in XSTATS_ADD_DC */
int tmp_num = patch->num_relocations;
STATS_ADD(emit_patched_relocations, tmp_num);
});
LOG(THREAD, LOG_EMIT, 4, "patch_emitted_code done\n");
}
/* Updates an indirect branch exit stub with the latest hashtable mask
* and hashtable address
* See also update_indirect_branch_lookup
*/
void
update_indirect_exit_stub(dcontext_t *dcontext, fragment_t *f, linkstub_t *l)
{
generated_code_t *code =
get_emitted_routines_code(dcontext _IF_X86_64(FRAGMENT_GENCODE_MODE(f->flags)));
byte *start_pc = (byte *)EXIT_STUB_PC(dcontext, f, l);
ibl_branch_type_t branch_type;
ASSERT(linkstub_owned_by_fragment(dcontext, f, l));
ASSERT(LINKSTUB_INDIRECT(l->flags));
ASSERT(EXIT_HAS_STUB(l->flags, f->flags));
/* Shared use indirection so no patching needed -- caller should check */
ASSERT(!TEST(FRAG_SHARED, f->flags));
#ifdef WINDOWS
/* Do not touch shared_syscall */
if (EXIT_TARGET_TAG(dcontext, f, l) ==
shared_syscall_routine_ex(dcontext _IF_X86_64(FRAGMENT_GENCODE_MODE(f->flags))))
return;
#endif
branch_type = extract_branchtype(l->flags);
LOG(THREAD, LOG_EMIT, 4, "update_indirect_exit_stub: f->tag=" PFX "\n", f->tag);
if (DYNAMO_OPTION(disable_traces) && !code->bb_ibl[branch_type].ibl_head_is_inlined) {
return;
}
if (TEST(FRAG_IS_TRACE, f->flags)) {
ASSERT(code->trace_ibl[branch_type].ibl_head_is_inlined);
patch_emitted_code(dcontext, &code->trace_ibl[branch_type].ibl_stub_patch,
start_pc);
} else {
ASSERT(code->bb_ibl[branch_type].ibl_head_is_inlined);
patch_emitted_code(dcontext, &code->bb_ibl[branch_type].ibl_stub_patch, start_pc);
}
}
/*###########################################################################
*
* fragment_t Prefixes
*
* Two types: indirect branch target, which restores eflags and xcx, and
* normal prefix, which just restores xcx
*/
int
fragment_prefix_size(uint flags)
{
if (use_ibt_prefix(flags)) {
return fragment_ibt_prefix_size(flags);
} else {
#ifdef CLIENT_INTERFACE
if (dynamo_options.bb_prefixes)
return FRAGMENT_BASE_PREFIX_SIZE(flags);
else
#endif
return 0;
}
}
#ifdef PROFILE_RDTSC
/***************************************************************************
***************************************************************************
** PROFILING USING RDTSC
**
**/
/*
We want the profile code to not count towards fragment times.
So we stop time as quickly as possible, in assembly here instead of
in the profile_fragment_enter function, and start time again as late
as possible:
mov %eax, eax_offset(dcontext) # save eax
mov %edx, edx_offset(dcontext) # save edx
rdtsc # stop time
switch to dynamo stack
pushfl # save eflags (call will clobber)
mov %ecx, ecx_offset(dcontext) # save ecx
pushl %edx # pass time as arg
pushl %eax
pushil &fragment_address # pass &frag as arg
call profile_fragment_enter #
addl $0xc, %esp # clean up args
popl %ecx # restore ecx
popfl # restore eflags
restore app stack
rdtsc # start time
movl %eax, start_time_OFFS(dcontext) # store time value
movl %edx, 4+start_time_OFFS(dcontext) # store time value
mov eax_offset(dcontext), %eax # restore eax
mov edx_offset(dcontext), %edx # restore edx
mov ecx_offset(dcontext), %ecx # restore ecx
*/
static uint profile_call_length = 0;
static int profile_call_fragment_offset = 0;
static int profile_call_call_offset = 0;
static byte profile_call_buf[128];
static dcontext_t *buffer_dcontext;
static void
build_profile_call_buffer(void);
uint
profile_call_size()
{
/* XXX i#1566: For -satisfy_w_xor_x we'd need to change the
* instr_encode calls and possibly more. Punting for now.
*/
ASSERT_NOT_IMPLEMENTED(!DYNAMO_OPTION(satisfy_w_xor_x),
"PROFILE_RDTSC is not supported with -satisfy_w_xor_x");
if (profile_call_length == 0)
build_profile_call_buffer();
return profile_call_length;
}
/* if insert_profile_call emits its code into the trace buffer, this
* routine must be called once the fragment is created and the code is
* in the fcache
*/
void
finalize_profile_call(dcontext_t *dcontext, fragment_t *f)
{
byte *start_pc = (byte *)FCACHE_ENTRY_PC(f);
byte *pc;
byte *prev_pc;
instr_t instr;
instr_init(dcontext, &instr);
/* fill in address of owning fragment now that that fragment exists */
pc = start_pc + profile_call_fragment_offset;
/* PR 248210: unsupported feature on x64 */
IF_X64(ASSERT_NOT_IMPLEMENTED(false));
*((int *)pc) = (uint)f;
/* fill in call's proper pc-relative offset now that code is
* in its final location in fcache
*/
pc = start_pc + profile_call_call_offset;
IF_X64(ASSERT_NOT_IMPLEMENTED(false));
*((int *)pc) = (int)&profile_fragment_enter - (int)pc - 4;
/* must fix up all dcontext references to point to the right dcontext */
pc = start_pc;
do {
prev_pc = pc;
instr_reset(dcontext, &instr);
pc = decode(dcontext, pc, &instr);
ASSERT(instr_valid(&instr)); /* our own code! */
/* look for loads and stores that reference buffer_dcontext */
if (instr_get_opcode(&instr) == OP_mov_ld &&
opnd_is_near_base_disp(instr_get_src(&instr, 0)) &&
opnd_get_base(instr_get_src(&instr, 0)) == REG_NULL &&
opnd_get_index(instr_get_src(&instr, 0)) == REG_NULL) {
/* if not really dcontext value, update_ will return old value */
instr_set_src(&instr, 0,
update_dcontext_address(instr_get_src(&instr, 0),
buffer_dcontext, dcontext));
} else if (instr_get_opcode(&instr) == OP_mov_st &&
opnd_is_near_base_disp(instr_get_dst(&instr, 0)) &&
opnd_get_base(instr_get_dst(&instr, 0)) == REG_NULL &&
opnd_get_index(instr_get_dst(&instr, 0)) == REG_NULL) {
/* if not really dcontext value, update_ will return old value */
instr_set_dst(&instr, 0,
update_dcontext_address(instr_get_dst(&instr, 0),
buffer_dcontext, dcontext));
}
if (!instr_raw_bits_valid(&instr)) {
DEBUG_DECLARE(byte * nxt_pc;)
DEBUG_DECLARE(nxt_pc =) instr_encode(dcontext, &instr, prev_pc);
ASSERT(nxt_pc != NULL);
}
} while (pc < start_pc + profile_call_length);
instr_free(dcontext, &instr);
}
void
insert_profile_call(cache_pc start_pc)
{
if (profile_call_length == 0)
build_profile_call_buffer();
memcpy((void *)start_pc, profile_call_buf, profile_call_length);
/* if thread-private, we change to proper dcontext when finalizing */
}
/* This routine builds the profile call code using the instr_t
* abstraction, then emits it into a buffer to be saved.
* The code can then be directly copied whenever needed.
* Assumption: this thread's dcontext must have been created
* before calling this function.
*/
static void
build_profile_call_buffer()
{
byte *pc, *nxt_pc;
instrlist_t ilist;
instr_t *inst;
int start_time_offs;
dcontext_t *dcontext = get_thread_private_dcontext();
ASSERT(dcontext != NULL);
/* remember dcontext for easy replacement when finalizing: */
buffer_dcontext = dcontext;
/* we require a dcontext to find this offset because it may
* or may not be pushed to a quadword boundary, making it
* hard to hardcode it
*/
start_time_offs = (int)(&(dcontext->start_time)) - (int)dcontext;
/* initialize the ilist */
instrlist_init(&ilist);
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_EAX, SCRATCH_REG0_OFFS));
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_EDX, SCRATCH_REG3_OFFS));
/* get time = rdtsc */
APP(&ilist, INSTR_CREATE_rdtsc(dcontext));
/* swap to dstack */
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_ESP, XSP_OFFSET));
APP(&ilist, instr_create_restore_dynamo_stack(dcontext));
/* finish saving caller-saved registers
* The profile_fragment_enter function will save the callee-saved
* regs (ebx, ebp, esi, edi) and will restore ebp and esp, but we need
* to explicitly save eax, ecx, and edx
*/
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_ECX, SCRATCH_REG2_OFFS));
/* save eflags (call will clobber) */
APP(&ilist, INSTR_CREATE_RAW_pushf(dcontext));
# ifdef WINDOWS
/* must preserve the LastErrorCode (if the profile procedure
* calls a Win32 API routine it could overwrite the app's error code)
* currently this is done in the profile routine itself --
* if you want to move it here, look at the code in profile.c
*/
# endif
/* push time as 2nd argument for call */
APP(&ilist, INSTR_CREATE_push(dcontext, opnd_create_reg(REG_EDX)));
APP(&ilist, INSTR_CREATE_push(dcontext, opnd_create_reg(REG_EAX)));
/* push fragment address as 1st argument for call
* fragment isn't built yet, we fill it in in finalize_profile_call
*/
APP(&ilist, INSTR_CREATE_push_imm(dcontext, OPND_CREATE_INT32(0)));
/* call near rel: 4-byte pc-relative offset from start of next instr
* we don't have that offset now so we fill it in later (in
* finalize_profile_call)
*/
APP(&ilist, INSTR_CREATE_call(dcontext, opnd_create_pc(NULL)));
/* pop arguments: addl $0xc, %esp */
APP(&ilist,
INSTR_CREATE_add(dcontext, opnd_create_reg(REG_ESP), OPND_CREATE_INT8(0xc)));
/* restore eflags */
APP(&ilist, INSTR_CREATE_RAW_popf(dcontext));
/* restore caller-saved registers */
APP(&ilist, instr_create_restore_from_dcontext(dcontext, REG_ECX, SCRATCH_REG2_OFFS));
/* restore app stack */
APP(&ilist, instr_create_restore_from_dcontext(dcontext, REG_ESP, XSP_OFFSET));
/* get start time = rdtsc */
APP(&ilist, INSTR_CREATE_rdtsc(dcontext));
/* copy start time into dcontext */
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_EAX, start_time_offs));
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_EDX, start_time_offs + 4));
/* finish restoring caller-saved registers */
APP(&ilist, instr_create_restore_from_dcontext(dcontext, REG_EDX, SCRATCH_REG3_OFFS));
APP(&ilist, instr_create_restore_from_dcontext(dcontext, REG_EAX, SCRATCH_REG0_OFFS));
/* now encode the instructions */
pc = profile_call_buf;
for (inst = instrlist_first(&ilist); inst; inst = instr_get_next(inst)) {
if (instr_is_call_direct(inst)) {
/* push_immed was just before us, so fragment address
* starts 4 bytes before us:
*/
profile_call_fragment_offset = (int)(pc - 4 - profile_call_buf);
/* call opcode is 1 byte, offset is next: */
profile_call_call_offset = (int)(pc + 1 - profile_call_buf);
}
/* we have no jumps with instr_t targets so we don't need to set note
* field in order to use instr_encode
*/
nxt_pc = instr_encode(dcontext, inst, (void *)pc);
ASSERT(nxt_pc != NULL);
profile_call_length += nxt_pc - pc;
pc = nxt_pc;
ASSERT(profile_call_length < 128);
}
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
}
#endif /* PROFILE_RDTSC */
#ifdef WINDOWS
/* Leaving in place old notes on LastError preservation: */
/* inlined versions of save/restore last error by reading of TIB */
/* If our inlined version fails on a later version of windows
should verify [GS]etLastError matches the disassembly below.
*/
/* Win2000: kernel32!SetLastError: */
/* 77E87671: 55 push ebp */
/* 77E87672: 8B EC mov ebp,esp */
/* 77E87674: 64 A1 18 00 00 00 mov eax,fs:[00000018] */
/* 77E8767A: 8B 4D 08 mov ecx,dword ptr [ebp+8] */
/* 77E8767D: 89 48 34 mov dword ptr [eax+34h],ecx */
/* 77E87680: 5D pop ebp */
/* 77E87681: C2 04 00 ret 4 */
/* Win2003: ntdll!RtlSetLastWin32Error: optimized to */
/* 77F45BB4: 64 A1 18 00 00 00 mov eax,fs:[00000018] */
/* 77F45BBA: 8B 4C 24 04 mov ecx,dword ptr [esp+4] */
/* 77F45BBE: 89 48 34 mov dword ptr [eax+34h],ecx */
/* 77F45BC1: C2 04 00 ret 4 */
/* See InsideWin2k, p. 329 SelfAddr fs:[18h] simply has the linear address of the TIB
while we're interested only in LastError which is at fs:[34h] */
/* Therefore all we need is a single instruction! */
/* 64 a1 34 00 00 00 mov dword ptr fs:[34h],errno_register */
/* Overall savings: 7 instructions, 5 data words */
/*kernel32!GetLastError:*/
/* 77E87684: 64 A1 18 00 00 00 mov eax,fs:[00000018] */
/* 77E8768A: 8B 40 34 mov eax,dword ptr [eax+34h] */
/* 77E8768D: C3 ret */
/* All we need is a single instruction: */
/* 77F45BBE: 89 48 34 mov reg_result, dword ptr fs:[34h] */
/* i#249: isolate app's PEB+TEB by keeping our own copy and swapping on cxt switch
* For clean calls we share this in clean_call_{save,restore} (i#171, i#1349).
*/
void
preinsert_swap_peb(dcontext_t *dcontext, instrlist_t *ilist, instr_t *next, bool absolute,
reg_id_t reg_dr, reg_id_t reg_scratch, bool to_priv)
{
# ifdef CLIENT_INTERFACE
/* We assume PEB is globally constant and we don't need per-thread pointers
* and can use use absolute pointers known at init time
*/
PEB *tgt_peb = to_priv ? get_private_peb() : get_own_peb();
reg_id_t scratch32 = IF_X64_ELSE(reg_64_to_32(reg_scratch), reg_scratch);
ASSERT(INTERNAL_OPTION(private_peb));
ASSERT(reg_dr != REG_NULL && reg_scratch != REG_NULL);
if (should_swap_peb_pointer()) {
/* can't store 64-bit immed, so we use scratch reg, for 32-bit too since
* long 32-bit-immed-store instr to fs:offs is slow to decode
*/
PRE(ilist, next,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(reg_scratch),
OPND_CREATE_INTPTR((ptr_int_t)tgt_peb)));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL, 0,
PEB_TIB_OFFSET, OPSZ_PTR),
opnd_create_reg(reg_scratch)));
}
# endif
/* See the comment at the definition of SWAP_TEB_STACKLIMIT() for full
* discussion of which stack fields we swap.
*/
if (SWAP_TEB_STACKLIMIT()) {
if (to_priv) {
PRE(ilist, next,
XINST_CREATE_load(dcontext, opnd_create_reg(reg_scratch),
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, BASE_STACK_TIB_OFFSET,
OPSZ_PTR)));
PRE(ilist, next,
SAVE_TO_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
APP_STACK_LIMIT_OFFSET));
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
DSTACK_OFFSET));
PRE(ilist, next,
INSTR_CREATE_lea(dcontext, opnd_create_reg(reg_scratch),
opnd_create_base_disp(reg_scratch, REG_NULL, 0,
-(int)DYNAMORIO_STACK_SIZE,
OPSZ_lea)));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, BASE_STACK_TIB_OFFSET,
OPSZ_PTR),
opnd_create_reg(reg_scratch)));
} else {
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
APP_STACK_LIMIT_OFFSET));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, BASE_STACK_TIB_OFFSET,
OPSZ_PTR),
opnd_create_reg(reg_scratch)));
}
}
if (SWAP_TEB_STACKBASE()) {
if (to_priv) {
PRE(ilist, next,
XINST_CREATE_load(dcontext, opnd_create_reg(reg_scratch),
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, TOP_STACK_TIB_OFFSET,
OPSZ_PTR)));
PRE(ilist, next,
SAVE_TO_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
APP_STACK_BASE_OFFSET));
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
DSTACK_OFFSET));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, TOP_STACK_TIB_OFFSET,
OPSZ_PTR),
opnd_create_reg(reg_scratch)));
} else {
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
APP_STACK_BASE_OFFSET));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, TOP_STACK_TIB_OFFSET,
OPSZ_PTR),
opnd_create_reg(reg_scratch)));
}
}
# ifdef CLIENT_INTERFACE
if (should_swap_teb_nonstack_fields()) {
/* Preserve app's TEB->LastErrorValue. We used to do this separately b/c
* DR at one point long ago made some win32 API calls: now we only have to
* do this when loading private libraries. We assume no private library
* code needs to preserve LastErrorCode across app execution.
*/
if (to_priv) {
/* yes errno is 32 bits even on x64 */
PRE(ilist, next,
XINST_CREATE_load(dcontext, opnd_create_reg(scratch32),
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, ERRNO_TIB_OFFSET,
OPSZ_4)));
PRE(ilist, next,
SAVE_TO_DC_VIA_REG(absolute, dcontext, reg_dr, scratch32,
APP_ERRNO_OFFSET));
} else {
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, scratch32,
APP_ERRNO_OFFSET));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, ERRNO_TIB_OFFSET, OPSZ_4),
opnd_create_reg(scratch32)));
}
/* We also swap TEB->FlsData. Unlike TEB->ProcessEnvironmentBlock, which is
* constant, and TEB->LastErrorCode, which is not peristent, we have to maintain
* both values and swap between them which is expensive.
*/
PRE(ilist, next,
XINST_CREATE_load(dcontext, opnd_create_reg(reg_scratch),
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL, 0,
FLS_DATA_TIB_OFFSET, OPSZ_PTR)));
PRE(ilist, next,
SAVE_TO_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
to_priv ? APP_FLS_OFFSET : PRIV_FLS_OFFSET));
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
to_priv ? PRIV_FLS_OFFSET : APP_FLS_OFFSET));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL, 0,
FLS_DATA_TIB_OFFSET, OPSZ_PTR),
opnd_create_reg(reg_scratch)));
/* We swap TEB->ReservedForNtRpc as well. Hopefully there won't be many
* more we'll have to swap.
*/
PRE(ilist, next,
XINST_CREATE_load(dcontext, opnd_create_reg(reg_scratch),
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL, 0,
NT_RPC_TIB_OFFSET, OPSZ_PTR)));
PRE(ilist, next,
SAVE_TO_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
to_priv ? APP_RPC_OFFSET : PRIV_RPC_OFFSET));
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
to_priv ? PRIV_RPC_OFFSET : APP_RPC_OFFSET));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL, 0,
NT_RPC_TIB_OFFSET, OPSZ_PTR),
opnd_create_reg(reg_scratch)));
/* We also swap TEB->NlsCache. */
PRE(ilist, next,
XINST_CREATE_load(dcontext, opnd_create_reg(reg_scratch),
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL, 0,
NLS_CACHE_TIB_OFFSET, OPSZ_PTR)));
PRE(ilist, next,
SAVE_TO_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
to_priv ? APP_NLS_CACHE_OFFSET : PRIV_NLS_CACHE_OFFSET));
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
to_priv ? PRIV_NLS_CACHE_OFFSET
: APP_NLS_CACHE_OFFSET));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL, 0,
NLS_CACHE_TIB_OFFSET, OPSZ_PTR),
opnd_create_reg(reg_scratch)));
}
if (should_swap_teb_static_tls()) {
/* We also have to swap TEB->ThreadLocalStoragePointer. Unlike the other
* fields, we control this private one so we never set it from the TEB field.
*/
if (to_priv) {
PRE(ilist, next,
XINST_CREATE_load(dcontext, opnd_create_reg(reg_scratch),
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL,
0, STATIC_TLS_TIB_OFFSET,
OPSZ_PTR)));
PRE(ilist, next,
SAVE_TO_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
APP_STATIC_TLS_OFFSET));
}
PRE(ilist, next,
RESTORE_FROM_DC_VIA_REG(absolute, dcontext, reg_dr, reg_scratch,
to_priv ? PRIV_STATIC_TLS_OFFSET
: APP_STATIC_TLS_OFFSET));
PRE(ilist, next,
XINST_CREATE_store(dcontext,
opnd_create_far_base_disp(SEG_TLS, REG_NULL, REG_NULL, 0,
STATIC_TLS_TIB_OFFSET, OPSZ_PTR),
opnd_create_reg(reg_scratch)));
}
# endif /* CLIENT_INTERFACE */
}
#endif /* WINDOWS */
/***************************************************************************/
/* THREAD-PRIVATE/SHARED ROUTINE GENERATION */
/***************************************************************************/
/* register for holding dcontext on fcache enter/return */
#define REG_DCTXT SCRATCH_REG5
/* append instructions to setup fcache target
* if (!absolute)
* # put target somewhere we can be absolute about
* RESTORE_FROM_UPCONTEXT next_tag_OFFSET,%xax
* if (shared)
* mov %xax,fs:xax_OFFSET
* endif
* endif
*/
static void
append_setup_fcache_target(dcontext_t *dcontext, instrlist_t *ilist, bool absolute,
bool shared)
{
if (absolute)
return;
/* put target into special slot that we can be absolute about */
APP(ilist, RESTORE_FROM_DC(dcontext, SCRATCH_REG0, NEXT_TAG_OFFSET));
if (shared) {
APP(ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG0, FCACHE_ENTER_TARGET_SLOT));
} else {
#ifdef WINDOWS
/* absolute into main dcontext (not one in REG_DCTXT) */
APP(ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG0,
NONSWAPPED_SCRATCH_OFFSET));
#else
/* no special scratch slot! */
ASSERT_NOT_IMPLEMENTED(false);
#endif /* !WINDOWS */
}
}
/* append instructions to jump to target in code cache
* ifdef X64 and (target is x86 mode)
* # we can't indirect through a register since we couldn't restore
* # the high bits (PR 283152)
* mov gencode-jmp86-value, fs:xbx_OFFSET
* far jmp to next instr, stored w/ 32-bit cs selector in fs:xbx_OFFSET
* endif
*
* # jump indirect through dcontext->next_tag, set by d_r_dispatch()
* if (absolute)
* JUMP_VIA_DCONTEXT next_tag_OFFSET
* else
* if (shared)
* jmp *fs:xax_OFFSET
* else
* JUMP_VIA_DCONTEXT nonswapped_scratch_OFFSET
* endif
* endif
*/
static void
append_jmp_to_fcache_target(dcontext_t *dcontext, instrlist_t *ilist,
generated_code_t *code, bool absolute, bool shared,
patch_list_t *patch _IF_X86_64(byte **jmp86_store_addr)
_IF_X86_64(byte **jmp86_target_addr))
{
#ifdef X86_64
if (GENCODE_IS_X86(code->gencode_mode)) {
instr_t *label = INSTR_CREATE_label(dcontext);
instr_t *store;
/* We must use an indirect jmp (far direct are illegal in x64) and
* we can't indirect through a register since we couldn't restore the
* high bits (PR 283152) so we write the 6-byte far address to TLS.
*/
/* AMD only supports 32-bit address for far jmp */
store = XINST_CREATE_store(dcontext, OPND_TLS_FIELD_SZ(TLS_REG1_SLOT, OPSZ_4),
OPND_CREATE_INT32(0 /*placeholder*/));
APP(ilist, store);
APP(ilist,
XINST_CREATE_store(dcontext, OPND_TLS_FIELD_SZ(TLS_REG1_SLOT + 4, OPSZ_2),
OPND_CREATE_INT16((ushort)CS32_SELECTOR)));
APP(ilist,
INSTR_CREATE_jmp_far_ind(dcontext, OPND_TLS_FIELD_SZ(TLS_REG1_SLOT, OPSZ_6)));
APP(ilist, label);
/* We need a patch that involves two instrs, which is not supported,
* so we get both addresses involved into local vars and do the patch
* by hand after emitting.
*/
add_patch_marker(patch, store, PATCH_ASSEMBLE_ABSOLUTE, -4 /* 4 bytes from end */,
(ptr_uint_t *)jmp86_store_addr);
add_patch_marker(patch, label, PATCH_ASSEMBLE_ABSOLUTE, 0 /* start of label */,
(ptr_uint_t *)jmp86_target_addr);
}
#endif /* X64 */
/* Jump indirect through next_tag. Dispatch set this value with
* where we want to go next in the fcache_t.
*/
if (absolute) {
APP(ilist, instr_create_jump_via_dcontext(dcontext, NEXT_TAG_OFFSET));
} else {
if (shared) {
/* next_tag placed into tls slot earlier in this routine */
#ifdef AARCH64
/* Load next_tag from FCACHE_ENTER_TARGET_SLOT, stored by
* append_setup_fcache_target.
*/
APP(ilist,
instr_create_restore_from_tls(dcontext, DR_REG_X0,
FCACHE_ENTER_TARGET_SLOT));
/* br x0 */
APP(ilist, INSTR_CREATE_br(dcontext, opnd_create_reg(DR_REG_X0)));
#else
APP(ilist,
XINST_CREATE_jump_mem(dcontext,
OPND_TLS_FIELD(FCACHE_ENTER_TARGET_SLOT)));
#endif
} else {
#ifdef WINDOWS
/* FIXME: we could just use tls, right? no real need for the "shared"
* parameter?
*/
/* need one absolute ref using main dcontext (not one in edi):
* it's the final jmp, using the special slot we set up earlier
*/
APP(ilist,
instr_create_jump_via_dcontext(dcontext, NONSWAPPED_SCRATCH_OFFSET));
#else /* !WINDOWS */
/* no special scratch slot! */
ASSERT_NOT_IMPLEMENTED(false);
#endif /* !WINDOWS */
}
}
}
/* Our context switch to and from the fragment cache are arranged such
* that there is no persistent state kept on the dstack, allowing us to
* start with a clean slate on exiting the cache. This eliminates the
* need to protect our dstack from inadvertent or malicious writes.
*
* We do not bother to save any DynamoRIO state, even the eflags. We clear
* them in fcache_return, assuming that a cleared state is always the
* proper value (df is never set across the cache, etc.)
*
* The code is split into several helper functions.
*
* # Used by d_r_dispatch to begin execution in fcache at dcontext->next_tag
* fcache_enter(dcontext_t *dcontext)
*
* # append_fcache_enter_prologue
* mov SCRATCH_REG5, xax # save callee-saved reg in case return for signal
* if (!absolute)
* mov ARG1, SCRATCH_REG5 # dcontext param
* if (TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask))
* RESTORE_FROM_UPCONTEXT PROT_OFFSET, %xsi
* endif
* endif
* cmp signals_pending_OFFSET(SCRATCH_REG5), 0
* jle no_signals
* mov xax, SCRATCH_REG5 # restore callee-saved reg
* ret
* no_signals:
*
* # append_load_tls_base (ARM only)
* mrc p15, 0, r0, c13, c0, 2
* ldr r10, [r10, TLS_SWAP_SLOT_OFFSET]
* ldr r1, [r0, offsetof(app_tls_swap)]
* str r1, [r10, TLS_SWAP_SLOT_OFFSET]
*
* # append_setup_fcache_target
* if (!absolute)
* # put target somewhere we can be absolute about
* RESTORE_FROM_UPCONTEXT next_tag_OFFSET, SCRATCH_REG0
* if (shared)
* mov SCRATCH_REG0, fs:xax_OFFSET
* endif
* endif
*
* # append_call_exit_dr_hook
* if (EXIT_DR_HOOK != NULL && !dcontext->ignore_enterexit)
* if (!absolute)
* push %xdi
* push %xsi
* else
* # support for skipping the hook
* RESTORE_FROM_UPCONTEXT ignore_enterexit_OFFSET,%edi
* cmpl %edi,0
* jnz post_hook
* endif
* call EXIT_DR_HOOK # for x64 windows, reserve 32 bytes stack space for call
* if (!absolute)
* pop %xsi
* pop %xdi
* endif
* endif
*
* post_hook:
*
* # restore the original register state
*
* # append_restore_simd_reg
* if preserve_xmm_caller_saved
* if (ZMM_ENABLED()) # this is evaluated at *generation time*
* if (!d_r_is_avx512_code_in_use()) # this is evaluated at *runtime*
* RESTORE_FROM_UPCONTEXT simd_OFFSET+0*64,%ymm0
* RESTORE_FROM_UPCONTEXT simd_OFFSET+1*64,%ymm1
* RESTORE_FROM_UPCONTEXT simd_OFFSET+2*64,%ymm2
* RESTORE_FROM_UPCONTEXT simd_OFFSET+3*64,%ymm3
* RESTORE_FROM_UPCONTEXT simd_OFFSET+4*64,%ymm4
* RESTORE_FROM_UPCONTEXT simd_OFFSET+5*64,%ymm5
* RESTORE_FROM_UPCONTEXT simd_OFFSET+6*64,%ymm6
* RESTORE_FROM_UPCONTEXT simd_OFFSET+7*64,%ymm7 # 32-bit Linux
* ifdef X64
* RESTORE_FROM_UPCONTEXT simd_OFFSET+8*64,%ymm8
* RESTORE_FROM_UPCONTEXT simd_OFFSET+9*64,%ymm9
* RESTORE_FROM_UPCONTEXT simd_OFFSET+10*64,%ymm10
* RESTORE_FROM_UPCONTEXT simd_OFFSET+11*64,%ymm11
* RESTORE_FROM_UPCONTEXT simd_OFFSET+12*64,%ymm12
* RESTORE_FROM_UPCONTEXT simd_OFFSET+13*64,%ymm13
* RESTORE_FROM_UPCONTEXT simd_OFFSET+14*64,%ymm14
* RESTORE_FROM_UPCONTEXT simd_OFFSET+15*64,%ymm15 # 64-bit Linux
* endif
* else # d_r_is_avx512_code_in_use()
* RESTORE_FROM_UPCONTEXT simd_OFFSET+0*64,%zmm0
* RESTORE_FROM_UPCONTEXT simd_OFFSET+1*64,%zmm1
* RESTORE_FROM_UPCONTEXT simd_OFFSET+2*64,%zmm2
* RESTORE_FROM_UPCONTEXT simd_OFFSET+3*64,%zmm3
* RESTORE_FROM_UPCONTEXT simd_OFFSET+4*64,%zmm4
* RESTORE_FROM_UPCONTEXT simd_OFFSET+5*64,%zmm5
* RESTORE_FROM_UPCONTEXT simd_OFFSET+6*64,%zmm6
* RESTORE_FROM_UPCONTEXT simd_OFFSET+7*64,%zmm7 # 32-bit Linux
* ifdef X64
* RESTORE_FROM_UPCONTEXT simd_OFFSET+8*64,%zmm8
* RESTORE_FROM_UPCONTEXT simd_OFFSET+9*64,%zmm9
* RESTORE_FROM_UPCONTEXT simd_OFFSET+10*64,%zmm10
* RESTORE_FROM_UPCONTEXT simd_OFFSET+11*64,%zmm11
* RESTORE_FROM_UPCONTEXT simd_OFFSET+12*64,%zmm12
* RESTORE_FROM_UPCONTEXT simd_OFFSET+13*64,%zmm13
* RESTORE_FROM_UPCONTEXT simd_OFFSET+14*64,%zmm14
* RESTORE_FROM_UPCONTEXT simd_OFFSET+15*64,%zmm15
* RESTORE_FROM_UPCONTEXT simd_OFFSET+16*64,%zmm16
* RESTORE_FROM_UPCONTEXT simd_OFFSET+17*64,%zmm17
* RESTORE_FROM_UPCONTEXT simd_OFFSET+18*64,%zmm18
* RESTORE_FROM_UPCONTEXT simd_OFFSET+19*64,%zmm19
* RESTORE_FROM_UPCONTEXT simd_OFFSET+20*64,%zmm20
* RESTORE_FROM_UPCONTEXT simd_OFFSET+21*64,%zmm21
* RESTORE_FROM_UPCONTEXT simd_OFFSET+22*64,%zmm22
* RESTORE_FROM_UPCONTEXT simd_OFFSET+23*64,%zmm23
* RESTORE_FROM_UPCONTEXT simd_OFFSET+24*64,%zmm24
* RESTORE_FROM_UPCONTEXT simd_OFFSET+25*64,%zmm25
* RESTORE_FROM_UPCONTEXT simd_OFFSET+26*64,%zmm26
* RESTORE_FROM_UPCONTEXT simd_OFFSET+27*64,%zmm27
* RESTORE_FROM_UPCONTEXT simd_OFFSET+28*64,%zmm28
* RESTORE_FROM_UPCONTEXT simd_OFFSET+29*64,%zmm29
* RESTORE_FROM_UPCONTEXT simd_OFFSET+30*64,%zmm30
* RESTORE_FROM_UPCONTEXT simd_OFFSET+31*64,%zmm31 # 64-bit Linux
* endif
* RESTORE_FROM_UPCONTEXT opmask_OFFSET+0*8,%k0
* RESTORE_FROM_UPCONTEXT opmask_OFFSET+1*8,%k1
* RESTORE_FROM_UPCONTEXT opmask_OFFSET+2*8,%k2
* RESTORE_FROM_UPCONTEXT opmask_OFFSET+3*8,%k3
* RESTORE_FROM_UPCONTEXT opmask_OFFSET+4*8,%k4
* RESTORE_FROM_UPCONTEXT opmask_OFFSET+5*8,%k5
* RESTORE_FROM_UPCONTEXT opmask_OFFSET+6*8,%k6
* RESTORE_FROM_UPCONTEXT opmask_OFFSET+7*8,%k7
* endif
* endif
* endif
*
* # append_restore_xflags
* RESTORE_FROM_UPCONTEXT xflags_OFFSET,%xax
* push %xax
* popf # restore eflags temporarily using dstack
*
* # append_restore_gpr
* ifdef X64
* RESTORE_FROM_UPCONTEXT r8_OFFSET,%r8
* RESTORE_FROM_UPCONTEXT r9_OFFSET,%r9
* RESTORE_FROM_UPCONTEXT r10_OFFSET,%r10
* RESTORE_FROM_UPCONTEXT r11_OFFSET,%r11
* RESTORE_FROM_UPCONTEXT r12_OFFSET,%r12
* RESTORE_FROM_UPCONTEXT r13_OFFSET,%r13
* RESTORE_FROM_UPCONTEXT r14_OFFSET,%r14
* RESTORE_FROM_UPCONTEXT r15_OFFSET,%r15
* endif
* RESTORE_FROM_UPCONTEXT xax_OFFSET,%xax
* RESTORE_FROM_UPCONTEXT xbx_OFFSET,%xbx
* RESTORE_FROM_UPCONTEXT xcx_OFFSET,%xcx
* RESTORE_FROM_UPCONTEXT xdx_OFFSET,%xdx
* if (absolute || !TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask))
* RESTORE_FROM_UPCONTEXT xsi_OFFSET,%xsi
* endif
* if (absolute || TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask))
* RESTORE_FROM_UPCONTEXT xdi_OFFSET,%xdi
* endif
* RESTORE_FROM_UPCONTEXT xbp_OFFSET,%xbp
* RESTORE_FROM_UPCONTEXT xsp_OFFSET,%xsp
* if (!absolute)
* if (TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask))
* RESTORE_FROM_UPCONTEXT xsi_OFFSET,%xsi
* else
* RESTORE_FROM_UPCONTEXT xdi_OFFSET,%xdi
* endif
* endif
*
* # append_jmp_to_fcache_target
* ifdef X64 and (target is x86 mode)
* # we can't indirect through a register since we couldn't restore
* # the high bits (PR 283152)
* mov gencode-jmp86-value, fs:xbx_OFFSET
* far jmp to next instr, stored w/ 32-bit cs selector in fs:xbx_OFFSET
* endif
*
* # jump indirect through dcontext->next_tag, set by d_r_dispatch()
* if (absolute)
* JUMP_VIA_DCONTEXT next_tag_OFFSET
* else
* if (shared)
* jmp *fs:xax_OFFSET
* else
* JUMP_VIA_DCONTEXT nonswapped_scratch_OFFSET
* endif
* endif
*
* # now executing in fcache
*/
static byte *
emit_fcache_enter_common(dcontext_t *dcontext, generated_code_t *code, byte *pc,
bool absolute, bool shared)
{
int len;
instrlist_t ilist;
patch_list_t patch;
#if defined(X86) && defined(X64)
byte *jmp86_store_addr = NULL;
byte *jmp86_target_addr = NULL;
#endif /* X64 */
init_patch_list(&patch, absolute ? PATCH_TYPE_ABSOLUTE : PATCH_TYPE_INDIRECT_XDI);
instrlist_init(&ilist);
/* no support for absolute addresses on x64/ARM: we always use tls */
IF_X64(ASSERT_NOT_IMPLEMENTED(!absolute && shared));
IF_ARM(ASSERT_NOT_IMPLEMENTED(!absolute && shared));
append_fcache_enter_prologue(dcontext, &ilist, absolute);
append_setup_fcache_target(dcontext, &ilist, absolute, shared);
append_call_exit_dr_hook(dcontext, &ilist, absolute, shared);
#ifdef WINDOWS
/* i#249: isolate the PEB and TEB */
preinsert_swap_peb(dcontext, &ilist, NULL, absolute, SCRATCH_REG5,
SCRATCH_REG0 /*scratch*/, false /*to app*/);
#endif
#ifdef AARCH64
/* Put app's X0, X1 in TLS_REG0_SLOT, TLS_REG1_SLOT; this is required by
* the fragment prefix.
*/
/* ldp x0, x1, [x5] */
APP(&ilist,
XINST_CREATE_load_pair(
dcontext, opnd_create_reg(DR_REG_X0), opnd_create_reg(DR_REG_X1),
opnd_create_base_disp(DR_REG_X5, DR_REG_NULL, 0, 0, OPSZ_16)));
/* stp x0, x1, [x28] */
APP(&ilist,
XINST_CREATE_store_pair(
dcontext, opnd_create_base_disp(dr_reg_stolen, DR_REG_NULL, 0, 0, OPSZ_16),
opnd_create_reg(DR_REG_X0), opnd_create_reg(DR_REG_X1)));
#endif
/* restore the original register state */
append_restore_simd_reg(dcontext, &ilist, absolute);
/* Please note that append_restore_simd_reg may change the flags. Therefore, the
* order matters.
*/
append_restore_xflags(dcontext, &ilist, absolute);
append_restore_gpr(dcontext, &ilist, absolute);
append_jmp_to_fcache_target(dcontext, &ilist, code, absolute, shared,
&patch _IF_X86_64(&jmp86_store_addr)
_IF_X86_64(&jmp86_target_addr));
/* now encode the instructions */
len = encode_with_patch_list(dcontext, &patch, &ilist, pc);
ASSERT(len != 0);
#if defined(X86) && defined(X64)
if (GENCODE_IS_X86(code->gencode_mode)) {
/* Put the absolute address in place */
ASSERT(jmp86_target_addr != NULL && jmp86_store_addr != NULL);
ASSERT(CHECK_TRUNCATE_TYPE_uint((ptr_uint_t)jmp86_target_addr));
*((uint *)jmp86_store_addr) = (uint)(ptr_uint_t)jmp86_target_addr;
}
#endif
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc + len;
}
byte *
emit_fcache_enter(dcontext_t *dcontext, generated_code_t *code, byte *pc)
{
return emit_fcache_enter_common(dcontext, code, pc, true /*absolute*/,
false /*!shared*/);
}
/* Generate a shared prologue for grabbing the dcontext into XDI
TODO: Should be used by fcache_return and shared IBL routines,
but for now some assumptions are not quite the same.
Only assumption is that xcx cannot be touched (IBL expects looked up address)
if save_xdi we assume DCONTEXT_BASE_SPILL_SLOT can be clobbered
OUTPUT: xdi contains dcontext
if save_xdi DCONTEXT_BASE_SPILL_SLOT will contain saved value
FIXME: xdx is the spill slot -- switch over to xdx as base reg?
Have to measure perf effect first (case 5239)
00: mov xdi, tls_slot_scratch2 64 89 3d 0c 0f 00 00 mov %edi -> %fs:0xf0c
07: mov tls_slot_dcontext, xdi 64 8b 3d 14 0f 00 00 mov %fs:0xf14 -> %edi
if TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask)
ASSERT_NOT_TESTED
endif
*/
void
insert_shared_get_dcontext(dcontext_t *dcontext, instrlist_t *ilist, instr_t *where,
bool save_xdi)
{
/* needed to support grabbing the dcontext w/ shared cache */
if (save_xdi) {
PRE(ilist, where,
SAVE_TO_TLS(dcontext, SCRATCH_REG5 /*xdi/r5*/, DCONTEXT_BASE_SPILL_SLOT));
}
PRE(ilist, where,
RESTORE_FROM_TLS(dcontext, SCRATCH_REG5 /*xdi/r5*/, TLS_DCONTEXT_SLOT));
if (TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask)) {
#ifdef X86
bool absolute = false;
/* PR 224798: we could avoid extra indirection by storing
* unprotected_context_t in TLS_DCONTEXT_SLOT instead of dcontext_t
*/
ASSERT_NOT_TESTED();
/* we'd need a 3rd slot in order to nicely get unprot ptr into esi
* we can do it w/ only 2 slots by clobbering dcontext ptr
* (we could add base reg info to RESTORE_FROM_DC/SAVE_TO_DC and go
* straight through esi to begin w/ and subtract one instr (xchg)
*/
PRE(ilist, where, RESTORE_FROM_DC(dcontext, SCRATCH_REG5, PROT_OFFS));
PRE(ilist, where,
INSTR_CREATE_xchg(dcontext, opnd_create_reg(SCRATCH_REG4),
opnd_create_reg(SCRATCH_REG5)));
PRE(ilist, where, SAVE_TO_DC(dcontext, SCRATCH_REG5, SCRATCH_REG4_OFFS));
PRE(ilist, where, RESTORE_FROM_TLS(dcontext, SCRATCH_REG5, TLS_DCONTEXT_SLOT));
#elif defined(ARM)
/* FIXMED i#1551: NYI on ARM */
ASSERT_NOT_REACHED();
#endif
}
}
/* restore XDI through TLS */
void
insert_shared_restore_dcontext_reg(dcontext_t *dcontext, instrlist_t *ilist,
instr_t *where)
{
PRE(ilist, where,
RESTORE_FROM_TLS(dcontext, SCRATCH_REG5 /*xdi/r5*/, DCONTEXT_BASE_SPILL_SLOT));
}
/* append instructions to prepare for fcache return:
* i.e., far jump to switch mode, load dcontext, etc.
*
* # on X86
* ifdef X64 and (source is x86 mode)
* far direct jmp to next instr w/ 64-bit switch
* endif
*
* if (!absolute)
* mov %xdi,fs:xdx_OFFSET
* mov fs:dcontext,%xdi
* if (TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask))
* RESTORE_FROM_DCONTEXT PROT_OFFSET,%xdi
* xchg %xsi,%xdi
* SAVE_TO_UPCONTEXT %xdi,xsi_OFFSET
* mov fs:dcontext,%xdi
* endif
* # get xax and xdi into their real slots, via xbx
* SAVE_TO_UPCONTEXT %xbx,xbx_OFFSET
* mov fs:xax_OFFSET,%xbx
* SAVE_TO_UPCONTEXT %xbx,xax_OFFSET
* mov fs:xdx_OFFSET,%xbx
* SAVE_TO_UPCONTEXT %xbx,xdi_OFFSET
* endif
*/
static bool
append_prepare_fcache_return(dcontext_t *dcontext, generated_code_t *code,
instrlist_t *ilist, bool absolute, bool shared)
{
bool instr_targets = false;
#ifdef X86_64
if (GENCODE_IS_X86(code->gencode_mode)) {
instr_t *label = INSTR_CREATE_label(dcontext);
instr_t *ljmp =
INSTR_CREATE_jmp_far(dcontext, opnd_create_far_instr(CS64_SELECTOR, label));
instr_set_x86_mode(ljmp, true /*x86*/);
APP(ilist, ljmp);
APP(ilist, label);
instr_targets = true;
}
#endif /* X86_64 */
if (absolute)
return instr_targets;
/* only support non-absolute w/ shared cache */
ASSERT_NOT_IMPLEMENTED(shared);
/* xax is in 1 scratch slot, so we have to use a 2nd scratch
* slot in order to get dcontext into xdi
*/
APP(ilist, SAVE_TO_TLS(dcontext, REG_DCTXT, DCONTEXT_BASE_SPILL_SLOT));
APP(ilist, RESTORE_FROM_TLS(dcontext, REG_DCTXT, TLS_DCONTEXT_SLOT));
if (TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask)) {
#ifdef X86
/* we'd need a 3rd slot in order to nicely get unprot ptr into xsi
* we can do it w/ only 2 slots by clobbering dcontext ptr
* (we could add base reg info to RESTORE_FROM_DC/SAVE_TO_DC and go
* straight through xsi to begin w/ and subtract one instr (xchg)
*/
ASSERT_NOT_TESTED();
APP(ilist, RESTORE_FROM_DC(dcontext, SCRATCH_REG5, PROT_OFFS));
APP(ilist,
INSTR_CREATE_xchg(dcontext, opnd_create_reg(SCRATCH_REG4),
opnd_create_reg(SCRATCH_REG5)));
APP(ilist, SAVE_TO_DC(dcontext, SCRATCH_REG5, SCRATCH_REG4_OFFS));
APP(ilist, RESTORE_FROM_TLS(dcontext, SCRATCH_REG5, TLS_DCONTEXT_SLOT));
#elif defined(ARM)
/* FIXME i#1551: NYI on ARM */
ASSERT_NOT_REACHED();
#endif /* X86/ARM */
}
return instr_targets;
}
static void
append_call_dispatch(dcontext_t *dcontext, instrlist_t *ilist, bool absolute)
{
/* call central d_r_dispatch routine */
/* for x64 linux we could optimize and avoid the "mov rdi, rdi" */
/* for ARM we use _noreturn to avoid storing to %lr */
dr_insert_call_noreturn(
(void *)dcontext, ilist, NULL /*append*/, (void *)d_r_dispatch, 1,
absolute ? OPND_CREATE_INTPTR((ptr_int_t)dcontext) : opnd_create_reg(REG_DCTXT));
/* d_r_dispatch() shouldn't return! */
insert_reachable_cti(dcontext, ilist, NULL, vmcode_get_start(),
(byte *)unexpected_return, true /*jmp*/, false /*!returns*/,
false /*!precise*/, DR_REG_R11 /*scratch*/, NULL);
}
/*
* # fcache_return: context switch back to DynamoRIO.
* # Invoked via
* # a) from the fcache via a fragment exit stub,
* # b) from indirect_branch_lookup().
* # Invokes d_r_dispatch() with a clean dstack.
* # Assumptions:
* # 1) app's value in xax/r0 already saved in dcontext.
* # 2) xax/r0 holds the linkstub ptr
* #
*
* fcache_return:
* # append_fcache_return_prologue
* ifdef X64 and (source is x86 mode)
* far direct jmp to next instr w/ 64-bit switch
* endif
*
* if (!absolute)
* mov %xdi,fs:xdx_OFFSET
* mov fs:dcontext,%xdi
* if (TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask))
* RESTORE_FROM_DCONTEXT PROT_OFFSET,%xdi
* xchg %xsi,%xdi
* SAVE_TO_UPCONTEXT %xdi,xsi_OFFSET
* mov fs:dcontext,%xdi
* endif
* endif
*
* # append_save_gpr
* if (!absolute)
* # get xax and xdi into their real slots, via xbx
* SAVE_TO_UPCONTEXT %xbx,xbx_OFFSET
* mov fs:xax_OFFSET,%xbx
* SAVE_TO_UPCONTEXT %xbx,xax_OFFSET
* mov fs:xdx_OFFSET,%xbx
* SAVE_TO_UPCONTEXT %xbx,xdi_OFFSET
* endif
*
* # save the current register state to context->regs
* # xax already in context
*
* if (absolute)
* SAVE_TO_UPCONTEXT %xbx,xbx_OFFSET
* endif
* SAVE_TO_UPCONTEXT %xcx,xcx_OFFSET
* SAVE_TO_UPCONTEXT %xdx,xdx_OFFSET
* if (absolute || !TEST(SELFPROT_DCONTEXT, dynamo_options.protect_mask))
* SAVE_TO_UPCONTEXT %xsi,xsi_OFFSET
* endif
* if (absolute)
* SAVE_TO_UPCONTEXT %xdi,xdi_OFFSET
* endif
* SAVE_TO_UPCONTEXT %xbp,xbp_OFFSET
* SAVE_TO_UPCONTEXT %xsp,xsp_OFFSET
* ifdef X64
* SAVE_TO_UPCONTEXT %r8,r8_OFFSET
* SAVE_TO_UPCONTEXT %r9,r9_OFFSET
* SAVE_TO_UPCONTEXT %r10,r10_OFFSET
* SAVE_TO_UPCONTEXT %r11,r11_OFFSET
* SAVE_TO_UPCONTEXT %r12,r12_OFFSET
* SAVE_TO_UPCONTEXT %r13,r13_OFFSET
* SAVE_TO_UPCONTEXT %r14,r14_OFFSET
* SAVE_TO_UPCONTEXT %r15,r15_OFFSET
* endif
*
* # switch to clean dstack
* RESTORE_FROM_DCONTEXT dstack_OFFSET,%xsp
*
* # append_save_clear_xflags
* # now save eflags -- too hard to do without a stack!
* pushf # push eflags on stack
* pop %xbx # grab eflags value
* SAVE_TO_UPCONTEXT %xbx,xflags_OFFSET # save eflags value
*
* # append_save_simd_reg
* if preserve_xmm_caller_saved
* if (ZMM_ENABLED()) # this is evaluated at *generation time*
* if (!d_r_is_avx512_code_in_use()) # this is evaluated at *runtime*
* SAVE_TO_UPCONTEXT %ymm0,simd_OFFSET+0*64
* SAVE_TO_UPCONTEXT %ymm1,simd_OFFSET+1*64
* SAVE_TO_UPCONTEXT %ymm2,simd_OFFSET+2*64
* SAVE_TO_UPCONTEXT %ymm3,simd_OFFSET+3*64
* SAVE_TO_UPCONTEXT %ymm4,simd_OFFSET+4*64
* SAVE_TO_UPCONTEXT %ymm5,simd_OFFSET+5*64
* SAVE_TO_UPCONTEXT %ymm6,simd_OFFSET+6*64
* SAVE_TO_UPCONTEXT %ymm7,simd_OFFSET+7*64 # 32-bit Linux
* ifdef X64
* SAVE_TO_UPCONTEXT %ymm8,simd_OFFSET+8*64
* SAVE_TO_UPCONTEXT %ymm9,simd_OFFSET+9*64
* SAVE_TO_UPCONTEXT %ymm10,simd_OFFSET+10*64
* SAVE_TO_UPCONTEXT %ymm11,simd_OFFSET+11*64
* SAVE_TO_UPCONTEXT %ymm12,simd_OFFSET+12*64
* SAVE_TO_UPCONTEXT %ymm13,simd_OFFSET+13*64
* SAVE_TO_UPCONTEXT %ymm14,simd_OFFSET+14*64
* SAVE_TO_UPCONTEXT %ymm15,simd_OFFSET+15*64
* endif
* else # d_r_is_avx512_code_in_use()
* SAVE_TO_UPCONTEXT %zmm0,simd_OFFSET+0*64
* SAVE_TO_UPCONTEXT %zmm1,simd_OFFSET+1*64
* SAVE_TO_UPCONTEXT %zmm2,simd_OFFSET+2*64
* SAVE_TO_UPCONTEXT %zmm3,simd_OFFSET+3*64
* SAVE_TO_UPCONTEXT %zmm4,simd_OFFSET+4*64
* SAVE_TO_UPCONTEXT %zmm5,simd_OFFSET+5*64
* SAVE_TO_UPCONTEXT %zmm6,simd_OFFSET+6*64
* SAVE_TO_UPCONTEXT %zmm7,simd_OFFSET+7*64
* ifdef X64
* SAVE_TO_UPCONTEXT %zmm8,simd_OFFSET+8*64
* SAVE_TO_UPCONTEXT %zmm9,simd_OFFSET+9*64
* SAVE_TO_UPCONTEXT %zmm10,simd_OFFSET+10*64
* SAVE_TO_UPCONTEXT %zmm11,simd_OFFSET+11*64
* SAVE_TO_UPCONTEXT %zmm12,simd_OFFSET+12*64
* SAVE_TO_UPCONTEXT %zmm13,simd_OFFSET+13*64
* SAVE_TO_UPCONTEXT %zmm14,simd_OFFSET+14*64
* SAVE_TO_UPCONTEXT %zmm15,simd_OFFSET+15*64
* SAVE_TO_UPCONTEXT %zmm16,simd_OFFSET+16*64
* SAVE_TO_UPCONTEXT %zmm17,simd_OFFSET+17*64
* SAVE_TO_UPCONTEXT %zmm18,simd_OFFSET+18*64
* SAVE_TO_UPCONTEXT %zmm19,simd_OFFSET+19*64
* SAVE_TO_UPCONTEXT %zmm20,simd_OFFSET+20*64
* SAVE_TO_UPCONTEXT %zmm21,simd_OFFSET+21*64
* SAVE_TO_UPCONTEXT %zmm22,simd_OFFSET+22*64
* SAVE_TO_UPCONTEXT %zmm23,simd_OFFSET+23*64
* SAVE_TO_UPCONTEXT %zmm24,simd_OFFSET+24*64
* SAVE_TO_UPCONTEXT %zmm25,simd_OFFSET+25*64
* SAVE_TO_UPCONTEXT %zmm26,simd_OFFSET+26*64
* SAVE_TO_UPCONTEXT %zmm27,simd_OFFSET+27*64
* SAVE_TO_UPCONTEXT %zmm28,simd_OFFSET+28*64
* SAVE_TO_UPCONTEXT %zmm29,simd_OFFSET+29*64
* SAVE_TO_UPCONTEXT %zmm30,simd_OFFSET+30*64
* SAVE_TO_UPCONTEXT %zmm31,simd_OFFSET+31*64
* endif
* SAVE_TO_UPCONTEXT %k0,opmask_OFFSET+0*8
* SAVE_TO_UPCONTEXT %k1,opmask_OFFSET+1*8
* SAVE_TO_UPCONTEXT %k2,opmask_OFFSET+2*8
* SAVE_TO_UPCONTEXT %k3,opmask_OFFSET+3*8
* SAVE_TO_UPCONTEXT %k4,opmask_OFFSET+4*8
* SAVE_TO_UPCONTEXT %k5,opmask_OFFSET+5*8
* SAVE_TO_UPCONTEXT %k6,opmask_OFFSET+6*8
* SAVE_TO_UPCONTEXT %k7,opmask_OFFSET+7*8
* endif
* endif
* endif
*
* # clear eflags now to avoid app's eflags messing up our ENTER_DR_HOOK
* # FIXME: this won't work at CPL0 if we ever run there!
* push 0
* popf
*
* # append_call_enter_dr_hook
* if (ENTER_DR_HOOK != NULL && !dcontext->ignore_enterexit)
* # don't bother to save any registers around call except for xax
* # and xcx, which holds next_tag
* push %xcx
* if (!absolute)
* push %xdi
* push %xsi
* endif
* push %xax
* if (absolute)
* # support for skipping the hook (note: 32-bits even on x64)
* RESTORE_FROM_UPCONTEXT ignore_enterexit_OFFSET,%edi
* cmp %edi,0
* jnz post_hook
* endif
* # for x64 windows, reserve 32 bytes stack space for call prior to call
* call ENTER_DR_HOOK
*
* post_hook:
* pop %xax
* if (!absolute)
* pop %xsi
* pop %xdi
* endif
* pop %xcx
* endif
*
* # save last_exit, currently in eax, into dcontext->last_exit
* SAVE_TO_DCONTEXT %xax,last_exit_OFFSET
*
* .ifdef WINDOWS && CLIENT_INTERFACE
* swap_peb
* .endif
*
* .ifdef SIDELINE
* # clear cur-trace field so we don't think cur trace is still running
* movl $0, _sideline_trace
* .endif
*
* # call central d_r_dispatch routine w/ dcontext as an argument
* if (absolute)
* push <dcontext>
* else
* push %xdi # for x64, mov %xdi, ARG1
* endif
* call d_r_dispatch # for x64 windows, reserve 32 bytes stack space for call
* # d_r_dispatch() shouldn't return!
* jmp unexpected_return
*/
/* N.B.: this routine is used to generate both the regular fcache_return
* and a slightly different copy that is used for the miss/unlinked paths
* for indirect_branch_lookup for self-protection.
* ibl_end should be true only for that end of the lookup routine.
*
* If linkstub != NULL, used for coarse fragments, this routine assumes that:
* - app xax is still in %xax
* - next target pc is in DIRECT_STUB_SPILL_SLOT tls
* - linkstub is the linkstub_t to pass back to d_r_dispatch
* - if coarse_info:
* - app xcx is in MANGLE_XCX_SPILL_SLOT
* - source coarse info is in %xcx
*
* We assume this routine does not use TLS slot FLOAT_PC_STATE_SLOT (TLS_REG1_SLOT).
*/
bool
append_fcache_return_common(dcontext_t *dcontext, generated_code_t *code,
instrlist_t *ilist, bool ibl_end, bool absolute, bool shared,
linkstub_t *linkstub, bool coarse_info)
{
bool instr_targets;
/* no support for absolute addresses on x64: we always use tls */
IF_X64(ASSERT_NOT_IMPLEMENTED(!absolute && shared));
/* currently linkstub is only used for coarse-grain exits */
ASSERT(linkstub == NULL || !absolute);
instr_targets = append_prepare_fcache_return(dcontext, code, ilist, absolute, shared);
append_save_gpr(dcontext, ilist, ibl_end, absolute, code, linkstub, coarse_info);
/* Switch to a clean dstack as part of our scheme to avoid state kept
* unprotected across cache executions.
* FIXME: this isn't perfect: we switch to the dstack BEFORE we call
* the entrance hook that will be used to coordinate other threads,
* so if our hook suspends all other threads to protect vs cross-thread
* attacks, the dstack is not perfectly protected.
*/
#ifdef AARCH64
APP(ilist, RESTORE_FROM_DC(dcontext, DR_REG_X1, DSTACK_OFFSET));
APP(ilist,
XINST_CREATE_move(dcontext, opnd_create_reg(DR_REG_SP),
opnd_create_reg(DR_REG_X1)));
#else
APP(ilist, RESTORE_FROM_DC(dcontext, REG_XSP, DSTACK_OFFSET));
#endif
append_save_clear_xflags(dcontext, ilist, absolute);
/* Please note that append_save_simd_reg may change the flags. Therefore, the
* order matters.
*/
append_save_simd_reg(dcontext, ilist, absolute);
#ifdef X86
instr_targets = ZMM_ENABLED() || instr_targets;
#endif
instr_targets =
append_call_enter_dr_hook(dcontext, ilist, ibl_end, absolute) || instr_targets;
/* save last_exit, currently in scratch_reg0 into dcontext->last_exit */
APP(ilist, SAVE_TO_DC(dcontext, SCRATCH_REG0, LAST_EXIT_OFFSET));
#ifdef WINDOWS
/* i#249: isolate the PEB and TEB */
preinsert_swap_peb(dcontext, ilist, NULL, absolute, SCRATCH_REG5,
SCRATCH_REG0 /*scratch*/, true /*to priv*/);
#endif
#ifdef SIDELINE
if (dynamo_options.sideline) {
/* clear cur-trace field so we don't think cur trace is still running */
/* PR 248210: unsupported feature on x64 */
IF_X64(ASSERT_NOT_IMPLEMENTED(false)); /* PR 244737: fix abs address */
APP(ilist,
XINST_CREATE_store(dcontext,
OPND_CREATE_MEM32(REG_NULL, (int)&sideline_trace),
OPND_CREATE_INT32(0)));
}
#endif
append_call_dispatch(dcontext, ilist, absolute);
return instr_targets;
}
byte *
emit_fcache_return(dcontext_t *dcontext, generated_code_t *code, byte *pc)
{
bool instr_targets;
instrlist_t ilist;
instrlist_init(&ilist);
instr_targets = append_fcache_return_common(
dcontext, code, &ilist, false /*!ibl_end*/, true /*absolute*/, false /*!shared*/,
NULL, false /*not coarse*/);
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, instr_targets);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
byte *
emit_fcache_enter_shared(dcontext_t *dcontext, generated_code_t *code, byte *pc)
{
return emit_fcache_enter_common(dcontext, code, pc, false /*through xdi*/,
true /*shared*/);
}
byte *
emit_fcache_return_shared(dcontext_t *dcontext, generated_code_t *code, byte *pc)
{
bool instr_targets;
instrlist_t ilist;
instrlist_init(&ilist);
instr_targets = append_fcache_return_common(
dcontext, code, &ilist, false /*!ibl_end*/, false /*through xdi*/,
true /*shared*/, NULL, false /*not coarse*/);
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, instr_targets);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
byte *
emit_fcache_return_coarse(dcontext_t *dcontext, generated_code_t *code, byte *pc)
{
bool instr_targets;
linkstub_t *linkstub = (linkstub_t *)get_coarse_exit_linkstub();
instrlist_t ilist;
instrlist_init(&ilist);
instr_targets = append_fcache_return_common(
dcontext, code, &ilist, false /*!ibl_end*/, false /*through xdi*/,
true /*shared*/, linkstub, true /*coarse info in xcx*/);
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, instr_targets);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
byte *
emit_trace_head_return_coarse(dcontext_t *dcontext, generated_code_t *code, byte *pc)
{
/* Could share tail end of coarse_fcache_return instead of duplicating */
bool instr_targets;
linkstub_t *linkstub = (linkstub_t *)get_coarse_trace_head_exit_linkstub();
instrlist_t ilist;
instrlist_init(&ilist);
instr_targets = append_fcache_return_common(
dcontext, code, &ilist, false /*!ibl_end*/, false /*through xdi*/,
true /*shared*/, linkstub, false /*no coarse info*/);
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, instr_targets);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
/* Our coarse entrance stubs have several advantages, such as eliminating
* future fragments, but their accompanying lazy linking does need source
* information that is not available in each stub. We instead have an
* unlinked entrance stub target a per-unit prefix that records the source
* unit. We can then search within the unit to identify the actual source
* entrance stub, which is enough for lazy linking (but does not find the
* unique source tag: case 8565). This also gives us a single indirection
* point in the form of the prefix at which to patch the fcache_return target.
* We also place in the prefix indirection points for trace head cache exit and
* the 3 coarse ibl targets, to keep the cache read-only and (again) make it
* easier to patch when persisting/sharing.
*/
uint
coarse_exit_prefix_size(coarse_info_t *info)
{
#if defined(X86) && defined(X64)
uint flags = COARSE_32_FLAG(info);
#endif
/* FIXME: would be nice to use size calculated in emit_coarse_exit_prefix(),
* but we need to know size before we emit and would have to do a throwaway
* emit, or else set up a template to be patched w/ specific info field.
* Also we'd have to unprot .data as we don't access this until post-init.
*/
/* We don't need to require addr16: in fact it might be better to force
* not using it, so if we persist on P4 but run on Core we don't lose
* performance. We have enough space.
*/
#ifdef X86
return SIZE_MOV_XBX_TO_TLS(flags, false) + SIZE_MOV_PTR_IMM_TO_XAX(flags) +
5 * JMP_LONG_LENGTH;
#else
/* FIXME i#1575: implement coarse-grain support; move to arch-specific dir? */
ASSERT_NOT_IMPLEMENTED(false);
return 0;
#endif
}
byte *
emit_coarse_exit_prefix(dcontext_t *dcontext, byte *pc, coarse_info_t *info)
{
byte *ibl;
DEBUG_DECLARE(byte *start_pc = pc;)
instrlist_t ilist;
patch_list_t patch;
instr_t *fcache_ret_prefix;
#if defined(X86) && defined(X64)
gencode_mode_t mode = FRAGMENT_GENCODE_MODE(COARSE_32_FLAG(info));
#endif
instrlist_init(&ilist);
init_patch_list(&patch, PATCH_TYPE_INDIRECT_FS);
/* prefix looks like this, using xcx instead of xbx just to make
* the fcache_return code simpler (as it already uses xbx early),
* and using the info as we're doing per-cache and not per-unit:
*
* fcache_return_coarse_prefix:
* 6/9 mov %xcx, MANGLE_XCX_SPILL_SLOT
* 5/10 mov <info ptr>, %xcx
* 5 jmp fcache_return_coarse
* trace_head_return_coarse_prefix:
* 5 jmp trace_head_return_coarse
* (if -disable_traces, it jmps to fcache_return_coarse_prefix instead)
* coarse_ibl_ret_prefix:
* 5 jmp coarse_ibl_ret
* coarse_ibl_call_prefix:
* 5 jmp coarse_ibl_call
* coarse_ibl_jmp_prefix:
* 5 jmp coarse_ibl_jmp
*
* We assume that info ptr is at
* trace_head_return_prefix - JMP_LONG_LENGTH - 4
* in patch_coarse_exit_prefix().
* We assume that the ibl prefixes are nothing but jmps in
* coarse_indirect_stub_jmp_target() so we can recover the ibl type.
*
* FIXME case 9647: on P4 our jmp->jmp sequence will be
* elided, but on Core we may want to switch to a jmp*, though
* since we have no register for a base ptr we'd need a reloc
* entry for every single stub
*/
/* entrance stub has put target_tag into xax-slot so we use xcx-slot */
ASSERT(DIRECT_STUB_SPILL_SLOT != MANGLE_XCX_SPILL_SLOT);
fcache_ret_prefix = INSTR_CREATE_label(dcontext);
APP(&ilist, fcache_ret_prefix);
#if defined(X86) && defined(X64)
if (TEST(PERSCACHE_X86_32, info->flags)) {
/* XXX: this won't work b/c opnd size will be wrong */
ASSERT_NOT_IMPLEMENTED(false && "must pass opnd size to SAVE_TO_TLS");
APP(&ilist, SAVE_TO_TLS(dcontext, REG_ECX, MANGLE_XCX_SPILL_SLOT));
/* We assume all our data structures are <4GB which is guaranteed for
* WOW64 processes.
*/
ASSERT(CHECK_TRUNCATE_TYPE_int((ptr_int_t)info));
APP(&ilist,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(REG_ECX),
OPND_CREATE_INT32((int)(ptr_int_t)info)));
} else { /* default code */
if (GENCODE_IS_X86_TO_X64(mode) && DYNAMO_OPTION(x86_to_x64_ibl_opt))
APP(&ilist, SAVE_TO_REG(dcontext, SCRATCH_REG2, REG_R9));
else
#endif
APP(&ilist,
SAVE_TO_TLS(dcontext, SCRATCH_REG2 /*xcx/r2*/, MANGLE_XCX_SPILL_SLOT));
APP(&ilist,
XINST_CREATE_load_int(dcontext, opnd_create_reg(SCRATCH_REG2 /*xcx/r2*/),
OPND_CREATE_INTPTR((ptr_int_t)info)));
#if defined(X86) && defined(X64)
}
#endif
APP(&ilist,
XINST_CREATE_jump(
dcontext,
opnd_create_pc(get_direct_exit_target(
dcontext, FRAG_SHARED | FRAG_COARSE_GRAIN | COARSE_32_FLAG(info)))));
APP(&ilist, INSTR_CREATE_label(dcontext));
add_patch_marker(&patch, instrlist_last(&ilist), PATCH_ASSEMBLE_ABSOLUTE,
0 /* start of instr */,
(ptr_uint_t *)&info->trace_head_return_prefix);
if (DYNAMO_OPTION(disable_traces) ||
/* i#670: the stub stored the abs addr at persist time. we need
* to adjust to the use-time mod base which we do in d_r_dispatch
* but we need to set the dcontext->coarse_exit so we go through
* the fcache return
*/
(info->frozen && info->mod_shift != 0)) {
/* trace_t heads need to store the info ptr for lazy linking */
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_instr(fcache_ret_prefix)));
} else {
APP(&ilist,
XINST_CREATE_jump(
dcontext,
opnd_create_pc(trace_head_return_coarse_routine(IF_X86_64(mode)))));
}
/* coarse does not support IBL_FAR so we don't bother with get_ibl_entry_type() */
ibl = get_ibl_routine_ex(
dcontext, IBL_LINKED,
get_source_fragment_type(dcontext, FRAG_SHARED | FRAG_COARSE_GRAIN),
IBL_RETURN _IF_X86_64(mode));
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(ibl)));
add_patch_marker(&patch, instrlist_last(&ilist), PATCH_ASSEMBLE_ABSOLUTE,
0 /* start of instr */, (ptr_uint_t *)&info->ibl_ret_prefix);
ibl = get_ibl_routine_ex(
dcontext, IBL_LINKED,
get_source_fragment_type(dcontext, FRAG_SHARED | FRAG_COARSE_GRAIN),
IBL_INDCALL _IF_X86_64(mode));
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(ibl)));
add_patch_marker(&patch, instrlist_last(&ilist), PATCH_ASSEMBLE_ABSOLUTE,
0 /* start of instr */, (ptr_uint_t *)&info->ibl_call_prefix);
ibl = get_ibl_routine_ex(
dcontext, IBL_LINKED,
get_source_fragment_type(dcontext, FRAG_SHARED | FRAG_COARSE_GRAIN),
IBL_INDJMP _IF_X86_64(mode));
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(ibl)));
add_patch_marker(&patch, instrlist_last(&ilist), PATCH_ASSEMBLE_ABSOLUTE,
0 /* start of instr */, (ptr_uint_t *)&info->ibl_jmp_prefix);
/* now encode the instructions */
pc += encode_with_patch_list(dcontext, &patch, &ilist, pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
ASSERT((size_t)(pc - start_pc) == coarse_exit_prefix_size(info));
DOLOG(3, LOG_EMIT, {
byte *dpc = start_pc;
LOG(GLOBAL, LOG_EMIT, 3, "\nprefixes for coarse unit %s:\n", info->module);
do {
if (dpc == info->fcache_return_prefix)
LOG(GLOBAL, LOG_EMIT, 3, "fcache_return_coarse_prefix:\n");
else if (dpc == info->trace_head_return_prefix)
LOG(GLOBAL, LOG_EMIT, 3, "trace_head_return_coarse_prefix:\n");
else if (dpc == info->ibl_ret_prefix)
LOG(GLOBAL, LOG_EMIT, 3, "ibl_coarse_ret_prefix:\n");
else if (dpc == info->ibl_call_prefix)
LOG(GLOBAL, LOG_EMIT, 3, "ibl_coarse_call_prefix:\n");
else if (dpc == info->ibl_jmp_prefix)
LOG(GLOBAL, LOG_EMIT, 3, "ibl_coarse_jmp_prefix:\n");
dpc = disassemble_with_bytes(dcontext, dpc, GLOBAL);
} while (dpc < pc);
LOG(GLOBAL, LOG_EMIT, 3, "\n");
});
return pc;
}
/* Update info pointer in exit prefixes */
void
patch_coarse_exit_prefix(dcontext_t *dcontext, coarse_info_t *info)
{
ptr_uint_t *pc =
(ptr_uint_t *)(info->trace_head_return_prefix - JMP_LONG_LENGTH - sizeof(info));
*pc = (ptr_uint_t)info;
}
#ifdef HASHTABLE_STATISTICS
/* note that arch_thread_init is called before fragment_thread_init,
* so these need to be updated
*/
/* When used in a thread-shared routine, this routine clobbers XDI. The
* caller should spill & restore it or rematerialize it as needed. */
/* NOTE - this routine does NOT save the eflags, which will be clobbered by the
* inc */
void
append_increment_counter(dcontext_t *dcontext, instrlist_t *ilist, ibl_code_t *ibl_code,
patch_list_t *patch,
reg_id_t entry_register, /* register indirect (XCX) or NULL */
/* adjusted to unprot_ht_statistics_t if no entry_register */
uint counter_offset, reg_id_t scratch_register)
{
# ifdef X86
instr_t *counter;
# endif
bool absolute = !ibl_code->thread_shared_routine;
/* no support for absolute addresses on x64: we always use tls/reg */
IF_X64(ASSERT_NOT_IMPLEMENTED(!absolute));
if (!INTERNAL_OPTION(hashtable_ibl_stats))
return;
LOG(THREAD, LOG_EMIT, 3,
"append_increment_counter: hashtable_stats_offset=0x%x counter_offset=0x%x\n",
ibl_code->hashtable_stats_offset, counter_offset);
if (entry_register == REG_NULL) {
/* adjust offset within a unprot_ht_statistics_t structure */
counter_offset += ibl_code->hashtable_stats_offset;
}
if (!absolute) {
opnd_t counter_opnd;
/* get dcontext in register (xdi) */
insert_shared_get_dcontext(dcontext, ilist, NULL, false /* dead register */);
/* XDI now has dcontext */
APP(ilist,
XINST_CREATE_load(
dcontext, opnd_create_reg(SCRATCH_REG5 /*xdi/r5*/),
OPND_DC_FIELD(absolute, dcontext, OPSZ_PTR, FRAGMENT_FIELD_OFFSET)));
/* XDI now has per_thread_t structure */
/* an extra step here: find the unprot_stats field in the fragment_table_t
* could avoid for protect_mask==0 if we always had a copy
* in the per_thread_t struct -- see fragment.h, not worth it
*/
if (entry_register != REG_NULL) {
APP(ilist,
XINST_CREATE_load(
dcontext, opnd_create_reg(SCRATCH_REG5 /*xdi/r5*/),
OPND_CREATE_MEMPTR(SCRATCH_REG5 /*xdi/r5*/,
ibl_code->entry_stats_to_lookup_table_offset)));
/* XDI should now have (entry_stats - lookup_table) value,
* so we need [xdi+xcx] to get an entry reference
*/
counter_opnd = opnd_create_base_disp(SCRATCH_REG5 /*xdi/r5*/, entry_register,
1, counter_offset, OPSZ_4);
} else {
APP(ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG5 /*xdi/r5*/),
OPND_CREATE_MEMPTR(SCRATCH_REG5 /*xdi/r5*/,
ibl_code->unprot_stats_offset)));
/* XDI now has unprot_stats structure */
counter_opnd = OPND_CREATE_MEM32(SCRATCH_REG5 /*xdi/r5*/, counter_offset);
}
# ifdef X86
counter = INSTR_CREATE_inc(dcontext, counter_opnd);
APP(ilist, counter);
# elif defined(ARM)
/* FIXMED i#1551: NYI on ARM */
ASSERT_NOT_IMPLEMENTED(false);
# endif
} else {
# ifdef X86
/* TAKE_ADDRESS will in fact add the necessary base to the statistics structure,
hence no explicit indirection needed here */
opnd_t counter_opnd = OPND_CREATE_MEMPTR(entry_register, counter_offset);
counter = INSTR_CREATE_inc(dcontext, counter_opnd);
/* hack to get both this table's unprot offset and the specific stat's offs */
ASSERT(counter_offset < USHRT_MAX);
if (entry_register != REG_NULL) {
/* although we currently don't use counter_offset,
* it doesn't hurt to support as well
*/
ASSERT(ibl_code->entry_stats_to_lookup_table_offset < USHRT_MAX);
add_patch_entry(patch, counter, PATCH_UNPROT_STAT | PATCH_TAKE_ADDRESS,
(ibl_code->entry_stats_to_lookup_table_offset << 16) |
counter_offset);
} else {
ASSERT(ibl_code->unprot_stats_offset < USHRT_MAX);
add_patch_entry(patch, counter, PATCH_UNPROT_STAT | PATCH_TAKE_ADDRESS,
(ibl_code->unprot_stats_offset << 16) | counter_offset);
}
APP(ilist, counter);
# elif defined(ARM)
/* FIXMED i#1551: NYI on ARM */
ASSERT_NOT_IMPLEMENTED(false);
# endif
}
}
#endif /* HASHTABLE_STATISTICS */
#ifdef INTERNAL
/* add a slowdown loop to measure if a routine is likely to be on a critical path */
/* note that FLAGS are clobbered */
static void
append_empty_loop(dcontext_t *dcontext, instrlist_t *ilist, uint iterations,
reg_id_t scratch_register)
{
# ifdef X86
instr_t *initloop;
instr_t *loop;
/* mov ebx, iterations */
/* loop: dec ebx */
/* jnz loop */
ASSERT(REG_NULL != scratch_register);
initloop = XINST_CREATE_load_int(dcontext, opnd_create_reg(scratch_register),
OPND_CREATE_INT32(iterations));
loop = INSTR_CREATE_dec(dcontext, opnd_create_reg(scratch_register));
APP(ilist, initloop);
APP(ilist, loop);
APP(ilist, INSTR_CREATE_jcc(dcontext, OP_jnz_short, opnd_create_instr(loop)));
# elif defined(ARM)
/* FIXMED i#1551: NYI on ARM */
ASSERT_NOT_IMPLEMENTED(false);
# endif
}
#endif /* INTERNAL */
#if defined(X86) && defined(X64)
void
instrlist_convert_to_x86(instrlist_t *ilist)
{
instr_t *in;
for (in = instrlist_first(ilist); in != NULL; in = instr_get_next(in)) {
instr_set_x86_mode(in, true /*x86*/);
instr_shrink_to_32_bits(in);
}
}
#endif
#ifndef AARCH64
bool
instr_is_ibl_hit_jump(instr_t *instr)
{
/* ARM and x86 use XINST_CREATE_jump_mem() */
return instr_is_jump_mem(instr);
}
#endif
/* what we do on a hit in the hashtable */
/* Restore XBX saved from the indirect exit stub insert_jmp_to_ibl() */
/* Indirect jump through hashtable entry pointed to by XCX */
void
append_ibl_found(dcontext_t *dcontext, instrlist_t *ilist, ibl_code_t *ibl_code,
patch_list_t *patch, uint start_pc_offset, bool collision,
bool only_spill_state_in_tls, /* if true, no table info in TLS;
* indirection off of XDI is used */
bool restore_eflags, instr_t **fragment_found)
{
bool absolute = !ibl_code->thread_shared_routine;
bool target_prefix = true;
/* eflags and xcx are restored in the target's prefix */
/* if thread private routine */
/*>>> RESTORE_FROM_UPCONTEXT xbx_OFFSET,%xbx */
/*>>> jmp *FRAGMENT_START_PC_OFFS(%xcx) */
instr_t *inst = NULL;
IF_X86_64(bool x86_to_x64_ibl_opt =
(ibl_code->x86_to_x64_mode && DYNAMO_OPTION(x86_to_x64_ibl_opt));)
/* no support for absolute addresses on x64: we always use tls/reg */
IF_X64(ASSERT_NOT_IMPLEMENTED(!absolute));
if (absolute) {
inst = RESTORE_FROM_DC(dcontext, SCRATCH_REG1, SCRATCH_REG1_OFFS);
}
if (!ibl_use_target_prefix(ibl_code)) {
target_prefix = false;
restore_eflags = true;
}
#ifdef HASHTABLE_STATISTICS
if (INTERNAL_OPTION(hashtable_ibl_stats) ||
INTERNAL_OPTION(hashtable_ibl_entry_stats)) {
if (!absolute && !only_spill_state_in_tls) {
/* XDI holds app state, not a ptr to dcontext+<some offset> */
APP(ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG5, HTABLE_STATS_SPILL_SLOT));
}
append_increment_counter(dcontext, ilist, ibl_code, patch, REG_NULL,
HASHLOOKUP_STAT_OFFS(hit), SCRATCH_REG1);
if (collision) {
append_increment_counter(dcontext, ilist, ibl_code, patch, REG_NULL,
HASHLOOKUP_STAT_OFFS(collision_hit), SCRATCH_REG1);
}
if (INTERNAL_OPTION(hashtable_ibl_entry_stats)) {
/* &lookup_table[i] - should allow access to &entry_stats[i] */
append_increment_counter(dcontext, ilist, ibl_code, patch, SCRATCH_REG2,
offsetof(fragment_stat_entry_t, hits), SCRATCH_REG1);
}
if (!absolute && !only_spill_state_in_tls)
APP(ilist, RESTORE_FROM_TLS(dcontext, SCRATCH_REG5, HTABLE_STATS_SPILL_SLOT));
}
#endif /* HASHTABLE_STATISTICS */
#ifdef INTERNAL
if (INTERNAL_OPTION(slowdown_ibl_found)) {
/* add a loop here */
append_empty_loop(dcontext, ilist, INTERNAL_OPTION(slowdown_ibl_found),
SCRATCH_REG1 /* dead */);
}
#endif /* INTERNAL */
if (restore_eflags) {
insert_restore_eflags(dcontext, ilist, NULL, 0, IBL_EFLAGS_IN_TLS(),
absolute _IF_X86_64(x86_to_x64_ibl_opt));
}
if (!target_prefix) {
/* We're going to clobber the xax slot */
ASSERT(restore_eflags);
/* For target_delete support with no prefix, since we're
* clobbering all the registers here, we must save something;
* We save the tag, rather than the table entry, to avoid an
* extra load to get the tag in target_delete:
* <save %xbx to xax slot> # put tag in xax slot for target_delete
*/
if (absolute) {
APP(ilist, SAVE_TO_DC(dcontext, SCRATCH_REG1, SCRATCH_REG0_OFFS));
} else {
APP(ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG1, DIRECT_STUB_SPILL_SLOT));
}
}
#if defined(X86) && defined(X64)
if (x86_to_x64_ibl_opt) {
APP(ilist, RESTORE_FROM_REG(dcontext, SCRATCH_REG1, REG_R10));
} else
#endif
if (absolute) {
/* restore XBX through dcontext */
APP(ilist, inst);
} else {
/* restore XBX through INDIRECT_STUB_SPILL_SLOT */
APP(ilist, RESTORE_FROM_TLS(dcontext, SCRATCH_REG1, INDIRECT_STUB_SPILL_SLOT));
DOCHECK(1, {
if (!SHARED_IB_TARGETS())
ASSERT(only_spill_state_in_tls);
});
}
if (only_spill_state_in_tls) {
/* If TLS doesn't hold table info, XDI was used for indirection.
* Restore XDI through DCONTEXT_BASE_SPILL_SLOT */
insert_shared_restore_dcontext_reg(dcontext, ilist, NULL);
}
if (target_prefix) {
/* FIXME: do we want this? seems to be a problem, I'm disabling:
* ASSERT(!collision || start_pc_offset == FRAGMENT_START_PC_OFFS)
*/
#ifdef AARCH64
ASSERT_NOT_IMPLEMENTED(false); /* FIXME i#1569 */
#else
APP(ilist,
XINST_CREATE_jump_mem(dcontext,
OPND_CREATE_MEMPTR(SCRATCH_REG2, start_pc_offset)));
#endif
} else {
/* There is no prefix so we must restore all and jmp through memory:
* mov start_pc_offset(%xcx), %xcx
* <save %xcx to xbx slot> # put target in xbx slot for later jmp
* <restore %xcx from xcx slot>
* jmp* <xbx slot>
*/
APP(ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG2),
OPND_CREATE_MEMPTR(SCRATCH_REG2, start_pc_offset)));
if (absolute) {
#ifdef X86
APP(ilist, SAVE_TO_DC(dcontext, SCRATCH_REG2, SCRATCH_REG2_OFFS));
if (IF_X64_ELSE(x86_to_x64_ibl_opt, false))
APP(ilist, RESTORE_FROM_REG(dcontext, SCRATCH_REG2, REG_R9));
else if (XCX_IN_TLS(0 /*!FRAG_SHARED*/)) {
APP(ilist,
RESTORE_FROM_TLS(dcontext, SCRATCH_REG2, MANGLE_XCX_SPILL_SLOT));
} else
APP(ilist, RESTORE_FROM_DC(dcontext, SCRATCH_REG2, SCRATCH_REG2_OFFS));
APP(ilist,
XINST_CREATE_jump_mem(
dcontext,
OPND_DC_FIELD(absolute, dcontext, OPSZ_PTR, SCRATCH_REG2_OFFS)));
#elif defined(AARCH64)
ASSERT_NOT_IMPLEMENTED(false); /* FIXME i#1569: NYI on AArch64 */
#elif defined(ARM)
ASSERT_NOT_IMPLEMENTED(false); /* FIXME i#1551: NYI on ARM */
#endif
} else {
APP(ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG2, INDIRECT_STUB_SPILL_SLOT));
#if defined(X86) && defined(X64)
if (x86_to_x64_ibl_opt)
APP(ilist, RESTORE_FROM_REG(dcontext, SCRATCH_REG2, REG_R9));
else
#endif
APP(ilist,
RESTORE_FROM_TLS(dcontext, SCRATCH_REG2, MANGLE_XCX_SPILL_SLOT));
#ifdef AARCH64
ASSERT_NOT_IMPLEMENTED(false); /* FIXME i#1569 */
#else
APP(ilist,
XINST_CREATE_jump_mem(dcontext,
OPND_TLS_FIELD(INDIRECT_STUB_SPILL_SLOT)));
#endif
}
}
if (fragment_found != NULL)
*fragment_found = inst;
}
static inline void
update_ibl_routine(dcontext_t *dcontext, ibl_code_t *ibl_code)
{
if (!ibl_code->initialized)
return;
patch_emitted_code(dcontext, &ibl_code->ibl_patch,
ibl_code->indirect_branch_lookup_routine);
DOLOG(2, LOG_EMIT, {
const char *ibl_name;
const char *ibl_brtype;
ibl_name = get_ibl_routine_name(
dcontext, ibl_code->indirect_branch_lookup_routine, &ibl_brtype);
LOG(THREAD, LOG_EMIT, 2, "Just updated indirect branch lookup\n%s_%s:\n",
ibl_name, ibl_brtype);
disassemble_with_annotations(
dcontext, &ibl_code->ibl_patch, ibl_code->indirect_branch_lookup_routine,
ibl_code->indirect_branch_lookup_routine + ibl_code->ibl_routine_length);
});
if (ibl_code->ibl_head_is_inlined) {
patch_emitted_code(dcontext, &ibl_code->ibl_stub_patch,
ibl_code->inline_ibl_stub_template);
DOLOG(2, LOG_EMIT, {
const char *ibl_name;
const char *ibl_brtype;
ibl_name = get_ibl_routine_name(
dcontext, ibl_code->indirect_branch_lookup_routine, &ibl_brtype);
LOG(THREAD, LOG_EMIT, 2,
"Just updated inlined stub indirect branch lookup\n%s_template_%s:\n",
ibl_name, ibl_brtype);
disassemble_with_annotations(
dcontext, &ibl_code->ibl_stub_patch, ibl_code->inline_ibl_stub_template,
ibl_code->inline_ibl_stub_template + ibl_code->inline_stub_length);
});
}
}
void
update_indirect_branch_lookup(dcontext_t *dcontext)
{
generated_code_t *code = THREAD_GENCODE(dcontext);
ibl_branch_type_t branch_type;
IF_ARM(dr_isa_mode_t old_mode;)
#ifdef X64
ASSERT(is_shared_gencode(code));
return; /* nothing to do: routines are all thread-shared */
#endif
#ifdef ARM
/* We need to switch to the mode of our gencode */
dr_set_isa_mode(dcontext, DEFAULT_ISA_MODE, &old_mode);
#endif
protect_generated_code(code, WRITABLE);
for (branch_type = IBL_BRANCH_TYPE_START; branch_type < IBL_BRANCH_TYPE_END;
branch_type++) {
update_ibl_routine(dcontext, &code->bb_ibl[branch_type]);
if (PRIVATE_TRACES_ENABLED() && !DYNAMO_OPTION(shared_trace_ibl_routine))
update_ibl_routine(dcontext, &code->trace_ibl[branch_type]);
}
#ifdef WINDOWS
/* update mask and table in inlined ibl at end of syscall routine */
if (DYNAMO_OPTION(shared_syscalls)) {
patch_emitted_code(dcontext, &code->shared_syscall_code.ibl_patch,
code->unlinked_shared_syscall);
DOLOG(2, LOG_EMIT, {
LOG(THREAD, LOG_EMIT, 2, "Just updated shared syscall routine:\n");
disassemble_with_annotations(dcontext, &code->shared_syscall_code.ibl_patch,
code->unlinked_shared_syscall,
code->end_shared_syscall);
});
}
#endif
protect_generated_code(code, READONLY);
#ifdef ARM
dr_set_isa_mode(dcontext, old_mode, NULL);
#endif
}
/* i#823: handle far cti transitions. For now only handling known cs values
* for WOW64 when using x64 DR, but we still use this far ibl so that in
* the future we can add general cs change handling outside of the
* fragment (which is much simpler: see below).
*
* One approach is to have the mode change happen in the fragment itself via
* ind branch mangling. But then we have the check for known cs there and
* thus multiple exits some of which are 32-bit and some of which are 64-bit
* which is messy. Instead, we spill another reg, put the selector in it,
* and jump to this ibl prefix routine. One drawback is that by not doing
* the mode transition in the fragment we give up on traces extending through
* it and we must make a far cti a trace barrier.
*
* fragment:
* spill xbx
* movzx selector -> xbx
* spill xcx
* mov target -> xcx
* jmp far_ibl
*
* far_ibl:
* clear top 32 bits of xcx slot
* xchg xcx, xbx
* lea xcx -32_bit_cs -> xcx
* jecxz to_32
* 64: (punting on handling cs o/w)
* xchg xcx, xbx
* restore xbx
* jmp 64-bit ibl
* to-32:
* dcontext -> ecx
* mov $1 -> x86_mode_offs(ecx)
* xchg xcx, xbx
* restore xbx
* far ind jmp through const mem that targets 32-bit ibl
*
* This is much simpler for state xl8: shouldn't need any added support.
* For unlinking: have two versions of the gencode, so the unlink
* is the standard fragment exit cti change only.
*
* For non-mixed-mode, we just jmp straight to ibl. It's simpler to
* generate and always go through this far_ibl though rather than
* having interp up front figure out whether a mode change for direct
* and then have far direct sometimes be direct and sometimes use
* indirect faar-Ibl.
*
* For -x86_to_x64, we assume no 32-bit un-translated code entering here.
*
* FIXME i#865: for mixed-mode (including -x86_to_x64), far ibl must
* preserve the app's r8-r15 during 32-bit execution.
*/
byte *
emit_far_ibl(dcontext_t *dcontext, byte *pc, ibl_code_t *ibl_code,
cache_pc ibl_same_mode_tgt _IF_X86_64(far_ref_t *far_jmp_opnd))
{
instrlist_t ilist;
instrlist_init(&ilist);
#if defined(X86) && defined(X64)
if (mixed_mode_enabled()) {
instr_t *change_mode = INSTR_CREATE_label(dcontext);
bool source_is_x86 =
DYNAMO_OPTION(x86_to_x64) ? ibl_code->x86_to_x64_mode : ibl_code->x86_mode;
short selector = source_is_x86 ? CS64_SELECTOR : CS32_SELECTOR;
/* all scratch space should be in TLS only */
ASSERT(ibl_code->thread_shared_routine || DYNAMO_OPTION(private_ib_in_tls));
if (ibl_code->x86_mode) {
/* we're going to look up rcx in ibl table but we only saved the
* bottom half so zero top half now
*/
APP(&ilist,
INSTR_CREATE_mov_imm(
dcontext,
opnd_create_tls_slot(os_tls_offset(MANGLE_XCX_SPILL_SLOT) + 4),
OPND_CREATE_INT32(0)));
}
APP(&ilist,
INSTR_CREATE_xchg(dcontext, opnd_create_reg(SCRATCH_REG1),
opnd_create_reg(SCRATCH_REG2)));
/* segment is just 2 bytes but need addr prefix if don't have rex prefix */
APP(&ilist,
INSTR_CREATE_lea(
dcontext, opnd_create_reg(SCRATCH_REG2),
opnd_create_base_disp(SCRATCH_REG2, REG_NULL, 0, -selector, OPSZ_lea)));
APP(&ilist, INSTR_CREATE_jecxz(dcontext, opnd_create_instr(change_mode)));
APP(&ilist,
INSTR_CREATE_xchg(dcontext, opnd_create_reg(SCRATCH_REG1),
opnd_create_reg(SCRATCH_REG2)));
if (ibl_code->x86_to_x64_mode && DYNAMO_OPTION(x86_to_x64_ibl_opt)) {
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG1),
opnd_create_reg(REG_R10)));
} else {
APP(&ilist, RESTORE_FROM_TLS(dcontext, SCRATCH_REG1, MANGLE_FAR_SPILL_SLOT));
}
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(ibl_same_mode_tgt)));
APP(&ilist, change_mode);
APP(&ilist,
instr_create_restore_from_tls(dcontext, SCRATCH_REG2, TLS_DCONTEXT_SLOT));
/* FIXME: for SELFPROT_DCONTEXT we'll need to exit to d_r_dispatch every time
* and add logic there to set x86_mode based on LINK_FAR.
* We do not want x86_mode sitting in unprotected_context_t.
*/
ASSERT_NOT_IMPLEMENTED(!TEST(SELFPROT_DCONTEXT, DYNAMO_OPTION(protect_mask)));
APP(&ilist,
XINST_CREATE_store(
dcontext,
OPND_CREATE_MEM8(SCRATCH_REG2, (int)offsetof(dcontext_t, isa_mode)),
OPND_CREATE_INT8(source_is_x86 ? DR_ISA_AMD64 : DR_ISA_IA32)));
APP(&ilist,
INSTR_CREATE_xchg(dcontext, opnd_create_reg(SCRATCH_REG1),
opnd_create_reg(SCRATCH_REG2)));
if (ibl_code->x86_to_x64_mode && DYNAMO_OPTION(x86_to_x64_ibl_opt)) {
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG1),
opnd_create_reg(REG_R10)));
} else {
APP(&ilist, RESTORE_FROM_TLS(dcontext, SCRATCH_REG1, MANGLE_FAR_SPILL_SLOT));
}
if (ibl_code->x86_mode) {
/* FIXME i#865: restore 64-bit regs here */
} else if (ibl_code->x86_to_x64_mode && DYNAMO_OPTION(x86_to_x64_ibl_opt)) {
/* In the current mode, XCX is spilled into R9.
* After mode switch, will use MANGLE_XCX_SPILL_SLOT for spilling XCX.
*/
APP(&ilist, SAVE_TO_TLS(dcontext, REG_R9, MANGLE_XCX_SPILL_SLOT));
/* FIXME i#865: restore 64-bit regs here */
} else {
/* FIXME i#865: save 64-bit regs here */
/* In the current mode, XCX is spilled into MANGLE_XCX_SPILL_SLOT.
* After mode switch, will use R9 for spilling XCX.
*/
APP(&ilist, RESTORE_FROM_TLS(dcontext, REG_R9, MANGLE_XCX_SPILL_SLOT));
}
/* For now we assume we're WOW64 and thus in low 4GB. For general mixed-mode
* and reachability (xref i#774) we will need a trampoline in low 4GB.
* Note that targeting the tail of the not-taken jecxz above doesn't help
* b/c then that needs to be 32-bit reachable.
*/
ASSERT(CHECK_TRUNCATE_TYPE_uint((ptr_uint_t)far_jmp_opnd));
APP(&ilist,
INSTR_CREATE_jmp_far_ind(dcontext,
opnd_create_base_disp(REG_NULL, REG_NULL, 0,
(uint)(ptr_uint_t)far_jmp_opnd,
OPSZ_6)));
/* For -x86_to_x64, we can disallow 32-bit fragments from having
* indirect branches or far branches or system calls, and thus ibl
* is always 64-bit.
* Even if we allow 32-bit indirection, here we have to pick one
* lookup method, and we'd go w/ the most common, which would assume
* a 32-bit target has been translated: so even for a same-mode far
* cti in a 32-bit (untranslated) fragment, we'd want to do a mode
* change here.
*/
/* caller will set target: we just set selector */
far_jmp_opnd->selector =
DYNAMO_OPTION(x86_to_x64) ? CS64_SELECTOR : (ushort)selector;
if (ibl_code->x86_mode) {
instrlist_convert_to_x86(&ilist);
}
} else {
#endif
/* We didn't spill or store into xbx when mangling so just jmp to ibl.
* Note that originally I had the existence of far_ibl, and LINK_FAR,
* as X64 only, and only emitted far_ibl for mixed-mode. But given that
* it's simpler to have far direct as indirect all the time, I decided
* to also go through a far ibl all the time. Eventually to fully
* handle any cs change we'll want it this way.
*
* XXX i#823: store cs into xbx when mangling, and then do cs
* change here.
*/
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(ibl_same_mode_tgt)));
#if defined(X86) && defined(X64)
}
#endif
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, true /*instr targets*/);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
#ifdef X86
static instr_t *
create_int_syscall_instr(dcontext_t *dcontext)
{
# ifdef WINDOWS
/* On windows should already be initialized by syscalls_init() */
ASSERT(get_syscall_method() != SYSCALL_METHOD_UNINITIALIZED);
/* int $0x2e */
if (DYNAMO_OPTION(sygate_int)) {
/* ref case 5217, we call to an existing int in NtYieldExecution
* to avoid tripping up Sygate. */
return INSTR_CREATE_call(dcontext, opnd_create_pc(int_syscall_address));
} else {
return INSTR_CREATE_int(dcontext, opnd_create_immed_int((char)0x2e, OPSZ_1));
}
# else
/* if uninitialized just guess int, we'll patch up later */
return INSTR_CREATE_int(dcontext, opnd_create_immed_int((char)0x80, OPSZ_1));
# endif
}
#endif
instr_t *
create_syscall_instr(dcontext_t *dcontext)
{
int method = get_syscall_method();
#ifdef AARCHXX
if (method == SYSCALL_METHOD_SVC || method == SYSCALL_METHOD_UNINITIALIZED) {
return INSTR_CREATE_svc(dcontext, opnd_create_immed_int((char)0x0, OPSZ_1));
}
#elif defined(X86)
if (method == SYSCALL_METHOD_INT || method == SYSCALL_METHOD_UNINITIALIZED) {
return create_int_syscall_instr(dcontext);
} else if (method == SYSCALL_METHOD_SYSENTER) {
return INSTR_CREATE_sysenter(dcontext);
} else if (method == SYSCALL_METHOD_SYSCALL) {
return INSTR_CREATE_syscall(dcontext);
}
# ifdef WINDOWS
else if (method == SYSCALL_METHOD_WOW64) {
if (get_os_version() < WINDOWS_VERSION_10) {
/* call *fs:0xc0 */
return INSTR_CREATE_call_ind(
dcontext,
opnd_create_far_base_disp(SEG_FS, REG_NULL, REG_NULL, 0, WOW64_TIB_OFFSET,
OPSZ_4_short2));
} else {
/* For Win10 we treat the call* to ntdll!Wow64SystemServiceCall
* (stored in wow64_syscall_call_tgt) as the syscall.
*/
return INSTR_CREATE_call(dcontext, opnd_create_pc(wow64_syscall_call_tgt));
}
}
# endif
#endif /* ARM/X86 */
else {
ASSERT_NOT_REACHED();
return NULL;
}
}
#ifdef WINDOWS
/* Insert instructions after the syscall instruction (e.g., sysenter) to
* restore the next tag target from dcontext XSI slot to %xcx register
* for continue execution.
* See the comment below for emit_shared_syscall about shared syscall
* handling.
*/
static void
insert_restore_target_from_dc(dcontext_t *dcontext, instrlist_t *ilist, bool all_shared)
{
ASSERT(IF_X64_ELSE(all_shared, true)); /* PR 244737 */
if (all_shared) {
APP(ilist,
instr_create_restore_from_dc_via_reg(dcontext, REG_NULL /*default*/,
SCRATCH_REG2, SCRATCH_REG4_OFFS));
} else {
APP(ilist,
instr_create_restore_from_dcontext(dcontext, SCRATCH_REG2,
SCRATCH_REG4_OFFS));
}
# ifdef CLIENT_INTERFACE
/* i#537: we push KiFastSystemCallRet on to the stack and adjust the
* next code to be executed at KiFastSystemCallRet.
*/
if (get_syscall_method() == SYSCALL_METHOD_SYSENTER &&
KiFastSystemCallRet_address != NULL) {
/* push adjusted ecx onto stack */
APP(ilist, INSTR_CREATE_push(dcontext, opnd_create_reg(SCRATCH_REG2)));
APP(ilist,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(SCRATCH_REG2),
OPND_CREATE_INT32(KiFastSystemCallRet_address)));
}
# endif /* CLIENT_INTERFACE */
}
/* All system call instructions turn into a jump to an exit stub that
* jumps here, with the xsi slot in dcontext (or the mangle-next-tag tls slot
* for -shared_fragment_shared_syscalls) containing the return address
* after the original system call instr, and xbx containing the linkstub ptr.
*
* Unlinked version of shared_syscall is needed, even though syscalls are
* not part of traces (we unlink for other reasons, like flushing or
* in-trace replacement).
* To make unlinked entry point, have to make completely separate routine
* that calls unlinked_ibl instead of indirect_branch_lookup, or else
* common linked case needs an extra conditional. I chose the latter
* approach. I figure an extra load and jecxz won't be noticeable.
* Another reason is that this approach means there is a single system
* call instruction to check for suspended threads at, instead of two.
* To make the jecxz match forward-not-taken I actually add another store
* on the linked path.
* FIXME: is this a perf hit that makes it worth the code complexity
* of two syscall routines?
* FIXME: The 'target_trace_table' indicates whether the trace or BB IBT
* table should be targetted. If BB2BB IBL is used (when trace building is
* not disabled), then both traces and BBs use the same shared syscall.
* (We emit only one.) So we can't target the BB table since that would
* result in missed opportunities to mark secondary trace heads (trace->BB
* IB transitions after shared syscall). So for BB2BB IBL this could be
* a perf hit, but not a regression compared to not using BB2BB IBL. More
* comments below in the routine.
*
_unlinked_shared_syscall:
SAVE_TO_UPCONTEXT $0,xax_OFFSET # flag: use unlinked ibl; xcx tls if all_shared
jmp skip_linked
_shared_syscall:
SAVE_TO_UPCONTEXT $1,xax_OFFSET # flag: use regular ibl; xcx tls if all_shared
skip_linked:
.ifdef SIDELINE
# clear cur-trace field so we don't think cur trace is still running
mov $0, _sideline_trace
.endif
.if all_shared
SAVE_TO_TLS xdi, xdi_offset
RESTORE_FROM_TLS xdi, dcontext_offset
.endif
.if !all_shared && DYNAMO_OPTION(shared_fragment_shared_syscalls)
.if !sysenter_syscall_method
LOAD_FROM_TLS MANGLE_NEXT_TAG_SLOT,%xdi
SAVE_TO_UPCONTEXT %xdi,xsi_OFFSET
.endif
RESTORE_FROM_TLS xdi_OFFSET
.endif
# make registers have app values for interrupt
.if !INTERNAL_OPTION(shared_syscalls_fastpath)
SAVE_TO_UPCONTEXT %xbx,xdi_OFFSET # save linkstub ptr
.if all_shared
# get next_tag (from xcx tls slot) into upcontext, for callback dcontext swap
RESTORE_FROM_TLS xbx, mangle_next_tag_slot
SAVE_TO_UPCONTEXT xbx, xsi_OFFSET
.endif
# %xbx is stored in TLS if shared fragments can target shared syscall
.if DYNAMO_OPTION(shared_fragment_shared_syscalls)
LOAD_FROM_TLS INDIRECT_STUB_SPILL_SLOT,%xbx # restore app's xbx
.else
RESTORE_FROM_UPCONTEXT xbx_OFFSET,%xbx # restore app's xbx
.endif
.endif
.if sysenter_syscall_method
pop xsi_OFFSET
push <after-syscall-address>
.endif
# even if !DYNAMO_OPTION(syscalls_synch_flush) must set for reset
movl 1, at_syscall_OFFSET # indicate to flusher we're in a syscall
.if all_shared
SAVE_TO_UPCONTEXT xdi, xdi_offset
RESTORE_FROM_TLS xdi, xdi_offset
.endif
# system call itself
int $0x2e
# kernel may decide to run a callback here...but when we come
# back we can't tell the difference
.if all_shared
RESTORE_FROM_TLS xdi, dcontext_offset
.endif
# even if !DYNAMO_OPTION(syscalls_synch_flush) must clear for cbret
movl 0, at_syscall_OFFSET # indicate to flusher/d_r_dispatch we're done w/ syscall
# assume interrupt could have changed register values
.if !inline_ibl_head # else, saved inside inlined ibl
# for shared_fragment_shared_syscalls = true, absolute != true
.if !DYNAMO_OPTION(shared_fragment_shared_syscalls)
SAVE_TO_UPCONTEXT %xbx,xbx_OFFSET
.endif
.if !absolute
SAVE_TO_TLS %xbx,INDIRECT_STUB_SPILL_SLOT
.endif
.if !INTERNAL_OPTION(shared_syscalls_fastpath)
RESTORE_FROM_UPCONTEXT xdi_OFFSET,%xbx # bring back linkstub ptr
.endif
.endif
# now set up for indirect_branch_lookup
.if !DYNAMO_OPTION(shared_fragment_shared_syscalls)
SAVE_TO_UPCONTEXT %xcx,xcx_OFFSET
.endif
.if !absolute && !all_shared
SAVE_TO_TLS %xcx,MANGLE_XCX_SPILL_SLOT
.endif
.if all_shared
xchg xcx-tls, xcx # get link/unlink flag, and save app xcx, at once
.if x64
mov ecx,ecx # clear top 32 bits of flag
.endif
.else
RESTORE_FROM_UPCONTEXT xax_OFFSET,%xcx # get link/unlink flag
.endif
# patch point: jecxz -> jmp for shared_syscall unlink
jecxz unlink
.if INTERNAL_OPTION(shared_syscalls_fastpath)
mov shared-syscalls-bb-linkstub, %xbx # set linkstub ptr
.if inline_ibl_head
SAVE_TO_UPCONTEXT %xbx,xdi_OFFSET # save linkstub ptr
.endif
.endif
# linked code
RESTORE_FROM_UPCONTEXT xsi_OFFSET,%xcx # bring back return address
.if !inline_ibl_head
jmp _indirect_branch_lookup
.else
# inline ibl lookup head here! (don't need unlink/miss, already did
# that work, miss goes straight to ibl routine)
.endif
unlink:
# unlinked code
RESTORE_FROM_UPCONTEXT xsi_OFFSET,%xcx # bring back return address
.if !inline_ibl_head
mov @shared_syscall_unlinked_linkstub,%xbx
.else
.if absolute
SAVE_TO_UPCONTEXT @shared_syscall_unlinked_linkstub,xdi_OFFSET
.else
SAVE_TO_TLS @shared_syscall_unlinked_linkstub,INDIRECT_STUB_SPILL_SLOT
.endif
.if !DYNAMO_OPTION(atomic_inlined_linking)
SAVE_TO_UPCONTEXT %xcx,xbx_offset
movb $0x1, %cl
.else
SAVE_TO_UPCONTEXT %xbx,xbx_OFFSET # could have changed in kernel
.endif
.endif
jmp _unlinked_ib_lookup
*/
byte *
emit_shared_syscall(dcontext_t *dcontext, generated_code_t *code, byte *pc,
ibl_code_t *ibl_code, patch_list_t *patch, byte *ind_br_lookup_pc,
byte *unlinked_ib_lookup_pc, bool target_trace_table,
bool inline_ibl_head, bool thread_shared, byte **shared_syscall_pc)
{
instrlist_t ilist;
byte *start_pc = pc;
instr_t *syscall; /* remember after-syscall pc b/c often suspended there */
/* relative labels */
instr_t *linked, *jecxz, *unlink, *skip_syscall = NULL;
bool absolute = !thread_shared;
uint after_syscall_ptr = 0;
uint syscall_method = get_syscall_method();
instr_t *adjust_tos;
/* thread_shared indicates whether ibl is thread-shared: this bool indicates
* whether this routine itself is all thread-shared */
bool all_shared = IF_X64_ELSE(true, false); /* PR 244737 */
IF_X64(bool x86_to_x64_ibl_opt =
ibl_code->x86_to_x64_mode && DYNAMO_OPTION(x86_to_x64_ibl_opt);)
/* no support for absolute addresses on x64: we always use tls */
IF_X64(ASSERT_NOT_IMPLEMENTED(!absolute));
/* x64 always shares shared_syscall fragments */
IF_X64(ASSERT_NOT_IMPLEMENTED(DYNAMO_OPTION(shared_fragment_shared_syscalls)));
/* PR 248207: haven't updated the inlining to be x64-compliant yet */
IF_X64(ASSERT_NOT_IMPLEMENTED(!inline_ibl_head));
/* i#821/PR 284029: for now we assume there are no syscalls in x86 code.
* To support them we need to update this routine, emit_do_syscall*,
* and emit_detach_callback_code().
*/
IF_X86_64(ASSERT_NOT_IMPLEMENTED(!ibl_code->x86_mode));
/* ibl_code was not initialized by caller */
ibl_code->thread_shared_routine = thread_shared;
ibl_code->branch_type = IBL_SHARED_SYSCALL;
/* initialize the ilist */
instrlist_init(&ilist);
init_patch_list(patch, absolute ? PATCH_TYPE_ABSOLUTE : PATCH_TYPE_INDIRECT_XDI);
/* We should generate some thread-shared code when
* shared_fragment_shared_syscalls=true. */
DOCHECK(1, {
if (DYNAMO_OPTION(shared_fragment_shared_syscalls))
ASSERT(!absolute);
});
LOG(THREAD, LOG_EMIT, 3,
"emit_shared_syscall: pc=" PFX " patch=" PFX
" inline_ibl_head=%d thread shared=%d\n",
pc, patch, inline_ibl_head, thread_shared);
/* FIXME: could save space by storing a single byte, and using movzx into ecx
* below before the jecxz
*/
if (all_shared) {
/* xax and xbx tls slots are taken so we use xcx */
# ifdef X64
if (x86_to_x64_ibl_opt) {
linked = INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(REG_R9D),
OPND_CREATE_INT32(1));
} else {
# endif
linked = XINST_CREATE_store(dcontext,
OPND_TLS_FIELD_SZ(MANGLE_XCX_SPILL_SLOT, OPSZ_4),
OPND_CREATE_INT32(1));
# ifdef X64
}
# endif
} else
linked = instr_create_save_immed32_to_dcontext(dcontext, 1, SCRATCH_REG0_OFFS);
APP(&ilist, linked);
add_patch_marker(patch, instrlist_first(&ilist), PATCH_ASSEMBLE_ABSOLUTE,
0 /* beginning of instruction */, (ptr_uint_t *)shared_syscall_pc);
# ifdef SIDELINE
if (dynamo_options.sideline) {
/* clear cur-trace field so we don't think cur trace is still running */
APP(&ilist,
XINST_CREATE_store(dcontext,
OPND_CREATE_ABSMEM((void *)&sideline_trace, OPSZ_4),
OPND_CREATE_INT32(0)));
}
# endif
if (all_shared) {
/* load %xdi w/ dcontext */
insert_shared_get_dcontext(dcontext, &ilist, NULL, true /*save xdi*/);
}
/* for all-shared we move next tag from tls down below once xbx is dead */
if (!all_shared && DYNAMO_OPTION(shared_fragment_shared_syscalls)) {
if (syscall_method != SYSCALL_METHOD_SYSENTER) {
/* Move the next tag field from TLS into the proper slot. */
APP(&ilist,
XINST_CREATE_load(
dcontext, opnd_create_reg(SCRATCH_REG5),
opnd_create_tls_slot(os_tls_offset(MANGLE_NEXT_TAG_SLOT))));
APP(&ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG5, SCRATCH_REG4_OFFS));
}
/* restore app %xdi */
insert_shared_restore_dcontext_reg(dcontext, &ilist, NULL);
}
/* put linkstub ptr in slot such that when inlined it will be
* in the right place in case of a miss */
if (!INTERNAL_OPTION(shared_syscalls_fastpath) && DYNAMO_OPTION(indirect_stubs)) {
/* even if inline_ibl_head and !absolute, we must put into mcontext
* here since tls is not saved on callback stack
*/
if (all_shared) {
APP(&ilist,
instr_create_save_to_dc_via_reg(dcontext, REG_NULL /*default*/,
SCRATCH_REG1, SCRATCH_REG5_OFFS));
} else {
APP(&ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG1, SCRATCH_REG5_OFFS));
}
} else {
/* FIXME: for -no_indirect_stubs, we need our own complete ibl
* here in order to use our own linkstub_t. For now we just use
* a trace jmp* linkstub_t from the ibl we target, making every
* post-non-ignorable-syscall fragment a trace head.
*/
}
if (all_shared) {
/* move next_tag from tls into dcontext, for callback dcontext swap,
* using dead xbx */
if (!DYNAMO_OPTION(indirect_stubs)) {
/* xbx isn't dead */
APP(&ilist,
instr_create_save_to_tls(dcontext, SCRATCH_REG1,
INDIRECT_STUB_SPILL_SLOT));
}
APP(&ilist,
instr_create_restore_from_tls(dcontext, SCRATCH_REG1, MANGLE_NEXT_TAG_SLOT));
APP(&ilist,
instr_create_save_to_dc_via_reg(dcontext, REG_NULL /*default*/, SCRATCH_REG1,
SCRATCH_REG4_OFFS));
if (!DYNAMO_OPTION(indirect_stubs)) {
/* restore xbx */
APP(&ilist,
instr_create_restore_from_tls(dcontext, SCRATCH_REG1,
INDIRECT_STUB_SPILL_SLOT));
}
}
/* make registers have app values for the interrupt */
/* restore app's xbx (if we went through a stub to get here) */
if (!INTERNAL_OPTION(shared_syscalls_fastpath) && DYNAMO_OPTION(indirect_stubs)) {
if (DYNAMO_OPTION(shared_fragment_shared_syscalls)) {
APP(&ilist,
XINST_CREATE_load(
dcontext, opnd_create_reg(SCRATCH_REG1),
opnd_create_tls_slot(os_tls_offset(INDIRECT_STUB_SPILL_SLOT))));
} else {
APP(&ilist,
instr_create_restore_from_dcontext(dcontext, SCRATCH_REG1,
SCRATCH_REG1_OFFS));
}
}
if (syscall_method == SYSCALL_METHOD_SYSENTER) {
/* PR 248210: not bothering to make x64-ready: if we do, be sure to pop into
* next-tag tls */
IF_X64(ASSERT_NOT_IMPLEMENTED(false));
/* For sysenter, mangle pushed the next tag onto the stack,
* so we pop it into the xsi slot and push the [to-be-patched]
* after-syscall address.
*/
/* We have to save xsp in case a callback is delivered and we later detach
* (since detach expects the callback dcontext xsp to be correct). xref 9889 */
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_XSP, XSP_OFFSET));
APP(&ilist,
INSTR_CREATE_pop(dcontext,
opnd_create_dcontext_field(dcontext, SCRATCH_REG4_OFFS)));
adjust_tos = INSTR_CREATE_push_imm(dcontext, OPND_CREATE_INT32(0));
APP(&ilist, adjust_tos);
add_patch_marker(patch, adjust_tos, PATCH_ASSEMBLE_ABSOLUTE,
1 /* offset of imm field */, (ptr_uint_t *)&after_syscall_ptr);
}
/* even if !DYNAMO_OPTION(syscalls_synch_flush) must set for reset */
ASSERT(!TEST(SELFPROT_DCONTEXT, DYNAMO_OPTION(protect_mask)));
if (all_shared) {
/* readers of at_syscall are ok w/ us not quite having xdi restored yet */
APP(&ilist,
XINST_CREATE_store(
dcontext,
opnd_create_dcontext_field_via_reg_sz(dcontext, REG_NULL /*default*/,
AT_SYSCALL_OFFSET, OPSZ_1),
OPND_CREATE_INT8(1)));
/* restore app %xdi */
insert_shared_restore_dcontext_reg(dcontext, &ilist, NULL);
} else
APP(&ilist, instr_create_save_immed8_to_dcontext(dcontext, 1, AT_SYSCALL_OFFSET));
if (DYNAMO_OPTION(sygate_sysenter) &&
get_syscall_method() == SYSCALL_METHOD_SYSENTER) {
/* PR 248210: not bothering to make x64-ready */
IF_X64(ASSERT_NOT_IMPLEMENTED(false));
/* case 5441 hack - set up stack so first return address points to ntdll
* Won't worry about arithmetic eflags since no one should care about
* those at a syscall, will preserve other regs though. */
/* FIXME - what is the perf impact of these extra 5 instructions, we can
* prob. do better. */
/* note we assume xsp == xdx (if doesn't we already have prob. ref
* case 5461) */
/* current state
* xsi_slot = next_pc
* xsp -> after_shared_syscall
* +4 -> app value1
* desired state
* sysenter_storage_slot = app_value1
* xsp -> sysenter_ret_address (ntdll ret)
* +4 -> after_shared_syscall
*/
/* NOTE - the stack mangling must match that of handle_system_call()
* and intercept_nt_continue() as not all routines looking at the stack
* differentiate. */
/* pop stack leaving old value (after_shared_syscall) in place */
APP(&ilist,
INSTR_CREATE_add(dcontext, opnd_create_reg(REG_XSP), OPND_CREATE_INT8(4)));
APP(&ilist,
INSTR_CREATE_pop(
dcontext, opnd_create_dcontext_field(dcontext, SYSENTER_STORAGE_OFFSET)));
/* instead of pulling in the existing stack value we could just patch in
* the after syscall imm */
/* see intel docs, source calculated before xsp dec'ed so we're pushing two
* stack slots up into the next slot up */
APP(&ilist, INSTR_CREATE_push(dcontext, OPND_CREATE_MEM32(REG_XSP, -8)));
APP(&ilist,
INSTR_CREATE_push_imm(dcontext,
OPND_CREATE_INTPTR((ptr_int_t)sysenter_ret_address)));
}
/* syscall itself */
APP(&ilist, create_syscall_instr(dcontext));
syscall = instrlist_last(&ilist);
if (DYNAMO_OPTION(sygate_sysenter) &&
get_syscall_method() == SYSCALL_METHOD_SYSENTER) {
/* PR 248210: not bothering to make x64-ready */
IF_X64(ASSERT_NOT_IMPLEMENTED(false));
/* case 5441 hack - we popped an extra stack slot, need to fill with saved
* app value */
APP(&ilist,
INSTR_CREATE_push(
dcontext, opnd_create_dcontext_field(dcontext, SYSENTER_STORAGE_OFFSET)));
}
/* Now that all instructions from the linked entry point up to and
* including the syscall have been added, prepend the unlinked path
* instructions. We wait until the syscall has been added because when
* shared_syscalls_fastpath = true and "int 2e" syscalls are used, the
* target of the unlinked path's jmp is the syscall itself.
*/
/* these two in reverse order since prepended */
instrlist_prepend(
&ilist, XINST_CREATE_jump(dcontext, opnd_create_instr(instr_get_next(linked))));
if (all_shared) {
/* xax and xbx tls slots are taken so we use xcx */
# ifdef X64
if (x86_to_x64_ibl_opt) {
instrlist_prepend(&ilist,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(REG_R9D),
OPND_CREATE_INT32(0)));
} else {
# endif
instrlist_prepend(
&ilist,
XINST_CREATE_store(dcontext,
/* simpler to do 4 bytes even on x64 */
OPND_TLS_FIELD_SZ(MANGLE_XCX_SPILL_SLOT, OPSZ_4),
OPND_CREATE_INT32(0)));
# ifdef X64
}
# endif
} else {
instrlist_prepend(
&ilist,
instr_create_save_immed32_to_dcontext(dcontext, 0, SCRATCH_REG0_OFFS));
}
/* even if !DYNAMO_OPTION(syscalls_synch_flush) must clear for cbret */
if (all_shared) {
/* readers of at_syscall are ok w/ us spilling xdi first */
insert_shared_get_dcontext(dcontext, &ilist, NULL, true /*save xdi*/);
APP(&ilist,
XINST_CREATE_store(
dcontext,
opnd_create_dcontext_field_via_reg_sz(dcontext, REG_NULL /*default*/,
AT_SYSCALL_OFFSET, OPSZ_1),
OPND_CREATE_INT8(0)));
} else
APP(&ilist, instr_create_save_immed8_to_dcontext(dcontext, 0, AT_SYSCALL_OFFSET));
if (!inline_ibl_head && DYNAMO_OPTION(indirect_stubs)) {
/* FIXME Can we remove the write to the mcontext for the !absolute
* case? Initial tests w/notepad crashed when doing so -- we should
* look deeper.
*/
/* save app's xbx (assume interrupt could have changed it) */
/* Remember, shared_fragment_shared_syscalls=true means absolute=false,
* so for shared_fragment_shared_syscalls=true %xbx is saved in
* the !absolute "if" that follows.
*/
if (!DYNAMO_OPTION(shared_fragment_shared_syscalls)) {
APP(&ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG1, SCRATCH_REG1_OFFS));
}
if (!absolute) {
/* save xbx in TLS so that downstream code can find it */
APP(&ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG1, INDIRECT_STUB_SPILL_SLOT));
}
if (!INTERNAL_OPTION(shared_syscalls_fastpath)) {
if (all_shared) {
APP(&ilist,
instr_create_restore_from_dc_via_reg(
dcontext, REG_NULL /*default*/, SCRATCH_REG1, SCRATCH_REG5_OFFS));
} else {
APP(&ilist,
instr_create_restore_from_dcontext(dcontext, SCRATCH_REG1,
SCRATCH_REG5_OFFS));
}
}
} /* if inlined, xbx will be saved inside inlined ibl; if no indirect stubs,
* xbx will be saved in the ibl routine, or not at all if unlinked
*/
/* set up for indirect_branch_lookup */
/* save app's xcx */
if (!DYNAMO_OPTION(shared_fragment_shared_syscalls)) {
APP(&ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG2, SCRATCH_REG2_OFFS));
}
/* FIXME Can we remove the write to the mcontext for the !absolute
* case, as suggested above? */
if (!absolute && !all_shared /*done later*/) {
/* save xcx in TLS */
# ifdef X64
if (x86_to_x64_ibl_opt)
APP(&ilist, SAVE_TO_REG(dcontext, SCRATCH_REG2, REG_R9));
else
# endif
APP(&ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG2, MANGLE_XCX_SPILL_SLOT));
}
if (!INTERNAL_OPTION(shared_syscalls_fastpath)) {
if (inline_ibl_head && DYNAMO_OPTION(indirect_stubs)) {
/* Need to move linkstub ptr from mcontext->xdi into tls.
* We couldn't put it directly there pre-syscall b/c tls
* is not saved on callback stack!
* We do this now to take advantage of xcx being dead.
*/
APP(&ilist,
instr_create_restore_from_dcontext(dcontext, SCRATCH_REG2,
SCRATCH_REG5_OFFS));
APP(&ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG2, TLS_REG3_SLOT));
}
}
/* get link flag */
unlink = INSTR_CREATE_label(dcontext);
if (all_shared) {
/* we stored 4 bytes so get 4 bytes back; save app xcx at same time */
# ifdef X64
if (x86_to_x64_ibl_opt) {
APP(&ilist,
INSTR_CREATE_xchg(dcontext, opnd_create_reg(REG_R9),
opnd_create_reg(SCRATCH_REG2)));
} else {
# endif
APP(&ilist,
INSTR_CREATE_xchg(dcontext, OPND_TLS_FIELD(MANGLE_XCX_SPILL_SLOT),
opnd_create_reg(SCRATCH_REG2)));
# ifdef X64
}
/* clear top 32 bits */
APP(&ilist,
XINST_CREATE_store(dcontext, opnd_create_reg(REG_ECX),
opnd_create_reg(REG_ECX)));
# endif
/* app xdi is restored later after we've restored next_tag from xsi slot */
} else {
APP(&ilist,
instr_create_restore_from_dcontext(dcontext, SCRATCH_REG2,
SCRATCH_REG0_OFFS));
}
jecxz = INSTR_CREATE_jecxz(dcontext, opnd_create_instr(unlink));
APP(&ilist, jecxz);
/* put linkstub ptr in xbx */
if (INTERNAL_OPTION(shared_syscalls_fastpath) && DYNAMO_OPTION(indirect_stubs)) {
APP(&ilist,
INSTR_CREATE_mov_imm(
dcontext, opnd_create_reg(SCRATCH_REG1),
OPND_CREATE_INTPTR((ptr_int_t)get_shared_syscalls_bb_linkstub())));
/* put linkstub ptr in slot such that when inlined it will be
* in the right place in case of a miss */
if (inline_ibl_head) {
if (absolute) {
APP(&ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG1,
SCRATCH_REG5_OFFS));
} else {
APP(&ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG1, TLS_REG3_SLOT));
}
}
} /* else case is up above to use dead xcx reg */
/* Add a patch marker once we know that there's an instr in the ilist
* after the syscall. */
add_patch_marker(patch, instr_get_next(syscall) /* take addr of next instr */,
PATCH_UINT_SIZED /* pc relative */, 0 /* beginning of instruction */,
(ptr_uint_t *)&code->sys_syscall_offs);
add_patch_marker(patch, jecxz, PATCH_UINT_SIZED /* pc relative */,
0 /* point at opcode of jecxz */,
(ptr_uint_t *)&code->sys_unlink_offs);
/* put return address in xcx (was put in xsi slot by mangle.c, or in tls
* by mangle.c and into xsi slot before syscall for all_shared) */
/* we duplicate the restore from dc and restore of xdi on the link
* and unlink paths, rather than putting next_tag back into tls here
* (can't rely on that tls slot persisting over syscall w/ callbacks)
*/
insert_restore_target_from_dc(dcontext, &ilist, all_shared);
if (all_shared) {
/* restore app %xdi */
insert_shared_restore_dcontext_reg(dcontext, &ilist, NULL);
}
/* FIXME As noted in the routine's header comments, shared syscall targets
* the trace [IBT] table when both traces and BBs could be using it (when
* trace building is not disabled). Ideally, we want traces to target the
* trace table and BBs to target the BB table (when BB2BB IBL is on, that is).
* Since the BB IBT table usually holds non-trace head BBs as well as traces
* (including traces is option controlled), using it will doubtless lead to
* higher IBL hit rate, though it's unclear if there would be a visible
* impact on performance. Since BBs and traces use different fake linkstubs
* when executing thru shared syscall, we can detect what the last fragment
* was and conditionally jump to the ideal IBL routine.
*
* Since the EFLAGS at this point hold app state, we'd need to save/restore
* them prior to executing the IBL code if we used a 'cmp' followed by cond.
* branch. Or we could save the EFLAGS and jump to a new entry point in the
* IBL, one just after the 'seto'. (We'd have to move any load of %xdi
* with the dcontext to just below the 'seto'.)
*
* We could avoid conditional code altogether if both inline_trace_ibl
* and inline_bb_ibl are false. Instead of passing fake linkstub addresses
* from a fragment exit stub through shared syscall, we could pass the
* address of the IBL routine to jump to -- BB IBL for BBs and trace IBL
* for traces. Shared syscall would do an indirect jump to reach the proper
* routine. On an IBL miss, the address is passed through to d_r_dispatch, which
* can convert the address into the appropriate fake linkstub address (check
* if the address is within emitted code and equals either BB or trace IBL.)
* Since an address is being passed around and saved to the dcontext during
* syscalls, some of which could be relatively long, this is a security
* hole.
*/
if (!inline_ibl_head) {
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(ind_br_lookup_pc)));
} else {
append_ibl_head(dcontext, &ilist, ibl_code, patch, NULL, NULL, NULL,
opnd_create_pc(ind_br_lookup_pc),
false /*miss cannot have 8-bit offs*/, target_trace_table,
inline_ibl_head);
}
/* unlink path (there can be no fall-through) */
APP(&ilist, unlink);
/* we duplicate the restore from dc and restore of xdi on the link
* and unlink paths: see note above */
insert_restore_target_from_dc(dcontext, &ilist, all_shared);
if (all_shared) {
/* restore app %xdi */
insert_shared_restore_dcontext_reg(dcontext, &ilist, NULL);
}
/* When traversing the unlinked entry path, since IBL is bypassed
* control reaches d_r_dispatch, and the target is (usually) added to the IBT
* table. But since the unlinked path was used, the target may already be
* present in the table so the add attempt is unnecessary and triggers an
* ASSERT in fragment_add_ibl_target().
*
* The add attempt is bypassed by moving an unlinked linkstub ptr into the
* correct place -- for inlined IBL, the %xdi slot, otherwise, %xbx. This will
* identify exits from the unlinked path. The stub's flags are set to 0
* to bypass the add IBL target attempt.
*/
if (!inline_ibl_head) {
if (DYNAMO_OPTION(indirect_stubs)) {
APP(&ilist,
INSTR_CREATE_mov_imm(
dcontext, opnd_create_reg(SCRATCH_REG1),
OPND_CREATE_INTPTR(
(ptr_int_t)get_shared_syscalls_unlinked_linkstub())));
}
} else {
if (absolute) {
APP(&ilist,
instr_create_save_immed32_to_dcontext(
dcontext, (int)(ptr_int_t)get_shared_syscalls_unlinked_linkstub(),
SCRATCH_REG5_OFFS));
} else {
APP(&ilist,
XINST_CREATE_store(
dcontext, OPND_TLS_FIELD(TLS_REG3_SLOT),
OPND_CREATE_INTPTR(
(ptr_int_t)get_shared_syscalls_unlinked_linkstub())));
}
if (!DYNAMO_OPTION(atomic_inlined_linking)) {
/* we need to duplicate the emit_inline_ibl_stub unlinking race
* condition detection code here, before we jump to unlink
*/
/*
* # set flag in xcx (bottom byte = 0x1) so that unlinked path can
* # detect race condition during unlinking
* 2 movb $0x1, %cl
*/
/* we expect target saved in xbx_offset */
if (absolute) {
APP(&ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG2,
SCRATCH_REG1_OFFS));
} else
APP(&ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG2, TLS_REG1_SLOT));
APP(&ilist,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(REG_CL),
OPND_CREATE_INT8(1)));
} else {
/* xbx could have changed in kernel, unlink expects it saved */
if (absolute) {
APP(&ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG1,
SCRATCH_REG1_OFFS));
} else
APP(&ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG1, TLS_REG1_SLOT));
}
}
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(unlinked_ib_lookup_pc)));
pc += encode_with_patch_list(dcontext, patch, &ilist, pc);
if (syscall_method == SYSCALL_METHOD_SYSENTER) {
ASSERT(after_syscall_ptr != 0);
IF_X64(ASSERT_NOT_IMPLEMENTED(false));
*((uint *)(ptr_uint_t)after_syscall_ptr) =
(uint)(ptr_uint_t)(code->unlinked_shared_syscall + code->sys_syscall_offs);
}
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
static byte *
emit_dispatch_template(dcontext_t *dcontext, byte *pc, uint offset)
{
instrlist_t ilist;
/* PR 244737: we don't use this for x64 b/c syscall routines are thread-shared */
IF_X64(ASSERT_NOT_IMPLEMENTED(false));
/* initialize the ilist */
instrlist_init(&ilist);
/* load %edi w/the dcontext */
insert_shared_get_dcontext(dcontext, &ilist, NULL, true);
/* load the generated_code_t address */
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(REG_EDI),
OPND_DC_FIELD(false, dcontext, OPSZ_PTR, PRIVATE_CODE_OFFSET)));
/* jump thru the address in the offset */
APP(&ilist, XINST_CREATE_jump_mem(dcontext, OPND_CREATE_MEM32(REG_EDI, offset)));
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, false /* no instr targets */);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
byte *
emit_shared_syscall_dispatch(dcontext_t *dcontext, byte *pc)
{
return emit_dispatch_template(dcontext, pc,
offsetof(generated_code_t, shared_syscall));
}
byte *
emit_unlinked_shared_syscall_dispatch(dcontext_t *dcontext, byte *pc)
{
return emit_dispatch_template(dcontext, pc,
offsetof(generated_code_t, unlinked_shared_syscall));
}
/* Links the shared_syscall routine to go directly to the indirect branch
* lookup routine.
* If it is already linked, does nothing.
* Assumes caller takes care of any synchronization if this is called
* from other than the owning thread!
*/
/* NOTE the link/unlink of shared syscall is atomic w/respect to threads in the
* cache since is only single byte write (always atomic). */
static void
link_shared_syscall_common(generated_code_t *code)
{
/* strategy: change "jmp unlink" back to "jecxz unlink" */
cache_pc pc;
if (code == NULL) /* shared_code_x86 */
return;
pc = code->unlinked_shared_syscall + code->sys_unlink_offs;
if (*pc != JECXZ_OPCODE) {
protect_generated_code(code, WRITABLE);
ASSERT(*pc == JMP_SHORT_OPCODE);
*pc = JECXZ_OPCODE;
protect_generated_code(code, READONLY);
}
}
void
link_shared_syscall(dcontext_t *dcontext)
{
ASSERT(IS_SHARED_SYSCALL_THREAD_SHARED || dcontext != GLOBAL_DCONTEXT);
if (dcontext == GLOBAL_DCONTEXT) {
link_shared_syscall_common(SHARED_GENCODE(GENCODE_X64));
# ifdef X64
/* N.B.: there are no 32-bit syscalls for WOW64 with 64-bit DR (i#821) */
if (DYNAMO_OPTION(x86_to_x64))
link_shared_syscall_common(SHARED_GENCODE(GENCODE_X86_TO_X64));
# endif
} else
link_shared_syscall_common(THREAD_GENCODE(dcontext));
}
/* Unlinks the shared_syscall routine so it goes back to d_r_dispatch after
* the system call itself.
* If it is already unlinked, does nothing.
* Assumes caller takes care of any synchronization if this is called
* from other than the owning thread!
*/
static void
unlink_shared_syscall_common(generated_code_t *code)
{
/* strategy: change "jecxz unlink" to "jmp unlink" */
cache_pc pc;
if (code == NULL) /* shared_code_x86 */
return;
pc = code->unlinked_shared_syscall + code->sys_unlink_offs;
if (*pc != JMP_SHORT_OPCODE) {
protect_generated_code(code, WRITABLE);
ASSERT(*pc == JECXZ_OPCODE);
*pc = JMP_SHORT_OPCODE;
protect_generated_code(code, READONLY);
}
}
void
unlink_shared_syscall(dcontext_t *dcontext)
{
ASSERT(IS_SHARED_SYSCALL_THREAD_SHARED || dcontext != GLOBAL_DCONTEXT);
if (dcontext == GLOBAL_DCONTEXT) {
unlink_shared_syscall_common(SHARED_GENCODE(GENCODE_X64));
# ifdef X64
/* N.B.: there are no 32-bit syscalls for WOW64 with 64-bit DR (i#821) */
if (DYNAMO_OPTION(x86_to_x64))
unlink_shared_syscall_common(SHARED_GENCODE(GENCODE_X86_TO_X64));
# endif
} else
unlink_shared_syscall_common(THREAD_GENCODE(dcontext));
}
#endif /* defined(WINDOWS) ****************************/
#ifdef WINDOWS
/* used by detach, this inlines the callback stack so that we can detach
*
* we spill xax and xbx to the PID and TID (respectively) TLS slots until we find
* the thread private state at which point we switch to using it for spilling. We
* use the TID slot (as opposed to the PEB slot that callback.c uses) because we need
* to get the TID anyways.
*
* note the counter walks backwards through the array of saved address (they are
* stored in reverse order)
*
* FIXME - we clobber eflags, but those should be dead after a system call anyways.
*
* From emit_patch_syscall()
* after_shared_syscall:
* jmp _after_do_syscall
*
* after_do_syscall:
* mov xax -> PID in TEB
* mov &callback_buf -> xax
* jmp xax
*
*
* From emit_detach_callback_code()
* // xax is currently saved in PID slot of TEB
* callback_buf:
* xchg xbx, TID in TEB // store xbx and get TID
* mov &callback_state -> xax //the array of detach_callback_stack_t
* match_tid:
* cmp xbx, thread_id_offset(xax)
* je match_found
* add xax, sizeof(detach_callback_stack_t)
* jmp match_tid // Note - infinite loop till find or crash (not clear what else to do)
* match_found: // xax now holds ptr to the detach_callback_stack_t for this thread
* xchg xbx, TID in TEB // restore tid & xbx
* mov xbx -> xbx_save_offset(xax)
* mov PID -> xbx
* xchg xbx, PID in TEB // restore pid, saved xax now in xbx
* mov xbx -> xax_save_offset(xax)
* mov xcx -> xcx_save_offset(xax)
* mov count_offset(xax) -> xbx // need count in register for addr calculation below
* sub xbx, 1
* mov xbx -> count_offset(xax)
* mov callback_addrs_offset(xax) -> xcx
* mov (xcx + xbx*sizeof(app_pc)) -> xcx // xcx now holds the xip we need to go to
* mov xcx -> target_offset(xax)
* mov xcx_save_offset(xax) -> xcx
* mov xbx_save_offset(xax) -> xbx
* lea code_buf_offset(xax) -> xax
* jmp xax
*
214f1000 6764871e2400 xchg fs:[0024],ebx
214f1006 b800114f21 mov eax,0x214f1100
214f100b 3b18 cmp ebx,[eax]
214f100d 0f8408000000 je 214f101b
214f1013 83c03c add eax,0x3c
214f1016 e9f0ffffff jmp 214f100b
214f101b 6764871e2400 xchg fs:[0024],ebx
214f1021 895810 mov [eax+0x10],ebx
214f1024 bb5c040000 mov ebx,0x45c
214f1029 6764871e2000 xchg fs:[0020],ebx
214f102f 89580c mov [eax+0xc],ebx
214f1032 894814 mov [eax+0x14],ecx
214f1035 8b5804 mov ebx,[eax+0x4]
214f1038 83eb01 sub ebx,0x1
214f103b 895804 mov [eax+0x4],ebx
214f103e 8b4808 mov ecx,[eax+0x8]
214f1041 8b0c99 mov ecx,[ecx+ebx*4]
214f1044 894818 mov [eax+0x18],ecx
214f1047 8b4814 mov ecx,[eax+0x14]
214f104a 8b5810 mov ebx,[eax+0x10]
214f104d 8d401c lea eax,[eax+0x1c]
214f1050 ffe0 jmp eax
*
*
* From emit_detach_callback_final_jmp()
* _detach_callback_stack_t.code_buf (thread private)
* mov (xax_save_offset) -> xax
* jmp *target
*
214f111c a10c114f21 mov eax,[214f110c]
214f1121 ff2518114f21 jmp dword ptr [214f1118]
*/
byte *
emit_detach_callback_code(dcontext_t *dcontext, byte *buf,
detach_callback_stack_t *callback_state)
{
byte *pc = buf;
instrlist_t ilist;
instr_t *match_tid = INSTR_CREATE_label(dcontext),
*match_found = INSTR_CREATE_label(dcontext);
/* i#821/PR 284029: for now we assume there are no syscalls in x86 code, so
* we do not need to generate an x86 version
*/
/* initialize the ilist */
instrlist_init(&ilist);
/* create instructions */
APP(&ilist,
INSTR_CREATE_xchg(dcontext, opnd_create_tls_slot(TID_TIB_OFFSET),
opnd_create_reg(SCRATCH_REG1)));
APP(&ilist,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(SCRATCH_REG0),
OPND_CREATE_INTPTR((ptr_uint_t)callback_state)));
APP(&ilist, match_tid);
/* FIXME - we clobber eflags. We don't anticipate that being a problem on callback
* returns since syscalls clobber eflags too. */
APP(&ilist,
INSTR_CREATE_cmp(
dcontext, opnd_create_reg(SCRATCH_REG1),
OPND_CREATE_MEMPTR(SCRATCH_REG0, offsetof(detach_callback_stack_t, tid))));
APP(&ilist, INSTR_CREATE_jcc_short(dcontext, OP_je, opnd_create_instr(match_found)));
APP(&ilist,
INSTR_CREATE_add(dcontext, opnd_create_reg(SCRATCH_REG0),
OPND_CREATE_INT_32OR8(sizeof(detach_callback_stack_t))));
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_instr(match_tid)));
APP(&ilist, match_found);
/* found matching tid ptr is in xax
* spill registers into local slots and restore TEB fields */
APP(&ilist,
INSTR_CREATE_xchg(dcontext, opnd_create_tls_slot(TID_TIB_OFFSET),
opnd_create_reg(SCRATCH_REG1)));
APP(&ilist,
XINST_CREATE_store(
dcontext,
OPND_CREATE_MEMPTR(SCRATCH_REG0, offsetof(detach_callback_stack_t, xbx_save)),
opnd_create_reg(SCRATCH_REG1)));
APP(&ilist,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(SCRATCH_REG1),
OPND_CREATE_INTPTR((ptr_uint_t)get_process_id())));
APP(&ilist,
INSTR_CREATE_xchg(dcontext, opnd_create_tls_slot(PID_TIB_OFFSET),
opnd_create_reg(SCRATCH_REG1)));
APP(&ilist,
XINST_CREATE_store(
dcontext,
OPND_CREATE_MEMPTR(SCRATCH_REG0, offsetof(detach_callback_stack_t, xax_save)),
opnd_create_reg(SCRATCH_REG1)));
APP(&ilist,
XINST_CREATE_store(
dcontext,
OPND_CREATE_MEMPTR(SCRATCH_REG0, offsetof(detach_callback_stack_t, xcx_save)),
opnd_create_reg(SCRATCH_REG2)));
/* now find the right address and move it into target while updating the
* thread private count */
APP(&ilist,
XINST_CREATE_load(
dcontext, opnd_create_reg(SCRATCH_REG1),
OPND_CREATE_MEMPTR(SCRATCH_REG0, offsetof(detach_callback_stack_t, count))));
/* see earlier comment on clobbering eflags */
APP(&ilist,
INSTR_CREATE_sub(dcontext, opnd_create_reg(SCRATCH_REG1), OPND_CREATE_INT8(1)));
APP(&ilist,
XINST_CREATE_store(
dcontext,
OPND_CREATE_MEMPTR(SCRATCH_REG0, offsetof(detach_callback_stack_t, count)),
opnd_create_reg(SCRATCH_REG1)));
APP(&ilist,
XINST_CREATE_load(
dcontext, opnd_create_reg(SCRATCH_REG2),
OPND_CREATE_MEMPTR(SCRATCH_REG0,
offsetof(detach_callback_stack_t, callback_addrs))));
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG2),
opnd_create_base_disp(SCRATCH_REG2, SCRATCH_REG1,
sizeof(app_pc), 0, OPSZ_PTR)));
APP(&ilist,
XINST_CREATE_store(
dcontext,
OPND_CREATE_MEMPTR(SCRATCH_REG0, offsetof(detach_callback_stack_t, target)),
opnd_create_reg(SCRATCH_REG2)));
APP(&ilist,
XINST_CREATE_load(
dcontext, opnd_create_reg(SCRATCH_REG2),
OPND_CREATE_MEMPTR(SCRATCH_REG0,
offsetof(detach_callback_stack_t, xcx_save))));
APP(&ilist,
XINST_CREATE_load(
dcontext, opnd_create_reg(SCRATCH_REG1),
OPND_CREATE_MEMPTR(SCRATCH_REG0,
offsetof(detach_callback_stack_t, xbx_save))));
APP(&ilist,
INSTR_CREATE_lea(
dcontext, opnd_create_reg(SCRATCH_REG0),
OPND_CREATE_MEM_lea(SCRATCH_REG0, REG_NULL, 0,
offsetof(detach_callback_stack_t, code_buf))));
APP(&ilist, INSTR_CREATE_jmp_ind(dcontext, opnd_create_reg(SCRATCH_REG0)));
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, true /* instr targets */);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
ASSERT(pc - buf < DETACH_CALLBACK_CODE_SIZE);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
void
emit_detach_callback_final_jmp(dcontext_t *dcontext,
detach_callback_stack_t *callback_state)
{
byte *pc = callback_state->code_buf;
instrlist_t ilist;
/* initialize the ilist */
instrlist_init(&ilist);
/* restore eax and jmp target */
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG0),
OPND_CREATE_ABSMEM(&(callback_state->xax_save), OPSZ_PTR)));
APP(&ilist,
INSTR_CREATE_jmp_ind(dcontext,
OPND_CREATE_ABSMEM(&(callback_state->target), OPSZ_PTR)));
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, true /* instr targets */);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
ASSERT(pc - callback_state->code_buf < DETACH_CALLBACK_FINAL_JMP_SIZE);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
}
void
emit_patch_syscall(dcontext_t *dcontext, byte *target _IF_X64(gencode_mode_t mode))
{
byte *pc = after_do_syscall_code_ex(dcontext _IF_X64(mode));
instrlist_t ilist;
if (DYNAMO_OPTION(shared_syscalls)) {
/* Simply patch shared_syscall to jump to after_do_syscall. Only
* one array of callback stack addresses is needed -- a return from
* a callback entered from shared_syscall will jump to the patched
* after_do_syscall and fetch the correct address off of our
* callback stack copy. It "just works".
*/
instr_t *instr = XINST_CREATE_jump(dcontext, opnd_create_pc(pc));
byte *tgt_pc = after_shared_syscall_code_ex(dcontext _IF_X64(mode));
byte *nxt_pc = instr_encode_to_copy(dcontext, instr,
vmcode_get_writable_addr(tgt_pc), tgt_pc);
ASSERT(nxt_pc != NULL);
nxt_pc = vmcode_get_executable_addr(nxt_pc);
/* check that there was room - shared_syscall should be before do_syscall
* anything between them is dead at this point */
ASSERT(after_shared_syscall_code_ex(dcontext _IF_X64(mode)) < pc && nxt_pc < pc);
instr_destroy(dcontext, instr);
LOG(THREAD, LOG_EMIT, 2,
"Finished patching shared syscall routine for detach -- patch " PFX
" to jump to " PFX "\n",
after_shared_syscall_code(dcontext), pc);
}
/* initialize the ilist */
instrlist_init(&ilist);
/* patch do_syscall to jmp to target */
/* Note that on 64-bit target may not be reachable in which case we need to inline
* the first register spill here so we can jmp reg. We go ahead and the spill here
* and jmp through reg for 32-bit as well for consistency. */
APP(&ilist,
XINST_CREATE_store(dcontext, opnd_create_tls_slot(PID_TIB_OFFSET),
opnd_create_reg(SCRATCH_REG0)));
APP(&ilist,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(SCRATCH_REG0),
OPND_CREATE_INTPTR((ptr_uint_t)target)));
APP(&ilist, INSTR_CREATE_jmp_ind(dcontext, opnd_create_reg(SCRATCH_REG0)));
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, true /* instr targets */);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* ASSERT that there was enough space after the system call (everything after
* do_syscall should be dead at this point). */
ASSERT(pc <= get_emitted_routines_code(dcontext _IF_X64(mode))->commit_end_pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
}
#endif /* WINDOWS */
/* this routine performs a single system call instruction and then returns
* to dynamo via fcache_return
*/
static byte *
emit_do_syscall_common(dcontext_t *dcontext, generated_code_t *code, byte *pc,
byte *fcache_return_pc, bool handle_clone, bool thread_shared,
int interrupt, instr_t *syscall_instr, uint *syscall_offs /*OUT*/)
{
instrlist_t ilist;
instr_t *syscall = NULL;
#ifdef UNIX
instr_t *post_syscall;
#endif
#if defined(UNIX) && defined(X86_32)
/* PR 286922: 32-bit clone syscall cannot use vsyscall: must be int */
if (handle_clone) {
ASSERT(interrupt == 0 || interrupt == 0x80);
interrupt = 0x80;
}
#endif
if (syscall_instr != NULL)
syscall = syscall_instr;
else {
if (interrupt != 0) {
#ifdef X86
syscall = INSTR_CREATE_int(dcontext,
opnd_create_immed_int((char)interrupt, OPSZ_1));
#endif
IF_ARM(ASSERT_NOT_REACHED());
} else
syscall = create_syscall_instr(dcontext);
}
/* i#821/PR 284029: for now we assume there are no syscalls in x86 code.
*/
IF_X86_64(ASSERT_NOT_IMPLEMENTED(!GENCODE_IS_X86(code->gencode_mode)));
ASSERT(syscall_offs != NULL);
*syscall_offs = instr_length(dcontext, syscall);
/* initialize the ilist */
instrlist_init(&ilist);
#ifdef AARCH64
/* We will call this from handle_system_call, so need prefix on AArch64. */
APP(&ilist,
XINST_CREATE_load_pair(
dcontext, opnd_create_reg(DR_REG_X0), opnd_create_reg(DR_REG_X1),
opnd_create_base_disp(dr_reg_stolen, DR_REG_NULL, 0, 0, OPSZ_16)));
/* XXX: should have a proper patch list entry */
*syscall_offs += AARCH64_INSTR_SIZE;
#endif
#if defined(ARM)
/* We have to save r0 in case the syscall is interrupted. We can't
* easily do this from d_r_dispatch b/c fcache_enter clobbers some TLS slots.
*/
APP(&ilist, instr_create_save_to_tls(dcontext, DR_REG_R0, TLS_REG0_SLOT));
/* XXX: should have a proper patch list entry */
*syscall_offs += THUMB_LONG_INSTR_SIZE;
#elif defined(AARCH64)
/* For AArch64, we need to save both x0 and x1 into SLOT 0 and SLOT 1
* in case the syscall is interrupted. See append_save_gpr.
* stp x0, x1, [x28]
*/
APP(&ilist,
INSTR_CREATE_stp(dcontext,
opnd_create_base_disp(dr_reg_stolen, DR_REG_NULL, 0, 0, OPSZ_16),
opnd_create_reg(DR_REG_X0), opnd_create_reg(DR_REG_X1)));
*syscall_offs += AARCH64_INSTR_SIZE;
#endif
/* system call itself -- using same method we've observed OS using */
APP(&ilist, syscall);
#ifdef UNIX
# ifdef X86
if (get_syscall_method() == SYSCALL_METHOD_UNINITIALIZED) {
/* Since we lazily find out the method, but emit these routines
* up front, we have to leave room for the longest syscall method.
* This used to the 6-byte LOL64 call* but we now walk into that
* call* (PR 286922). Not much of a perf worry, but if we
* ever have proactive syscall determination on linux we should
* remove these nops.
*/
ASSERT(instr_length(dcontext, instrlist_last(&ilist)) == 2);
if (SYSCALL_METHOD_LONGEST_INSTR == 6) {
/* we could add 4-byte nop support but I'm too lazy */
APP(&ilist, INSTR_CREATE_nop3byte(dcontext));
APP(&ilist, INSTR_CREATE_nop1byte(dcontext));
} else
ASSERT_NOT_IMPLEMENTED(instr_length(dcontext, instrlist_last(&ilist)) ==
SYSCALL_METHOD_LONGEST_INSTR);
}
# endif
post_syscall = instrlist_last(&ilist);
#endif
/* go to fcache return -- use special syscall linkstub */
/* in case it returns: go to fcache return -- use 0 as &linkstub */
if (thread_shared)
APP(&ilist, instr_create_save_to_tls(dcontext, SCRATCH_REG0, TLS_REG0_SLOT));
else {
APP(&ilist,
instr_create_save_to_dcontext(dcontext, SCRATCH_REG0, SCRATCH_REG0_OFFS));
}
#ifdef AARCH64
/* Save X1 as this is used for the indirect branch in the exit stub. */
APP(&ilist, instr_create_save_to_tls(dcontext, SCRATCH_REG1, TLS_REG1_SLOT));
#endif
insert_mov_immed_ptrsz(dcontext, (ptr_int_t)get_syscall_linkstub(),
opnd_create_reg(SCRATCH_REG0), &ilist, NULL, NULL, NULL);
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(fcache_return_pc)));
#ifdef UNIX
if (handle_clone) {
/* put in clone code, and make sure to target it.
* do it here since it assumes an instr after the syscall exists.
*/
mangle_insert_clone_code(dcontext, &ilist,
post_syscall _IF_X86_64(code->gencode_mode));
}
#endif
/* now encode the instructions */
pc =
instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc, NULL,
#ifdef UNIX
handle_clone /* instr targets */
#else
false /* no instr targets */
#endif
);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
#ifdef AARCHXX
byte *
emit_fcache_enter_gonative(dcontext_t *dcontext, generated_code_t *code, byte *pc)
{
int len;
instrlist_t ilist;
patch_list_t patch;
bool absolute = false;
bool shared = true;
init_patch_list(&patch, absolute ? PATCH_TYPE_ABSOLUTE : PATCH_TYPE_INDIRECT_XDI);
instrlist_init(&ilist);
append_fcache_enter_prologue(dcontext, &ilist, absolute);
append_setup_fcache_target(dcontext, &ilist, absolute, shared);
append_call_exit_dr_hook(dcontext, &ilist, absolute, shared);
/* restore the original register state */
append_restore_xflags(dcontext, &ilist, absolute);
append_restore_simd_reg(dcontext, &ilist, absolute);
append_restore_gpr(dcontext, &ilist, absolute);
/* We need to restore the stolen reg, but we have no scratch registers.
* We are forced to use the stack here. We assume a go-native point is
* a clean ABI point where the stack is valid and there is no app state
* beyond TOS.
*/
/* spill r0 */
APP(&ilist,
XINST_CREATE_store(dcontext, OPND_CREATE_MEMPTR(DR_REG_SP, -XSP_SZ),
opnd_create_reg(DR_REG_R0)));
/* Load target PC from FCACHE_ENTER_TARGET_SLOT, stored by
* by append_setup_fcache_target.
*/
APP(&ilist,
instr_create_restore_from_tls(dcontext, DR_REG_R0, FCACHE_ENTER_TARGET_SLOT));
/* store target PC */
APP(&ilist,
XINST_CREATE_store(dcontext, OPND_CREATE_MEMPTR(DR_REG_SP, -2 * XSP_SZ),
opnd_create_reg(DR_REG_R0)));
/* restore r0 */
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(DR_REG_R0),
OPND_CREATE_MEMPTR(DR_REG_SP, -XSP_SZ)));
/* restore stolen reg */
APP(&ilist,
instr_create_restore_from_tls(dcontext, dr_reg_stolen, TLS_REG_STOLEN_SLOT));
/* go to stored target PC */
# ifdef AARCH64
/* For AArch64, we can't jump through memory like on x86, or write
* to the PC like on ARM. For now assume we're at an ABI call
* boundary (true for dr_app_stop) and we clobber the caller-saved
* register r12.
* XXX: The only clean transfer method we have is SYS_rt_sigreturn,
* which we do use to send other threads native on detach.
* To support externally-triggered detach at non-clean points in the future
* we could try changing the callers to invoke thread_set_self_mcontext()
* instead of coming here (and also finish implementing that for A64).
*/
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(DR_REG_R12),
OPND_CREATE_MEMPTR(DR_REG_SP, -2 * XSP_SZ)));
APP(&ilist, INSTR_CREATE_br(dcontext, opnd_create_reg(DR_REG_R12)));
# else
APP(&ilist,
INSTR_CREATE_ldr(dcontext, opnd_create_reg(DR_REG_PC),
OPND_CREATE_MEMPTR(DR_REG_SP, -2 * XSP_SZ)));
# endif
/* now encode the instructions */
len = encode_with_patch_list(dcontext, &patch, &ilist, pc);
ASSERT(len != 0);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc + len;
}
#endif /* AARCHXX */
#ifdef WINDOWS
/* like fcache_enter but indirects the dcontext passed in through edi */
byte *
emit_fcache_enter_indirect(dcontext_t *dcontext, generated_code_t *code, byte *pc,
byte *fcache_return_pc)
{
return emit_fcache_enter_common(dcontext, code, pc, false /*indirect*/,
false /*!shared*/);
}
/* This routine performs an int 2b, which maps to NtCallbackReturn, and then returns
* to dynamo via fcache_return (though it won't reach there)
*/
byte *
emit_do_callback_return(dcontext_t *dcontext, byte *pc, byte *fcache_return_pc,
bool thread_shared)
{
instrlist_t ilist;
/* initialize the ilist */
instrlist_init(&ilist);
/* interrupt 2b */
APP(&ilist, INSTR_CREATE_int(dcontext, opnd_create_immed_int(0x2b, OPSZ_1)));
/* in case it returns: go to fcache return -- use 0 as &linkstub */
if (thread_shared)
APP(&ilist, instr_create_save_to_tls(dcontext, SCRATCH_REG0, TLS_REG0_SLOT));
else
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_EAX, SCRATCH_REG0_OFFS));
/* for x64 we rely on sign-extension to fill out rax */
APP(&ilist,
INSTR_CREATE_mov_imm(dcontext, opnd_create_reg(REG_EAX), OPND_CREATE_INT32(0)));
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(fcache_return_pc)));
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, false /* no instr targets */);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
#else /* !WINDOWS => UNIX */
byte *
emit_do_clone_syscall(dcontext_t *dcontext, generated_code_t *code, byte *pc,
byte *fcache_return_pc, bool thread_shared,
uint *syscall_offs /*OUT*/)
{
return emit_do_syscall_common(dcontext, code, pc, fcache_return_pc, true,
thread_shared, false, NULL, syscall_offs);
}
# ifdef VMX86_SERVER
byte *
emit_do_vmkuw_syscall(dcontext_t *dcontext, generated_code_t *code, byte *pc,
byte *fcache_return_pc, bool thread_shared,
uint *syscall_offs /*OUT*/)
{
instr_t *gateway = INSTR_CREATE_int(
dcontext, opnd_create_immed_int((char)VMKUW_SYSCALL_GATEWAY, OPSZ_1));
return emit_do_syscall_common(dcontext, code, pc, fcache_return_pc, false,
thread_shared, false, gateway, syscall_offs);
}
# endif
#endif /* UNIX */
byte *
emit_do_syscall(dcontext_t *dcontext, generated_code_t *code, byte *pc,
byte *fcache_return_pc, bool thread_shared, int interrupt,
uint *syscall_offs /*OUT*/)
{
pc = emit_do_syscall_common(dcontext, code, pc, fcache_return_pc, false,
thread_shared, interrupt, NULL, syscall_offs);
return pc;
}
#ifndef WINDOWS
/* updates first syscall instr it finds with the new method of syscall */
static void
update_syscall(dcontext_t *dcontext, byte *pc)
{
LOG_DECLARE(byte *start_pc = pc;)
byte *prev_pc;
IF_ARM(dr_isa_mode_t old_mode;)
instr_t instr;
instr_init(dcontext, &instr);
# ifdef ARM
/* We need to switch to the mode of our gencode */
dr_set_isa_mode(dcontext, DEFAULT_ISA_MODE, &old_mode);
# endif
do {
prev_pc = pc;
instr_reset(dcontext, &instr);
pc = decode_cti(dcontext, pc, &instr);
ASSERT(pc != NULL); /* this our own code we're decoding, should be valid */
if (instr_is_syscall(&instr)) {
instr_t *newinst = create_syscall_instr(dcontext);
byte *nxt_pc = instr_encode_to_copy(
dcontext, newinst, vmcode_get_writable_addr(prev_pc), prev_pc);
/* instruction must not change size! */
ASSERT(nxt_pc != NULL);
nxt_pc = vmcode_get_executable_addr(nxt_pc);
if (nxt_pc != pc) {
pc = nxt_pc;
byte *stop_pc = prev_pc + SYSCALL_METHOD_LONGEST_INSTR;
ASSERT(nxt_pc <= stop_pc);
while (pc < stop_pc) {
/* we could add >3-byte nop support but I'm too lazy */
int noplen = MIN(stop_pc - pc, 3);
instr_t *nop = instr_create_nbyte_nop(dcontext, noplen, true);
pc = instr_encode_to_copy(dcontext, nop, vmcode_get_writable_addr(pc),
pc);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
instr_destroy(dcontext, nop);
}
}
instr_destroy(dcontext, newinst);
break;
}
ASSERT(pc - prev_pc < 128);
} while (1);
machine_cache_sync(prev_pc, pc, true);
instr_free(dcontext, &instr);
# ifdef ARM
dr_set_isa_mode(dcontext, old_mode, NULL);
# endif
DOLOG(3, LOG_EMIT, {
LOG(THREAD, LOG_EMIT, 3, "Just updated syscall routine:\n");
prev_pc = pc;
pc = start_pc;
do {
pc = disassemble_with_bytes(dcontext, pc, THREAD);
} while (pc < prev_pc + 1); /* +1 to get next instr */
LOG(THREAD, LOG_EMIT, 3, " ...\n");
});
}
void
update_syscalls(dcontext_t *dcontext)
{
byte *pc;
generated_code_t *code = THREAD_GENCODE(dcontext);
protect_generated_code(code, WRITABLE);
pc = get_do_syscall_entry(dcontext);
update_syscall(dcontext, pc);
# ifdef X64
/* PR 286922: for 32-bit, we do NOT update the clone syscall as it
* always uses int (since can't use call to vsyscall when swapping
* stacks!)
*/
pc = get_do_clone_syscall_entry(dcontext);
update_syscall(dcontext, pc);
# endif
protect_generated_code(code, READONLY);
}
#endif /* !WINDOWS */
/* Returns -1 on failure */
int
decode_syscall_num(dcontext_t *dcontext, byte *entry)
{
byte *pc;
int syscall = -1;
instr_t instr;
ASSERT(entry != NULL);
instr_init(dcontext, &instr);
pc = entry;
LOG(GLOBAL, LOG_EMIT, 3, "decode_syscall_num " PFX "\n", entry);
while (true) {
DOLOG(3, LOG_EMIT, { disassemble_with_bytes(dcontext, pc, GLOBAL); });
instr_reset(dcontext, &instr);
pc = decode(dcontext, pc, &instr);
if (pc == NULL)
break; /* give up gracefully */
/* we do not handle control transfer instructions! */
if (instr_is_cti(&instr)) {
#ifdef WINDOWS /* since no interception code buffer to check on linux */
if (DYNAMO_OPTION(native_exec_syscalls) && instr_is_ubr(&instr)) {
/* probably our own trampoline, follow it
* ASSUMPTION: mov eax is the instr that jmp targets: i.e.,
* we don't handle deep hooks here.
*/
if (!is_syscall_trampoline(opnd_get_pc(instr_get_target(&instr)), &pc)) {
break; /* give up gracefully */
} /* else, carry on at pc */
} else
#endif
break; /* give up gracefully */
}
if (instr_num_dsts(&instr) > 0 && opnd_is_reg(instr_get_dst(&instr, 0)) &&
opnd_get_reg(instr_get_dst(&instr, 0)) == SCRATCH_REG0) {
#ifndef AARCH64 /* FIXME i#1569: recognise "move" on AArch64 */
if (instr_get_opcode(&instr) == IF_X86_ELSE(OP_mov_imm, OP_mov)) {
IF_X64(ASSERT_TRUNCATE(int, int,
opnd_get_immed_int(instr_get_src(&instr, 0))));
syscall = (int)opnd_get_immed_int(instr_get_src(&instr, 0));
LOG(GLOBAL, LOG_EMIT, 3, "\tfound syscall num: 0x%x\n", syscall);
break;
} else
#endif
break; /* give up gracefully */
}
}
instr_free(dcontext, &instr);
return syscall;
}
#ifdef UNIX
/* PR 212290: can't be static code in x86.asm since it can't be PIC */
/*
* new_thread_dynamo_start - for initializing a new thread created
* via the clone system call.
* assumptions:
* 1) The clone_record_t is on the base of the stack.
* 2) App's IF_X86_ELSE(xax, r0) is scratch (app expects 0 in it).
*/
byte *
emit_new_thread_dynamo_start(dcontext_t *dcontext, byte *pc)
{
instrlist_t ilist;
uint offset;
/* initialize the ilist */
instrlist_init(&ilist);
/* Since we don't have TLS available here (we could use CLONE_SETTLS
* for kernel 2.5.32+: PR 285898) we can't non-racily acquire
* initstack_mutex as we can't spill or spare a register
* (xref i#101/PR 207903).
*/
/* Grab exec state and pass as param in a priv_mcontext_t struct.
* new_thread_setup() will restore real app xsp.
* We emulate x86.asm's PUSH_DR_MCONTEXT(SCRATCH_REG0) (for priv_mcontext_t.pc).
*/
offset = insert_push_all_registers(dcontext, NULL, &ilist, NULL, IF_X64_ELSE(16, 4),
opnd_create_reg(SCRATCH_REG0),
/* we have to pass in scratch to prevent
* use of the stolen reg, which would be
* a race w/ the parent's use of it!
*/
SCRATCH_REG0 _IF_AARCH64(false));
# ifndef AARCH64
/* put pre-push xsp into priv_mcontext_t.xsp slot */
ASSERT(offset == get_clean_call_switch_stack_size());
APP(&ilist,
XINST_CREATE_add_2src(dcontext, opnd_create_reg(SCRATCH_REG0),
opnd_create_reg(REG_XSP), OPND_CREATE_INT32(offset)));
APP(&ilist,
XINST_CREATE_store(dcontext,
OPND_CREATE_MEMPTR(REG_XSP, offsetof(priv_mcontext_t, xsp)),
opnd_create_reg(SCRATCH_REG0)));
# ifdef X86
if (!INTERNAL_OPTION(safe_read_tls_init)) {
/* We avoid get_thread_id syscall in get_thread_private_dcontext()
* by clearing the segment register here (cheaper check than syscall)
* (xref PR 192231). If we crash prior to this point though, the
* signal handler will get the wrong dcontext, but that's a small window.
* See comments in get_thread_private_dcontext() for alternatives.
*/
APP(&ilist,
XINST_CREATE_load_int(dcontext, opnd_create_reg(REG_AX),
OPND_CREATE_INT16(0)));
APP(&ilist,
INSTR_CREATE_mov_seg(dcontext, opnd_create_reg(SEG_TLS),
opnd_create_reg(REG_AX)));
} /* Else, os_clone_pre() inherits a valid-except-.magic segment (i#2089). */
# endif
/* stack grew down, so priv_mcontext_t at tos */
APP(&ilist,
XINST_CREATE_move(dcontext, opnd_create_reg(SCRATCH_REG0),
opnd_create_reg(REG_XSP)));
# else
/* For AArch64, SP was already saved by insert_push_all_registers and
* pointing to priv_mcontext_t. Move sp to the first argument:
* mov x0, sp
*/
APP(&ilist,
XINST_CREATE_move(dcontext, opnd_create_reg(DR_REG_X0),
opnd_create_reg(DR_REG_XSP)));
# endif
dr_insert_call_noreturn(dcontext, &ilist, NULL, (void *)new_thread_setup, 1,
opnd_create_reg(SCRATCH_REG0));
/* should not return */
insert_reachable_cti(dcontext, &ilist, NULL, vmcode_get_start(),
(byte *)unexpected_return, true /*jmp*/, false /*!returns*/,
false /*!precise*/, DR_REG_R11 /*scratch*/, NULL);
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, true /* instr targets */);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
#endif /* UNIX */
#ifdef TRACE_HEAD_CACHE_INCR
/* trace_t heads come here instead of back to dynamo to have their counters
* incremented.
*/
byte *
emit_trace_head_incr(dcontext_t *dcontext, byte *pc, byte *fcache_return_pc)
{
/* save ecx
save eax->xbx slot
mov target_fragment_offs(eax), eax
movzx counter_offs(eax), ecx
lea 1(ecx), ecx # increment counter
mov data16 cx, counter_offs(eax)
lea -hot_threshold(ecx), ecx # compare to hot_threshold
jecxz is_hot
mov start_pc_offs(eax), ecx
movzx prefix_size_offs(eax), eax
lea (ecx,eax,1), ecx
mov ecx, trace_head_pc_offs + dcontext # special slot to avoid target prefix
restore ecx
restore eax
jmp * trace_head_pc_offs + dcontext
is_hot:
restore ebx slot to eax # put &l into eax
restore ecx
jmp fcache_return
*/
instrlist_t ilist;
instr_t *is_hot =
instr_create_restore_from_dcontext(dcontext, REG_EAX, SCRATCH_REG1_OFFS);
instr_t *in;
/* PR 248210: unsupported feature on x64 */
IF_X64(ASSERT_NOT_IMPLEMENTED(false));
instrlist_init(&ilist);
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_ECX, SCRATCH_REG2_OFFS));
if (DYNAMO_OPTION(shared_bbs)) {
/* HACK to get shared exit stub, which puts eax into fs:scratch1, to work
* w/ thread-private THCI: we pull eax out of the tls slot and into mcontext.
* This requires that all direct stubs for cti that can link to trace
* heads use the shared stub -- so if traces can link to trace heads, their
* exits must use the shared stubs, even if the traces are thread-private.
*/
APP(&ilist, RESTORE_FROM_TLS(dcontext, REG_ECX, EXIT_STUB_SPILL_SLOT));
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_ECX, SCRATCH_REG0_OFFS));
}
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_EAX, SCRATCH_REG1_OFFS));
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(REG_EAX),
OPND_CREATE_MEM32(REG_EAX, LINKSTUB_TARGET_FRAG_OFFS)));
ASSERT_NOT_IMPLEMENTED(false &&
"must handle LINKSTUB_CBR_FALLTHROUGH case"
" by calculating target tag")
APP(&ilist,
INSTR_CREATE_movzx(
dcontext, opnd_create_reg(REG_ECX),
opnd_create_base_disp(REG_EAX, REG_NULL, 0, FRAGMENT_COUNTER_OFFS, OPSZ_2)));
APP(&ilist,
INSTR_CREATE_lea(dcontext, opnd_create_reg(REG_ECX),
opnd_create_base_disp(REG_ECX, REG_NULL, 0, 1, OPSZ_lea)));
/* data16 prefix is set auto-magically */
APP(&ilist,
XINST_CREATE_store(
dcontext,
opnd_create_base_disp(REG_EAX, REG_NULL, 0, FRAGMENT_COUNTER_OFFS, OPSZ_2),
opnd_create_reg(REG_CX)));
APP(&ilist,
INSTR_CREATE_lea(dcontext, opnd_create_reg(REG_ECX),
opnd_create_base_disp(REG_ECX, REG_NULL, 0,
-((int)INTERNAL_OPTION(trace_threshold)),
OPSZ_lea)));
APP(&ilist, INSTR_CREATE_jecxz(dcontext, opnd_create_instr(is_hot)));
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(REG_ECX),
OPND_CREATE_MEM32(REG_EAX, FRAGMENT_START_PC_OFFS)));
APP(&ilist,
INSTR_CREATE_movzx(dcontext, opnd_create_reg(REG_EAX),
opnd_create_base_disp(REG_EAX, REG_NULL, 0,
FRAGMENT_PREFIX_SIZE_OFFS, OPSZ_1)));
APP(&ilist,
INSTR_CREATE_lea(dcontext, opnd_create_reg(REG_ECX),
opnd_create_base_disp(REG_ECX, REG_EAX, 1, 0, OPSZ_lea)));
APP(&ilist, instr_create_save_to_dcontext(dcontext, REG_ECX, TRACE_HEAD_PC_OFFSET));
APP(&ilist, instr_create_restore_from_dcontext(dcontext, REG_ECX, SCRATCH_REG2_OFFS));
APP(&ilist, instr_create_restore_from_dcontext(dcontext, REG_EAX, SCRATCH_REG0_OFFS));
APP(&ilist,
INSTR_CREATE_jmp_ind(dcontext,
opnd_create_dcontext_field(dcontext, TRACE_HEAD_PC_OFFSET)));
APP(&ilist, is_hot);
APP(&ilist, instr_create_restore_from_dcontext(dcontext, REG_ECX, SCRATCH_REG2_OFFS));
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(fcache_return_pc)));
/* now encode the instructions */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, true /* instr targets */);
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
byte *
emit_trace_head_incr_shared(dcontext_t *dcontext, byte *pc, byte *fcache_return_pc)
{
ASSERT_NOT_IMPLEMENTED(false);
}
#endif /* TRACE_HEAD_CACHE_INCR */
/***************************************************************************
* SPECIAL IBL XFER ROUTINES
*/
byte *
special_ibl_xfer_tgt(dcontext_t *dcontext, generated_code_t *code,
ibl_entry_point_type_t entry_type, ibl_branch_type_t ibl_type)
{
/* We use the trace ibl so that the target will be a trace head,
* avoiding a trace disruption.
* We request that bbs doing this xfer are marked DR_EMIT_MUST_END_TRACE.
* We use the ret ibt b/c we figure most uses will involve rets and there's
* no reason to fill up the jmp ibt.
* This feature is unavail for prog shep b/c of the cross-type pollution.
*/
return get_ibl_routine_ex(
dcontext, entry_type,
DYNAMO_OPTION(disable_traces)
? (code->thread_shared ? IBL_BB_SHARED : IBL_BB_PRIVATE)
: (code->thread_shared ? IBL_TRACE_SHARED : IBL_TRACE_PRIVATE),
ibl_type _IF_X86_64(code->gencode_mode));
}
/* We only need a thread-private version if our ibl target is thread-private */
bool
special_ibl_xfer_is_thread_private(void)
{
#ifdef X64
return false; /* all gencode is shared */
#else
return (DYNAMO_OPTION(disable_traces) ? !DYNAMO_OPTION(shared_bbs)
: !DYNAMO_OPTION(shared_traces));
#endif
}
#ifdef AARCHXX
size_t
get_ibl_entry_tls_offs(dcontext_t *dcontext, cache_pc ibl_entry)
{
spill_state_t state;
byte *local;
ibl_type_t ibl_type = { 0 };
/* FIXME i#1551: add Thumb support: ARM vs Thumb gencode */
DEBUG_DECLARE(bool is_ibl =)
get_ibl_routine_type_ex(dcontext, ibl_entry, &ibl_type);
ASSERT(is_ibl);
/* FIXME i#1575: coarse-grain NYI on ARM/AArch64 */
ASSERT(ibl_type.source_fragment_type != IBL_COARSE_SHARED);
if (IS_IBL_TRACE(ibl_type.source_fragment_type)) {
if (IS_IBL_LINKED(ibl_type.link_state))
local = (byte *)&state.trace_ibl[ibl_type.branch_type].ibl;
else
local = (byte *)&state.trace_ibl[ibl_type.branch_type].unlinked;
} else {
ASSERT(IS_IBL_BB(ibl_type.source_fragment_type));
if (IS_IBL_LINKED(ibl_type.link_state))
local = (byte *)&state.bb_ibl[ibl_type.branch_type].ibl;
else
local = (byte *)&state.bb_ibl[ibl_type.branch_type].unlinked;
}
return (local - (byte *)&state);
}
#endif
/* emit the special_ibl trampoline code for transferring the control flow to
* ibl lookup
* - index: the index of special_ibl array to be emitted to
* - ibl_type: the branch type (IBL_RETURN or IBL_INDCALL)
* - custom_ilist: the custom instructions added by caller, which are added at
* the end of trampoline and right before jump to the ibl routine
* - tgt: the opnd holding the target, which will be moved into XCX for ibl.
*/
static byte *
emit_special_ibl_xfer(dcontext_t *dcontext, byte *pc, generated_code_t *code, uint index,
ibl_branch_type_t ibl_type, instrlist_t *custom_ilist, opnd_t tgt)
{
instrlist_t ilist;
patch_list_t patch;
instr_t *in;
/* For AArch64 the linkstub has to be in X0 and the app's X0 has to be
* spilled in TLS_REG0_SLOT before calling the ibl routine.
*/
reg_id_t stub_reg = IF_AARCH64_ELSE(SCRATCH_REG0, SCRATCH_REG1);
ushort stub_slot = IF_AARCH64_ELSE(TLS_REG0_SLOT, TLS_REG1_SLOT);
IF_X86(size_t len;)
byte *ibl_tgt = special_ibl_xfer_tgt(dcontext, code, IBL_LINKED, ibl_type);
bool absolute = !code->thread_shared;
ASSERT(ibl_tgt != NULL);
instrlist_init(&ilist);
init_patch_list(&patch, absolute ? PATCH_TYPE_ABSOLUTE : PATCH_TYPE_INDIRECT_FS);
if (DYNAMO_OPTION(indirect_stubs)) {
const linkstub_t *linkstub = get_special_ibl_linkstub(
ibl_type, DYNAMO_OPTION(disable_traces) ? false : true);
APP(&ilist, SAVE_TO_TLS(dcontext, stub_reg, stub_slot));
insert_mov_immed_ptrsz(dcontext, (ptr_int_t)linkstub, opnd_create_reg(stub_reg),
&ilist, NULL, NULL, NULL);
}
if (code->thread_shared || DYNAMO_OPTION(private_ib_in_tls)) {
#if defined(X86) && defined(X64)
if (GENCODE_IS_X86_TO_X64(code->gencode_mode) &&
DYNAMO_OPTION(x86_to_x64_ibl_opt)) {
APP(&ilist, SAVE_TO_REG(dcontext, SCRATCH_REG2, REG_R9));
} else
#endif
APP(&ilist, SAVE_TO_TLS(dcontext, SCRATCH_REG2, MANGLE_XCX_SPILL_SLOT));
} else {
APP(&ilist, SAVE_TO_DC(dcontext, SCRATCH_REG2, SCRATCH_REG2_OFFS));
}
APP(&ilist, XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG2), tgt));
/* insert customized instructions right before xfer to ibl */
if (custom_ilist != NULL)
in = instrlist_first(custom_ilist);
else
in = NULL;
while (in != NULL) {
instrlist_remove(custom_ilist, in);
APP(&ilist, in);
in = instrlist_first(custom_ilist);
}
#ifdef X86_64
if (GENCODE_IS_X86(code->gencode_mode))
instrlist_convert_to_x86(&ilist);
#endif
/* do not add new instrs that need conversion to x86 below here! */
#ifdef X86
/* to support patching the 4-byte pc-rel tgt we must ensure it doesn't
* cross a cache line
*/
for (len = 0, in = instrlist_first(&ilist); in != NULL; in = instr_get_next(in)) {
len += instr_length(dcontext, in);
}
if (CROSSES_ALIGNMENT(pc + len + 1 /*opcode*/, 4, PAD_JMPS_ALIGNMENT)) {
instr_t *nop_inst;
len = ALIGN_FORWARD(pc + len + 1, 4) - (ptr_uint_t)(pc + len + 1);
nop_inst = INSTR_CREATE_nopNbyte(dcontext, (uint)len);
# ifdef X64
if (GENCODE_IS_X86(code->gencode_mode)) {
instr_set_x86_mode(nop_inst, true /*x86*/);
instr_shrink_to_32_bits(nop_inst);
}
# endif
/* XXX: better to put prior to entry point but then need to change model
* of who assigns entry point
*/
APP(&ilist, nop_inst);
}
APP(&ilist, XINST_CREATE_jump(dcontext, opnd_create_pc(ibl_tgt)));
#elif defined(AARCH64)
APP(&ilist,
INSTR_CREATE_ldr(dcontext, opnd_create_reg(SCRATCH_REG1),
OPND_TLS_FIELD(get_ibl_entry_tls_offs(dcontext, ibl_tgt))));
APP(&ilist, XINST_CREATE_jump_reg(dcontext, opnd_create_reg(SCRATCH_REG1)));
#elif defined(ARM)
/* i#1906: loads to PC must use word-aligned addresses */
ASSERT(ALIGNED(get_ibl_entry_tls_offs(dcontext, ibl_tgt), PC_LOAD_ADDR_ALIGN));
APP(&ilist,
INSTR_CREATE_ldr(dcontext, opnd_create_reg(DR_REG_PC),
OPND_TLS_FIELD(get_ibl_entry_tls_offs(dcontext, ibl_tgt))));
#endif
add_patch_marker(&patch, instrlist_last(&ilist), PATCH_UINT_SIZED /* pc relative */,
0 /* point at opcode */,
(ptr_uint_t *)&code->special_ibl_unlink_offs[index]);
/* now encode the instructions */
pc += encode_with_patch_list(dcontext, &patch, &ilist, pc);
ASSERT(pc != NULL);
/* free the instrlist_t elements */
instrlist_clear(dcontext, &ilist);
return pc;
}
void
link_special_ibl_xfer(dcontext_t *dcontext)
{
IF_CLIENT_INTERFACE(
relink_special_ibl_xfer(dcontext, CLIENT_IBL_IDX, IBL_LINKED, IBL_RETURN);)
#ifdef UNIX
if (DYNAMO_OPTION(native_exec_opt)) {
relink_special_ibl_xfer(dcontext, NATIVE_PLT_IBL_IDX, IBL_LINKED, IBL_INDCALL);
relink_special_ibl_xfer(dcontext, NATIVE_RET_IBL_IDX, IBL_LINKED, IBL_RETURN);
}
#endif
}
void
unlink_special_ibl_xfer(dcontext_t *dcontext)
{
IF_CLIENT_INTERFACE(
relink_special_ibl_xfer(dcontext, CLIENT_IBL_IDX, IBL_UNLINKED, IBL_RETURN);)
#ifdef UNIX
if (DYNAMO_OPTION(native_exec_opt)) {
relink_special_ibl_xfer(dcontext, NATIVE_PLT_IBL_IDX, IBL_UNLINKED, IBL_INDCALL);
relink_special_ibl_xfer(dcontext, NATIVE_RET_IBL_IDX, IBL_UNLINKED, IBL_RETURN);
}
#endif
}
#ifdef CLIENT_INTERFACE
/* i#849: low-overhead xfer for clients */
byte *
emit_client_ibl_xfer(dcontext_t *dcontext, byte *pc, generated_code_t *code)
{
/* The client puts the target in SPILL_SLOT_REDIRECT_NATIVE_TGT. */
return emit_special_ibl_xfer(
dcontext, pc, code, CLIENT_IBL_IDX, IBL_RETURN, NULL,
reg_spill_slot_opnd(dcontext, SPILL_SLOT_REDIRECT_NATIVE_TGT));
}
#endif /* CLIENT_INTERFACE */
/* i#171: out-of-line clean call */
/* XXX: i#1149 the clean call context switch should be shared among all threads */
bool
client_clean_call_is_thread_private(void)
{
#ifdef X64
return false; /* all gencode is shared */
#else
return !USE_SHARED_GENCODE();
#endif
}
byte *
emit_clean_call_save(dcontext_t *dcontext, byte *pc, generated_code_t *code)
{
#ifdef ARM
/* FIXME i#1621: NYI on AArch32 */
return pc;
#endif
instrlist_t ilist;
instrlist_init(&ilist);
/* xref insert_out_of_line_context_switch @ x86/mangle.c,
* stack was adjusted beyond what we place there to get retaddr
* in right spot, adjust the stack back to save context
*/
/* XXX: this LEA can be optimized away by using the LEA
* in insert_push_all_registers
*/
#ifdef X86
APP(&ilist,
INSTR_CREATE_lea(dcontext, opnd_create_reg(DR_REG_XSP),
opnd_create_base_disp(DR_REG_XSP, DR_REG_NULL, 0,
(int)(get_clean_call_switch_stack_size() +
get_clean_call_temp_stack_size() +
XSP_SZ /* return addr */),
OPSZ_lea)));
/* save all registers */
insert_push_all_registers(dcontext, NULL, &ilist, NULL, (uint)PAGE_SIZE,
OPND_CREATE_INT32(0), REG_NULL);
#elif defined(AARCH64)
/* save all registers */
insert_push_all_registers(dcontext, NULL, &ilist, NULL, (uint)PAGE_SIZE,
OPND_CREATE_INT32(0), REG_NULL, true);
#endif
#ifdef WINDOWS
/* i#249: isolate the PEB and TEB */
/* We pay the cost of this extra load of dcontext in order to get
* this code shared (when not shared we place this where we already
* have the dcontext in a register: see prepare_for_clean_call()).
*/
if (SCRATCH_ALWAYS_TLS())
insert_get_mcontext_base(dcontext, &ilist, NULL, SCRATCH_REG0);
preinsert_swap_peb(dcontext, &ilist, NULL, !SCRATCH_ALWAYS_TLS(), SCRATCH_REG0 /*dc*/,
SCRATCH_REG2 /*scratch*/, true /*to priv*/);
/* We also need 2 extra loads to restore the 2 regs, in case the
* clean call passes them as args.
*/
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG0),
OPND_CREATE_MEMPTR(REG_XSP, offsetof(priv_mcontext_t, xax))));
APP(&ilist,
XINST_CREATE_load(dcontext, opnd_create_reg(SCRATCH_REG2),
OPND_CREATE_MEMPTR(REG_XSP, offsetof(priv_mcontext_t, xcx))));
#endif
/* clear eflags */
insert_clear_eflags(dcontext, NULL, &ilist, NULL);
#ifdef X86
/* return back */
APP(&ilist,
INSTR_CREATE_lea(dcontext, opnd_create_reg(DR_REG_XSP),
opnd_create_base_disp(DR_REG_XSP, DR_REG_NULL, 0,
-(get_clean_call_temp_stack_size() +
(int)XSP_SZ /* return stack */),
OPSZ_lea)));
APP(&ilist,
INSTR_CREATE_ret_imm(dcontext,
OPND_CREATE_INT16(get_clean_call_temp_stack_size())));
#elif defined(AARCH64)
APP(&ilist, INSTR_CREATE_br(dcontext, opnd_create_reg(DR_REG_X30)));
#else
/* FIXME i#1621: NYI on AArch32 */
ASSERT_NOT_IMPLEMENTED(false);
#endif
/* emti code */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, IF_X86_ELSE(ZMM_ENABLED(), false));
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
instrlist_clear(dcontext, &ilist);
return pc;
}
byte *
emit_clean_call_restore(dcontext_t *dcontext, byte *pc, generated_code_t *code)
{
instrlist_t ilist;
#ifdef ARM
/* FIXME i#1551: NYI on AArch32
* (no assert here, it's in get_clean_call_restore())
*/
return pc;
#endif
instrlist_init(&ilist);
#ifdef WINDOWS
/* i#249: isolate the PEB and TEB */
/* We pay the cost of this extra load of dcontext in order to get
* this code shared (when not shared we place this where we already
* have the dcontext in a register: see cleanup_after_clean_call()).
* The 2 regs are dead as the popa will restore.
*/
if (SCRATCH_ALWAYS_TLS())
insert_get_mcontext_base(dcontext, &ilist, NULL, SCRATCH_REG0);
preinsert_swap_peb(dcontext, &ilist, NULL, !SCRATCH_ALWAYS_TLS(), SCRATCH_REG0 /*dc*/,
SCRATCH_REG2 /*scratch*/, false /*to app*/);
#endif
#ifdef X86
/* adjust the stack for the return target */
APP(&ilist,
INSTR_CREATE_lea(
dcontext, opnd_create_reg(DR_REG_XSP),
opnd_create_base_disp(DR_REG_XSP, DR_REG_NULL, 0, (int)XSP_SZ, OPSZ_lea)));
/* restore all registers */
insert_pop_all_registers(dcontext, NULL, &ilist, NULL, (uint)PAGE_SIZE);
/* return back */
/* we adjust lea + ret_imm instead of ind jmp to take advantage of RSB */
APP(&ilist,
INSTR_CREATE_lea(dcontext, opnd_create_reg(DR_REG_XSP),
opnd_create_base_disp(DR_REG_XSP, DR_REG_NULL, 0,
-(get_clean_call_switch_stack_size() +
(int)XSP_SZ /* return address */),
OPSZ_lea)));
APP(&ilist,
INSTR_CREATE_ret_imm(dcontext,
OPND_CREATE_INT16(get_clean_call_switch_stack_size())));
#elif defined(AARCH64)
insert_pop_all_registers(dcontext, NULL, &ilist, NULL, (uint)PAGE_SIZE, true);
APP(&ilist, INSTR_CREATE_br(dcontext, opnd_create_reg(DR_REG_X30)));
#else
/* FIXME i#1621: NYI on AArch32 */
ASSERT_NOT_IMPLEMENTED(false);
#endif
/* emit code */
pc = instrlist_encode_to_copy(dcontext, &ilist, vmcode_get_writable_addr(pc), pc,
NULL, IF_X86_ELSE(ZMM_ENABLED(), false));
ASSERT(pc != NULL);
pc = vmcode_get_executable_addr(pc);
instrlist_clear(dcontext, &ilist);
return pc;
}
/* mirrored inline implementation of set_last_exit() */
void
insert_set_last_exit(dcontext_t *dcontext, linkstub_t *l, instrlist_t *ilist,
instr_t *where, reg_id_t reg_dc)
{
ASSERT(l != NULL);
/* C equivalent:
* dcontext->last_exit = l
*/
insert_mov_immed_ptrsz(
dcontext, (ptr_int_t)l,
opnd_create_dcontext_field_via_reg(dcontext, reg_dc, LAST_EXIT_OFFSET), ilist,
where, NULL, NULL);
/* C equivalent:
* dcontext->last_fragment = linkstub_fragment()
*/
insert_mov_immed_ptrsz(
dcontext, (ptr_int_t)linkstub_fragment(dcontext, l),
opnd_create_dcontext_field_via_reg(dcontext, reg_dc, LAST_FRAG_OFFSET), ilist,
where, NULL, NULL);
/* C equivalent:
* dcontext->coarse_exit.dir_exit = NULL
*/
insert_mov_immed_ptrsz(
dcontext, (ptr_int_t)NULL,
opnd_create_dcontext_field_via_reg(dcontext, reg_dc, COARSE_DIR_EXIT_OFFSET),
ilist, where, NULL, NULL);
}
/* mirrored inline implementation of return_to_native() */
static void
insert_entering_native(dcontext_t *dcontext, instrlist_t *ilist, instr_t *where,
reg_id_t reg_dc, reg_id_t reg_scratch)
{
/* FIXME i#2375: for UNIX we need to do what os_thread_not_under_dynamo() does:
* set the signal mask and clear the TLS.
*/
#ifdef WINDOWS
/* FIXME i#1238-c#1: we did not turn off asynch interception in windows */
/* skip C equivalent:
* set_asynch_interception(dcontext->owning_thread, false)
*/
ASSERT_BUG_NUM(1238, false && "set_asynch_interception is not inlined");
#endif
/* C equivalent:
* dcontext->thread_record->under_dynamo_control = false
*/
PRE(ilist, where,
instr_create_restore_from_dc_via_reg(dcontext, reg_dc, reg_scratch,
THREAD_RECORD_OFFSET));
PRE(ilist, where,
XINST_CREATE_store(
dcontext,
OPND_CREATE_MEM8(reg_scratch,
offsetof(thread_record_t, under_dynamo_control)),
OPND_CREATE_INT8(false)));
/* C equivalent:
* set_last_exit(dcontext, (linkstub_t *) get_native_exec_linkstub())
*/
insert_set_last_exit(dcontext, (linkstub_t *)get_native_exec_linkstub(), ilist, where,
reg_dc);
/* XXX i#1238-c#4 -native_exec_opt does not support -kstats
* skip C equivalent:
* KSTOP_NOT_MATCHING(dispatch_num_exits)
*/
/* skip C equivalent:
* SYSLOG_INTERNAL_WARNING_ONCE("entered at least one module natively")
*/
/* C equivalent:
* whereami = DR_WHERE_APP
*/
PRE(ilist, where,
instr_create_save_immed_to_dc_via_reg(dcontext, reg_dc, WHEREAMI_OFFSET,
(ptr_int_t)DR_WHERE_APP, OPSZ_4));
/* skip C equivalent:
* STATS_INC(num_native_module_enter)
*/
}
/* mirrored inline implementation of return_to_native()
* two registers are needed:
* - reg_dc holds the dcontext
* - reg_scratch is the scratch register.
*/
void
insert_return_to_native(dcontext_t *dcontext, instrlist_t *ilist, instr_t *where,
reg_id_t reg_dc, reg_id_t reg_scratch)
{
/* skip C equivalent:
* ENTERING_DR()
*/
ASSERT(dcontext != NULL);
/* C equivalent:
* entering_native(dcontext)
*/
insert_entering_native(dcontext, ilist, where, reg_dc, reg_scratch);
/* skip C equivalent:
* EXITING_DR()
*/
}
#if defined(UNIX)
static void
insert_entering_non_native(dcontext_t *dcontext, instrlist_t *ilist, instr_t *where,
reg_id_t reg_dc, reg_id_t reg_scratch)
{
/* FIXME i#2375: for UNIX we need to do what os_thread_re_take_over() and
* os_thread_under_dynamo() do: reinstate the TLS and restore the signal mask.
*/
/* C equivalent:
* dcontext->thread_record->under_dynamo_control = true
*/
PRE(ilist, where,
instr_create_restore_from_dc_via_reg(dcontext, reg_dc, reg_scratch,
THREAD_RECORD_OFFSET));
PRE(ilist, where,
XINST_CREATE_store(
dcontext,
OPND_CREATE_MEM8(reg_scratch,
offsetof(thread_record_t, under_dynamo_control)),
OPND_CREATE_INT8(true)));
/* C equivalent:
* set_last_exit(dcontext, (linkstub_t *) get_native_exec_linkstub())
*/
insert_set_last_exit(dcontext, (linkstub_t *)get_native_exec_linkstub(), ilist, where,
reg_dc);
/* C equivalent:
* whereami = DR_WHERE_FCACHE
*/
PRE(ilist, where,
instr_create_save_immed_to_dc_via_reg(dcontext, reg_dc, WHEREAMI_OFFSET,
(ptr_int_t)DR_WHERE_FCACHE, OPSZ_4));
}
/* Emit code to transfer execution from native module to code cache of non-native
* module via plt calls.
* The emitted code update some fields of dcontext like whereami and last_exit,
* and jump to ibl looking for target code fragment.
* We assume %XAX holds the target and can be clobbered.
*/
byte *
emit_native_plt_ibl_xfer(dcontext_t *dcontext, byte *pc, generated_code_t *code)
{
instrlist_t ilist;
opnd_t tgt = opnd_create_reg(SCRATCH_REG0);
ASSERT(DYNAMO_OPTION(native_exec_opt));
instrlist_init(&ilist);
insert_shared_get_dcontext(dcontext, &ilist, NULL, true);
insert_entering_non_native(dcontext, &ilist, NULL, REG_NULL, SCRATCH_REG0);
insert_shared_restore_dcontext_reg(dcontext, &ilist, NULL);
return emit_special_ibl_xfer(dcontext, pc, code, NATIVE_PLT_IBL_IDX, IBL_INDCALL,
&ilist, tgt);
}
/* Emit code to transfer execution from native module to code cache of non-native
* module via return.
* The emitted code update some fields of dcontext like whereami and last_exit,
* and jump to ibl looking for target code fragment.
* We assume %XAX holds the target and must be restored from TLS_REG0_SLOT before
* jumpping to ibl.
*/
byte *
emit_native_ret_ibl_xfer(dcontext_t *dcontext, byte *pc, generated_code_t *code)
{
instrlist_t ilist;
opnd_t tgt = opnd_create_reg(SCRATCH_REG0);
ASSERT(DYNAMO_OPTION(native_exec_opt));
instrlist_init(&ilist);
insert_shared_get_dcontext(dcontext, &ilist, NULL, true);
insert_entering_non_native(dcontext, &ilist, NULL, REG_NULL, SCRATCH_REG0);
insert_shared_restore_dcontext_reg(dcontext, &ilist, NULL);
/* restore xax */
APP(&ilist, instr_create_restore_from_tls(dcontext, SCRATCH_REG0, TLS_REG0_SLOT));
return emit_special_ibl_xfer(dcontext, pc, code, NATIVE_RET_IBL_IDX, IBL_RETURN,
&ilist, tgt);
}
#endif /* UNIX */
| 1 | 22,933 | > i#4670 signl-interrupted special ibl xfer frag: Unlink if signal pending nit: This looks like one of many commits with the text before the colon. nit: On the long side: 56 or 60 chars is what some views show Spelling error. | DynamoRIO-dynamorio | c |
@@ -668,6 +668,8 @@ int flb_start(flb_ctx_t *ctx)
fd = event->fd;
bytes = flb_pipe_r(fd, &val, sizeof(uint64_t));
if (bytes <= 0) {
+ pthread_cancel(tid);
+ pthread_join(tid, NULL);
ctx->status = FLB_LIB_ERROR;
return -1;
} | 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* Fluent Bit Demo
* ===============
* Copyright (C) 2019-2021 The Fluent Bit Authors
* Copyright (C) 2015-2018 Treasure Data Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <fluent-bit/flb_lib.h>
#include <fluent-bit/flb_mem.h>
#include <fluent-bit/flb_pipe.h>
#include <fluent-bit/flb_engine.h>
#include <fluent-bit/flb_input.h>
#include <fluent-bit/flb_output.h>
#include <fluent-bit/flb_filter.h>
#include <fluent-bit/flb_utils.h>
#include <fluent-bit/flb_time.h>
#include <fluent-bit/flb_coro.h>
#include <fluent-bit/flb_callback.h>
#include <fluent-bit/flb_kv.h>
#include <fluent-bit/tls/flb_tls.h>
#include <signal.h>
#include <stdarg.h>
#include <cmetrics/cmetrics.h>
#ifdef FLB_HAVE_MTRACE
#include <mcheck.h>
#endif
#ifdef FLB_HAVE_AWS_ERROR_REPORTER
#include <fluent-bit/aws/flb_aws_error_reporter.h>
struct flb_aws_error_reporter *error_reporter;
#endif
/* thread initializator */
static pthread_once_t flb_lib_once = PTHREAD_ONCE_INIT;
#ifdef FLB_SYSTEM_WINDOWS
static inline int flb_socket_init_win32(void)
{
WSADATA wsaData;
int err;
err = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (err != 0) {
fprintf(stderr, "WSAStartup failed with error: %d\n", err);
return err;
}
return 0;
}
#endif
static inline struct flb_input_instance *in_instance_get(flb_ctx_t *ctx,
int ffd)
{
struct mk_list *head;
struct flb_input_instance *i_ins;
mk_list_foreach(head, &ctx->config->inputs) {
i_ins = mk_list_entry(head, struct flb_input_instance, _head);
if (i_ins->id == ffd) {
return i_ins;
}
}
return NULL;
}
static inline struct flb_output_instance *out_instance_get(flb_ctx_t *ctx,
int ffd)
{
struct mk_list *head;
struct flb_output_instance *o_ins;
mk_list_foreach(head, &ctx->config->outputs) {
o_ins = mk_list_entry(head, struct flb_output_instance, _head);
if (o_ins->id == ffd) {
return o_ins;
}
}
return NULL;
}
static inline struct flb_filter_instance *filter_instance_get(flb_ctx_t *ctx,
int ffd)
{
struct mk_list *head;
struct flb_filter_instance *f_ins;
mk_list_foreach(head, &ctx->config->filters) {
f_ins = mk_list_entry(head, struct flb_filter_instance, _head);
if (f_ins->id == ffd) {
return f_ins;
}
}
return NULL;
}
void flb_init_env()
{
flb_tls_init();
flb_coro_init();
flb_upstream_init();
flb_output_prepare();
/* libraries */
cmt_initialize();
}
flb_ctx_t *flb_create()
{
int ret;
flb_ctx_t *ctx;
struct flb_config *config;
#ifdef FLB_HAVE_MTRACE
/* Start tracing malloc and free */
mtrace();
#endif
#ifdef FLB_SYSTEM_WINDOWS
/* Ensure we initialized Windows Sockets */
if (flb_socket_init_win32()) {
return NULL;
}
#endif
ctx = flb_calloc(1, sizeof(flb_ctx_t));
if (!ctx) {
perror("malloc");
return NULL;
}
config = flb_config_init();
if (!config) {
flb_free(ctx);
return NULL;
}
ctx->config = config;
ctx->status = FLB_LIB_NONE;
/*
* Initialize our pipe to send data to our worker, used
* by 'lib' input plugin.
*/
ret = flb_pipe_create(config->ch_data);
if (ret == -1) {
perror("pipe");
flb_config_exit(ctx->config);
flb_free(ctx);
return NULL;
}
/* Create the event loop to receive notifications */
ctx->event_loop = mk_event_loop_create(256);
if (!ctx->event_loop) {
flb_config_exit(ctx->config);
flb_free(ctx);
return NULL;
}
config->ch_evl = ctx->event_loop;
/* Prepare the notification channels */
ctx->event_channel = flb_calloc(1, sizeof(struct mk_event));
if (!ctx->event_channel) {
perror("calloc");
flb_config_exit(ctx->config);
flb_free(ctx);
return NULL;
}
MK_EVENT_ZERO(ctx->event_channel);
ret = mk_event_channel_create(config->ch_evl,
&config->ch_notif[0],
&config->ch_notif[1],
ctx->event_channel);
if (ret != 0) {
flb_error("[lib] could not create notification channels");
flb_config_exit(ctx->config);
flb_destroy(ctx);
return NULL;
}
#ifdef FLB_HAVE_AWS_ERROR_REPORTER
if (is_error_reporting_enabled()) {
error_reporter = flb_aws_error_reporter_create();
}
#endif
return ctx;
}
/* Release resources associated to the library context */
void flb_destroy(flb_ctx_t *ctx)
{
if (!ctx) {
return;
}
if (ctx->event_channel) {
mk_event_del(ctx->event_loop, ctx->event_channel);
flb_free(ctx->event_channel);
}
/* Remove resources from the event loop */
mk_event_loop_destroy(ctx->event_loop);
/* cfg->is_running is set to false when flb_engine_shutdown has been invoked (event loop) */
if(ctx->config) {
if (ctx->config->is_running == FLB_TRUE) {
flb_engine_shutdown(ctx->config);
}
flb_config_exit(ctx->config);
}
#ifdef FLB_HAVE_AWS_ERROR_REPORTER
if (is_error_reporting_enabled()) {
flb_aws_error_reporter_destroy(error_reporter);
}
#endif
flb_free(ctx);
ctx = NULL;
#ifdef FLB_HAVE_MTRACE
/* Stop tracing malloc and free */
muntrace();
#endif
}
/* Defines a new input instance */
int flb_input(flb_ctx_t *ctx, const char *input, void *data)
{
struct flb_input_instance *i_ins;
i_ins = flb_input_new(ctx->config, input, data, FLB_TRUE);
if (!i_ins) {
return -1;
}
return i_ins->id;
}
/* Defines a new output instance */
int flb_output(flb_ctx_t *ctx, const char *output, struct flb_lib_out_cb *cb)
{
struct flb_output_instance *o_ins;
o_ins = flb_output_new(ctx->config, output, cb);
if (!o_ins) {
return -1;
}
return o_ins->id;
}
/* Defines a new filter instance */
int flb_filter(flb_ctx_t *ctx, const char *filter, void *data)
{
struct flb_filter_instance *f_ins;
f_ins = flb_filter_new(ctx->config, filter, data);
if (!f_ins) {
return -1;
}
return f_ins->id;
}
/* Set an input interface property */
int flb_input_set(flb_ctx_t *ctx, int ffd, ...)
{
int ret;
char *key;
char *value;
va_list va;
struct flb_input_instance *i_ins;
i_ins = in_instance_get(ctx, ffd);
if (!i_ins) {
return -1;
}
va_start(va, ffd);
while ((key = va_arg(va, char *))) {
value = va_arg(va, char *);
if (!value) {
/* Wrong parameter */
va_end(va);
return -1;
}
ret = flb_input_set_property(i_ins, key, value);
if (ret != 0) {
va_end(va);
return -1;
}
}
va_end(va);
return 0;
}
static inline int flb_config_map_property_check(char *plugin_name, struct mk_list *config_map, char *key, char *val)
{
struct flb_kv *kv;
struct mk_list properties;
int r;
mk_list_init(&properties);
kv = flb_kv_item_create(&properties, (char *) key, (char *) val);
if (!kv) {
return FLB_LIB_ERROR;
}
r = flb_config_map_properties_check(plugin_name, &properties, config_map);
flb_kv_item_destroy(kv);
return r;
}
/* Check if a given k, v is a valid config directive for the given output plugin */
int flb_output_property_check(flb_ctx_t *ctx, int ffd, char *key, char *val)
{
struct flb_output_instance *o_ins;
struct mk_list *config_map;
struct flb_output_plugin *p;
int r;
o_ins = out_instance_get(ctx, ffd);
if (!o_ins) {
return FLB_LIB_ERROR;
}
p = o_ins->p;
if (!p->config_map) {
return FLB_LIB_NO_CONFIG_MAP;
}
config_map = flb_config_map_create(ctx->config, p->config_map);
if (!config_map) {
return FLB_LIB_ERROR;
}
r = flb_config_map_property_check(p->name, config_map, key, val);
flb_config_map_destroy(config_map);
return r;
}
/* Check if a given k, v is a valid config directive for the given input plugin */
int flb_input_property_check(flb_ctx_t *ctx, int ffd, char *key, char *val)
{
struct flb_input_instance *i_ins;
struct flb_input_plugin *p;
struct mk_list *config_map;
int r;
i_ins = in_instance_get(ctx, ffd);
if (!i_ins) {
return FLB_LIB_ERROR;
}
p = i_ins->p;
if (!p->config_map) {
return FLB_LIB_NO_CONFIG_MAP;
}
config_map = flb_config_map_create(ctx->config, p->config_map);
if (!config_map) {
return FLB_LIB_ERROR;
}
r = flb_config_map_property_check(p->name, config_map, key, val);
flb_config_map_destroy(config_map);
return r;
}
/* Check if a given k, v is a valid config directive for the given filter plugin */
int flb_filter_property_check(flb_ctx_t *ctx, int ffd, char *key, char *val)
{
struct flb_filter_instance *f_ins;
struct flb_filter_plugin *p;
struct mk_list *config_map;
int r;
f_ins = filter_instance_get(ctx, ffd);
if (!f_ins) {
return FLB_LIB_ERROR;
}
p = f_ins->p;
if (!p->config_map) {
return FLB_LIB_NO_CONFIG_MAP;
}
config_map = flb_config_map_create(ctx->config, p->config_map);
if (!config_map) {
return FLB_LIB_ERROR;
}
r = flb_config_map_property_check(p->name, config_map, key, val);
flb_config_map_destroy(config_map);
return r;
}
/* Set an output interface property */
int flb_output_set(flb_ctx_t *ctx, int ffd, ...)
{
int ret;
char *key;
char *value;
va_list va;
struct flb_output_instance *o_ins;
o_ins = out_instance_get(ctx, ffd);
if (!o_ins) {
return -1;
}
va_start(va, ffd);
while ((key = va_arg(va, char *))) {
value = va_arg(va, char *);
if (!value) {
/* Wrong parameter */
va_end(va);
return -1;
}
ret = flb_output_set_property(o_ins, key, value);
if (ret != 0) {
va_end(va);
return -1;
}
}
va_end(va);
return 0;
}
int flb_output_set_callback(flb_ctx_t *ctx, int ffd, char *name,
void (*cb)(char *, void *, void *))
{
struct flb_output_instance *o_ins;
o_ins = out_instance_get(ctx, ffd);
if (!o_ins) {
return -1;
}
return flb_callback_set(o_ins->callback, name, cb);
}
int flb_output_set_test(flb_ctx_t *ctx, int ffd, char *test_name,
void (*out_callback) (void *, int, int, void *, size_t, void *),
void *out_callback_data,
void *test_ctx)
{
struct flb_output_instance *o_ins;
o_ins = out_instance_get(ctx, ffd);
if (!o_ins) {
return -1;
}
/*
* Enabling a test, set the output instance in 'test' mode, so no real
* flush callback is invoked, only the desired implemented test.
*/
/* Formatter test */
if (strcmp(test_name, "formatter") == 0) {
o_ins->test_mode = FLB_TRUE;
o_ins->test_formatter.rt_ctx = ctx;
o_ins->test_formatter.rt_ffd = ffd;
o_ins->test_formatter.rt_out_callback = out_callback;
o_ins->test_formatter.rt_data = out_callback_data;
o_ins->test_formatter.flush_ctx = test_ctx;
}
else {
return -1;
}
return 0;
}
/* Set an filter interface property */
int flb_filter_set(flb_ctx_t *ctx, int ffd, ...)
{
int ret;
char *key;
char *value;
va_list va;
struct flb_filter_instance *f_ins;
f_ins = filter_instance_get(ctx, ffd);
if (!f_ins) {
return -1;
}
va_start(va, ffd);
while ((key = va_arg(va, char *))) {
value = va_arg(va, char *);
if (!value) {
/* Wrong parameter */
va_end(va);
return -1;
}
ret = flb_filter_set_property(f_ins, key, value);
if (ret != 0) {
va_end(va);
return -1;
}
}
va_end(va);
return 0;
}
/* Set a service property */
int flb_service_set(flb_ctx_t *ctx, ...)
{
int ret;
char *key;
char *value;
va_list va;
va_start(va, ctx);
while ((key = va_arg(va, char *))) {
value = va_arg(va, char *);
if (!value) {
/* Wrong parameter */
va_end(va);
return -1;
}
ret = flb_config_set_property(ctx->config, key, value);
if (ret != 0) {
va_end(va);
return -1;
}
}
va_end(va);
return 0;
}
/* Load a configuration file that may be used by the input or output plugin */
int flb_lib_config_file(struct flb_lib_ctx *ctx, const char *path)
{
if (access(path, R_OK) != 0) {
perror("access");
return -1;
}
ctx->config->file = mk_rconf_open(path);
if (!ctx->config->file) {
fprintf(stderr, "Error reading configuration file: %s\n", path);
return -1;
}
return 0;
}
/* This is a wrapper to release a buffer which comes from out_lib_flush() */
int flb_lib_free(void* data)
{
if (data == NULL) {
return -1;
}
flb_free(data);
return 0;
}
/* Push some data into the Engine */
int flb_lib_push(flb_ctx_t *ctx, int ffd, const void *data, size_t len)
{
int ret;
struct flb_input_instance *i_ins;
if (ctx->status == FLB_LIB_NONE || ctx->status == FLB_LIB_ERROR) {
flb_error("[lib] cannot push data, engine is not running");
return -1;
}
i_ins = in_instance_get(ctx, ffd);
if (!i_ins) {
return -1;
}
ret = flb_pipe_w(i_ins->channel[1], data, len);
if (ret == -1) {
flb_errno();
return -1;
}
return ret;
}
static void flb_lib_worker(void *data)
{
int ret;
flb_ctx_t *ctx = data;
struct flb_config *config;
config = ctx->config;
mk_utils_worker_rename("flb-pipeline");
ret = flb_engine_start(config);
if (ret == -1) {
flb_engine_failed(config);
flb_engine_shutdown(config);
}
ctx->status = FLB_LIB_NONE;
}
/* Return the current time to be used by lib callers */
double flb_time_now()
{
struct flb_time t;
flb_time_get(&t);
return flb_time_to_double(&t);
}
/* Start the engine */
int flb_start(flb_ctx_t *ctx)
{
int fd;
int bytes;
int ret;
uint64_t val;
pthread_t tid;
struct mk_event *event;
struct flb_config *config;
pthread_once(&flb_lib_once, flb_init_env);
config = ctx->config;
ret = mk_utils_worker_spawn(flb_lib_worker, ctx, &tid);
if (ret == -1) {
return -1;
}
config->worker = tid;
/* Wait for the started signal so we can return to the caller */
mk_event_wait(config->ch_evl);
mk_event_foreach(event, config->ch_evl) {
fd = event->fd;
bytes = flb_pipe_r(fd, &val, sizeof(uint64_t));
if (bytes <= 0) {
ctx->status = FLB_LIB_ERROR;
return -1;
}
if (val == FLB_ENGINE_STARTED) {
flb_debug("[lib] backend started");
ctx->status = FLB_LIB_OK;
break;
}
else if (val == FLB_ENGINE_FAILED) {
flb_error("[lib] backend failed");
ctx->status = FLB_LIB_ERROR;
return -1;
}
}
return 0;
}
int flb_loop(flb_ctx_t *ctx)
{
while (ctx->status == FLB_LIB_OK) {
sleep(1);
}
return 0;
}
/* Stop the engine */
int flb_stop(flb_ctx_t *ctx)
{
int ret;
pthread_t tid;
if (ctx->status == FLB_LIB_NONE || ctx->status == FLB_LIB_ERROR) {
return 0;
}
if (!ctx->config) {
return 0;
}
if (ctx->config->file) {
mk_rconf_free(ctx->config->file);
}
flb_debug("[lib] sending STOP signal to the engine");
tid = ctx->config->worker;
flb_engine_exit(ctx->config);
ret = pthread_join(tid, NULL);
flb_debug("[lib] Fluent Bit engine stopped");
return ret;
}
| 1 | 15,106 | Should we need to invoke pthread_cancel ? | fluent-fluent-bit | c |
@@ -122,7 +122,8 @@ public class ZMSResources {
public Domain postUserDomain(@PathParam("name") String name, @HeaderParam("Y-Audit-Ref") String auditRef, UserDomain detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
- context.authorize("create", "user." + name + ":domain", null);
+ String userDomainPrefix = System.getProperty(ZMSConsts.ZMS_PROP_USER_DOMAIN, ZMSConsts.USER_DOMAIN) + ".";
+ context.authorize("create", userDomainPrefix + name + ":domain", null);
Domain e = this.delegate.postUserDomain(context, name, auditRef, detail);
return e;
} catch (ResourceException e) { | 1 | //
// This file generated by rdl 1.4.12. Do not modify!
//
package com.yahoo.athenz.zms;
import com.yahoo.rdl.*;
import java.util.*;
import javax.ws.rs.*;
import javax.ws.rs.core.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.inject.Inject;
@Path("/v1")
public class ZMSResources {
@GET
@Path("/domain/{domain}")
@Produces(MediaType.APPLICATION_JSON)
public Domain getDomain(@PathParam("domain") String domain) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Domain e = this.delegate.getDomain(context, domain);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getDomain");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain")
@Produces(MediaType.APPLICATION_JSON)
public DomainList getDomainList(@QueryParam("limit") Integer limit, @QueryParam("skip") String skip, @QueryParam("prefix") String prefix, @QueryParam("depth") Integer depth, @QueryParam("account") String account, @QueryParam("ypmid") Integer productId, @QueryParam("member") String roleMember, @QueryParam("role") String roleName, @HeaderParam("If-Modified-Since") String modifiedSince) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
DomainList e = this.delegate.getDomainList(context, limit, skip, prefix, depth, account, productId, roleMember, roleName, modifiedSince);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getDomainList");
throw typedException(code, e, ResourceError.class);
}
}
}
@POST
@Path("/domain")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Domain postTopLevelDomain(@HeaderParam("Y-Audit-Ref") String auditRef, TopLevelDomain detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("create", "sys.auth:domain", null);
Domain e = this.delegate.postTopLevelDomain(context, auditRef, detail);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource postTopLevelDomain");
throw typedException(code, e, ResourceError.class);
}
}
}
@POST
@Path("/subdomain/{parent}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Domain postSubDomain(@PathParam("parent") String parent, @HeaderParam("Y-Audit-Ref") String auditRef, SubDomain detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("create", "" + parent + ":domain", null);
Domain e = this.delegate.postSubDomain(context, parent, auditRef, detail);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource postSubDomain");
throw typedException(code, e, ResourceError.class);
}
}
}
@POST
@Path("/userdomain/{name}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Domain postUserDomain(@PathParam("name") String name, @HeaderParam("Y-Audit-Ref") String auditRef, UserDomain detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("create", "user." + name + ":domain", null);
Domain e = this.delegate.postUserDomain(context, name, auditRef, detail);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource postUserDomain");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{name}")
@Produces(MediaType.APPLICATION_JSON)
public TopLevelDomain deleteTopLevelDomain(@PathParam("name") String name, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "sys.auth:domain", null);
TopLevelDomain e = this.delegate.deleteTopLevelDomain(context, name, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteTopLevelDomain");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/subdomain/{parent}/{name}")
@Produces(MediaType.APPLICATION_JSON)
public SubDomain deleteSubDomain(@PathParam("parent") String parent, @PathParam("name") String name, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "" + parent + ":domain", null);
SubDomain e = this.delegate.deleteSubDomain(context, parent, name, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteSubDomain");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/userdomain/{name}")
@Produces(MediaType.APPLICATION_JSON)
public UserDomain deleteUserDomain(@PathParam("name") String name, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "user." + name + ":domain", null);
UserDomain e = this.delegate.deleteUserDomain(context, name, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteUserDomain");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{name}/meta")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Domain putDomainMeta(@PathParam("name") String name, @HeaderParam("Y-Audit-Ref") String auditRef, DomainMeta detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + name + ":", null);
Domain e = this.delegate.putDomainMeta(context, name, auditRef, detail);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putDomainMeta");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{name}/template")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public DomainTemplate putDomainTemplate(@PathParam("name") String name, @HeaderParam("Y-Audit-Ref") String auditRef, DomainTemplate template) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + name + ":", null);
DomainTemplate e = this.delegate.putDomainTemplate(context, name, auditRef, template);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putDomainTemplate");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{name}/template")
@Produces(MediaType.APPLICATION_JSON)
public DomainTemplateList getDomainTemplateList(@PathParam("name") String name) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
DomainTemplateList e = this.delegate.getDomainTemplateList(context, name);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getDomainTemplateList");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{name}/template/{template}")
@Produces(MediaType.APPLICATION_JSON)
public DomainTemplate deleteDomainTemplate(@PathParam("name") String name, @PathParam("template") String template, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "" + name + ":", null);
DomainTemplate e = this.delegate.deleteDomainTemplate(context, name, template, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteDomainTemplate");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/check")
@Produces(MediaType.APPLICATION_JSON)
public DomainDataCheck getDomainDataCheck(@PathParam("domainName") String domainName) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
DomainDataCheck e = this.delegate.getDomainDataCheck(context, domainName);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getDomainDataCheck");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domainName}/entity/{entityName}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Entity putEntity(@PathParam("domainName") String domainName, @PathParam("entityName") String entityName, @HeaderParam("Y-Audit-Ref") String auditRef, Entity entity) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domainName + ":" + entityName + "", null);
Entity e = this.delegate.putEntity(context, domainName, entityName, auditRef, entity);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putEntity");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/entity/{entityName}")
@Produces(MediaType.APPLICATION_JSON)
public Entity getEntity(@PathParam("domainName") String domainName, @PathParam("entityName") String entityName) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Entity e = this.delegate.getEntity(context, domainName, entityName);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getEntity");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domainName}/entity/{entityName}")
@Produces(MediaType.APPLICATION_JSON)
public Entity deleteEntity(@PathParam("domainName") String domainName, @PathParam("entityName") String entityName, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "" + domainName + ":" + entityName + "", null);
Entity e = this.delegate.deleteEntity(context, domainName, entityName, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteEntity");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/entity")
@Produces(MediaType.APPLICATION_JSON)
public EntityList getEntityList(@PathParam("domainName") String domainName) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
EntityList e = this.delegate.getEntityList(context, domainName);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getEntityList");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/role")
@Produces(MediaType.APPLICATION_JSON)
public RoleList getRoleList(@PathParam("domainName") String domainName, @QueryParam("limit") Integer limit, @QueryParam("skip") String skip) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
RoleList e = this.delegate.getRoleList(context, domainName, limit, skip);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getRoleList");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/roles")
@Produces(MediaType.APPLICATION_JSON)
public Roles getRoles(@PathParam("domainName") String domainName, @QueryParam("members") @DefaultValue("false") Boolean members) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Roles e = this.delegate.getRoles(context, domainName, members);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/role/{roleName}")
@Produces(MediaType.APPLICATION_JSON)
public Role getRole(@PathParam("domainName") String domainName, @PathParam("roleName") String roleName, @QueryParam("auditLog") @DefaultValue("false") Boolean auditLog, @QueryParam("expand") @DefaultValue("false") Boolean expand) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Role e = this.delegate.getRole(context, domainName, roleName, auditLog, expand);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getRole");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domainName}/role/{roleName}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Role putRole(@PathParam("domainName") String domainName, @PathParam("roleName") String roleName, @HeaderParam("Y-Audit-Ref") String auditRef, Role role) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domainName + ":role." + roleName + "", null);
Role e = this.delegate.putRole(context, domainName, roleName, auditRef, role);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putRole");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domainName}/role/{roleName}")
@Produces(MediaType.APPLICATION_JSON)
public Role deleteRole(@PathParam("domainName") String domainName, @PathParam("roleName") String roleName, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "" + domainName + ":role." + roleName + "", null);
Role e = this.delegate.deleteRole(context, domainName, roleName, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteRole");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/role/{roleName}/member/{memberName}")
@Produces(MediaType.APPLICATION_JSON)
public Membership getMembership(@PathParam("domainName") String domainName, @PathParam("roleName") String roleName, @PathParam("memberName") String memberName) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Membership e = this.delegate.getMembership(context, domainName, roleName, memberName);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getMembership");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domainName}/role/{roleName}/member/{memberName}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Membership putMembership(@PathParam("domainName") String domainName, @PathParam("roleName") String roleName, @PathParam("memberName") String memberName, @HeaderParam("Y-Audit-Ref") String auditRef, Membership membership) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domainName + ":role." + roleName + "", null);
Membership e = this.delegate.putMembership(context, domainName, roleName, memberName, auditRef, membership);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putMembership");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domainName}/role/{roleName}/member/{memberName}")
@Produces(MediaType.APPLICATION_JSON)
public Membership deleteMembership(@PathParam("domainName") String domainName, @PathParam("roleName") String roleName, @PathParam("memberName") String memberName, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domainName + ":role." + roleName + "", null);
Membership e = this.delegate.deleteMembership(context, domainName, roleName, memberName, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteMembership");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domainName}/admins")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public DefaultAdmins putDefaultAdmins(@PathParam("domainName") String domainName, @HeaderParam("Y-Audit-Ref") String auditRef, DefaultAdmins defaultAdmins) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "sys.auth:domain", null);
DefaultAdmins e = this.delegate.putDefaultAdmins(context, domainName, auditRef, defaultAdmins);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putDefaultAdmins");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/policy")
@Produces(MediaType.APPLICATION_JSON)
public PolicyList getPolicyList(@PathParam("domainName") String domainName, @QueryParam("limit") Integer limit, @QueryParam("skip") String skip) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
PolicyList e = this.delegate.getPolicyList(context, domainName, limit, skip);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getPolicyList");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/policies")
@Produces(MediaType.APPLICATION_JSON)
public Policies getPolicies(@PathParam("domainName") String domainName, @QueryParam("assertions") @DefaultValue("false") Boolean assertions) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Policies e = this.delegate.getPolicies(context, domainName, assertions);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getPolicies");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/policy/{policyName}")
@Produces(MediaType.APPLICATION_JSON)
public Policy getPolicy(@PathParam("domainName") String domainName, @PathParam("policyName") String policyName) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Policy e = this.delegate.getPolicy(context, domainName, policyName);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getPolicy");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domainName}/policy/{policyName}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Policy putPolicy(@PathParam("domainName") String domainName, @PathParam("policyName") String policyName, @HeaderParam("Y-Audit-Ref") String auditRef, Policy policy) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domainName + ":policy." + policyName + "", null);
Policy e = this.delegate.putPolicy(context, domainName, policyName, auditRef, policy);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putPolicy");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domainName}/policy/{policyName}")
@Produces(MediaType.APPLICATION_JSON)
public Policy deletePolicy(@PathParam("domainName") String domainName, @PathParam("policyName") String policyName, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "" + domainName + ":policy." + policyName + "", null);
Policy e = this.delegate.deletePolicy(context, domainName, policyName, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deletePolicy");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/policy/{policyName}/assertion/{assertionId}")
@Produces(MediaType.APPLICATION_JSON)
public Assertion getAssertion(@PathParam("domainName") String domainName, @PathParam("policyName") String policyName, @PathParam("assertionId") Long assertionId) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Assertion e = this.delegate.getAssertion(context, domainName, policyName, assertionId);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getAssertion");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domainName}/policy/{policyName}/assertion")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Assertion putAssertion(@PathParam("domainName") String domainName, @PathParam("policyName") String policyName, @HeaderParam("Y-Audit-Ref") String auditRef, Assertion assertion) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domainName + ":policy." + policyName + "", null);
Assertion e = this.delegate.putAssertion(context, domainName, policyName, auditRef, assertion);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.CREATED:
throw typedException(code, e, Assertion.class);
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putAssertion");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domainName}/policy/{policyName}/assertion/{assertionId}")
@Produces(MediaType.APPLICATION_JSON)
public Assertion deleteAssertion(@PathParam("domainName") String domainName, @PathParam("policyName") String policyName, @PathParam("assertionId") Long assertionId, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domainName + ":policy." + policyName + "", null);
Assertion e = this.delegate.deleteAssertion(context, domainName, policyName, assertionId, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteAssertion");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domain}/service/{service}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public ServiceIdentity putServiceIdentity(@PathParam("domain") String domain, @PathParam("service") String service, @HeaderParam("Y-Audit-Ref") String auditRef, ServiceIdentity detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":service", null);
ServiceIdentity e = this.delegate.putServiceIdentity(context, domain, service, auditRef, detail);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putServiceIdentity");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domain}/service/{service}")
@Produces(MediaType.APPLICATION_JSON)
public ServiceIdentity getServiceIdentity(@PathParam("domain") String domain, @PathParam("service") String service) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
ServiceIdentity e = this.delegate.getServiceIdentity(context, domain, service);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getServiceIdentity");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domain}/service/{service}")
@Produces(MediaType.APPLICATION_JSON)
public ServiceIdentity deleteServiceIdentity(@PathParam("domain") String domain, @PathParam("service") String service, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "" + domain + ":service", null);
ServiceIdentity e = this.delegate.deleteServiceIdentity(context, domain, service, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteServiceIdentity");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/services")
@Produces(MediaType.APPLICATION_JSON)
public ServiceIdentities getServiceIdentities(@PathParam("domainName") String domainName, @QueryParam("publickeys") @DefaultValue("false") Boolean publickeys, @QueryParam("hosts") @DefaultValue("false") Boolean hosts) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
ServiceIdentities e = this.delegate.getServiceIdentities(context, domainName, publickeys, hosts);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getServiceIdentities");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domainName}/service")
@Produces(MediaType.APPLICATION_JSON)
public ServiceIdentityList getServiceIdentityList(@PathParam("domainName") String domainName, @QueryParam("limit") Integer limit, @QueryParam("skip") String skip) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
ServiceIdentityList e = this.delegate.getServiceIdentityList(context, domainName, limit, skip);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getServiceIdentityList");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domain}/service/{service}/publickey/{id}")
@Produces(MediaType.APPLICATION_JSON)
public PublicKeyEntry getPublicKeyEntry(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("id") String id) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
PublicKeyEntry e = this.delegate.getPublicKeyEntry(context, domain, service, id);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getPublicKeyEntry");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domain}/service/{service}/publickey/{id}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public PublicKeyEntry putPublicKeyEntry(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("id") String id, @HeaderParam("Y-Audit-Ref") String auditRef, PublicKeyEntry publicKeyEntry) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":service." + service + "", null);
PublicKeyEntry e = this.delegate.putPublicKeyEntry(context, domain, service, id, auditRef, publicKeyEntry);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putPublicKeyEntry");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domain}/service/{service}/publickey/{id}")
@Produces(MediaType.APPLICATION_JSON)
public PublicKeyEntry deletePublicKeyEntry(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("id") String id, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":service." + service + "", null);
PublicKeyEntry e = this.delegate.deletePublicKeyEntry(context, domain, service, id, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deletePublicKeyEntry");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domain}/tenancy/{service}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public Tenancy putTenancy(@PathParam("domain") String domain, @PathParam("service") String service, @HeaderParam("Y-Audit-Ref") String auditRef, Tenancy detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":tenancy", null);
Tenancy e = this.delegate.putTenancy(context, domain, service, auditRef, detail);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putTenancy");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domain}/tenancy/{service}")
@Produces(MediaType.APPLICATION_JSON)
public Tenancy getTenancy(@PathParam("domain") String domain, @PathParam("service") String service) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Tenancy e = this.delegate.getTenancy(context, domain, service);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getTenancy");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domain}/tenancy/{service}")
@Produces(MediaType.APPLICATION_JSON)
public Tenancy deleteTenancy(@PathParam("domain") String domain, @PathParam("service") String service, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "" + domain + ":tenancy", null);
Tenancy e = this.delegate.deleteTenancy(context, domain, service, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteTenancy");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domain}/tenancy/{service}/resourceGroup/{resourceGroup}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public TenancyResourceGroup putTenancyResourceGroup(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("resourceGroup") String resourceGroup, @HeaderParam("Y-Audit-Ref") String auditRef, TenancyResourceGroup detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":tenancy." + service + "", null);
TenancyResourceGroup e = this.delegate.putTenancyResourceGroup(context, domain, service, resourceGroup, auditRef, detail);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putTenancyResourceGroup");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domain}/tenancy/{service}/resourceGroup/{resourceGroup}")
@Produces(MediaType.APPLICATION_JSON)
public TenancyResourceGroup deleteTenancyResourceGroup(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("resourceGroup") String resourceGroup, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":tenancy." + service + "", null);
TenancyResourceGroup e = this.delegate.deleteTenancyResourceGroup(context, domain, service, resourceGroup, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteTenancyResourceGroup");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domain}/service/{service}/tenant/{tenantDomain}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public TenantRoles putTenantRoles(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("tenantDomain") String tenantDomain, @HeaderParam("Y-Audit-Ref") String auditRef, TenantRoles detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":tenant." + tenantDomain + "", null);
TenantRoles e = this.delegate.putTenantRoles(context, domain, service, tenantDomain, auditRef, detail);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.CREATED:
throw typedException(code, e, TenantRoles.class);
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putTenantRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domain}/service/{service}/tenant/{tenantDomain}")
@Produces(MediaType.APPLICATION_JSON)
public TenantRoles getTenantRoles(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("tenantDomain") String tenantDomain) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
TenantRoles e = this.delegate.getTenantRoles(context, domain, service, tenantDomain);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getTenantRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domain}/service/{service}/tenant/{tenantDomain}")
@Produces(MediaType.APPLICATION_JSON)
public TenantRoles deleteTenantRoles(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("tenantDomain") String tenantDomain, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("delete", "" + domain + ":tenant." + tenantDomain + "", null);
TenantRoles e = this.delegate.deleteTenantRoles(context, domain, service, tenantDomain, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteTenantRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{domain}/service/{service}/tenant/{tenantDomain}/resourceGroup/{resourceGroup}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public TenantResourceGroupRoles putTenantResourceGroupRoles(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("tenantDomain") String tenantDomain, @PathParam("resourceGroup") String resourceGroup, @HeaderParam("Y-Audit-Ref") String auditRef, TenantResourceGroupRoles detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":tenant." + tenantDomain + "", null);
TenantResourceGroupRoles e = this.delegate.putTenantResourceGroupRoles(context, domain, service, tenantDomain, resourceGroup, auditRef, detail);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.CREATED:
throw typedException(code, e, TenantResourceGroupRoles.class);
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putTenantResourceGroupRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{domain}/service/{service}/tenant/{tenantDomain}/resourceGroup/{resourceGroup}")
@Produces(MediaType.APPLICATION_JSON)
public TenantResourceGroupRoles getTenantResourceGroupRoles(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("tenantDomain") String tenantDomain, @PathParam("resourceGroup") String resourceGroup) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
TenantResourceGroupRoles e = this.delegate.getTenantResourceGroupRoles(context, domain, service, tenantDomain, resourceGroup);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getTenantResourceGroupRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{domain}/service/{service}/tenant/{tenantDomain}/resourceGroup/{resourceGroup}")
@Produces(MediaType.APPLICATION_JSON)
public TenantResourceGroupRoles deleteTenantResourceGroupRoles(@PathParam("domain") String domain, @PathParam("service") String service, @PathParam("tenantDomain") String tenantDomain, @PathParam("resourceGroup") String resourceGroup, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + domain + ":tenant." + tenantDomain + "", null);
TenantResourceGroupRoles e = this.delegate.deleteTenantResourceGroupRoles(context, domain, service, tenantDomain, resourceGroup, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteTenantResourceGroupRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@PUT
@Path("/domain/{tenantDomain}/provDomain/{provDomain}/provService/{provService}/resourceGroup/{resourceGroup}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public ProviderResourceGroupRoles putProviderResourceGroupRoles(@PathParam("tenantDomain") String tenantDomain, @PathParam("provDomain") String provDomain, @PathParam("provService") String provService, @PathParam("resourceGroup") String resourceGroup, @HeaderParam("Y-Audit-Ref") String auditRef, ProviderResourceGroupRoles detail) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + tenantDomain + ":tenancy." + provDomain + "." + provService + "", null);
ProviderResourceGroupRoles e = this.delegate.putProviderResourceGroupRoles(context, tenantDomain, provDomain, provService, resourceGroup, auditRef, detail);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.CREATED:
throw typedException(code, e, ProviderResourceGroupRoles.class);
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource putProviderResourceGroupRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/domain/{tenantDomain}/provDomain/{provDomain}/provService/{provService}/resourceGroup/{resourceGroup}")
@Produces(MediaType.APPLICATION_JSON)
public ProviderResourceGroupRoles getProviderResourceGroupRoles(@PathParam("tenantDomain") String tenantDomain, @PathParam("provDomain") String provDomain, @PathParam("provService") String provService, @PathParam("resourceGroup") String resourceGroup) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
ProviderResourceGroupRoles e = this.delegate.getProviderResourceGroupRoles(context, tenantDomain, provDomain, provService, resourceGroup);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getProviderResourceGroupRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@DELETE
@Path("/domain/{tenantDomain}/provDomain/{provDomain}/provService/{provService}/resourceGroup/{resourceGroup}")
@Produces(MediaType.APPLICATION_JSON)
public ProviderResourceGroupRoles deleteProviderResourceGroupRoles(@PathParam("tenantDomain") String tenantDomain, @PathParam("provDomain") String provDomain, @PathParam("provService") String provService, @PathParam("resourceGroup") String resourceGroup, @HeaderParam("Y-Audit-Ref") String auditRef) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authorize("update", "" + tenantDomain + ":tenancy." + provDomain + "." + provService + "", null);
ProviderResourceGroupRoles e = this.delegate.deleteProviderResourceGroupRoles(context, tenantDomain, provDomain, provService, resourceGroup, auditRef);
return null;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.CONFLICT:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource deleteProviderResourceGroupRoles");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/access/{action}/{resource}")
@Produces(MediaType.APPLICATION_JSON)
public Access getAccess(@PathParam("action") String action, @PathParam("resource") String resource, @QueryParam("domain") String domain, @QueryParam("principal") String checkPrincipal) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Access e = this.delegate.getAccess(context, action, resource, domain, checkPrincipal);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getAccess");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/access/{action}")
@Produces(MediaType.APPLICATION_JSON)
public Access getAccessExt(@PathParam("action") String action, @QueryParam("resource") String resource, @QueryParam("domain") String domain, @QueryParam("principal") String checkPrincipal) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Access e = this.delegate.getAccessExt(context, action, resource, domain, checkPrincipal);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getAccessExt");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/resource")
@Produces(MediaType.APPLICATION_JSON)
public ResourceAccessList getResourceAccessList(@QueryParam("principal") String principal, @QueryParam("action") String action) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
ResourceAccessList e = this.delegate.getResourceAccessList(context, principal, action);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getResourceAccessList");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/sys/modified_domains")
@Produces(MediaType.APPLICATION_JSON)
public void getSignedDomains(@QueryParam("domain") String domain, @QueryParam("metaonly") String metaOnly, @HeaderParam("If-None-Match") String matchingTag) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
GetSignedDomainsResult result = new GetSignedDomainsResult(context);
this.delegate.getSignedDomains(context, domain, metaOnly, matchingTag, result);
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.NOT_MODIFIED:
throw typedException(code, e, void.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getSignedDomains");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/user/{userName}/token")
@Produces(MediaType.APPLICATION_JSON)
public UserToken getUserToken(@PathParam("userName") String userName, @QueryParam("services") String serviceNames) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
UserToken e = this.delegate.getUserToken(context, userName, serviceNames);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getUserToken");
throw typedException(code, e, ResourceError.class);
}
}
}
@OPTIONS
@Path("/user/{userName}/token")
@Produces(MediaType.APPLICATION_JSON)
public UserToken optionsUserToken(@PathParam("userName") String userName, @QueryParam("services") String serviceNames) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
UserToken e = this.delegate.optionsUserToken(context, userName, serviceNames);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource optionsUserToken");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/principal")
@Produces(MediaType.APPLICATION_JSON)
public ServicePrincipal getServicePrincipal() {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
ServicePrincipal e = this.delegate.getServicePrincipal(context);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.FORBIDDEN:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getServicePrincipal");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/template")
@Produces(MediaType.APPLICATION_JSON)
public ServerTemplateList getServerTemplateList() {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
ServerTemplateList e = this.delegate.getServerTemplateList(context);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getServerTemplateList");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/template/{template}")
@Produces(MediaType.APPLICATION_JSON)
public Template getTemplate(@PathParam("template") String template) {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
context.authenticate();
Template e = this.delegate.getTemplate(context, template);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
case ResourceException.BAD_REQUEST:
throw typedException(code, e, ResourceError.class);
case ResourceException.NOT_FOUND:
throw typedException(code, e, ResourceError.class);
case ResourceException.UNAUTHORIZED:
throw typedException(code, e, ResourceError.class);
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getTemplate");
throw typedException(code, e, ResourceError.class);
}
}
}
@GET
@Path("/schema")
@Produces(MediaType.APPLICATION_JSON)
public Schema getRdlSchema() {
try {
ResourceContext context = this.delegate.newResourceContext(this.request, this.response);
Schema e = this.delegate.getRdlSchema(context);
return e;
} catch (ResourceException e) {
int code = e.getCode();
switch (code) {
default:
System.err.println("*** Warning: undeclared exception (" + code + ") for resource getRdlSchema");
throw typedException(code, e, ResourceError.class);
}
}
}
WebApplicationException typedException(int code, ResourceException e, Class<?> eClass) {
Object data = e.getData();
Object entity = eClass.isInstance(data) ? data : null;
if (entity != null) {
return new WebApplicationException(Response.status(code).entity(entity).build());
} else {
return new WebApplicationException(code);
}
}
@Inject private ZMSHandler delegate;
@Context private HttpServletRequest request;
@Context private HttpServletResponse response;
}
| 1 | 4,290 | this is auto generated file so no changes are allowed here | AthenZ-athenz | java |
@@ -0,0 +1,13 @@
+if (
+ node.querySelector(
+ 'input[type="submit"]:not([disabled]), img[type="submit"]:not([disabled]), button[type="submit"]:not([disabled])'
+ )
+) {
+ return true;
+}
+
+if (!node.querySelectorAll(':not(textarea)').length) {
+ return false;
+}
+
+return undefined; | 1 | 1 | 13,247 | All buttons are submit buttons, except if they are `type=reset` or `type=button`. I suggest you do an exclude of those, rather than only include `button[type=submit]`. | dequelabs-axe-core | js |
|
@@ -38,7 +38,7 @@ module Travis
def perl_version
# this check is needed because safe_yaml parses the string 5.10 to 5.1
- config[:perl] == 5.1 ? "5.10" : config[:perl]
+ config[:perl] == 5.1 ? "5.10" : config[:perl] == 5.2 ? "5.20" : config[:perl]
end
end
end | 1 | module Travis
module Build
class Script
class Perl < Script
DEFAULTS = {
perl: '5.14'
}
def cache_slug
super << "--perl-" << config[:perl].to_s
end
def export
super
set 'TRAVIS_PERL_VERSION', perl_version, echo: false
end
def setup
super
cmd "perlbrew use #{perl_version}"
end
def announce
super
cmd 'perl --version'
cmd 'cpanm --version'
end
def install
cmd 'cpanm --quiet --installdeps --notest .', fold: 'install', retry: true
end
def script
self.if '-f Build.PL', 'perl Build.PL && ./Build && ./Build test'
self.elif '-f Makefile.PL', 'perl Makefile.PL && make test'
self.else 'make test'
end
def perl_version
# this check is needed because safe_yaml parses the string 5.10 to 5.1
config[:perl] == 5.1 ? "5.10" : config[:perl]
end
end
end
end
end
| 1 | 11,780 | can you please make this multi line, this version is hard to read. | travis-ci-travis-build | rb |
@@ -128,7 +128,7 @@ Blockly.HorizontalFlyout.prototype.setMetrics_ = function(xyRatio) {
return;
}
- if (goog.isNumber(xyRatio.x)) {
+ if (typeof xyRatio.x === 'number') {
this.workspace_.scrollX = -metrics.contentWidth * xyRatio.x;
}
| 1 | /**
* @license
* Visual Blocks Editor
*
* Copyright 2011 Google Inc.
* https://developers.google.com/blockly/
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @fileoverview Flyout tray containing blocks which may be created.
* @author [email protected] (Neil Fraser)
*/
'use strict';
goog.provide('Blockly.HorizontalFlyout');
goog.require('Blockly.Block');
goog.require('Blockly.Comment');
goog.require('Blockly.Events');
goog.require('Blockly.FlyoutButton');
goog.require('Blockly.Flyout');
goog.require('Blockly.WorkspaceSvg');
goog.require('goog.dom');
goog.require('goog.dom.animationFrame.polyfill');
goog.require('goog.events');
goog.require('goog.math.Rect');
goog.require('goog.userAgent');
/**
* Class for a flyout.
* @param {!Object} workspaceOptions Dictionary of options for the workspace.
* @extends {Blockly.Flyout}
* @constructor
*/
Blockly.HorizontalFlyout = function(workspaceOptions) {
workspaceOptions.getMetrics = this.getMetrics_.bind(this);
workspaceOptions.setMetrics = this.setMetrics_.bind(this);
Blockly.HorizontalFlyout.superClass_.constructor.call(this, workspaceOptions);
/**
* Flyout should be laid out horizontally vs vertically.
* @type {boolean}
* @private
*/
this.horizontalLayout_ = true;
};
goog.inherits(Blockly.HorizontalFlyout, Blockly.Flyout);
/**
* Return an object with all the metrics required to size scrollbars for the
* flyout. The following properties are computed:
* .viewHeight: Height of the visible rectangle,
* .viewWidth: Width of the visible rectangle,
* .contentHeight: Height of the contents,
* .contentWidth: Width of the contents,
* .viewTop: Offset of top edge of visible rectangle from parent,
* .contentTop: Offset of the top-most content from the y=0 coordinate,
* .absoluteTop: Top-edge of view.
* .viewLeft: Offset of the left edge of visible rectangle from parent,
* .contentLeft: Offset of the left-most content from the x=0 coordinate,
* .absoluteLeft: Left-edge of view.
* @return {Object} Contains size and position metrics of the flyout.
* @private
*/
Blockly.HorizontalFlyout.prototype.getMetrics_ = function() {
if (!this.isVisible()) {
// Flyout is hidden.
return null;
}
try {
var optionBox = this.workspace_.getCanvas().getBBox();
} catch (e) {
// Firefox has trouble with hidden elements (Bug 528969).
var optionBox = {height: 0, y: 0, width: 0, x: 0};
}
var absoluteTop = this.SCROLLBAR_PADDING;
var absoluteLeft = this.SCROLLBAR_PADDING;
if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_BOTTOM) {
absoluteTop = 0;
}
var viewHeight = this.height_;
if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_TOP) {
viewHeight += this.MARGIN;
}
var viewWidth = this.width_ - 2 * this.SCROLLBAR_PADDING;
var metrics = {
viewHeight: viewHeight,
viewWidth: viewWidth,
contentHeight: optionBox.height * this.workspace_.scale + 2 * this.MARGIN,
contentWidth: optionBox.width * this.workspace_.scale + 2 * this.MARGIN,
viewTop: -this.workspace_.scrollY,
viewLeft: -this.workspace_.scrollX,
contentTop: optionBox.y,
contentLeft: optionBox.x,
absoluteTop: absoluteTop,
absoluteLeft: absoluteLeft
};
return metrics;
};
/**
* Sets the translation of the flyout to match the scrollbars.
* @param {!Object} xyRatio Contains a y property which is a float
* between 0 and 1 specifying the degree of scrolling and a
* similar x property.
* @private
*/
Blockly.HorizontalFlyout.prototype.setMetrics_ = function(xyRatio) {
var metrics = this.getMetrics_();
// This is a fix to an apparent race condition.
if (!metrics) {
return;
}
if (goog.isNumber(xyRatio.x)) {
this.workspace_.scrollX = -metrics.contentWidth * xyRatio.x;
}
this.workspace_.translate(this.workspace_.scrollX + metrics.absoluteLeft,
this.workspace_.scrollY + metrics.absoluteTop);
if (this.categoryScrollPositions) {
this.selectCategoryByScrollPosition(-this.workspace_.scrollX);
}
};
/**
* Move the flyout to the edge of the workspace.
*/
Blockly.HorizontalFlyout.prototype.position = function() {
if (!this.isVisible()) {
return;
}
var targetWorkspaceMetrics = this.targetWorkspace_.getMetrics();
if (!targetWorkspaceMetrics) {
// Hidden components will return null.
return;
}
var edgeWidth = this.horizontalLayout_ ?
targetWorkspaceMetrics.viewWidth - 2 * this.CORNER_RADIUS :
this.width_ - this.CORNER_RADIUS;
var edgeHeight = this.horizontalLayout_ ?
this.height_ - this.CORNER_RADIUS :
targetWorkspaceMetrics.viewHeight - 2 * this.CORNER_RADIUS;
this.setBackgroundPath_(edgeWidth, edgeHeight);
var x = targetWorkspaceMetrics.absoluteLeft;
if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_RIGHT) {
x += targetWorkspaceMetrics.viewWidth;
x -= this.width_;
}
var y = targetWorkspaceMetrics.absoluteTop;
if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_BOTTOM) {
y += targetWorkspaceMetrics.viewHeight;
y -= this.height_;
}
// Record the height for Blockly.Flyout.getMetrics_, or width if the layout is
// horizontal.
if (this.horizontalLayout_) {
this.width_ = targetWorkspaceMetrics.viewWidth;
} else {
this.height_ = targetWorkspaceMetrics.viewHeight;
}
this.svgGroup_.setAttribute("width", this.width_);
this.svgGroup_.setAttribute("height", this.height_);
var transform = 'translate(' + x + 'px,' + y + 'px)';
Blockly.utils.setCssTransform(this.svgGroup_, transform);
// Update the scrollbar (if one exists).
if (this.scrollbar_) {
// Set the scrollbars origin to be the top left of the flyout.
this.scrollbar_.setOrigin(x, y);
this.scrollbar_.resize();
}
// The blocks need to be visible in order to be laid out and measured correctly, but we don't
// want the flyout to show up until it's properly sized.
// Opacity is set to zero in show().
this.svgGroup_.style.opacity = 1;
};
/**
* Create and set the path for the visible boundaries of the flyout.
* @param {number} width The width of the flyout, not including the
* rounded corners.
* @param {number} height The height of the flyout, not including
* rounded corners.
* @private
*/
Blockly.HorizontalFlyout.prototype.setBackgroundPath_ = function(width, height) {
var atTop = this.toolboxPosition_ == Blockly.TOOLBOX_AT_TOP;
// Start at top left.
var path = ['M 0,' + (atTop ? 0 : this.CORNER_RADIUS)];
if (atTop) {
// Top.
path.push('h', width + 2 * this.CORNER_RADIUS);
// Right.
path.push('v', height);
// Bottom.
path.push('a', this.CORNER_RADIUS, this.CORNER_RADIUS, 0, 0, 1,
-this.CORNER_RADIUS, this.CORNER_RADIUS);
path.push('h', -1 * width);
// Left.
path.push('a', this.CORNER_RADIUS, this.CORNER_RADIUS, 0, 0, 1,
-this.CORNER_RADIUS, -this.CORNER_RADIUS);
path.push('z');
} else {
// Top.
path.push('a', this.CORNER_RADIUS, this.CORNER_RADIUS, 0, 0, 1,
this.CORNER_RADIUS, -this.CORNER_RADIUS);
path.push('h', width);
// Right.
path.push('a', this.CORNER_RADIUS, this.CORNER_RADIUS, 0, 0, 1,
this.CORNER_RADIUS, this.CORNER_RADIUS);
path.push('v', height);
// Bottom.
path.push('h', -width - 2 * this.CORNER_RADIUS);
// Left.
path.push('z');
}
this.svgBackground_.setAttribute('d', path.join(' '));
};
/**
* Scroll the flyout to the top.
*/
Blockly.HorizontalFlyout.prototype.scrollToStart = function() {
this.scrollbar_.set(this.RTL ? Infinity : 0);
};
/**
* Scroll the flyout to a position.
* @param {number} pos The targeted scroll position.
* @package
*/
Blockly.HorizontalFlyout.prototype.scrollTo = function(pos) {
this.scrollTarget = pos * this.workspace_.scale;
// Make sure not to set the scroll target past the farthest point we can
// scroll to, i.e. the content width minus the view width
var metrics = this.workspace_.getMetrics();
var contentWidth = metrics.contentWidth;
var viewWidth = metrics.viewWidth;
this.scrollTarget = Math.min(this.scrollTarget, contentWidth - viewWidth);
this.stepScrollAnimation();
};
/**
* Scroll the flyout.
* @param {!Event} e Mouse wheel scroll event.
* @private
*/
Blockly.HorizontalFlyout.prototype.wheel_ = function(e) {
// remove scrollTarget to stop auto scrolling in stepScrollAnimation
this.scrollTarget = null;
var delta = e.deltaX;
// If we're scrolling more vertically than horizontally, use the vertical
// scroll delta instead. This allows people using a mouse wheel (which can
// only scroll vertically) to scroll the horizontal flyout. It also allows
// trackpad users to scroll it by scrolling either horizontally or
// vertically.
if (Math.abs(e.deltaY) > Math.abs(delta)) {
delta = e.deltaY;
}
if (delta) {
// Firefox's mouse wheel deltas are a tenth that of Chrome/Safari.
// DeltaMode is 1 for a mouse wheel, but not for a trackpad scroll event
if (goog.userAgent.GECKO && (e.deltaMode === 1)) {
delta *= 10;
}
var metrics = this.getMetrics_();
var pos = metrics.viewLeft + delta;
var limit = metrics.contentWidth - metrics.viewWidth;
pos = Math.min(pos, limit);
pos = Math.max(pos, 0);
this.scrollbar_.set(pos);
// When the flyout moves from a wheel event, hide WidgetDiv and DropDownDiv.
Blockly.WidgetDiv.hide(true);
Blockly.DropDownDiv.hideWithoutAnimation();
}
// Don't scroll the page.
e.preventDefault();
// Don't propagate mousewheel event (zooming).
e.stopPropagation();
};
/**
* Lay out the blocks in the flyout.
* @param {!Array.<!Object>} contents The blocks and buttons to lay out.
* @param {!Array.<number>} gaps The visible gaps between blocks.
* @private
*/
Blockly.HorizontalFlyout.prototype.layout_ = function(contents, gaps) {
this.workspace_.scale = this.targetWorkspace_.scale;
var margin = this.MARGIN;
var cursorX = margin;
var cursorY = margin;
if (this.RTL) {
contents = contents.reverse();
}
for (var i = 0, item; item = contents[i]; i++) {
if (item.type == 'block') {
var block = item.block;
var allBlocks = block.getDescendants(false);
for (var j = 0, child; child = allBlocks[j]; j++) {
// Mark blocks as being inside a flyout. This is used to detect and
// prevent the closure of the flyout if the user right-clicks on such a
// block.
child.isInFlyout = true;
}
var root = block.getSvgRoot();
var blockHW = block.getHeightWidth();
var moveX = cursorX;
if (this.RTL) {
moveX += blockHW.width;
}
block.moveBy(moveX, cursorY);
cursorX += blockHW.width + gaps[i];
// Create an invisible rectangle under the block to act as a button. Just
// using the block as a button is poor, since blocks have holes in them.
var rect = Blockly.utils.createSvgElement('rect', {'fill-opacity': 0}, null);
rect.tooltip = block;
Blockly.Tooltip.bindMouseEvents(rect);
// Add the rectangles under the blocks, so that the blocks' tooltips work.
this.workspace_.getCanvas().insertBefore(rect, block.getSvgRoot());
block.flyoutRect_ = rect;
this.backgroundButtons_[i] = rect;
this.addBlockListeners_(root, block, rect);
} else if (item.type == 'button') {
var button = item.button;
var buttonSvg = button.createDom();
button.moveTo(cursorX, cursorY);
button.show();
// Clicking on a flyout button or label is a lot like clicking on the
// flyout background.
this.listeners_.push(Blockly.bindEventWithChecks_(buttonSvg, 'mousedown',
this, this.onMouseDown_));
this.buttons_.push(button);
cursorX += (button.width + gaps[i]);
}
}
};
/**
* Determine if a drag delta is toward the workspace, based on the position
* and orientation of the flyout. This to decide if a new block should be
* created or if the flyout should scroll.
* @param {!goog.math.Coordinate} currentDragDeltaXY How far the pointer has
* moved from the position at mouse down, in pixel units.
* @return {boolean} true if the drag is toward the workspace.
* @package
*/
Blockly.HorizontalFlyout.prototype.isDragTowardWorkspace = function(currentDragDeltaXY) {
var dx = currentDragDeltaXY.x;
var dy = currentDragDeltaXY.y;
// Direction goes from -180 to 180, with 0 toward the right and 90 on top.
var dragDirection = Math.atan2(dy, dx) / Math.PI * 180;
var draggingTowardWorkspace = false;
var range = this.dragAngleRange_;
if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_TOP) {
// Horizontal at top.
if (dragDirection < 90 + range && dragDirection > 90 - range) {
draggingTowardWorkspace = true;
}
} else {
// Horizontal at bottom.
if (dragDirection > -90 - range && dragDirection < -90 + range) {
draggingTowardWorkspace = true;
}
}
return draggingTowardWorkspace;
};
/**
* Return the deletion rectangle for this flyout in viewport coordinates.
* @return {goog.math.Rect} Rectangle in which to delete.
*/
Blockly.HorizontalFlyout.prototype.getClientRect = function() {
if (!this.svgGroup_) {
return null;
}
var flyoutRect = this.svgGroup_.getBoundingClientRect();
// BIG_NUM is offscreen padding so that blocks dragged beyond the shown flyout
// area are still deleted. Must be larger than the largest screen size,
// but be smaller than half Number.MAX_SAFE_INTEGER (not available on IE).
var BIG_NUM = 1000000000;
var y = flyoutRect.top;
var height = flyoutRect.height;
if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_TOP) {
return new goog.math.Rect(-BIG_NUM, y - BIG_NUM, BIG_NUM * 2,
BIG_NUM + height);
} else if (this.toolboxPosition_ == Blockly.TOOLBOX_AT_BOTTOM) {
return new goog.math.Rect(-BIG_NUM, y, BIG_NUM * 2,
BIG_NUM + height);
}
};
/**
* Compute height of flyout. Position button under each block.
* For RTL: Lay out the blocks right-aligned.
* @param {!Array<!Blockly.Block>} blocks The blocks to reflow.
*/
Blockly.HorizontalFlyout.prototype.reflowInternal_ = function(blocks) {
this.workspace_.scale = this.targetWorkspace_.scale;
var flyoutHeight = 0;
for (var i = 0, block; block = blocks[i]; i++) {
flyoutHeight = Math.max(flyoutHeight, block.getHeightWidth().height);
}
flyoutHeight += this.MARGIN * 1.5;
flyoutHeight *= this.workspace_.scale;
flyoutHeight += Blockly.Scrollbar.scrollbarThickness;
if (this.height_ != flyoutHeight) {
for (var i = 0, block; block = blocks[i]; i++) {
var blockHW = block.getHeightWidth();
if (block.flyoutRect_) {
block.flyoutRect_.setAttribute('width', blockHW.width);
block.flyoutRect_.setAttribute('height', blockHW.height);
// Rectangles behind blocks with output tabs are shifted a bit.
var blockXY = block.getRelativeToSurfaceXY();
block.flyoutRect_.setAttribute('y', blockXY.y);
block.flyoutRect_.setAttribute('x',
this.RTL ? blockXY.x - blockHW.width : blockXY.x);
// For hat blocks we want to shift them down by the hat height
// since the y coordinate is the corner, not the top of the hat.
var hatOffset =
block.startHat_ ? Blockly.BlockSvg.START_HAT_HEIGHT : 0;
if (hatOffset) {
block.moveBy(0, hatOffset);
}
block.flyoutRect_.setAttribute('y', blockXY.y);
}
}
// Record the height for .getMetrics_ and .position.
this.height_ = flyoutHeight;
// Call this since it is possible the trash and zoom buttons need
// to move. e.g. on a bottom positioned flyout when zoom is clicked.
this.targetWorkspace_.resize();
}
};
| 1 | 9,997 | For consistency, it's best to either always use strict equality (`===`) or loose equality (`==`) in `typeof` checks, and to not mix them. | LLK-scratch-blocks | js |
@@ -11,6 +11,10 @@ FactoryGirl.define do
project_title "NCR Name"
association :proposal, flow: 'linear'
+ trait :with_approver do
+ association :proposal, :with_approver, flow: 'linear'
+ end
+
trait :with_approvers do
association :proposal, :with_approvers, flow: 'linear'
end | 1 | FactoryGirl.define do
factory :ncr_work_order, class: Ncr::WorkOrder do
amount 1000
expense_type "BA61"
vendor "Some Vend"
not_to_exceed false
building_number Ncr::BUILDING_NUMBERS[0]
emergency false
rwa_number "R1234567" # TODO remove, since it's not applicable for BA61
org_code Ncr::Organization.all[0].to_s
project_title "NCR Name"
association :proposal, flow: 'linear'
trait :with_approvers do
association :proposal, :with_approvers, flow: 'linear'
end
trait :is_emergency do
emergency true
association :proposal, :with_observers, flow: 'linear'
end
end
end
| 1 | 13,565 | Work Orders would never have only one approver, right? | 18F-C2 | rb |
@@ -0,0 +1,17 @@
+package com.codahale.metrics.collectd;
+
+enum DataType {
+
+ COUNTER(0), GAUGE(1);
+
+ private final int code;
+
+ private DataType(int code) {
+ this.code = code;
+ }
+
+ public int getCode() {
+ return code;
+ }
+
+} | 1 | 1 | 7,031 | `code` is written to the message as a `byte`, so I think it's better to declare it in the enum as `byte` as well to avoid a narrowing primitive conversion from `int` to `byte` in runtime. | dropwizard-metrics | java |
|
@@ -163,9 +163,11 @@ function DashboardTopEarningPagesWidget( { Widget, WidgetReportZero, WidgetRepor
{
title: __( 'Earnings', 'google-site-kit' ),
tooltip: __( 'Earnings', 'google-site-kit' ),
- Component: ( { row } ) => numFmt(
- row.metrics[ 0 ].values[ 0 ],
- currencyFormat,
+ field: 'metrics.0.values.0',
+ Component: ( { fieldValue } ) => (
+ <span>
+ { numFmt( fieldValue, currencyFormat ) }
+ </span>
),
},
]; | 1 | /**
* DashboardTopEarningPagesWidget component.
*
* Site Kit by Google, Copyright 2021 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* WordPress dependencies
*/
import { __, _x } from '@wordpress/i18n';
import { compose } from '@wordpress/compose';
/**
* Internal dependencies
*/
import Data from 'googlesitekit-data';
import { MODULES_ANALYTICS, DATE_RANGE_OFFSET } from '../../../analytics/datastore/constants';
import { CORE_USER } from '../../../../googlesitekit/datastore/user/constants';
import { STORE_NAME } from '../../datastore/constants';
import whenActive from '../../../../util/when-active';
import PreviewTable from '../../../../components/PreviewTable';
import SourceLink from '../../../../components/SourceLink';
import AdSenseLinkCTA from '../../../analytics/components/common/AdSenseLinkCTA';
import { isZeroReport } from '../../../analytics/util';
import TableOverflowContainer from '../../../../components/TableOverflowContainer';
import ReportTable from '../../../../components/ReportTable';
import Link from '../../../../components/Link';
import AdBlockerWarning from '../common/AdBlockerWarning';
import { generateDateRangeArgs } from '../../../analytics/util/report-date-range-args';
import { numFmt } from '../../../../util';
import { getCurrencyFormat } from '../../util/currency';
const { useSelect } = Data;
function DashboardTopEarningPagesWidget( { Widget, WidgetReportZero, WidgetReportError } ) {
const {
analyticsMainURL,
data,
error,
loading,
isAdSenseLinked,
isAdblockerActive,
currencyFormat,
} = useSelect( ( select ) => {
const { startDate, endDate } = select( CORE_USER ).getDateRangeDates( {
offsetDays: DATE_RANGE_OFFSET,
} );
const args = {
startDate,
endDate,
dimensions: [ 'ga:pageTitle', 'ga:pagePath' ],
metrics: [
{ expression: 'ga:adsenseRevenue', alias: 'Earnings' },
{ expression: 'ga:adsenseECPM', alias: 'Page RPM' },
{ expression: 'ga:adsensePageImpressions', alias: 'Impressions' },
],
orderby: {
fieldName: 'ga:adsenseRevenue',
sortOrder: 'DESCENDING',
},
limit: 5,
};
const adsenseData = select( STORE_NAME ).getReport( {
startDate,
endDate,
metrics: 'TOTAL_EARNINGS',
} );
const adSenseLinked = select( MODULES_ANALYTICS ).getAdsenseLinked();
return {
analyticsMainURL: select( MODULES_ANALYTICS ).getServiceReportURL( 'content-publisher-overview', generateDateRangeArgs( { startDate, endDate } ) ),
data: select( MODULES_ANALYTICS ).getReport( args ),
error: select( MODULES_ANALYTICS ).getErrorForSelector( 'getReport', [ args ] ),
loading: ! select( MODULES_ANALYTICS ).hasFinishedResolution( 'getReport', [ args ] ),
isAdSenseLinked: adSenseLinked,
isAdblockerActive: select( STORE_NAME ).isAdBlockerActive(),
currencyFormat: getCurrencyFormat( adsenseData ),
};
} );
const Footer = () => (
<SourceLink
className="googlesitekit-data-block__source"
name={ _x( 'Analytics', 'Service name', 'google-site-kit' ) }
href={ analyticsMainURL }
external
/>
);
if ( isAdblockerActive ) {
return (
<Widget Footer={ Footer }>
<AdBlockerWarning />
</Widget>
);
}
if ( loading ) {
return (
<Widget noPadding Footer={ Footer }>
<PreviewTable rows={ 5 } padding />
</Widget>
);
}
// A restricted metrics error will cause this value to change in the resolver
// so this check should happen before an error, which is only relevant if they are linked.
if ( ! isAdSenseLinked ) {
return (
<Widget Footer={ Footer }>
<AdSenseLinkCTA />
</Widget>
);
}
if ( error ) {
return (
<Widget Footer={ Footer } >
<WidgetReportError moduleSlug="analytics" error={ error } />
</Widget>
);
}
if ( isZeroReport( data ) ) {
return (
<Widget Footer={ Footer }>
<WidgetReportZero moduleSlug="analytics" />
</Widget>
);
}
const tableColumns = [
{
title: __( 'Top Earning Pages', 'google-site-kit' ),
tooltip: __( 'Top Earning Pages', 'google-site-kit' ),
primary: true,
Component: ( { row } ) => {
const [ title, url ] = row.dimensions;
return (
<Link
href={ url }
children={ title }
external
inherit
/>
);
},
},
{
title: __( 'Earnings', 'google-site-kit' ),
tooltip: __( 'Earnings', 'google-site-kit' ),
Component: ( { row } ) => numFmt(
row.metrics[ 0 ].values[ 0 ],
currencyFormat,
),
},
];
return (
<Widget noPadding Footer={ Footer }>
<TableOverflowContainer>
<ReportTable
rows={ data[ 0 ].data.rows }
columns={ tableColumns }
/>
</TableOverflowContainer>
</Widget>
);
}
export default compose(
whenActive( { moduleName: 'adsense' } ),
whenActive( { moduleName: 'analytics' } ),
)( DashboardTopEarningPagesWidget );
| 1 | 39,604 | This is the only "extra" change here. | google-site-kit-wp | js |
@@ -36,14 +36,15 @@ type SignedMessageValidator interface {
}
type defaultMessageValidator struct {
- allowHighNonce bool
+ allowHighNonce bool
+ bypassBLSSignatureCheck bool
}
// NewDefaultMessageValidator creates a new default validator.
// A default validator checks for both permanent semantic problems (e.g. invalid signature)
// as well as temporary conditions which may change (e.g. actor can't cover gas limit).
func NewDefaultMessageValidator() SignedMessageValidator {
- return &defaultMessageValidator{}
+ return &defaultMessageValidator{bypassBLSSignatureCheck: true}
}
// NewOutboundMessageValidator creates a new default validator for outbound messages. This | 1 | package consensus
import (
"context"
"math/big"
"github.com/filecoin-project/go-filecoin/actor"
"github.com/filecoin-project/go-filecoin/actor/builtin/account"
"github.com/filecoin-project/go-filecoin/address"
"github.com/filecoin-project/go-filecoin/config"
"github.com/filecoin-project/go-filecoin/metrics"
"github.com/filecoin-project/go-filecoin/state"
"github.com/filecoin-project/go-filecoin/types"
"github.com/filecoin-project/go-filecoin/vm/errors"
)
var errNegativeValueCt *metrics.Int64Counter
var errGasAboveBlockLimitCt *metrics.Int64Counter
var errInsufficientGasCt *metrics.Int64Counter
var errNonceTooLowCt *metrics.Int64Counter
var errNonceTooHighCt *metrics.Int64Counter
func init() {
errNegativeValueCt = metrics.NewInt64Counter("consensus/msg_negative_value_err", "Number of negative valuedmessage")
errGasAboveBlockLimitCt = metrics.NewInt64Counter("consensus/msg_gas_above_blk_limit_err", "Number of messages with gas above block limit")
errInsufficientGasCt = metrics.NewInt64Counter("consensus/msg_insufficient_gas_err", "Number of messages with insufficient gas")
errNonceTooLowCt = metrics.NewInt64Counter("consensus/msg_nonce_low_err", "Number of messages with nonce too low")
errNonceTooHighCt = metrics.NewInt64Counter("consensus/msg_nonce_high_err", "Number of messages with nonce too high")
}
// SignedMessageValidator validates incoming signed messages.
type SignedMessageValidator interface {
// Validate checks that a message is semantically valid for processing, returning any
// invalidity as an error
Validate(ctx context.Context, msg *types.SignedMessage, fromActor *actor.Actor) error
}
type defaultMessageValidator struct {
allowHighNonce bool
}
// NewDefaultMessageValidator creates a new default validator.
// A default validator checks for both permanent semantic problems (e.g. invalid signature)
// as well as temporary conditions which may change (e.g. actor can't cover gas limit).
func NewDefaultMessageValidator() SignedMessageValidator {
return &defaultMessageValidator{}
}
// NewOutboundMessageValidator creates a new default validator for outbound messages. This
// validator matches the default behaviour but allows nonces higher than the actor's current nonce
// (allowing multiple messages to enter the mpool at once).
func NewOutboundMessageValidator() SignedMessageValidator {
return &defaultMessageValidator{allowHighNonce: true}
}
var _ SignedMessageValidator = (*defaultMessageValidator)(nil)
func (v *defaultMessageValidator) Validate(ctx context.Context, msg *types.SignedMessage, fromActor *actor.Actor) error {
if !msg.VerifySignature() {
return errInvalidSignature
}
if msg.From == msg.To {
return errSelfSend
}
if msg.GasPrice.LessEqual(types.ZeroAttoFIL) {
return errGasPriceZero
}
// Sender must be an account actor, or an empty actor which will be upgraded to an account actor
// when the message is processed.
if !(fromActor.Empty() || account.IsAccount(fromActor)) {
return errNonAccountActor
}
if msg.Value.IsNegative() {
log.Debugf("Cannot transfer negative value: %s from actor: %s", msg.Value.String(), msg.From.String())
errNegativeValueCt.Inc(ctx, 1)
return errNegativeValue
}
if msg.GasLimit > types.BlockGasLimit {
log.Debugf("Message: %s gas limit from actor: %s above block limit: %s", msg.String(), msg.From.String(), string(types.BlockGasLimit))
errGasAboveBlockLimitCt.Inc(ctx, 1)
return errGasAboveBlockLimit
}
// Avoid processing messages for actors that cannot pay.
if !canCoverGasLimit(msg, fromActor) {
log.Debugf("Insufficient funds for message: %s to cover gas limit from actor: %s", msg.String(), msg.From.String())
errInsufficientGasCt.Inc(ctx, 1)
return errInsufficientGas
}
if msg.Nonce < fromActor.Nonce {
log.Debugf("Message: %s nonce lower than actor nonce: %s from actor: %s", msg.String(), fromActor.Nonce, msg.From.String())
errNonceTooLowCt.Inc(ctx, 1)
return errNonceTooLow
}
if !v.allowHighNonce && msg.Nonce > fromActor.Nonce {
log.Debugf("Message: %s nonce greater than actor nonce: %s from actor: %s", msg.String(), fromActor.Nonce, msg.From.String())
errNonceTooHighCt.Inc(ctx, 1)
return errNonceTooHigh
}
return nil
}
// Check's whether the maximum gas charge + message value is within the actor's balance.
// Note that this is an imperfect test, since nested messages invoked by this one may transfer
// more value from the actor's balance.
func canCoverGasLimit(msg *types.SignedMessage, actor *actor.Actor) bool {
maximumGasCharge := msg.GasPrice.MulBigInt(big.NewInt(int64(msg.GasLimit)))
return maximumGasCharge.LessEqual(actor.Balance.Sub(msg.Value))
}
// IngestionValidatorAPI allows the validator to access latest state
type ingestionValidatorAPI interface {
GetActor(context.Context, address.Address) (*actor.Actor, error)
}
// IngestionValidator can access latest state and runs additional checks to mitigate DoS attacks
type IngestionValidator struct {
api ingestionValidatorAPI
cfg *config.MessagePoolConfig
validator defaultMessageValidator
}
// NewIngestionValidator creates a new validator with an api
func NewIngestionValidator(api ingestionValidatorAPI, cfg *config.MessagePoolConfig) *IngestionValidator {
return &IngestionValidator{
api: api,
cfg: cfg,
validator: defaultMessageValidator{allowHighNonce: true},
}
}
// Validate validates the signed message.
// Errors probably mean the validation failed, but possibly indicate a failure to retrieve state
func (v *IngestionValidator) Validate(ctx context.Context, msg *types.SignedMessage) error {
// retrieve from actor
fromActor, err := v.api.GetActor(ctx, msg.From)
if err != nil {
if state.IsActorNotFoundError(err) {
fromActor = &actor.Actor{}
} else {
return err
}
}
// check that message nonce is not too high
if msg.Nonce > fromActor.Nonce && msg.Nonce-fromActor.Nonce > v.cfg.MaxNonceGap {
return errors.NewRevertErrorf("message nonce (%d) is too much greater than actor nonce (%d)", msg.Nonce, fromActor.Nonce)
}
return v.validator.Validate(ctx, msg, fromActor)
}
| 1 | 21,813 | Please TODO and link to an issue for changing this. | filecoin-project-venus | go |
@@ -1,9 +1,10 @@
+/* eslint-disable comma-dangle */
const en_US = {}
en_US.strings = {
addBulkFilesFailed: {
'0': 'Failed to add %{smart_count} file due to an internal error',
- '1': 'Failed to add %{smart_count} files due to internal errors',
+ '1': 'Failed to add %{smart_count} files due to internal errors'
},
addingMoreFiles: 'Adding more files',
addMore: 'Add more', | 1 | const en_US = {}
en_US.strings = {
addBulkFilesFailed: {
'0': 'Failed to add %{smart_count} file due to an internal error',
'1': 'Failed to add %{smart_count} files due to internal errors',
},
addingMoreFiles: 'Adding more files',
addMore: 'Add more',
addMoreFiles: 'Add more files',
allFilesFromFolderNamed: 'All files from folder %{name}',
allowAccessDescription: 'In order to take pictures or record video with your camera, please allow camera access for this site.',
allowAccessTitle: 'Please allow access to your camera',
aspectRatioLandscape: 'Crop landscape (16:9)',
aspectRatioPortrait: 'Crop portrait (9:16)',
aspectRatioSquare: 'Crop square',
authAborted: 'Authentication aborted',
authenticateWith: 'Connect to %{pluginName}',
authenticateWithTitle: 'Please authenticate with %{pluginName} to select files',
back: 'Back',
backToSearch: 'Back to Search',
browse: 'browse',
browseFiles: 'browse files',
browseFolders: 'browse folders',
cancel: 'Cancel',
cancelUpload: 'Cancel upload',
chooseFiles: 'Choose files',
closeModal: 'Close Modal',
companionError: 'Connection with Companion failed',
companionUnauthorizeHint: 'To unauthorize to your %{provider} account, please go to %{url}',
complete: 'Complete',
connectedToInternet: 'Connected to the Internet',
copyLink: 'Copy link',
copyLinkToClipboardFallback: 'Copy the URL below',
copyLinkToClipboardSuccess: 'Link copied to clipboard',
creatingAssembly: 'Preparing upload...',
creatingAssemblyFailed: 'Transloadit: Could not create Assembly',
dashboardTitle: 'File Uploader',
dashboardWindowTitle: 'File Uploader Window (Press escape to close)',
dataUploadedOfTotal: '%{complete} of %{total}',
discardRecordedFile: 'Discard recorded file',
done: 'Done',
dropHereOr: 'Drop files here or %{browse}',
dropHint: 'Drop your files here',
dropPasteBoth: 'Drop files here, %{browseFiles} or %{browseFolders}',
dropPasteFiles: 'Drop files here or %{browseFiles}',
dropPasteFolders: 'Drop files here or %{browseFolders}',
dropPasteImportBoth: 'Drop files here, %{browseFiles}, %{browseFolders} or import from:',
dropPasteImportFiles: 'Drop files here, %{browseFiles} or import from:',
dropPasteImportFolders: 'Drop files here, %{browseFolders} or import from:',
editFile: 'Edit file',
editFileWithFilename: 'Edit file %{file}',
editing: 'Editing %{file}',
emptyFolderAdded: 'No files were added from empty folder',
encoding: 'Encoding...',
enterCorrectUrl: 'Incorrect URL: Please make sure you are entering a direct link to a file',
enterTextToSearch: 'Enter text to search for images',
enterUrlToImport: 'Enter URL to import a file',
exceedsSize: '%{file} exceeds maximum allowed size of %{size}',
failedToFetch: 'Companion failed to fetch this URL, please make sure it’s correct',
failedToUpload: 'Failed to upload %{file}',
filesUploadedOfTotal: {
'0': '%{complete} of %{smart_count} file uploaded',
'1': '%{complete} of %{smart_count} files uploaded',
},
filter: 'Filter',
finishEditingFile: 'Finish editing file',
flipHorizontal: 'Flip horizontal',
folderAdded: {
'0': 'Added %{smart_count} file from %{folder}',
'1': 'Added %{smart_count} files from %{folder}',
},
folderAlreadyAdded: 'The folder "%{folder}" was already added',
generatingThumbnails: 'Generating thumbnails...',
import: 'Import',
importFiles: 'Import files from:',
importFrom: 'Import from %{name}',
inferiorSize: 'This file is smaller than the allowed size of %{size}',
loading: 'Loading...',
logOut: 'Log out',
micDisabled: 'Microphone access denied by user',
missingRequiredMetaField: 'Missing required meta fields',
missingRequiredMetaFieldOnFile: 'Missing required meta fields in %{fileName}',
myDevice: 'My Device',
noCameraDescription: 'In order to take pictures or record video, please connect a camera device',
noCameraTitle: 'Camera Not Available',
noDuplicates: 'Cannot add the duplicate file \'%{fileName}\', it already exists',
noFilesFound: 'You have no files or folders here',
noInternetConnection: 'No Internet connection',
noMoreFilesAllowed: 'Cannot add more files',
openFolderNamed: 'Open folder %{name}',
pause: 'Pause',
paused: 'Paused',
pauseUpload: 'Pause upload',
pluginNameBox: 'Box',
pluginNameCamera: 'Camera',
pluginNameDropbox: 'Dropbox',
pluginNameFacebook: 'Facebook',
pluginNameGoogleDrive: 'Google Drive',
pluginNameInstagram: 'Instagram',
pluginNameOneDrive: 'OneDrive',
pluginNameZoom: 'Zoom',
poweredBy: 'Powered by %{uppy}',
processingXFiles: {
'0': 'Processing %{smart_count} file',
'1': 'Processing %{smart_count} files',
},
recording: 'Recording',
recordingLength: 'Recording length %{recording_length}',
recordingStoppedMaxSize: 'Recording stopped because the file size is about to exceed the limit',
recoveredAllFiles: 'We restored all files. You can now resume the upload.',
recoveredXFiles: {
'0': 'We could not fully recover 1 file. Please re-select it and resume the upload.',
'1': 'We could not fully recover %{smart_count} files. Please re-select them and resume the upload.',
},
removeFile: 'Remove file %{file}',
reSelect: 'Re-select',
resetFilter: 'Reset filter',
resume: 'Resume',
resumeUpload: 'Resume upload',
retry: 'Retry',
retryUpload: 'Retry upload',
revert: 'Revert',
rotate: 'Rotate',
save: 'Save',
saveChanges: 'Save changes',
searchImages: 'Search for images',
selectX: {
'0': 'Select %{smart_count}',
'1': 'Select %{smart_count}',
},
sessionRestored: 'Session restored',
signInWithGoogle: 'Sign in with Google',
smile: 'Smile!',
startCapturing: 'Begin screen capturing',
startRecording: 'Begin video recording',
stopCapturing: 'Stop screen capturing',
stopRecording: 'Stop video recording',
streamActive: 'Stream active',
streamPassive: 'Stream passive',
submitRecordedFile: 'Submit recorded file',
takePicture: 'Take a picture',
timedOut: 'Upload stalled for %{seconds} seconds, aborting.',
upload: 'Upload',
uploadComplete: 'Upload complete',
uploadFailed: 'Upload failed',
uploading: 'Uploading',
uploadingXFiles: {
'0': 'Uploading %{smart_count} file',
'1': 'Uploading %{smart_count} files',
},
uploadPaused: 'Upload paused',
uploadXFiles: {
'0': 'Upload %{smart_count} file',
'1': 'Upload %{smart_count} files',
},
uploadXNewFiles: {
'0': 'Upload +%{smart_count} file',
'1': 'Upload +%{smart_count} files',
},
xFilesSelected: {
'0': '%{smart_count} file selected',
'1': '%{smart_count} files selected',
},
xMoreFilesAdded: {
'0': '%{smart_count} more file added',
'1': '%{smart_count} more files added',
},
xTimeLeft: '%{time} left',
youCanOnlyUploadFileTypes: 'You can only upload: %{types}',
youCanOnlyUploadX: {
'0': 'You can only upload %{smart_count} file',
'1': 'You can only upload %{smart_count} files',
},
youHaveToAtLeastSelectX: {
'0': 'You have to select at least %{smart_count} file',
'1': 'You have to select at least %{smart_count} files',
},
zoomIn: 'Zoom in',
zoomOut: 'Zoom out',
}
en_US.pluralize = function pluralize (count) {
if (count === 1) {
return 0
}
return 1
}
if (typeof window !== 'undefined' && typeof window.Uppy !== 'undefined') {
window.Uppy.locales.en_US = en_US
}
module.exports = en_US
| 1 | 14,813 | Can we make the script output trailing commas? | transloadit-uppy | js |
@@ -0,0 +1,10 @@
+exports.featureFlags = {
+ widgets: {
+ dashboard: {
+ enabled: 'development',
+ },
+ pageDashboard: {
+ enabled: 'development',
+ },
+ },
+}; | 1 | 1 | 30,313 | This file should get a file header | google-site-kit-wp | js |
|
@@ -7,7 +7,6 @@
#include "base/Base.h"
#include "kvstore/wal/FileBasedWal.h"
#include "kvstore/wal/FileBasedWalIterator.h"
-#include "kvstore/wal/BufferFlusher.h"
#include "fs/FileUtils.h"
#include "time/WallClock.h"
| 1 | /* Copyright (c) 2018 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
#include "base/Base.h"
#include "kvstore/wal/FileBasedWal.h"
#include "kvstore/wal/FileBasedWalIterator.h"
#include "kvstore/wal/BufferFlusher.h"
#include "fs/FileUtils.h"
#include "time/WallClock.h"
namespace nebula {
namespace wal {
using nebula::fs::FileUtils;
/**********************************************
*
* Implementation of FileBasedWal
*
*********************************************/
// static
std::shared_ptr<FileBasedWal> FileBasedWal::getWal(
const folly::StringPiece dir,
FileBasedWalPolicy policy,
BufferFlusher* flusher,
PreProcessor preProcessor) {
return std::shared_ptr<FileBasedWal>(
new FileBasedWal(dir, std::move(policy), flusher, std::move(preProcessor)));
}
FileBasedWal::FileBasedWal(const folly::StringPiece dir,
FileBasedWalPolicy policy,
BufferFlusher* flusher,
PreProcessor preProcessor)
: flusher_(flusher)
, dir_(dir.toString())
, policy_(std::move(policy))
, maxFileSize_(policy_.fileSize)
, maxBufferSize_(policy_.bufferSize)
, preProcessor_(std::move(preProcessor)) {
// Make sure WAL directory exist
if (FileUtils::fileType(dir_.c_str()) == fs::FileType::NOTEXIST) {
FileUtils::makeDir(dir_);
}
scanAllWalFiles();
if (!walFiles_.empty()) {
auto& info = walFiles_.rbegin()->second;
firstLogId_ = walFiles_.begin()->second->firstId();
lastLogId_ = info->lastId();
lastLogTerm_ = info->lastTerm();
currFd_ = open(info->path(), O_WRONLY | O_APPEND);
currInfo_ = info;
CHECK_GE(currFd_, 0);
}
}
FileBasedWal::~FileBasedWal() {
// FileBasedWal inherits from std::enable_shared_from_this, so at this
// moment, there should have no other thread holding this WAL object
while (onGoingBuffersNum_ > 0) {
LOG(INFO) << "Waiting for the buffer flushed, remaining " << onGoingBuffersNum_.load();
usleep(50000);
}
if (!buffers_.empty()) {
// There should be only one left
CHECK_EQ(buffers_.size(), 1UL);
if (buffers_.back()->freeze()) {
flushBuffer(buffers_.back());
}
}
// Close the last file
closeCurrFile();
LOG(INFO) << "~FileBasedWal, dir = " << dir_;
}
void FileBasedWal::scanAllWalFiles() {
std::vector<std::string> files =
FileUtils::listAllFilesInDir(dir_.c_str(), false, "*.wal");
for (auto& fn : files) {
// Split the file name
// The file name convention is "<first id in the file>.wal"
std::vector<std::string> parts;
folly::split('.', fn, parts);
if (parts.size() != 2) {
LOG(ERROR) << "Ignore unknown file \"" << fn << "\"";
continue;
}
int64_t startIdFromName;
try {
startIdFromName = folly::to<int64_t>(parts[0]);
} catch (const std::exception& ex) {
LOG(ERROR) << "Ignore bad file name \"" << fn << "\"";
continue;
}
WalFileInfoPtr info = std::make_shared<WalFileInfo>(
FileUtils::joinPath(dir_, fn),
startIdFromName);
// Get the size of the file and the mtime
struct stat st;
if (lstat(info->path(), &st) < 0) {
LOG(ERROR) << "Failed to get the size and mtime for \""
<< fn << "\", ignore it";
continue;
}
info->setSize(st.st_size);
info->setMTime(st.st_mtime);
if (info->size() == 0) {
LOG(ERROR) << "Found empty wal file \"" << fn
<< "\", ignore it";
continue;
}
// Open the file
int32_t fd = open(info->path(), O_RDONLY);
if (fd < 0) {
LOG(ERROR) << "Failed to open the file \"" << fn << "\" ("
<< errno << "): " << strerror(errno);
continue;
}
// Read the first log id
LogID firstLogId = -1;
if (read(fd, &firstLogId, sizeof(LogID)) != sizeof(LogID)) {
LOG(ERROR) << "Failed to read the first log id from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
if (firstLogId != startIdFromName) {
LOG(ERROR) << "The first log id " << firstLogId
<< " does not match the file name \""
<< fn << "\", ignore it!";
close(fd);
continue;
}
// Read the last log length
if (lseek(fd, -sizeof(int32_t), SEEK_END) < 0) {
LOG(ERROR) << "Failed to seek the last log length from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
int32_t succMsgLen;
if (read(fd, &succMsgLen, sizeof(int32_t)) != sizeof(int32_t)) {
LOG(ERROR) << "Failed to read the last log length from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
// Verify the last log length
if (lseek(fd,
-(sizeof(int32_t) * 2 + succMsgLen + sizeof(ClusterID)),
SEEK_END) < 0) {
LOG(ERROR) << "Failed to seek the last log length from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
int32_t precMsgLen;
if (read(fd, &precMsgLen, sizeof(int32_t)) != sizeof(int32_t)) {
LOG(ERROR) << "Failed to read the last log length from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
if (precMsgLen != succMsgLen) {
LOG(ERROR) << "It seems the wal file \"" << fn
<< "\" is corrupted. Ignore it";
// TODO We might want to fix it as much as possible
close(fd);
continue;
}
// Read the last log term
if (lseek(fd,
-(sizeof(int32_t) * 2
+ succMsgLen
+ sizeof(ClusterID)
+ sizeof(TermID)),
SEEK_END) < 0) {
LOG(ERROR) << "Failed to seek the last log term from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
TermID term = -1;
if (read(fd, &term, sizeof(TermID)) != sizeof(TermID)) {
LOG(ERROR) << "Failed to read the last log term from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
info->setLastTerm(term);
// Read the last log id
if (lseek(fd,
-(sizeof(int32_t) * 2
+ succMsgLen
+ sizeof(ClusterID)
+ sizeof(TermID)
+ sizeof(LogID)),
SEEK_END) < 0) {
LOG(ERROR) << "Failed to seek the last log id from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
LogID lastLogId = -1;
if (read(fd, &lastLogId, sizeof(LogID)) != sizeof(LogID)) {
LOG(ERROR) << "Failed to read the last log id from \""
<< fn << "\" (" << errno << "): "
<< strerror(errno);
close(fd);
continue;
}
info->setLastId(lastLogId);
// We now get all necessary info
close(fd);
walFiles_.insert(std::make_pair(startIdFromName, info));
}
// Make sure there is no gap in the logs
if (!walFiles_.empty()) {
LogID logIdAfterLastGap = -1;
auto it = walFiles_.begin();
LogID prevLastId = it->second->lastId();
for (++it; it != walFiles_.end(); ++it) {
if (it->second->firstId() > prevLastId + 1) {
// Found a gap
LOG(ERROR) << "Found a log id gap before "
<< it->second->firstId()
<< ", the previous log id is " << prevLastId;
logIdAfterLastGap = it->second->firstId();
}
prevLastId = it->second->lastId();
}
if (logIdAfterLastGap > 0) {
// Found gap, remove all logs before the last gap
it = walFiles_.begin();
while (it->second->firstId() < logIdAfterLastGap) {
LOG(INFO) << "Removing the wal file \""
<< it->second->path() << "\"";
unlink(it->second->path());
it = walFiles_.erase(it);
}
}
}
}
void FileBasedWal::closeCurrFile() {
if (currFd_ < 0) {
// Already closed
CHECK(!currInfo_);
return;
}
// Close the file
CHECK_EQ(close(currFd_), 0);
currFd_ = -1;
currInfo_->setMTime(::time(nullptr));
DCHECK_EQ(currInfo_->size(), FileUtils::fileSize(currInfo_->path()))
<< currInfo_->path() << " size does not match";
currInfo_.reset();
}
void FileBasedWal::prepareNewFile(LogID startLogId) {
std::lock_guard<std::mutex> g(walFilesMutex_);
CHECK_LT(currFd_, 0)
<< "The current file needs to be closed first";
// Prepare the last entry in walFiles_
WalFileInfoPtr info = std::make_shared<WalFileInfo>(
FileUtils::joinPath(dir_,
folly::stringPrintf("%019ld.wal", startLogId)),
startLogId);
VLOG(1) << "Write new file " << info->path();
walFiles_.emplace(std::make_pair(startLogId, info));
// Create the file for write
currFd_ = open(
info->path(),
O_CREAT | O_EXCL | O_WRONLY | O_APPEND | O_CLOEXEC | O_LARGEFILE,
0644);
if (currFd_ < 0) {
LOG(FATAL) << "Failed to open file \"" << info->path()
<< "\" (errno: " << errno << "): "
<< strerror(errno);
}
currInfo_ = info;
}
void FileBasedWal::dumpCord(Cord& cord,
LogID firstId,
LogID lastId,
TermID lastTerm) {
if (cord.size() <= 0) {
return;
}
if (currFd_ < 0) {
// Need to prepare a new file
prepareNewFile(firstId);
}
auto cb = [this](const char* p, int32_t s) -> bool {
const char* start = p;
int32_t size = s;
do {
ssize_t res = write(currFd_, start, size);
if (res < 0) {
LOG(ERROR) << "Failed to write wal file (" << errno
<< "): " << strerror(errno) << ", fd " << currFd_;
return false;
}
size -= res;
start += res;
} while (size > 0);
return true;
};
if (!cord.applyTo(cb)) {
LOG(FATAL) << "Failed to flush the wal file";
} else {
// Succeeded writing all buffered content, adjust the file size
currInfo_->setSize(currInfo_->size() + cord.size());
currInfo_->setLastId(lastId);
currInfo_->setLastTerm(lastTerm);
}
}
void FileBasedWal::flushBuffer(BufferPtr buffer) {
std::lock_guard<std::mutex> flushGuard(flushMutex_);
if (!buffer || buffer->empty() || buffer->invalid()) {
onGoingBuffersNum_--;
return;
}
// Rollover if required
if (buffer->needToRollover()) {
closeCurrFile();
}
Cord cord;
LogID firstIdInCord = buffer->firstLogId();
auto accessFn = [&cord, &firstIdInCord, this] (
LogID id,
TermID term,
ClusterID cluster,
const std::string& log) {
cord << id << term << int32_t(log.size()) << cluster;
cord.write(log.data(), log.size());
cord << int32_t(log.size());
size_t currSize = currFd_ >= 0 ? currInfo_->size() : 0;
if (currSize + cord.size() > maxFileSize_) {
dumpCord(cord, firstIdInCord, id, term);
// Reset the cord
cord.clear();
firstIdInCord = id + 1;
// Need to close the current file and create a new file
closeCurrFile();
}
};
// Dump the buffer to file
auto lastLog = buffer->accessAllLogs(accessFn);
// Dump the rest if any
if (!cord.empty()) {
dumpCord(cord, firstIdInCord, lastLog.first, lastLog.second);
}
// Flush the wal file
if (currFd_ >= 0) {
CHECK_EQ(fsync(currFd_), 0);
}
// Remove the buffer from the list
{
std::lock_guard<std::mutex> g(buffersMutex_);
CHECK_EQ(buffer.get(), buffers_.front().get());
buffers_.pop_front();
}
onGoingBuffersNum_--;
slotReadyCV_.notify_one();
}
BufferPtr FileBasedWal::createNewBuffer(
LogID firstId,
std::unique_lock<std::mutex>& guard) {
if (buffers_.size() >= policy_.numBuffers) {
// Log appending is way too fast
LOG(WARNING) << "Write buffer is exhausted,"
" need to wait for vacancy";
// TODO: Output a counter here
// Need to wait for a vacant slot
slotReadyCV_.wait(guard, [self = shared_from_this()] {
return self->buffers_.size() < self->policy_.numBuffers;
});
}
// Create a new buffer to use
buffers_.emplace_back(std::make_shared<InMemoryLogBuffer>(firstId));
return buffers_.back();
}
bool FileBasedWal::appendLogInternal(BufferPtr& buffer,
LogID id,
TermID term,
ClusterID cluster,
std::string msg) {
if (stopped_) {
LOG(ERROR) << "WAL has stopped. Do not accept logs any more";
return false;
}
if (lastLogId_ != 0 && firstLogId_ != 0 && id != lastLogId_ + 1) {
LOG(ERROR) << "There is a gap in the log id. The last log id is "
<< lastLogId_
<< ", and the id being appended is " << id;
return false;
}
if (!preProcessor_(id, term, cluster, msg)) {
LOG(ERROR) << "Pre process failed for log " << id;
return false;
}
if (buffer &&
(buffer->size() +
msg.size() +
sizeof(ClusterID) +
sizeof(TermID) +
sizeof(LogID) > maxBufferSize_)) {
// Freeze the current buffer
if (buffer->freeze()) {
onGoingBuffersNum_++;
flusher_->flushBuffer(shared_from_this(), buffer);
}
buffer.reset();
}
// Create a new buffer if needed
if (!buffer) {
std::unique_lock<std::mutex> guard(buffersMutex_);
buffer = createNewBuffer(id, guard);
}
DCHECK_EQ(
id,
static_cast<int64_t>(buffer->firstLogId() + buffer->numLogs()));
buffer->push(term, cluster, std::move(msg));
lastLogId_ = id;
lastLogTerm_ = term;
if (firstLogId_ == 0) {
firstLogId_ = id;
}
return true;
}
bool FileBasedWal::appendLog(LogID id,
TermID term,
ClusterID cluster,
std::string msg) {
BufferPtr buffer;
{
std::lock_guard<std::mutex> g(buffersMutex_);
if (!buffers_.empty()) {
buffer = buffers_.back();
}
}
if (!appendLogInternal(buffer, id, term, cluster, std::move(msg))) {
LOG(ERROR) << "Failed to append log for logId " << id;
return false;
}
return true;
}
bool FileBasedWal::appendLogs(LogIterator& iter) {
BufferPtr buffer;
{
std::lock_guard<std::mutex> g(buffersMutex_);
if (!buffers_.empty()) {
buffer = buffers_.back();
}
}
for (; iter.valid(); ++iter) {
if (!appendLogInternal(buffer,
iter.logId(),
iter.logTerm(),
iter.logSource(),
iter.logMsg().toString())) {
LOG(ERROR) << "Failed to append log for logId "
<< iter.logId();
return false;
}
}
return true;
}
std::unique_ptr<LogIterator> FileBasedWal::iterator(LogID firstLogId,
LogID lastLogId) {
return std::unique_ptr<LogIterator>(
new FileBasedWalIterator(shared_from_this(),
firstLogId,
lastLogId));
}
bool FileBasedWal::rollbackToLog(LogID id) {
std::lock_guard<std::mutex> flushGuard(flushMutex_);
bool foundTarget{false};
if (id < firstLogId_ - 1 || id > lastLogId_) {
LOG(ERROR) << "Rollback target id " << id
<< " is not in the range of ["
<< firstLogId_ << ","
<< lastLogId_ << "] of WAL";
return false;
}
BufferPtr buf = nullptr;
{
// First rollback from buffers
std::unique_lock<std::mutex> g(buffersMutex_);
// Remove all buffers that are rolled back
auto it = buffers_.begin();
while (it != buffers_.end() && (*it)->firstLogId() <= id) {
++it;
}
while (it != buffers_.end()) {
(*it)->markInvalid();
it = buffers_.erase(it);
}
if (!buffers_.empty()) {
// Found the target log id
buf = buffers_.back();
foundTarget = true;
lastLogId_ = id;
lastLogTerm_ = buf->getTerm(lastLogId_ - buf->firstLogId());
// Create a new buffer starting from id + 1
createNewBuffer(id + 1, g);
// Since the log id is rolled back, we need to close
// the previous wal file
buffers_.back()->rollover();
}
}
if (foundTarget) {
CHECK(buf != nullptr);
if (buf->freeze()) {
// Flush the incomplete buffer which the target log id resides in
onGoingBuffersNum_++;
flusher_->flushBuffer(shared_from_this(), buf);
}
}
int fd{-1};
while (!foundTarget) {
LOG(WARNING) << "Need to rollback from files."
" This is an expensive operation."
" Please make sure it is correct and necessary";
// Close the current file fist
closeCurrFile();
std::lock_guard<std::mutex> g(walFilesMutex_);
if (walFiles_.empty()) {
CHECK_EQ(id, 0);
foundTarget = true;
lastLogId_ = 0;
break;
}
auto it = walFiles_.upper_bound(id);
// We need to remove wal files whose entire log range
// are rolled back
while (it != walFiles_.end()) {
// Need to remove the file
VLOG(2) << "Removing file " << it->second->path();
unlink(it->second->path());
it = walFiles_.erase(it);
}
if (walFiles_.empty()) {
CHECK_EQ(id, 0);
foundTarget = true;
lastLogId_ = 0;
break;
}
fd = open(walFiles_.rbegin()->second->path(), O_RDONLY);
CHECK_GE(fd, 0) << "Failed to open file \""
<< walFiles_.rbegin()->second->path()
<< "\" (" << errno << "): "
<< strerror(errno);
lastLogId_ = id;
break;
}
// Find the current log entry
if (fd >= 0) {
size_t pos = 0;
while (true) {
LogID logId;
// Read the logID
CHECK_EQ(pread(fd,
reinterpret_cast<char*>(&logId),
sizeof(LogID),
pos),
static_cast<ssize_t>(sizeof(LogID)));
// Read the termID
CHECK_EQ(pread(fd,
reinterpret_cast<char*>(&lastLogTerm_),
sizeof(TermID),
pos + sizeof(LogID)),
static_cast<ssize_t>(sizeof(TermID)));
// Read the log length
int32_t msgLen = 0;
CHECK_EQ(pread(fd,
reinterpret_cast<char*>(&msgLen),
sizeof(int32_t),
pos + sizeof(LogID) + sizeof(TermID)),
static_cast<ssize_t>(sizeof(int32_t)));
if (logId == lastLogId_) {
foundTarget = true;
break;
}
pos += sizeof(LogID)
+ sizeof(TermID)
+ sizeof(int32_t) * 2
+ msgLen
+ sizeof(ClusterID);
}
close(fd);
}
CHECK(foundTarget);
return true;
}
bool FileBasedWal::reset() {
std::lock_guard<std::mutex> flushGuard(flushMutex_);
closeCurrFile();
{
std::lock_guard<std::mutex> g(buffersMutex_);
buffers_.clear();
}
{
std::lock_guard<std::mutex> g(walFilesMutex_);
walFiles_.clear();
}
std::vector<std::string> files =
FileUtils::listAllFilesInDir(dir_.c_str(), false, "*.wal");
for (auto& fn : files) {
auto absFn = FileUtils::joinPath(dir_, fn);
LOG(INFO) << "Removing " << absFn;
unlink(absFn.c_str());
}
lastLogId_ = firstLogId_ = 0;
return true;
}
void FileBasedWal::cleanWAL() {
std::lock_guard<std::mutex> g(walFilesMutex_);
if (walFiles_.empty()) {
return;
}
auto now = time::WallClock::fastNowInSec();
// We skip the latest wal file because it is beging written now.
size_t index = 0;
auto it = walFiles_.begin();
auto size = walFiles_.size();
while (it != walFiles_.end()) {
if (index++ < size - 1 && (now - it->second->mtime() > policy_.ttl)) {
VLOG(1) << "Clean wals, Remove " << it->second->path();
unlink(it->second->path());
it = walFiles_.erase(it);
} else {
++it;
}
}
firstLogId_ = walFiles_.begin()->second->firstId();
}
size_t FileBasedWal::accessAllWalInfo(std::function<bool(WalFileInfoPtr info)> fn) const {
std::lock_guard<std::mutex> g(walFilesMutex_);
size_t count = 0;
for (auto it = walFiles_.rbegin(); it != walFiles_.rend(); ++it) {
++count;
if (!fn(it->second)) {
break;
}
}
return count;
}
size_t FileBasedWal::accessAllBuffers(std::function<bool(BufferPtr buffer)> fn) const {
std::lock_guard<std::mutex> g(buffersMutex_);
size_t count = 0;
for (auto it = buffers_.rbegin(); it != buffers_.rend(); ++it) {
++count;
if (!fn(*it)) {
break;
}
}
return count;
}
} // namespace wal
} // namespace nebula
| 1 | 20,884 | maybe we need process the os error more safely and friendly when open file failed, because this error is very common when cpu has a high pressure, crash directly is danger. | vesoft-inc-nebula | cpp |
@@ -135,6 +135,9 @@ func registerWriteCommand(cmd *cobra.Command) {
// gasPriceInRau returns the suggest gas price
func gasPriceInRau() (*big.Int, error) {
+ if account.CryptoSm2 {
+ return big.NewInt(0), nil
+ }
gasPrice := gasPriceFlag.Value().(string)
if len(gasPrice) != 0 {
return util.StringToRau(gasPrice, util.GasPriceDecimalNum) | 1 | // Copyright (c) 2019 IoTeX Foundation
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
// License 2.0 that can be found in the LICENSE file.
package action
import (
"context"
"encoding/hex"
"fmt"
"math/big"
"strings"
"github.com/golang/protobuf/proto"
"github.com/grpc-ecosystem/go-grpc-middleware/util/metautils"
"github.com/spf13/cobra"
"google.golang.org/grpc/status"
"github.com/iotexproject/go-pkgs/crypto"
"github.com/iotexproject/go-pkgs/hash"
"github.com/iotexproject/iotex-address/address"
"github.com/iotexproject/iotex-proto/golang/iotexapi"
"github.com/iotexproject/iotex-proto/golang/iotextypes"
"github.com/iotexproject/iotex-core/action"
"github.com/iotexproject/iotex-core/ioctl/cmd/account"
"github.com/iotexproject/iotex-core/ioctl/config"
"github.com/iotexproject/iotex-core/ioctl/flag"
"github.com/iotexproject/iotex-core/ioctl/output"
"github.com/iotexproject/iotex-core/ioctl/util"
"github.com/iotexproject/iotex-core/pkg/unit"
"github.com/iotexproject/iotex-core/pkg/util/byteutil"
)
// Multi-language support
var (
actionCmdShorts = map[config.Language]string{
config.English: "Manage actions of IoTeX blockchain",
config.Chinese: "管理IoTex区块链的行为", // this translation
}
actionCmdUses = map[config.Language]string{
config.English: "action",
config.Chinese: "action 行为", // this translation
}
flagActionEndPointUsages = map[config.Language]string{
config.English: "set endpoint for once",
config.Chinese: "一次设置端点", // this translation
}
flagActionInsecureUsages = map[config.Language]string{
config.English: "insecure connection for once",
config.Chinese: "一次不安全连接", // this translation
}
)
const defaultGasLimit = uint64(20000000)
var defaultGasPrice = big.NewInt(unit.Qev)
// Flags
var (
gasLimitFlag = flag.NewUint64VarP("gas-limit", "l", 0, "set gas limit")
gasPriceFlag = flag.NewStringVarP("gas-price", "p", "1", "set gas price (unit: 10^(-6)IOTX), use suggested gas price if input is \"0\"")
nonceFlag = flag.NewUint64VarP("nonce", "n", 0, "set nonce (default using pending nonce)")
signerFlag = flag.NewStringVarP("signer", "s", "", "choose a signing account")
bytecodeFlag = flag.NewStringVarP("bytecode", "b", "", "set the byte code")
yesFlag = flag.BoolVarP("assume-yes", "y", false, " answer yes for all confirmations")
passwordFlag = flag.NewStringVarP("password", "P", "", "input password for account")
)
// ActionCmd represents the action command
var ActionCmd = &cobra.Command{
Use: config.TranslateInLang(actionCmdUses, config.UILanguage),
Short: config.TranslateInLang(actionCmdShorts, config.UILanguage),
}
type sendMessage struct {
Info string `json:"info"`
TxHash string `json:"txHash"`
URL string `json:"url"`
}
func (m *sendMessage) String() string {
if output.Format == "" {
return fmt.Sprintf("%s\nWait for several seconds and query this action by hash:%s", m.Info, m.URL)
}
return output.FormatString(output.Result, m)
}
func init() {
ActionCmd.AddCommand(actionHashCmd)
ActionCmd.AddCommand(actionTransferCmd)
ActionCmd.AddCommand(actionDeployCmd)
ActionCmd.AddCommand(actionInvokeCmd)
ActionCmd.AddCommand(actionReadCmd)
ActionCmd.AddCommand(actionClaimCmd)
ActionCmd.AddCommand(actionDepositCmd)
ActionCmd.AddCommand(actionSendRawCmd)
ActionCmd.PersistentFlags().StringVar(&config.ReadConfig.Endpoint, "endpoint",
config.ReadConfig.Endpoint, config.TranslateInLang(flagActionEndPointUsages,
config.UILanguage))
ActionCmd.PersistentFlags().BoolVar(&config.Insecure, "insecure", config.Insecure,
config.TranslateInLang(flagActionInsecureUsages, config.UILanguage))
}
func decodeBytecode() ([]byte, error) {
return hex.DecodeString(strings.TrimPrefix(bytecodeFlag.Value().(string), "0x"))
}
func signer() (address string, err error) {
return util.GetAddress(signerFlag.Value().(string))
}
func nonce(executor string) (uint64, error) {
nonce := nonceFlag.Value().(uint64)
if nonce != 0 {
return nonce, nil
}
accountMeta, err := account.GetAccountMeta(executor)
if err != nil {
return 0, output.NewError(0, "failed to get account meta", err)
}
return accountMeta.PendingNonce, nil
}
func registerWriteCommand(cmd *cobra.Command) {
gasLimitFlag.RegisterCommand(cmd)
gasPriceFlag.RegisterCommand(cmd)
signerFlag.RegisterCommand(cmd)
nonceFlag.RegisterCommand(cmd)
yesFlag.RegisterCommand(cmd)
passwordFlag.RegisterCommand(cmd)
}
// gasPriceInRau returns the suggest gas price
func gasPriceInRau() (*big.Int, error) {
gasPrice := gasPriceFlag.Value().(string)
if len(gasPrice) != 0 {
return util.StringToRau(gasPrice, util.GasPriceDecimalNum)
}
conn, err := util.ConnectToEndpoint(config.ReadConfig.SecureConnect && !config.Insecure)
if err != nil {
return nil, output.NewError(output.NetworkError, "failed to connect to endpoint", err)
}
defer conn.Close()
cli := iotexapi.NewAPIServiceClient(conn)
ctx := context.Background()
jwtMD, err := util.JwtAuth()
if err == nil {
ctx = metautils.NiceMD(jwtMD).ToOutgoing(ctx)
}
request := &iotexapi.SuggestGasPriceRequest{}
response, err := cli.SuggestGasPrice(ctx, request)
if err != nil {
sta, ok := status.FromError(err)
if ok {
return nil, output.NewError(output.APIError, sta.Message(), nil)
}
return nil, output.NewError(output.NetworkError, "failed to invoke SuggestGasPrice api", err)
}
return new(big.Int).SetUint64(response.GasPrice), nil
}
func fixGasLimit(caller string, execution *action.Execution) (*action.Execution, error) {
conn, err := util.ConnectToEndpoint(config.ReadConfig.SecureConnect && !config.Insecure)
if err != nil {
return nil, output.NewError(output.NetworkError, "failed to connect to endpoint", err)
}
defer conn.Close()
cli := iotexapi.NewAPIServiceClient(conn)
request := &iotexapi.EstimateActionGasConsumptionRequest{
Action: &iotexapi.EstimateActionGasConsumptionRequest_Execution{
Execution: execution.Proto(),
},
CallerAddress: caller,
}
ctx := context.Background()
jwtMD, err := util.JwtAuth()
if err == nil {
ctx = metautils.NiceMD(jwtMD).ToOutgoing(ctx)
}
res, err := cli.EstimateActionGasConsumption(ctx, request)
if err != nil {
sta, ok := status.FromError(err)
if ok {
return nil, output.NewError(output.APIError, sta.Message(), nil)
}
return nil, output.NewError(output.NetworkError,
"failed to invoke EstimateActionGasConsumption api", err)
}
return action.NewExecution(execution.Contract(), execution.Nonce(), execution.Amount(), res.Gas, execution.GasPrice(), execution.Data())
}
// SendRaw sends raw action to blockchain
func SendRaw(selp *iotextypes.Action) error {
conn, err := util.ConnectToEndpoint(config.ReadConfig.SecureConnect && !config.Insecure)
if err != nil {
return output.NewError(output.NetworkError, "failed to connect to endpoint", err)
}
defer conn.Close()
cli := iotexapi.NewAPIServiceClient(conn)
ctx := context.Background()
jwtMD, err := util.JwtAuth()
if err == nil {
ctx = metautils.NiceMD(jwtMD).ToOutgoing(ctx)
}
request := &iotexapi.SendActionRequest{Action: selp}
if _, err = cli.SendAction(ctx, request); err != nil {
if sta, ok := status.FromError(err); ok {
return output.NewError(output.APIError, sta.Message(), nil)
}
return output.NewError(output.NetworkError, "failed to invoke SendAction api", err)
}
shash := hash.Hash256b(byteutil.Must(proto.Marshal(selp)))
txhash := hex.EncodeToString(shash[:])
message := sendMessage{Info: "Action has been sent to blockchain.", TxHash: txhash}
switch config.ReadConfig.Explorer {
case "iotexscan":
message.URL = "iotexscan.io/action/" + txhash
case "iotxplorer":
message.URL = "iotxplorer.io/actions/" + txhash
default:
message.URL = config.ReadConfig.Explorer + txhash
}
fmt.Println(message.String())
return nil
}
// SendAction sends signed action to blockchain
func SendAction(elp action.Envelope, signer string) error {
var (
prvKey crypto.PrivateKey
err error
prvKeyOrPassword string
)
if !account.IsSignerExist(signer) {
output.PrintQuery(fmt.Sprintf("Enter private key #%s:", signer))
prvKeyOrPassword, err = util.ReadSecretFromStdin()
if err != nil {
return output.NewError(output.InputError, "failed to get private key", err)
}
prvKey, err = crypto.HexStringToPrivateKey(prvKeyOrPassword)
if err != nil {
return output.NewError(output.InputError, "failed to HexString private key", err)
}
} else if passwordFlag.Value() == "" {
output.PrintQuery(fmt.Sprintf("Enter password #%s:\n", signer))
prvKeyOrPassword, err = util.ReadSecretFromStdin()
if err != nil {
return output.NewError(output.InputError, "failed to get password", err)
}
} else {
prvKeyOrPassword = passwordFlag.Value().(string)
}
prvKey, err = account.LocalAccountToPrivateKey(signer, prvKeyOrPassword)
if err != nil {
return output.NewError(output.KeystoreError, "failed to get private key from keystore", err)
}
defer prvKey.Zero()
sealed, err := action.Sign(elp, prvKey)
prvKey.Zero()
if err != nil {
return output.NewError(output.CryptoError, "failed to sign action", err)
}
if err := isBalanceEnough(signer, sealed); err != nil {
return output.NewError(0, "failed to pass balance check", err) // TODO: undefined error
}
selp := sealed.Proto()
actionInfo, err := printActionProto(selp)
if err != nil {
return output.NewError(0, "failed to print action proto message", err)
}
if yesFlag.Value() == false {
var confirm string
info := fmt.Sprintln(actionInfo + "\nPlease confirm your action.\n")
message := output.ConfirmationMessage{Info: info, Options: []string{"yes"}}
fmt.Println(message.String())
fmt.Scanf("%s", &confirm)
if !strings.EqualFold(confirm, "yes") {
output.PrintResult("quit")
return nil
}
}
return SendRaw(selp)
}
// Execute sends signed execution transaction to blockchain
func Execute(contract string, amount *big.Int, bytecode []byte) error {
gasPriceRau, err := gasPriceInRau()
if err != nil {
return output.NewError(0, "failed to get gas price", err)
}
signer, err := signer()
if err != nil {
return output.NewError(output.AddressError, "failed to get signer address", err)
}
nonce, err := nonce(signer)
if err != nil {
return output.NewError(0, "failed to get nonce", err)
}
gasLimit := gasLimitFlag.Value().(uint64)
tx, err := action.NewExecution(contract, nonce, amount, gasLimit, gasPriceRau, bytecode)
if err != nil || tx == nil {
return output.NewError(output.InstantiationError, "failed to make a Execution instance", err)
}
if gasLimit == 0 {
tx, err = fixGasLimit(signer, tx)
if err != nil || tx == nil {
return output.NewError(0, "failed to fix Execution gaslimit", err)
}
gasLimit = tx.GasLimit()
}
return SendAction(
(&action.EnvelopeBuilder{}).
SetNonce(nonce).
SetGasPrice(gasPriceRau).
SetGasLimit(gasLimit).
SetAction(tx).Build(),
signer,
)
}
// Read reads smart contract on IoTeX blockchain
func Read(contract address.Address, bytecode []byte) (string, error) {
caller, err := signer()
if err != nil {
caller = address.ZeroAddress
}
exec, err := action.NewExecution(contract.String(), 0, big.NewInt(0), defaultGasLimit, defaultGasPrice, bytecode)
if err != nil {
return "", output.NewError(output.InstantiationError, "cannot make an Execution instance", err)
}
conn, err := util.ConnectToEndpoint(config.ReadConfig.SecureConnect && !config.Insecure)
if err != nil {
return "", output.NewError(output.NetworkError, "failed to connect to endpoint", err)
}
defer conn.Close()
ctx := context.Background()
jwtMD, err := util.JwtAuth()
if err == nil {
ctx = metautils.NiceMD(jwtMD).ToOutgoing(ctx)
}
res, err := iotexapi.NewAPIServiceClient(conn).ReadContract(
ctx,
&iotexapi.ReadContractRequest{
Execution: exec.Proto(),
CallerAddress: caller,
},
)
if err == nil {
return res.Data, nil
}
if sta, ok := status.FromError(err); ok {
return "", output.NewError(output.APIError, sta.Message(), nil)
}
return "", output.NewError(output.NetworkError, "failed to invoke ReadContract api", err)
}
func isBalanceEnough(address string, act action.SealedEnvelope) error {
accountMeta, err := account.GetAccountMeta(address)
if err != nil {
return output.NewError(0, "failed to get account meta", err)
}
balance, ok := big.NewInt(0).SetString(accountMeta.Balance, 10)
if !ok {
return output.NewError(output.ConvertError, "failed to convert balance into big int", nil)
}
cost, err := act.Cost()
if err != nil {
return output.NewError(output.RuntimeError, "failed to check cost of an action", nil)
}
if balance.Cmp(cost) < 0 {
return output.NewError(output.ValidationError, "balance is not enough", nil)
}
return nil
}
| 1 | 21,072 | we need to pay attention not to use this flag everywhere. | iotexproject-iotex-core | go |
@@ -22,7 +22,6 @@ import (
)
type Protocol string
-type TableIDType uint8
type GroupIDType uint32
type MeterIDType uint32
| 1 | // Copyright 2019 Antrea Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package openflow
import (
"net"
"time"
"antrea.io/ofnet/ofctrl"
)
type Protocol string
type TableIDType uint8
type GroupIDType uint32
type MeterIDType uint32
type MissActionType uint32
type Range [2]uint32
type OFOperation int
const (
LastTableID TableIDType = 0xff
TableIDAll = LastTableID
)
const (
ProtocolIP Protocol = "ip"
ProtocolIPv6 Protocol = "ipv6"
ProtocolARP Protocol = "arp"
ProtocolTCP Protocol = "tcp"
ProtocolTCPv6 Protocol = "tcpv6"
ProtocolUDP Protocol = "udp"
ProtocolUDPv6 Protocol = "udpv6"
ProtocolSCTP Protocol = "sctp"
ProtocolSCTPv6 Protocol = "sctpv6"
ProtocolICMP Protocol = "icmp"
ProtocolICMPv6 Protocol = "icmpv6"
)
const (
TableMissActionDrop MissActionType = iota
TableMissActionNormal
TableMissActionNext
TableMissActionNone
)
const (
NxmFieldSrcMAC = "NXM_OF_ETH_SRC"
NxmFieldDstMAC = "NXM_OF_ETH_DST"
NxmFieldARPSha = "NXM_NX_ARP_SHA"
NxmFieldARPTha = "NXM_NX_ARP_THA"
NxmFieldARPSpa = "NXM_OF_ARP_SPA"
NxmFieldARPTpa = "NXM_OF_ARP_TPA"
NxmFieldCtLabel = "NXM_NX_CT_LABEL"
NxmFieldCtMark = "NXM_NX_CT_MARK"
NxmFieldARPOp = "NXM_OF_ARP_OP"
NxmFieldReg = "NXM_NX_REG"
NxmFieldTunMetadata = "NXM_NX_TUN_METADATA"
NxmFieldIPToS = "NXM_OF_IP_TOS"
NxmFieldXXReg = "NXM_NX_XXREG"
NxmFieldPktMark = "NXM_NX_PKT_MARK"
NxmFieldSrcIPv4 = "NXM_OF_IP_SRC"
NxmFieldDstIPv4 = "NXM_OF_IP_DST"
NxmFieldSrcIPv6 = "NXM_NX_IPV6_SRC"
NxmFieldDstIPv6 = "NXM_NX_IPV6_DST"
)
const (
AddMessage OFOperation = iota
ModifyMessage
DeleteMessage
)
// IPDSCPToSRange stores the DSCP bits in ToS field of IP header.
var IPDSCPToSRange = &Range{2, 7}
// Bridge defines operations on an openflow bridge.
type Bridge interface {
CreateTable(id, next TableIDType, missAction MissActionType) Table
DeleteTable(id TableIDType) bool
CreateGroup(id GroupIDType) Group
DeleteGroup(id GroupIDType) bool
CreateMeter(id MeterIDType, flags ofctrl.MeterFlag) Meter
DeleteMeter(id MeterIDType) bool
DeleteMeterAll() error
DumpTableStatus() []TableStatus
// DumpFlows queries the Openflow entries from OFSwitch. The filter of the query is Openflow cookieID; the result is
// a map from flow cookieID to FlowStates.
DumpFlows(cookieID, cookieMask uint64) (map[uint64]*FlowStates, error)
// DeleteFlowsByCookie removes Openflow entries from OFSwitch. The removed Openflow entries use the specific CookieID.
DeleteFlowsByCookie(cookieID, cookieMask uint64) error
// AddFlowsInBundle syncs multiple Openflow entries in a single transaction. This operation could add new flows in
// "addFlows", modify flows in "modFlows", and remove flows in "delFlows" in the same bundle.
AddFlowsInBundle(addflows []Flow, modFlows []Flow, delFlows []Flow) error
// AddOFEntriesInBundle syncs multiple Openflow entries(including Flow and Group) in a single transaction. This
// operation could add new entries in "addEntries", modify entries in "modEntries", and remove entries in
// "delEntries" in the same bundle.
AddOFEntriesInBundle(addEntries []OFEntry, modEntries []OFEntry, delEntries []OFEntry) error
// Connect initiates connection to the OFSwitch. It will block until the connection is established. connectCh is used to
// send notification whenever the switch is connected or reconnected.
Connect(maxRetrySec int, connectCh chan struct{}) error
// Disconnect stops connection to the OFSwitch.
Disconnect() error
// IsConnected returns the OFSwitch's connection status. The result is true if the OFSwitch is connected.
IsConnected() bool
// SubscribePacketIn registers a consumer to listen to PacketIn messages matching the provided reason. When the
// Bridge receives a PacketIn message with the specified reason, it sends the message to the consumer using the
// provided channel.
SubscribePacketIn(reason uint8, pktInQueue *PacketInQueue) error
// AddTLVMap adds a TLV mapping with OVS field tun_metadataX. The value loaded in tun_metadataX is transported by
// Geneve header with the specified <optClass, optType, optLength>. The value of OptLength must be a multiple of 4.
// The value loaded into field tun_metadataX must fit within optLength bytes.
AddTLVMap(optClass uint16, optType uint8, optLength uint8, tunMetadataIndex uint16) error
// SendPacketOut sends a packetOut message to the OVS Bridge.
SendPacketOut(packetOut *ofctrl.PacketOut) error
// BuildPacketOut returns a new PacketOutBuilder.
BuildPacketOut() PacketOutBuilder
}
// TableStatus represents the status of a specific flow table. The status is useful for debugging.
type TableStatus struct {
ID uint `json:"id"`
FlowCount uint `json:"flowCount"`
UpdateTime time.Time `json:"updateTime"`
}
type Table interface {
GetID() TableIDType
BuildFlow(priority uint16) FlowBuilder
GetMissAction() MissActionType
Status() TableStatus
GetNext() TableIDType
}
type EntryType string
const (
FlowEntry EntryType = "FlowEntry"
GroupEntry EntryType = "GroupEntry"
MeterEntry EntryType = "MeterEntry"
)
type OFEntry interface {
Add() error
Modify() error
Delete() error
Type() EntryType
KeyString() string
// Reset ensures that the entry is "correct" and that the Add /
// Modify / Delete methods can be called on this object. This method
// should be called if a reconnection event happened.
Reset()
// GetBundleMessage returns ofctrl.OpenFlowModMessage which can be used in Bundle messages. operation specifies what
// operation is expected to be taken on the OFEntry.
GetBundleMessage(operation OFOperation) (ofctrl.OpenFlowModMessage, error)
}
type Flow interface {
OFEntry
// Returns the flow priority associated with OFEntry
FlowPriority() uint16
FlowProtocol() Protocol
MatchString() string
// CopyToBuilder returns a new FlowBuilder that copies the matches of the Flow.
// It copies the original actions of the Flow only if copyActions is set to true, and
// resets the priority in the new FlowBuilder if the provided priority is not 0.
CopyToBuilder(priority uint16, copyActions bool) FlowBuilder
IsDropFlow() bool
}
type Action interface {
LoadARPOperation(value uint16) FlowBuilder
LoadToRegField(field *RegField, value uint32) FlowBuilder
LoadRegMark(mark *RegMark) FlowBuilder
LoadPktMarkRange(value uint32, to *Range) FlowBuilder
LoadIPDSCP(value uint8) FlowBuilder
LoadRange(name string, addr uint64, to *Range) FlowBuilder
Move(from, to string) FlowBuilder
MoveRange(fromName, toName string, from, to Range) FlowBuilder
Resubmit(port uint16, table TableIDType) FlowBuilder
ResubmitToTable(table TableIDType) FlowBuilder
CT(commit bool, tableID TableIDType, zone int) CTAction
Drop() FlowBuilder
Output(port int) FlowBuilder
OutputFieldRange(from string, rng *Range) FlowBuilder
OutputToRegField(field *RegField) FlowBuilder
OutputInPort() FlowBuilder
SetDstMAC(addr net.HardwareAddr) FlowBuilder
SetSrcMAC(addr net.HardwareAddr) FlowBuilder
SetARPSha(addr net.HardwareAddr) FlowBuilder
SetARPTha(addr net.HardwareAddr) FlowBuilder
SetARPSpa(addr net.IP) FlowBuilder
SetARPTpa(addr net.IP) FlowBuilder
SetSrcIP(addr net.IP) FlowBuilder
SetDstIP(addr net.IP) FlowBuilder
SetTunnelDst(addr net.IP) FlowBuilder
DecTTL() FlowBuilder
Normal() FlowBuilder
Conjunction(conjID uint32, clauseID uint8, nClause uint8) FlowBuilder
Group(id GroupIDType) FlowBuilder
Learn(id TableIDType, priority uint16, idleTimeout, hardTimeout uint16, cookieID uint64) LearnAction
GotoTable(table TableIDType) FlowBuilder
SendToController(reason uint8) FlowBuilder
Note(notes string) FlowBuilder
Meter(meterID uint32) FlowBuilder
}
type FlowBuilder interface {
MatchPriority(uint16) FlowBuilder
MatchProtocol(name Protocol) FlowBuilder
MatchIPProtocolValue(isIPv6 bool, protoValue uint8) FlowBuilder
MatchXXReg(regID int, data []byte) FlowBuilder
MatchRegMark(mark *RegMark) FlowBuilder
MatchRegFieldWithValue(field *RegField, data uint32) FlowBuilder
MatchInPort(inPort uint32) FlowBuilder
MatchDstIP(ip net.IP) FlowBuilder
MatchDstIPNet(ipNet net.IPNet) FlowBuilder
MatchSrcIP(ip net.IP) FlowBuilder
MatchSrcIPNet(ipNet net.IPNet) FlowBuilder
MatchDstMAC(mac net.HardwareAddr) FlowBuilder
MatchSrcMAC(mac net.HardwareAddr) FlowBuilder
MatchARPSha(mac net.HardwareAddr) FlowBuilder
MatchARPTha(mac net.HardwareAddr) FlowBuilder
MatchARPSpa(ip net.IP) FlowBuilder
MatchARPTpa(ip net.IP) FlowBuilder
MatchARPOp(op uint16) FlowBuilder
MatchIPDSCP(dscp uint8) FlowBuilder
MatchCTStateNew(isSet bool) FlowBuilder
MatchCTStateRel(isSet bool) FlowBuilder
MatchCTStateRpl(isSet bool) FlowBuilder
MatchCTStateEst(isSet bool) FlowBuilder
MatchCTStateTrk(isSet bool) FlowBuilder
MatchCTStateInv(isSet bool) FlowBuilder
MatchCTStateDNAT(isSet bool) FlowBuilder
MatchCTStateSNAT(isSet bool) FlowBuilder
MatchCTMark(mark *CtMark) FlowBuilder
MatchCTLabelField(high, low uint64, field *CtLabel) FlowBuilder
MatchPktMark(value uint32, mask *uint32) FlowBuilder
MatchConjID(value uint32) FlowBuilder
MatchDstPort(port uint16, portMask *uint16) FlowBuilder
MatchSrcPort(port uint16, portMask *uint16) FlowBuilder
MatchICMPv6Type(icmp6Type byte) FlowBuilder
MatchICMPv6Code(icmp6Code byte) FlowBuilder
MatchTunnelDst(dstIP net.IP) FlowBuilder
MatchTunMetadata(index int, data uint32) FlowBuilder
// MatchCTSrcIP matches the source IPv4 address of the connection tracker original direction tuple.
MatchCTSrcIP(ip net.IP) FlowBuilder
// MatchCTSrcIPNet matches the source IPv4 address of the connection tracker original direction tuple with IP masking.
MatchCTSrcIPNet(ipnet net.IPNet) FlowBuilder
// MatchCTDstIP matches the destination IPv4 address of the connection tracker original direction tuple.
MatchCTDstIP(ip net.IP) FlowBuilder
// MatchCTDstIP matches the destination IPv4 address of the connection tracker original direction tuple with IP masking.
MatchCTDstIPNet(ipNet net.IPNet) FlowBuilder
// MatchCTSrcPort matches the transport source port of the connection tracker original direction tuple.
MatchCTSrcPort(port uint16) FlowBuilder
// MatchCTDstPort matches the transport destination port of the connection tracker original direction tuple.
MatchCTDstPort(port uint16) FlowBuilder
// MatchCTProtocol matches the IP protocol type of the connection tracker original direction tuple.
MatchCTProtocol(proto Protocol) FlowBuilder
Cookie(cookieID uint64) FlowBuilder
SetHardTimeout(timout uint16) FlowBuilder
SetIdleTimeout(timeout uint16) FlowBuilder
Action() Action
Done() Flow
}
type LearnAction interface {
DeleteLearned() LearnAction
MatchEthernetProtocolIP(isIPv6 bool) LearnAction
MatchTransportDst(protocol Protocol) LearnAction
MatchLearnedTCPDstPort() LearnAction
MatchLearnedUDPDstPort() LearnAction
MatchLearnedSCTPDstPort() LearnAction
MatchLearnedTCPv6DstPort() LearnAction
MatchLearnedUDPv6DstPort() LearnAction
MatchLearnedSCTPv6DstPort() LearnAction
MatchLearnedSrcIP() LearnAction
MatchLearnedDstIP() LearnAction
MatchLearnedSrcIPv6() LearnAction
MatchLearnedDstIPv6() LearnAction
MatchRegMark(mark *RegMark) LearnAction
LoadRegMark(mark *RegMark) LearnAction
LoadFieldToField(fromField, toField *RegField) LearnAction
LoadXXRegToXXReg(fromXXField, toXXField *XXRegField) LearnAction
SetDstMAC(mac net.HardwareAddr) LearnAction
Done() FlowBuilder
}
type Group interface {
OFEntry
ResetBuckets() Group
Bucket() BucketBuilder
}
type BucketBuilder interface {
Weight(val uint16) BucketBuilder
// Deprecated.
LoadReg(regID int, data uint32) BucketBuilder
LoadXXReg(regID int, data []byte) BucketBuilder
// Deprecated.
LoadRegRange(regID int, data uint32, rng *Range) BucketBuilder
LoadToRegField(field *RegField, data uint32) BucketBuilder
ResubmitToTable(tableID TableIDType) BucketBuilder
Done() Group
}
type Meter interface {
OFEntry
ResetMeterBands() Meter
MeterBand() MeterBandBuilder
}
type MeterBandBuilder interface {
MeterType(meterType ofctrl.MeterType) MeterBandBuilder
Rate(rate uint32) MeterBandBuilder
Burst(burst uint32) MeterBandBuilder
PrecLevel(precLevel uint8) MeterBandBuilder
Experimenter(experimenter uint32) MeterBandBuilder
Done() Meter
}
type CTAction interface {
LoadToMark(value uint32) CTAction
LoadToCtMark(mark *CtMark) CTAction
LoadToLabelField(value uint64, labelField *CtLabel) CTAction
MoveToLabel(fromName string, fromRng, labelRng *Range) CTAction
// NAT action translates the packet in the way that the connection was committed into the conntrack zone, e.g., if
// a connection was committed with SNAT, the later packets would be translated with the earlier SNAT configurations.
NAT() CTAction
// SNAT actions is used to translate the source IP to a specific address or address in a pool when committing the
// packet into the conntrack zone. If a single IP is used as the target address, StartIP and EndIP in the range
// should be the same. portRange could be nil.
SNAT(ipRange *IPRange, portRange *PortRange) CTAction
// DNAT actions is used to translate the destination IP to a specific address or address in a pool when committing
// the packet into the conntrack zone. If a single IP is used as the target address, StartIP and EndIP in the range
// should be the same. portRange could be nil.
DNAT(ipRange *IPRange, portRange *PortRange) CTAction
CTDone() FlowBuilder
}
type PacketOutBuilder interface {
SetSrcMAC(mac net.HardwareAddr) PacketOutBuilder
SetDstMAC(mac net.HardwareAddr) PacketOutBuilder
SetSrcIP(ip net.IP) PacketOutBuilder
SetDstIP(ip net.IP) PacketOutBuilder
SetIPProtocol(protocol Protocol) PacketOutBuilder
SetIPProtocolValue(isIPv6 bool, protoValue uint8) PacketOutBuilder
SetTTL(ttl uint8) PacketOutBuilder
SetIPFlags(flags uint16) PacketOutBuilder
SetIPHeaderID(id uint16) PacketOutBuilder
SetTCPSrcPort(port uint16) PacketOutBuilder
SetTCPDstPort(port uint16) PacketOutBuilder
SetTCPFlags(flags uint8) PacketOutBuilder
SetTCPSeqNum(seqNum uint32) PacketOutBuilder
SetTCPAckNum(ackNum uint32) PacketOutBuilder
SetUDPSrcPort(port uint16) PacketOutBuilder
SetUDPDstPort(port uint16) PacketOutBuilder
SetUDPData(data []byte) PacketOutBuilder
SetICMPType(icmpType uint8) PacketOutBuilder
SetICMPCode(icmpCode uint8) PacketOutBuilder
SetICMPID(id uint16) PacketOutBuilder
SetICMPSequence(seq uint16) PacketOutBuilder
SetICMPData(data []byte) PacketOutBuilder
SetInport(inPort uint32) PacketOutBuilder
SetOutport(outport uint32) PacketOutBuilder
AddLoadAction(name string, data uint64, rng *Range) PacketOutBuilder
AddLoadRegMark(mark *RegMark) PacketOutBuilder
Done() *ofctrl.PacketOut
}
type ctBase struct {
commit bool
force bool
ctTable uint8
ctZone uint16
}
type IPRange struct {
StartIP net.IP
EndIP net.IP
}
type PortRange struct {
StartPort uint16
EndPort uint16
}
type Packet struct {
IsIPv6 bool
DestinationMAC net.HardwareAddr
SourceMAC net.HardwareAddr
DestinationIP net.IP
SourceIP net.IP
IPLength uint16
IPProto uint8
IPFlags uint16
TTL uint8
DestinationPort uint16
SourcePort uint16
TCPFlags uint8
ICMPType uint8
ICMPCode uint8
ICMPEchoID uint16
ICMPEchoSeq uint16
}
// RegField specifies a bit range of a register. regID is the register number, and rng is the range of bits
// taken by the field. The OF client could use a RegField to cache or match varied value.
type RegField struct {
regID int
rng *Range
name string
}
// RegMark is a value saved in a RegField. A RegMark is used to indicate the traffic
// has some expected characteristics.
type RegMark struct {
field *RegField
value uint32
}
// XXRegField specifies a xxreg with a required bit range.
type XXRegField RegField
// CtMark is used to indicate the connection characteristics.
type CtMark struct {
rng *Range
value uint32
}
type CtLabel struct {
rng *Range
name string
}
| 1 | 42,670 | curious about this change, since it is not mentioned in the commit message and now we have `uint8` all over the place | antrea-io-antrea | go |
@@ -74,7 +74,7 @@ func (db *DB) SubscribePush(ctx context.Context) (c <-chan swarm.Chunk, stop fun
}
select {
- case chunks <- swarm.NewChunk(swarm.NewAddress(dataItem.Address), dataItem.Data).WithTagID(item.Tag).WithStamp(dataItem.Stamp):
+ case chunks <- swarm.NewChunk(swarm.NewAddress(dataItem.Address), dataItem.Data).WithTagID(item.Tag):
count++
// set next iteration start item
// when its chunk is successfully sent to channel | 1 | // Copyright 2019 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package localstore
import (
"context"
"sync"
"time"
"github.com/ethersphere/bee/pkg/shed"
"github.com/ethersphere/bee/pkg/swarm"
)
// SubscribePush returns a channel that provides storage chunks with ordering from push syncing index.
// Returned stop function will terminate current and further iterations, and also it will close
// the returned channel without any errors. Make sure that you check the second returned parameter
// from the channel to stop iteration when its value is false.
func (db *DB) SubscribePush(ctx context.Context) (c <-chan swarm.Chunk, stop func()) {
db.metrics.SubscribePush.Inc()
chunks := make(chan swarm.Chunk)
trigger := make(chan struct{}, 1)
db.pushTriggersMu.Lock()
db.pushTriggers = append(db.pushTriggers, trigger)
db.pushTriggersMu.Unlock()
// send signal for the initial iteration
trigger <- struct{}{}
stopChan := make(chan struct{})
var stopChanOnce sync.Once
db.subscritionsWG.Add(1)
go func() {
defer db.subscritionsWG.Done()
db.metrics.SubscribePushIterationDone.Inc()
// close the returned chunkInfo channel at the end to
// signal that the subscription is done
defer close(chunks)
// sinceItem is the Item from which the next iteration
// should start. The first iteration starts from the first Item.
var sinceItem *shed.Item
for {
select {
case <-trigger:
// iterate until:
// - last index Item is reached
// - subscription stop is called
// - context is done.met
db.metrics.SubscribePushIteration.Inc()
iterStart := time.Now()
var count int
err := db.pushIndex.Iterate(func(item shed.Item) (stop bool, err error) {
// get chunk data
dataItem, err := db.retrievalDataIndex.Get(item)
if err != nil {
return true, err
}
select {
case chunks <- swarm.NewChunk(swarm.NewAddress(dataItem.Address), dataItem.Data).WithTagID(item.Tag).WithStamp(dataItem.Stamp):
count++
// set next iteration start item
// when its chunk is successfully sent to channel
sinceItem = &item
return false, nil
case <-stopChan:
// gracefully stop the iteration
// on stop
return true, nil
case <-db.close:
// gracefully stop the iteration
// on database close
return true, nil
case <-ctx.Done():
return true, ctx.Err()
}
}, &shed.IterateOptions{
StartFrom: sinceItem,
// sinceItem was sent as the last Address in the previous
// iterator call, skip it in this one
SkipStartFromItem: true,
})
totalTimeMetric(db.metrics.TotalTimeSubscribePushIteration, iterStart)
if err != nil {
db.metrics.SubscribePushIterationFailure.Inc()
db.logger.Debugf("localstore push subscription iteration: %v", err)
return
}
case <-stopChan:
// terminate the subscription
// on stop
return
case <-db.close:
// terminate the subscription
// on database close
return
case <-ctx.Done():
err := ctx.Err()
if err != nil {
db.logger.Debugf("localstore push subscription iteration: %v", err)
}
return
}
}
}()
stop = func() {
stopChanOnce.Do(func() {
close(stopChan)
})
db.pushTriggersMu.Lock()
defer db.pushTriggersMu.Unlock()
for i, t := range db.pushTriggers {
if t == trigger {
db.pushTriggers = append(db.pushTriggers[:i], db.pushTriggers[i+1:]...)
break
}
}
}
return chunks, stop
}
// triggerPushSubscriptions is used internally for starting iterations
// on Push subscriptions. Whenever new item is added to the push index,
// this function should be called.
func (db *DB) triggerPushSubscriptions() {
db.pushTriggersMu.RLock()
defer db.pushTriggersMu.RUnlock()
for _, t := range db.pushTriggers {
select {
case t <- struct{}{}:
default:
}
}
}
| 1 | 14,080 | wait, are we not mising `WithStamp` here? | ethersphere-bee | go |
@@ -66,7 +66,7 @@ func (api *APIImpl) Syncing(ctx context.Context) (interface{}, error) {
return false, err
}
- currentBlock, _, err := stages.GetStageProgress(api.dbReader, stages.TxPool)
+ currentBlock, _, err := stages.GetStageProgress(api.dbReader, stages.Finish)
if err != nil {
return false, err
} | 1 | package commands
import (
"context"
"fmt"
"github.com/ledgerwatch/turbo-geth/common"
"github.com/ledgerwatch/turbo-geth/common/hexutil"
"github.com/ledgerwatch/turbo-geth/core"
"github.com/ledgerwatch/turbo-geth/core/rawdb"
"github.com/ledgerwatch/turbo-geth/core/types"
"github.com/ledgerwatch/turbo-geth/eth/stagedsync/stages"
"github.com/ledgerwatch/turbo-geth/ethdb"
"github.com/ledgerwatch/turbo-geth/internal/ethapi"
"github.com/ledgerwatch/turbo-geth/rpc"
)
// EthAPI is a collection of functions that are exposed in the
type EthAPI interface {
Coinbase(ctx context.Context) (common.Address, error)
BlockNumber(ctx context.Context) (hexutil.Uint64, error)
GetBlockByNumber(ctx context.Context, number rpc.BlockNumber, fullTx bool) (map[string]interface{}, error)
GetBlockByHash(ctx context.Context, hash common.Hash, fullTx bool) (map[string]interface{}, error)
GetBalance(ctx context.Context, address common.Address, blockNrOrHash rpc.BlockNumberOrHash) (*hexutil.Big, error)
GetTransactionReceipt(ctx context.Context, hash common.Hash) (map[string]interface{}, error)
GetLogs(ctx context.Context, hash common.Hash) ([][]*types.Log, error)
Call(ctx context.Context, args ethapi.CallArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *map[common.Address]ethapi.Account) (hexutil.Bytes, error)
EstimateGas(ctx context.Context, args ethapi.CallArgs) (hexutil.Uint64, error)
SendRawTransaction(ctx context.Context, encodedTx hexutil.Bytes) (common.Hash, error)
Syncing(ctx context.Context) (interface{}, error)
GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*hexutil.Uint, error)
GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (*hexutil.Uint, error)
}
// APIImpl is implementation of the EthAPI interface based on remote Db access
type APIImpl struct {
db ethdb.KV
ethBackend ethdb.Backend
dbReader ethdb.Getter
chainContext core.ChainContext
GasCap uint64
}
// NewAPI returns APIImpl instance
func NewAPI(db ethdb.KV, dbReader ethdb.Getter, eth ethdb.Backend, gascap uint64) *APIImpl {
return &APIImpl{
db: db,
dbReader: dbReader,
ethBackend: eth,
GasCap: gascap,
}
}
func (api *APIImpl) BlockNumber(ctx context.Context) (hexutil.Uint64, error) {
execution, _, err := stages.GetStageProgress(api.dbReader, stages.Finish)
if err != nil {
return 0, err
}
return hexutil.Uint64(execution), nil
}
// Syncing - we can return the progress of the very first stage as the highest block, and then the progress of the very last stage as the current block
func (api *APIImpl) Syncing(ctx context.Context) (interface{}, error) {
highestBlock, _, err := stages.GetStageProgress(api.dbReader, stages.Headers)
if err != nil {
return false, err
}
currentBlock, _, err := stages.GetStageProgress(api.dbReader, stages.TxPool)
if err != nil {
return false, err
}
// Return not syncing if the synchronisation already completed
if currentBlock >= highestBlock {
return false, nil
}
// Otherwise gather the block sync stats
return map[string]hexutil.Uint64{
"currentBlock": hexutil.Uint64(currentBlock),
"highestBlock": hexutil.Uint64(highestBlock),
}, nil
}
func (api *APIImpl) GetBlockTransactionCountByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*hexutil.Uint, error) {
var blockNum uint64
if blockNr == rpc.LatestBlockNumber || blockNr == rpc.PendingBlockNumber {
var err error
blockNum, _, err = stages.GetStageProgress(api.dbReader, stages.Execution)
if err != nil {
return nil, fmt.Errorf("getting latest block number: %v", err)
}
} else if blockNr == rpc.EarliestBlockNumber {
blockNum = 0
} else {
blockNum = uint64(blockNr.Int64())
}
block := rawdb.ReadBlockByNumber(api.dbReader, blockNum)
if block == nil {
return nil, fmt.Errorf("block not found: %d", blockNum)
}
n := hexutil.Uint(len(block.Transactions()))
return &n, nil
}
func (api *APIImpl) GetBlockTransactionCountByHash(ctx context.Context, blockHash common.Hash) (*hexutil.Uint, error) {
block := rawdb.ReadBlockByHash(api.dbReader, blockHash)
if block == nil {
return nil, fmt.Errorf("block not found: %x", blockHash)
}
n := hexutil.Uint(len(block.Transactions()))
return &n, nil
}
| 1 | 21,697 | oh. didn't know we store this stage progress. | ledgerwatch-erigon | go |
@@ -91,6 +91,7 @@ function getUnicodeNonBmpRegExp() {
'\u25A0-\u25FF' + // Geometric Shapes
'\u2600-\u26FF' + // Misc Symbols
'\u2700-\u27BF' + // Dingbats
+ '\uE000-\uF8FF' + // Private Use
']'
);
} | 1 | /* global text */
/**
* Determine if a given string contains unicode characters, specified in options
*
* @method hasUnicode
* @memberof axe.commons.text
* @instance
* @param {String} str string to verify
* @param {Object} options config containing which unicode character sets to verify
* @property {Boolean} options.emoji verify emoji unicode
* @property {Boolean} options.nonBmp verify nonBmp unicode
* @property {Boolean} options.punctuations verify punctuations unicode
* @returns {Boolean}
*/
text.hasUnicode = function hasUnicode(str, options) {
const { emoji, nonBmp, punctuations } = options;
if (emoji) {
return axe.imports.emojiRegexText().test(str);
}
if (nonBmp) {
return getUnicodeNonBmpRegExp().test(str);
}
if (punctuations) {
return getPunctuationRegExp().test(str);
}
return false;
};
/**
* Remove specified type(s) unicode characters
*
* @method removeUnicode
* @memberof axe.commons.text
* @instance
* @param {String} str string to operate on
* @param {Object} options config containing which unicode character sets to remove
* @property {Boolean} options.emoji remove emoji unicode
* @property {Boolean} options.nonBmp remove nonBmp unicode
* @property {Boolean} options.punctuations remove punctuations unicode
* @returns {String}
*/
text.removeUnicode = function removeUnicode(str, options) {
const { emoji, nonBmp, punctuations } = options;
if (emoji) {
str = str.replace(axe.imports.emojiRegexText(), '');
}
if (nonBmp) {
str = str.replace(getUnicodeNonBmpRegExp(), '');
}
if (punctuations) {
str = str.replace(getPunctuationRegExp(), '');
}
return str;
};
/**
* Regex for matching unicode values out of Basic Multilingual Plane (BMP)
* Reference:
* - https://github.com/mathiasbynens/regenerate
* - https://unicode-table.com/
* - https://mathiasbynens.be/notes/javascript-unicode
*
* @returns {RegExp}
*/
function getUnicodeNonBmpRegExp() {
/**
* Regex for matching astral plane unicode
* - http://kourge.net/projects/regexp-unicode-block
*/
return new RegExp(
'[' +
'\u1D00-\u1D7F' + // Phonetic Extensions
'\u1D80-\u1DBF' + // Phonetic Extensions Supplement
'\u1DC0-\u1DFF' + // Combining Diacritical Marks Supplement
// '\u2000-\u206F' + // General punctuation - handled in -> getPunctuationRegExp
'\u20A0-\u20CF' + // Currency symbols
'\u20D0-\u20FF' + // Combining Diacritical Marks for Symbols
'\u2100-\u214F' + // Letter like symbols
'\u2150-\u218F' + // Number forms (eg: Roman numbers)
'\u2190-\u21FF' + // Arrows
'\u2200-\u22FF' + // Mathematical operators
'\u2300-\u23FF' + // Misc Technical
'\u2400-\u243F' + // Control pictures
'\u2440-\u245F' + // OCR
'\u2460-\u24FF' + // Enclosed alpha numerics
'\u2500-\u257F' + // Box Drawing
'\u2580-\u259F' + // Block Elements
'\u25A0-\u25FF' + // Geometric Shapes
'\u2600-\u26FF' + // Misc Symbols
'\u2700-\u27BF' + // Dingbats
']'
);
}
/**
* Get regular expression for matching punctuations
*
* @returns {RegExp}
*/
function getPunctuationRegExp() {
/**
* Reference: http://kunststube.net/encoding/
* US-ASCII
* -> !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
*
* General Punctuation block
* -> \u2000-\u206F
*
* Supplemental Punctuation block
* Reference: https://en.wikipedia.org/wiki/Supplemental_Punctuation
* -> \u2E00-\u2E7F Reference
*/
return /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]/g;
}
| 1 | 14,966 | Going with definition from here: > Does Unicode have private-use characters? > A: Yes. There are three ranges of private-use characters in the standard. The main range in the BMP is U+E000..U+F8FF, containing 6,400 private-use characters. That range is often referred to as the Private Use Area (PUA). But there are also two large ranges of supplementary private-use characters, consisting of most of the code points on Planes 15 and 16: U+F0000..U+FFFFD and U+100000..U+10FFFD. Together those ranges allocate another 131,068 private-use characters. Altogether, then, there are 137,468 private-use characters in Unicode. It looks like we are only ignoring ones in BMP and not the supplementary private-use characters. Shouldn't we consider the supplementary ones too? | dequelabs-axe-core | js |
@@ -300,7 +300,7 @@ class FunctionCallReturnTypeFetcher
return new Type\Union([
$atomic_types['array']->count !== null
? new Type\Atomic\TLiteralInt($atomic_types['array']->count)
- : new Type\Atomic\TInt
+ : new Type\Atomic\TPositiveInt
]);
}
| 1 | <?php
namespace Psalm\Internal\Analyzer\Statements\Expression\Call;
use PhpParser;
use PhpParser\BuilderFactory;
use Psalm\Internal\Analyzer\Statements\ExpressionAnalyzer;
use Psalm\Internal\Analyzer\StatementsAnalyzer;
use Psalm\CodeLocation;
use Psalm\Context;
use Psalm\Internal\FileManipulation\FileManipulationBuffer;
use Psalm\Internal\DataFlow\TaintSource;
use Psalm\Internal\DataFlow\DataFlowNode;
use Psalm\Internal\Codebase\TaintFlowGraph;
use Psalm\Internal\Type\TypeExpander;
use Psalm\Internal\Type\TemplateInferredTypeReplacer;
use Psalm\Plugin\EventHandler\Event\AfterFunctionCallAnalysisEvent;
use Psalm\Storage\FunctionLikeStorage;
use Psalm\Type;
use Psalm\Type\Atomic\TCallable;
use function count;
use function strtolower;
use function strpos;
use Psalm\Internal\Type\TemplateBound;
use Psalm\Internal\Type\TemplateResult;
use function explode;
/**
* @internal
*/
class FunctionCallReturnTypeFetcher
{
/**
* @param non-empty-string $function_id
*/
public static function fetch(
StatementsAnalyzer $statements_analyzer,
\Psalm\Codebase $codebase,
PhpParser\Node\Expr\FuncCall $stmt,
PhpParser\Node\Name $function_name,
string $function_id,
bool $in_call_map,
bool $is_stubbed,
?FunctionLikeStorage $function_storage,
?TCallable $callmap_callable,
TemplateResult $template_result,
Context $context
) : Type\Union {
$stmt_type = null;
$config = $codebase->config;
if ($codebase->functions->return_type_provider->has($function_id)) {
$stmt_type = $codebase->functions->return_type_provider->getReturnType(
$statements_analyzer,
$function_id,
$stmt->args,
$context,
new CodeLocation($statements_analyzer->getSource(), $function_name)
);
}
if (!$stmt_type) {
if (!$in_call_map || $is_stubbed) {
if ($function_storage && $function_storage->template_types) {
foreach ($function_storage->template_types as $template_name => $_) {
if (!isset($template_result->upper_bounds[$template_name])) {
if ($template_name === 'TFunctionArgCount') {
$template_result->upper_bounds[$template_name] = [
'fn-' . $function_id => new TemplateBound(
Type::getInt(false, count($stmt->args))
)
];
} elseif ($template_name === 'TPhpMajorVersion') {
$template_result->upper_bounds[$template_name] = [
'fn-' . $function_id => new TemplateBound(
Type::getInt(false, $codebase->php_major_version)
)
];
} else {
$template_result->upper_bounds[$template_name] = [
'fn-' . $function_id => new TemplateBound(
Type::getEmpty()
)
];
}
}
}
}
if ($function_storage && !$context->isSuppressingExceptions($statements_analyzer)) {
$context->mergeFunctionExceptions(
$function_storage,
new CodeLocation($statements_analyzer->getSource(), $stmt)
);
}
try {
if ($function_storage && $function_storage->return_type) {
$return_type = clone $function_storage->return_type;
if ($template_result->upper_bounds && $function_storage->template_types) {
$return_type = TypeExpander::expandUnion(
$codebase,
$return_type,
null,
null,
null
);
TemplateInferredTypeReplacer::replace(
$return_type,
$template_result,
$codebase
);
}
$return_type = TypeExpander::expandUnion(
$codebase,
$return_type,
null,
null,
null
);
$return_type_location = $function_storage->return_type_location;
$event = new AfterFunctionCallAnalysisEvent(
$stmt,
$function_id,
$context,
$statements_analyzer->getSource(),
$codebase,
$return_type,
[]
);
$config->eventDispatcher->dispatchAfterFunctionCallAnalysis($event);
$file_manipulations = $event->getFileReplacements();
if ($file_manipulations) {
FileManipulationBuffer::add(
$statements_analyzer->getFilePath(),
$file_manipulations
);
}
$stmt_type = $return_type;
$return_type->by_ref = $function_storage->returns_by_ref;
// only check the type locally if it's defined externally
if ($return_type_location &&
!$is_stubbed && // makes lookups or array_* functions quicker
!$config->isInProjectDirs($return_type_location->file_path)
) {
$return_type->check(
$statements_analyzer,
new CodeLocation($statements_analyzer->getSource(), $stmt),
$statements_analyzer->getSuppressedIssues(),
$context->phantom_classes,
true,
false,
false,
$context->calling_method_id
);
}
}
} catch (\InvalidArgumentException $e) {
// this can happen when the function was defined in the Config startup script
$stmt_type = Type::getMixed();
}
} else {
if (!$callmap_callable) {
throw new \UnexpectedValueException('We should have a callmap callable here');
}
$stmt_type = self::getReturnTypeFromCallMapWithArgs(
$statements_analyzer,
$function_id,
$stmt->args,
$callmap_callable,
$context
);
}
}
if (!$stmt_type) {
$stmt_type = Type::getMixed();
}
if (!$statements_analyzer->data_flow_graph instanceof TaintFlowGraph || !$function_storage) {
return $stmt_type;
}
$return_node = self::taintReturnType(
$statements_analyzer,
$stmt,
$function_id,
$function_storage,
$stmt_type,
$template_result
);
if ($function_storage->proxy_calls !== null) {
foreach ($function_storage->proxy_calls as $proxy_call) {
$fake_call_arguments = [];
foreach ($proxy_call['params'] as $i) {
$fake_call_arguments[] = $stmt->args[$i];
}
$fake_call_factory = new BuilderFactory();
if (strpos($proxy_call['fqn'], '::') !== false) {
list($fqcn, $method) = explode('::', $proxy_call['fqn']);
$fake_call = $fake_call_factory->staticCall($fqcn, $method, $fake_call_arguments);
} else {
$fake_call = $fake_call_factory->funcCall($proxy_call['fqn'], $fake_call_arguments);
}
$old_node_data = $statements_analyzer->node_data;
$statements_analyzer->node_data = clone $statements_analyzer->node_data;
ExpressionAnalyzer::analyze($statements_analyzer, $fake_call, $context);
$statements_analyzer->node_data = $old_node_data;
if ($return_node && $proxy_call['return']) {
$fake_call_type = $statements_analyzer->node_data->getType($fake_call);
if (null !== $fake_call_type) {
foreach ($fake_call_type->parent_nodes as $fake_call_node) {
$statements_analyzer->data_flow_graph->addPath($fake_call_node, $return_node, 'return');
}
}
}
}
}
return $stmt_type;
}
/**
* @param list<PhpParser\Node\Arg> $call_args
*/
private static function getReturnTypeFromCallMapWithArgs(
StatementsAnalyzer $statements_analyzer,
string $function_id,
array $call_args,
TCallable $callmap_callable,
Context $context
): Type\Union {
$call_map_key = strtolower($function_id);
$codebase = $statements_analyzer->getCodebase();
if (!$call_args) {
switch ($call_map_key) {
case 'hrtime':
return new Type\Union([
new Type\Atomic\TKeyedArray([
Type::getInt(),
Type::getInt()
])
]);
case 'get_called_class':
return new Type\Union([
new Type\Atomic\TClassString(
$context->self ?: 'object',
$context->self ? new Type\Atomic\TNamedObject($context->self, true) : null
)
]);
case 'get_parent_class':
if ($context->self && $codebase->classExists($context->self)) {
$classlike_storage = $codebase->classlike_storage_provider->get($context->self);
if ($classlike_storage->parent_classes) {
return new Type\Union([
new Type\Atomic\TClassString(
\array_values($classlike_storage->parent_classes)[0]
)
]);
}
}
}
} else {
switch ($call_map_key) {
case 'count':
if (($first_arg_type = $statements_analyzer->node_data->getType($call_args[0]->value))) {
$atomic_types = $first_arg_type->getAtomicTypes();
if (count($atomic_types) === 1) {
if (isset($atomic_types['array'])) {
if ($atomic_types['array'] instanceof Type\Atomic\TCallableArray
|| $atomic_types['array'] instanceof Type\Atomic\TCallableList
|| $atomic_types['array'] instanceof Type\Atomic\TCallableKeyedArray
) {
return Type::getInt(false, 2);
}
if ($atomic_types['array'] instanceof Type\Atomic\TNonEmptyArray) {
return new Type\Union([
$atomic_types['array']->count !== null
? new Type\Atomic\TLiteralInt($atomic_types['array']->count)
: new Type\Atomic\TInt
]);
}
if ($atomic_types['array'] instanceof Type\Atomic\TNonEmptyList) {
return new Type\Union([
$atomic_types['array']->count !== null
? new Type\Atomic\TLiteralInt($atomic_types['array']->count)
: new Type\Atomic\TInt
]);
}
if ($atomic_types['array'] instanceof Type\Atomic\TKeyedArray
&& $atomic_types['array']->sealed
) {
return new Type\Union([
new Type\Atomic\TLiteralInt(count($atomic_types['array']->properties))
]);
}
}
}
}
break;
case 'hrtime':
if (($first_arg_type = $statements_analyzer->node_data->getType($call_args[0]->value))) {
if ((string) $first_arg_type === 'true') {
$int = Type::getInt();
$int->from_calculation = true;
return $int;
}
if ((string) $first_arg_type === 'false') {
return new Type\Union([
new Type\Atomic\TKeyedArray([
Type::getInt(),
Type::getInt()
])
]);
}
return new Type\Union([
new Type\Atomic\TKeyedArray([
Type::getInt(),
Type::getInt()
]),
new Type\Atomic\TInt()
]);
}
$int = Type::getInt();
$int->from_calculation = true;
return $int;
case 'min':
case 'max':
if (isset($call_args[0])) {
$first_arg = $call_args[0]->value;
if ($first_arg_type = $statements_analyzer->node_data->getType($first_arg)) {
if ($first_arg_type->hasArray()) {
/** @psalm-suppress PossiblyUndefinedStringArrayOffset */
$array_type = $first_arg_type->getAtomicTypes()['array'];
if ($array_type instanceof Type\Atomic\TKeyedArray) {
return $array_type->getGenericValueType();
}
if ($array_type instanceof Type\Atomic\TArray) {
return clone $array_type->type_params[1];
}
if ($array_type instanceof Type\Atomic\TList) {
return clone $array_type->type_param;
}
} elseif ($first_arg_type->hasScalarType()
&& ($second_arg = ($call_args[1]->value ?? null))
&& ($second_arg_type = $statements_analyzer->node_data->getType($second_arg))
&& $second_arg_type->hasScalarType()
) {
return Type::combineUnionTypes($first_arg_type, $second_arg_type);
}
}
}
break;
case 'get_parent_class':
// this is unreliable, as it's hard to know exactly what's wanted - attempted this in
// https://github.com/vimeo/psalm/commit/355ed831e1c69c96bbf9bf2654ef64786cbe9fd7
// but caused problems where it didn’t know exactly what level of child we
// were receiving.
//
// Really this should only work on instances we've created with new Foo(),
// but that requires more work
break;
case 'fgetcsv':
$string_type = Type::getString();
$string_type->addType(new Type\Atomic\TNull);
$string_type->ignore_nullable_issues = true;
$call_map_return_type = new Type\Union([
new Type\Atomic\TNonEmptyList(
$string_type
),
new Type\Atomic\TFalse,
new Type\Atomic\TNull
]);
if ($codebase->config->ignore_internal_nullable_issues) {
$call_map_return_type->ignore_nullable_issues = true;
}
if ($codebase->config->ignore_internal_falsable_issues) {
$call_map_return_type->ignore_falsable_issues = true;
}
return $call_map_return_type;
}
}
$stmt_type = $callmap_callable->return_type
? clone $callmap_callable->return_type
: Type::getMixed();
switch ($function_id) {
case 'mb_strpos':
case 'mb_strrpos':
case 'mb_stripos':
case 'mb_strripos':
case 'strpos':
case 'strrpos':
case 'stripos':
case 'strripos':
case 'strstr':
case 'stristr':
case 'strrchr':
case 'strpbrk':
case 'array_search':
break;
default:
if ($stmt_type->isFalsable()
&& $codebase->config->ignore_internal_falsable_issues
) {
$stmt_type->ignore_falsable_issues = true;
}
}
switch ($call_map_key) {
case 'array_replace':
case 'array_replace_recursive':
if ($codebase->config->ignore_internal_nullable_issues) {
$stmt_type->ignore_nullable_issues = true;
}
break;
}
return $stmt_type;
}
private static function taintReturnType(
StatementsAnalyzer $statements_analyzer,
PhpParser\Node\Expr\FuncCall $stmt,
string $function_id,
FunctionLikeStorage $function_storage,
Type\Union $stmt_type,
TemplateResult $template_result
) : ?DataFlowNode {
if (!$statements_analyzer->data_flow_graph instanceof TaintFlowGraph
|| \in_array('TaintedInput', $statements_analyzer->getSuppressedIssues())
) {
return null;
}
$node_location = new CodeLocation($statements_analyzer->getSource(), $stmt);
$function_call_node = DataFlowNode::getForMethodReturn(
$function_id,
$function_id,
$function_storage->signature_return_type_location ?: $function_storage->location,
$function_storage->specialize_call ? $node_location : null
);
$statements_analyzer->data_flow_graph->addNode($function_call_node);
$codebase = $statements_analyzer->getCodebase();
$conditionally_removed_taints = [];
foreach ($function_storage->conditionally_removed_taints as $conditionally_removed_taint) {
$conditionally_removed_taint = clone $conditionally_removed_taint;
TemplateInferredTypeReplacer::replace(
$conditionally_removed_taint,
$template_result,
$codebase
);
$expanded_type = TypeExpander::expandUnion(
$statements_analyzer->getCodebase(),
$conditionally_removed_taint,
null,
null,
null,
true,
true
);
if (!$expanded_type->isNullable()) {
foreach ($expanded_type->getLiteralStrings() as $literal_string) {
$conditionally_removed_taints[] = $literal_string->value;
}
}
}
if ($conditionally_removed_taints && $function_storage->location) {
$assignment_node = DataFlowNode::getForAssignment(
$function_id . '-escaped',
$function_storage->signature_return_type_location ?: $function_storage->location,
$function_call_node->specialization_key
);
$statements_analyzer->data_flow_graph->addPath(
$function_call_node,
$assignment_node,
'conditionally-escaped',
[],
$conditionally_removed_taints
);
$stmt_type->parent_nodes[$assignment_node->id] = $assignment_node;
} else {
$stmt_type->parent_nodes[$function_call_node->id] = $function_call_node;
}
if ($function_storage->return_source_params) {
$removed_taints = $function_storage->removed_taints;
if ($function_id === 'preg_replace' && count($stmt->args) > 2) {
$first_stmt_type = $statements_analyzer->node_data->getType($stmt->args[0]->value);
$second_stmt_type = $statements_analyzer->node_data->getType($stmt->args[1]->value);
if ($first_stmt_type
&& $second_stmt_type
&& $first_stmt_type->isSingleStringLiteral()
&& $second_stmt_type->isSingleStringLiteral()
) {
$first_arg_value = $first_stmt_type->getSingleStringLiteral()->value;
$pattern = \substr($first_arg_value, 1, -1);
if ($pattern[0] === '['
&& $pattern[1] === '^'
&& \substr($pattern, -1) === ']'
) {
$pattern = \substr($pattern, 2, -1);
if (self::simpleExclusion($pattern, $first_arg_value[0])) {
$removed_taints[] = 'html';
$removed_taints[] = 'sql';
}
}
}
}
foreach ($function_storage->return_source_params as $i => $path_type) {
if (!isset($stmt->args[$i])) {
continue;
}
$current_arg_is_variadic = $function_storage->params[$i]->is_variadic;
$taintableArgIndex = [$i];
if ($current_arg_is_variadic) {
$max_params = count($stmt->args) - 1;
for ($arg_index = $i + 1; $arg_index <= $max_params; $arg_index++) {
$taintableArgIndex[] = $arg_index;
}
}
foreach ($taintableArgIndex as $argIndex) {
$arg_location = new CodeLocation(
$statements_analyzer->getSource(),
$stmt->args[$argIndex]->value
);
$function_param_sink = DataFlowNode::getForMethodArgument(
$function_id,
$function_id,
$argIndex,
$arg_location,
$function_storage->specialize_call ? $node_location : null
);
$statements_analyzer->data_flow_graph->addNode($function_param_sink);
$statements_analyzer->data_flow_graph->addPath(
$function_param_sink,
$function_call_node,
$path_type,
$function_storage->added_taints,
$removed_taints
);
}
}
}
if ($function_storage->taint_source_types) {
$method_node = TaintSource::getForMethodReturn(
$function_id,
$function_id,
$node_location
);
$method_node->taints = $function_storage->taint_source_types;
$statements_analyzer->data_flow_graph->addSource($method_node);
}
return $function_call_node;
}
/**
* @psalm-pure
*/
private static function simpleExclusion(string $pattern, string $escape_char) : bool
{
$str_length = \strlen($pattern);
for ($i = 0; $i < $str_length; $i++) {
$current = $pattern[$i];
$next = $pattern[$i + 1] ?? null;
if ($current === '\\') {
if ($next == null
|| $next === 'x'
|| $next === 'u'
) {
return false;
}
if ($next === '.'
|| $next === '('
|| $next === ')'
|| $next === '['
|| $next === ']'
|| $next === 's'
|| $next === 'w'
|| $next === $escape_char
) {
$i++;
continue;
}
return false;
}
if ($next !== '-') {
if ($current === '_'
|| $current === '-'
|| $current === '|'
|| $current === ':'
|| $current === '#'
|| $current === '.'
|| $current === ' '
) {
continue;
}
return false;
}
if ($current === ']') {
return false;
}
if (!isset($pattern[$i + 2])) {
return false;
}
if (($current === 'a' && $pattern[$i + 2] === 'z')
|| ($current === 'a' && $pattern[$i + 2] === 'Z')
|| ($current === 'A' && $pattern[$i + 2] === 'Z')
|| ($current === '0' && $pattern[$i + 2] === '9')
) {
$i += 2;
continue;
}
return false;
}
return true;
}
}
| 1 | 9,805 | This change is un-tested and requires testing | vimeo-psalm | php |
@@ -83,6 +83,11 @@ class notebook_extension(extension):
logo = param.Boolean(default=True, doc="Toggles display of HoloViews logo")
+ comms = param.ObjectSelector(
+ default='default', objects=['default', 'ipywidgets', 'vscode'], doc="""
+ Whether to render output in Jupyter with the default Jupyter
+ extension or use the jupyter_bokeh ipywidget model.""")
+
inline = param.Boolean(default=True, doc="""
Whether to inline JS and CSS resources.
If disabled, resources are loaded from CDN if one is available.""") | 1 | import os
from unittest import SkipTest
import param
import holoviews
from IPython import version_info
from IPython.core.completer import IPCompleter
from IPython.display import HTML, publish_display_data
from param import ipython as param_ext
from ..core.dimension import LabelledData
from ..core.tree import AttrTree
from ..core.options import Store
from ..element.comparison import ComparisonTestCase
from ..util import extension
from ..plotting.renderer import Renderer
from .magics import load_magics
from .display_hooks import display # noqa (API import)
from .display_hooks import pprint_display, png_display, svg_display
AttrTree._disabled_prefixes = ['_repr_','_ipython_canary_method_should_not_exist']
def show_traceback():
"""
Display the full traceback after an abbreviated traceback has occurred.
"""
from .display_hooks import FULL_TRACEBACK
print(FULL_TRACEBACK)
class IPTestCase(ComparisonTestCase):
"""
This class extends ComparisonTestCase to handle IPython specific
objects and support the execution of cells and magic.
"""
def setUp(self):
super(IPTestCase, self).setUp()
try:
import IPython
from IPython.display import HTML, SVG
self.ip = IPython.InteractiveShell()
if self.ip is None:
raise TypeError()
except Exception:
raise SkipTest("IPython could not be started")
self.addTypeEqualityFunc(HTML, self.skip_comparison)
self.addTypeEqualityFunc(SVG, self.skip_comparison)
def skip_comparison(self, obj1, obj2, msg): pass
def get_object(self, name):
obj = self.ip._object_find(name).obj
if obj is None:
raise self.failureException("Could not find object %s" % name)
return obj
def cell(self, line):
"Run an IPython cell"
self.ip.run_cell(line, silent=True)
def cell_magic(self, *args, **kwargs):
"Run an IPython cell magic"
self.ip.run_cell_magic(*args, **kwargs)
def line_magic(self, *args, **kwargs):
"Run an IPython line magic"
self.ip.run_line_magic(*args, **kwargs)
class notebook_extension(extension):
"""
Notebook specific extension to hv.extension that offers options for
controlling the notebook environment.
"""
css = param.String(default='', doc="Optional CSS rule set to apply to the notebook.")
logo = param.Boolean(default=True, doc="Toggles display of HoloViews logo")
inline = param.Boolean(default=True, doc="""
Whether to inline JS and CSS resources.
If disabled, resources are loaded from CDN if one is available.""")
width = param.Number(default=None, bounds=(0, 100), doc="""
Width of the notebook as a percentage of the browser screen window width.""")
display_formats = param.List(default=['html'], doc="""
A list of formats that are rendered to the notebook where
multiple formats may be selected at once (although only one
format will be displayed).
Although the 'html' format is supported across backends, other
formats supported by the current backend (e.g 'png' and 'svg'
using the matplotlib backend) may be used. This may be useful to
export figures to other formats such as PDF with nbconvert. """)
allow_jedi_completion = param.Boolean(default=False, doc="""
Whether to allow jedi tab-completion to be enabled in IPython.
Disabled by default because many HoloViews features rely on
tab-completion machinery not supported when using jedi.""")
case_sensitive_completion = param.Boolean(default=False, doc="""
Whether to monkey patch IPython to use the correct tab-completion
behavior. """)
_loaded = False
def __call__(self, *args, **params):
super(notebook_extension, self).__call__(*args, **params)
# Abort if IPython not found
try:
ip = params.pop('ip', None) or get_ipython() # noqa (get_ipython)
except:
return
# Notebook archive relies on display hooks being set to work.
try:
if version_info[0] >= 4:
import nbformat # noqa (ensures availability)
else:
from IPython import nbformat # noqa (ensures availability)
try:
from .archive import notebook_archive
holoviews.archive = notebook_archive
except AttributeError as e:
if str(e) != "module 'tornado.web' has no attribute 'asynchronous'":
raise
except ImportError:
pass
# Not quite right, should be set when switching backends
if 'matplotlib' in Store.renderers and not notebook_extension._loaded:
svg_exporter = Store.renderers['matplotlib'].instance(holomap=None,fig='svg')
holoviews.archive.exporters = [svg_exporter] + holoviews.archive.exporters
p = param.ParamOverrides(self, {k:v for k,v in params.items() if k!='config'})
if p.case_sensitive_completion:
from IPython.core import completer
completer.completions_sorting_key = self.completions_sorting_key
if not p.allow_jedi_completion and hasattr(IPCompleter, 'use_jedi'):
ip.run_line_magic('config', 'IPCompleter.use_jedi = False')
resources = self._get_resources(args, params)
Store.display_formats = p.display_formats
if 'html' not in p.display_formats and len(p.display_formats) > 1:
msg = ('Output magic unable to control displayed format '
'as IPython notebook uses fixed precedence '
'between %r' % p.display_formats)
display(HTML('<b>Warning</b>: %s' % msg))
loaded = notebook_extension._loaded
if loaded == False:
param_ext.load_ipython_extension(ip, verbose=False)
load_magics(ip)
Store.output_settings.initialize(list(Store.renderers.keys()))
Store.set_display_hook('html+js', LabelledData, pprint_display)
Store.set_display_hook('png', LabelledData, png_display)
Store.set_display_hook('svg', LabelledData, svg_display)
notebook_extension._loaded = True
css = ''
if p.width is not None:
css += '<style>div.container { width: %s%% }</style>' % p.width
if p.css:
css += '<style>%s</style>' % p.css
if css:
display(HTML(css))
resources = list(resources)
if len(resources) == 0: return
for r in [r for r in resources if r != 'holoviews']:
Store.renderers[r].load_nb(inline=p.inline)
Renderer.load_nb()
if hasattr(ip, 'kernel') and not loaded:
Renderer.comm_manager.get_client_comm(notebook_extension._process_comm_msg,
"hv-extension-comm")
# Create a message for the logo (if shown)
self.load_hvjs(logo=p.logo,
bokeh_logo= p.logo and ('bokeh' in resources),
mpl_logo= p.logo and (('matplotlib' in resources)
or resources==['holoviews']),
plotly_logo= p.logo and ('plotly' in resources))
@classmethod
def completions_sorting_key(cls, word):
"Fixed version of IPyton.completer.completions_sorting_key"
prio1, prio2 = 0, 0
if word.startswith('__'): prio1 = 2
elif word.startswith('_'): prio1 = 1
if word.endswith('='): prio1 = -1
if word.startswith('%%'):
if not "%" in word[2:]:
word = word[2:]; prio2 = 2
elif word.startswith('%'):
if not "%" in word[1:]:
word = word[1:]; prio2 = 1
return prio1, word, prio2
def _get_resources(self, args, params):
"""
Finds the list of resources from the keyword parameters and pops
them out of the params dictionary.
"""
resources = []
disabled = []
for resource in ['holoviews'] + list(Store.renderers.keys()):
if resource in args:
resources.append(resource)
if resource in params:
setting = params.pop(resource)
if setting is True and resource != 'matplotlib':
if resource not in resources:
resources.append(resource)
if setting is False:
disabled.append(resource)
unmatched_args = set(args) - set(resources)
if unmatched_args:
display(HTML('<b>Warning:</b> Unrecognized resources %s'
% ', '.join(unmatched_args)))
resources = [r for r in resources if r not in disabled]
if ('holoviews' not in disabled) and ('holoviews' not in resources):
resources = ['holoviews'] + resources
return resources
@classmethod
def load_hvjs(cls, logo=False, bokeh_logo=False, mpl_logo=False, plotly_logo=False,
JS=True, message='HoloViewsJS successfully loaded.'):
"""
Displays javascript and CSS to initialize HoloViews widgets.
"""
import jinja2
templateLoader = jinja2.FileSystemLoader(os.path.dirname(os.path.abspath(__file__)))
jinjaEnv = jinja2.Environment(loader=templateLoader)
template = jinjaEnv.get_template('load_notebook.html')
html = template.render({'logo': logo,
'bokeh_logo': bokeh_logo,
'mpl_logo': mpl_logo,
'plotly_logo': plotly_logo,
'message': message})
publish_display_data(data={'text/html': html})
notebook_extension.add_delete_action(Renderer._delete_plot)
def load_ipython_extension(ip):
notebook_extension(ip=ip)
def unload_ipython_extension(ip):
notebook_extension._loaded = False
| 1 | 23,625 | Should the docstring mention the vscode option? | holoviz-holoviews | py |
@@ -83,6 +83,8 @@ public class PackageMetadataTransformer {
.packageVersionBound(packageConfig.generatedPackageVersionBound(language))
.protoPath(packageConfig.protoPath())
.shortName(packageConfig.shortName())
+ .gapicConfigName(packageConfig.shortName() + "_gapic.yaml")
+ .packageType(packageConfig.packageType())
.gaxVersionBound(packageConfig.gaxVersionBound(language))
.grpcVersionBound(packageConfig.grpcVersionBound(language))
.protoVersionBound(packageConfig.protoVersionBound(language)) | 1 | /* Copyright 2016 Google Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.api.codegen.transformer;
import com.google.api.codegen.TargetLanguage;
import com.google.api.codegen.config.PackageMetadataConfig;
import com.google.api.codegen.config.VersionBound;
import com.google.api.codegen.viewmodel.metadata.PackageDependencyView;
import com.google.api.codegen.viewmodel.metadata.PackageMetadataView;
import com.google.api.tools.framework.model.Model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
/** Constructs a partial ViewModel for producing package metadata related views */
public class PackageMetadataTransformer {
/**
* Construct a partial ViewModel, represented by its Builder, using all of the proto package
* dependencies specified in the package config.
*/
public PackageMetadataView.Builder generateMetadataView(
PackageMetadataConfig packageConfig,
Model model,
String template,
String outputPath,
TargetLanguage language) {
return generateMetadataView(packageConfig, model, template, outputPath, language, null);
}
/**
* Construct a partial ViewModel, represented by its Builder, from the config. Proto package
* dependencies are included only if whitelisted.
*/
public PackageMetadataView.Builder generateMetadataView(
PackageMetadataConfig packageConfig,
Model model,
String template,
String outputPath,
TargetLanguage language,
Set<String> whitelistedDependencies) {
// Note that internally, this is overridable in the service config, but the component is not
// available externally. See:
// https://github.com/googleapis/toolkit/issues/933
String discoveryApiName = model.getServiceConfig().getName();
int dotIndex = discoveryApiName.indexOf(".");
if (dotIndex > 0) {
discoveryApiName = discoveryApiName.substring(0, dotIndex).replace("-", "_");
}
List<PackageDependencyView> protoPackageDependencies = new ArrayList<>();
if (packageConfig.protoPackageDependencies(language) != null) {
for (Map.Entry<String, VersionBound> entry :
packageConfig.protoPackageDependencies(language).entrySet()) {
if (entry.getValue() != null
&& (whitelistedDependencies == null
|| whitelistedDependencies.contains(entry.getKey()))) {
protoPackageDependencies.add(
PackageDependencyView.create(entry.getKey(), entry.getValue()));
}
}
// Ensures deterministic test results.
Collections.sort(protoPackageDependencies);
}
return PackageMetadataView.newBuilder()
.templateFileName(template)
.outputPath(outputPath)
.packageVersionBound(packageConfig.generatedPackageVersionBound(language))
.protoPath(packageConfig.protoPath())
.shortName(packageConfig.shortName())
.gaxVersionBound(packageConfig.gaxVersionBound(language))
.grpcVersionBound(packageConfig.grpcVersionBound(language))
.protoVersionBound(packageConfig.protoVersionBound(language))
.protoPackageDependencies(protoPackageDependencies)
.authVersionBound(packageConfig.authVersionBound(language))
.protoPackageName("proto-" + packageConfig.packageName(language))
.gapicPackageName("gapic-" + packageConfig.packageName(language))
.majorVersion(packageConfig.apiVersion())
.author(packageConfig.author())
.email(packageConfig.email())
.homepage(packageConfig.homepage())
.licenseName(packageConfig.licenseName())
.fullName(model.getServiceConfig().getTitle())
.discoveryApiName(discoveryApiName)
.hasMultipleServices(false);
}
}
| 1 | 21,885 | ISTM that since `artman` know the "real" value of the GAPIC config name, it should pass that value to toolkit, rather than toolkit guessing the name based on a heuristic. Then again, I don't know what this value actually does for Java codegen... | googleapis-gapic-generator | java |
@@ -17,7 +17,7 @@ package main
import (
"time"
- "github.com/docopt/docopt-go"
+ docopt "github.com/docopt/docopt-go"
log "github.com/sirupsen/logrus"
"github.com/projectcalico/felix/iptables" | 1 | // Copyright (c) 2017 Tigera, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package main
import (
"time"
"github.com/docopt/docopt-go"
log "github.com/sirupsen/logrus"
"github.com/projectcalico/felix/iptables"
)
const usage = `iptables-locker, test tool for grabbing the iptables lock.
Usage:
iptables-locker <duration>
`
func main() {
arguments, err := docopt.Parse(usage, nil, true, "v0.1", false)
if err != nil {
println(usage)
log.WithError(err).Fatal("Failed to parse usage")
}
durationStr := arguments["<duration>"].(string)
duration, err := time.ParseDuration(durationStr)
if err != nil {
println(usage)
log.WithError(err).Fatal("Failed to parse usage")
}
iptablesLock := iptables.NewSharedLock(
"/run/xtables.lock",
1*time.Second,
50*time.Millisecond,
)
iptablesLock.Lock()
println("LOCKED")
time.Sleep(duration)
iptablesLock.Unlock()
}
| 1 | 16,673 | Please back out the import changes in files you haven't touched. I think these happen if you run goimports without having the vendor directory populated | projectcalico-felix | go |
@@ -17,6 +17,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
Task WriteAsync(ArraySegment<byte> buffer, bool chunk = false, CancellationToken cancellationToken = default(CancellationToken));
void Flush();
Task FlushAsync(CancellationToken cancellationToken = default(CancellationToken));
- void Write<T>(Action<WritableBuffer, T> write, T state);
+ void Write<T>(Action<WritableBuffer, T> write, T state) where T : struct;
}
} | 1 | // Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.Kestrel.Internal.System.IO.Pipelines;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
/// <summary>
/// Operations performed for buffered socket output
/// </summary>
public interface ISocketOutput
{
void Write(ArraySegment<byte> buffer, bool chunk = false);
Task WriteAsync(ArraySegment<byte> buffer, bool chunk = false, CancellationToken cancellationToken = default(CancellationToken));
void Flush();
Task FlushAsync(CancellationToken cancellationToken = default(CancellationToken));
void Write<T>(Action<WritableBuffer, T> write, T state);
}
}
| 1 | 12,638 | Should this be `ISocketOutput<T> where T : struct`? | aspnet-KestrelHttpServer | .cs |
@@ -104,4 +104,11 @@ public interface Snapshot {
* @return the location of the manifest list for this Snapshot
*/
String manifestListLocation();
+
+ /**
+ * Return this snapshot's sequence number, or 0 if the table has no snapshot yet.
+ *
+ * @return the sequence number of this Snapshot
+ */
+ Long sequenceNumber();
} | 1 | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.iceberg;
import java.util.List;
import java.util.Map;
/**
* A snapshot of the data in a table at a point in time.
* <p>
* A snapshot consist of one or more file manifests, and the complete table contents is the union
* of all the data files in those manifests.
* <p>
* Snapshots are created by table operations, like {@link AppendFiles} and {@link RewriteFiles}.
*/
public interface Snapshot {
/**
* Return this snapshot's ID.
*
* @return a long ID
*/
long snapshotId();
/**
* Return this snapshot's parent ID or null.
*
* @return a long ID for this snapshot's parent, or null if it has no parent
*/
Long parentId();
/**
* Return this snapshot's timestamp.
* <p>
* This timestamp is the same as those produced by {@link System#currentTimeMillis()}.
*
* @return a long timestamp in milliseconds
*/
long timestampMillis();
/**
* Return the location of all manifests in this snapshot.
* <p>
* The current table is made of the union of the data files in these manifests.
*
* @return a list of fully-qualified manifest locations
*/
List<ManifestFile> manifests();
/**
* Return the name of the {@link DataOperations data operation} that produced this snapshot.
*
* @return the operation that produced this snapshot, or null if the operation is unknown
* @see DataOperations
*/
String operation();
/**
* Return a string map of summary data for the operation that produced this snapshot.
*
* @return a string map of summary data.
*/
Map<String, String> summary();
/**
* Return all files added to the table in this snapshot.
* <p>
* The files returned include the following columns: file_path, file_format, partition,
* record_count, and file_size_in_bytes. Other columns will be null.
*
* @return all files added to the table in this snapshot.
*/
Iterable<DataFile> addedFiles();
/**
* Return all files deleted from the table in this snapshot.
* <p>
* The files returned include the following columns: file_path, file_format, partition,
* record_count, and file_size_in_bytes. Other columns will be null.
*
* @return all files deleted from the table in this snapshot.
*/
Iterable<DataFile> deletedFiles();
/**
* Return the location of this snapshot's manifest list, or null if it is not separate.
*
* @return the location of the manifest list for this Snapshot
*/
String manifestListLocation();
}
| 1 | 16,335 | In which case will this actually return 0? If there is no snapshot, then there is no `Snapshot` object, right? | apache-iceberg | java |
@@ -133,6 +133,11 @@ class NumClassCheckHook(Hook):
for name, module in model.named_modules():
if hasattr(module, 'num_classes') and not isinstance(
module, (RPNHead, VGG, FusedSemanticHead, GARPNHead)):
+ assert type(dataset.CLASSES) is not str, \
+ (f'`CLASSES` in {dataset.__class__.__name__}'
+ f'should be a tuple of str.'
+ f'Add comma if number of classes is 1 as '
+ f'CLASSES = ({dataset.CLASSES},)')
assert module.num_classes == len(dataset.CLASSES), \
(f'The `num_classes` ({module.num_classes}) in '
f'{module.__class__.__name__} of ' | 1 | import copy
import warnings
from mmcv.cnn import VGG
from mmcv.runner.hooks import HOOKS, Hook
from mmdet.datasets.builder import PIPELINES
from mmdet.datasets.pipelines import LoadAnnotations, LoadImageFromFile
from mmdet.models.dense_heads import GARPNHead, RPNHead
from mmdet.models.roi_heads.mask_heads import FusedSemanticHead
def replace_ImageToTensor(pipelines):
"""Replace the ImageToTensor transform in a data pipeline to
DefaultFormatBundle, which is normally useful in batch inference.
Args:
pipelines (list[dict]): Data pipeline configs.
Returns:
list: The new pipeline list with all ImageToTensor replaced by
DefaultFormatBundle.
Examples:
>>> pipelines = [
... dict(type='LoadImageFromFile'),
... dict(
... type='MultiScaleFlipAug',
... img_scale=(1333, 800),
... flip=False,
... transforms=[
... dict(type='Resize', keep_ratio=True),
... dict(type='RandomFlip'),
... dict(type='Normalize', mean=[0, 0, 0], std=[1, 1, 1]),
... dict(type='Pad', size_divisor=32),
... dict(type='ImageToTensor', keys=['img']),
... dict(type='Collect', keys=['img']),
... ])
... ]
>>> expected_pipelines = [
... dict(type='LoadImageFromFile'),
... dict(
... type='MultiScaleFlipAug',
... img_scale=(1333, 800),
... flip=False,
... transforms=[
... dict(type='Resize', keep_ratio=True),
... dict(type='RandomFlip'),
... dict(type='Normalize', mean=[0, 0, 0], std=[1, 1, 1]),
... dict(type='Pad', size_divisor=32),
... dict(type='DefaultFormatBundle'),
... dict(type='Collect', keys=['img']),
... ])
... ]
>>> assert expected_pipelines == replace_ImageToTensor(pipelines)
"""
pipelines = copy.deepcopy(pipelines)
for i, pipeline in enumerate(pipelines):
if pipeline['type'] == 'MultiScaleFlipAug':
assert 'transforms' in pipeline
pipeline['transforms'] = replace_ImageToTensor(
pipeline['transforms'])
elif pipeline['type'] == 'ImageToTensor':
warnings.warn(
'"ImageToTensor" pipeline is replaced by '
'"DefaultFormatBundle" for batch inference. It is '
'recommended to manually replace it in the test '
'data pipeline in your config file.', UserWarning)
pipelines[i] = {'type': 'DefaultFormatBundle'}
return pipelines
def get_loading_pipeline(pipeline):
"""Only keep loading image and annotations related configuration.
Args:
pipeline (list[dict]): Data pipeline configs.
Returns:
list[dict]: The new pipeline list with only keep
loading image and annotations related configuration.
Examples:
>>> pipelines = [
... dict(type='LoadImageFromFile'),
... dict(type='LoadAnnotations', with_bbox=True),
... dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
... dict(type='RandomFlip', flip_ratio=0.5),
... dict(type='Normalize', **img_norm_cfg),
... dict(type='Pad', size_divisor=32),
... dict(type='DefaultFormatBundle'),
... dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
... ]
>>> expected_pipelines = [
... dict(type='LoadImageFromFile'),
... dict(type='LoadAnnotations', with_bbox=True)
... ]
>>> assert expected_pipelines ==\
... get_loading_pipeline(pipelines)
"""
loading_pipeline_cfg = []
for cfg in pipeline:
obj_cls = PIPELINES.get(cfg['type'])
# TODO:use more elegant way to distinguish loading modules
if obj_cls is not None and obj_cls in (LoadImageFromFile,
LoadAnnotations):
loading_pipeline_cfg.append(cfg)
assert len(loading_pipeline_cfg) == 2, \
'The data pipeline in your config file must include ' \
'loading image and annotations related pipeline.'
return loading_pipeline_cfg
@HOOKS.register_module()
class NumClassCheckHook(Hook):
def _check_head(self, runner):
"""Check whether the `num_classes` in head matches the length of
`CLASSSES` in `dataset`.
Args:
runner (obj:`EpochBasedRunner`): Epoch based Runner.
"""
model = runner.model
dataset = runner.data_loader.dataset
if dataset.CLASSES is None:
runner.logger.warning(
f'Please set `CLASSES` '
f'in the {dataset.__class__.__name__} and'
f'check if it is consistent with the `num_classes` '
f'of head')
else:
for name, module in model.named_modules():
if hasattr(module, 'num_classes') and not isinstance(
module, (RPNHead, VGG, FusedSemanticHead, GARPNHead)):
assert module.num_classes == len(dataset.CLASSES), \
(f'The `num_classes` ({module.num_classes}) in '
f'{module.__class__.__name__} of '
f'{model.__class__.__name__} does not matches '
f'the length of `CLASSES` '
f'{len(dataset.CLASSES)}) in '
f'{dataset.__class__.__name__}')
def before_train_epoch(self, runner):
"""Check whether the training dataset is compatible with head.
Args:
runner (obj:`EpochBasedRunner`): Epoch based Runner.
"""
self._check_head(runner)
def before_val_epoch(self, runner):
"""Check whether the dataset in val epoch is compatible with head.
Args:
runner (obj:`EpochBasedRunner`): Epoch based Runner.
"""
self._check_head(runner)
| 1 | 23,303 | This part of code is valuable and necessary. Can we move it to another place for a more clear logic and only check it once? For example, move it to line 133 before delving into each module. | open-mmlab-mmdetection | py |
@@ -36,7 +36,7 @@ if __name__ == "__main__":
"boto3",
f"dagster{pin}",
"packaging",
- "psycopg2-binary<2.9",
+ "psycopg2-binary",
"requests",
],
extras_require={ | 1 | from typing import Dict
from setuptools import find_packages, setup # type: ignore
def get_version() -> str:
version: Dict[str, str] = {}
with open("dagster_aws/version.py") as fp:
exec(fp.read(), version) # pylint: disable=W0122
return version["__version__"]
if __name__ == "__main__":
ver = get_version()
# dont pin dev installs to avoid pip dep resolver issues
pin = "" if ver == "dev" else f"=={ver}"
setup(
name="dagster-aws",
version=ver,
author="Elementl",
author_email="[email protected]",
license="Apache-2.0",
description="Package for AWS-specific Dagster framework solid and resource components.",
url="https://github.com/dagster-io/dagster/tree/master/python_modules/libraries/dagster-aws",
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
],
packages=find_packages(exclude=["test"]),
include_package_data=True,
install_requires=[
"boto3",
f"dagster{pin}",
"packaging",
"psycopg2-binary<2.9",
"requests",
],
extras_require={
"pyspark": ["dagster-pyspark"],
"test": ["moto==1.3.16", "requests-mock"],
},
zip_safe=False,
)
| 1 | 14,583 | Are we at all worried that changing pins will cause release hiccups? I think we've decided that relaxing pins should be safe but adding pins has caused us build issues in the past - so I think we're fine? | dagster-io-dagster | py |
@@ -12,8 +12,9 @@ import (
)
var (
- _ = collection.Entry(&Entry{})
- serializedDataSize = swarm.SectionSize * 2
+ _ = collection.Entry(&Entry{})
+ serializedDataSize = swarm.SectionSize * 2
+ encryptedSerializedDataSize = swarm.EncryptedHashSize * 2
)
// Entry provides addition of metadata to a data reference. | 1 | // Copyright 2020 The Swarm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package entry
import (
"errors"
"github.com/ethersphere/bee/pkg/collection"
"github.com/ethersphere/bee/pkg/swarm"
)
var (
_ = collection.Entry(&Entry{})
serializedDataSize = swarm.SectionSize * 2
)
// Entry provides addition of metadata to a data reference.
// Implements collection.Entry.
type Entry struct {
reference swarm.Address
metadata swarm.Address
}
// New creates a new Entry.
func New(reference, metadata swarm.Address) *Entry {
return &Entry{
reference: reference,
metadata: metadata,
}
}
// Reference implements collection.Entry
func (e *Entry) Reference() swarm.Address {
return e.reference
}
// Metadata implements collection.Entry
func (e *Entry) Metadata() swarm.Address {
return e.metadata
}
// MarshalBinary implements encoding.BinaryMarshaler
func (e *Entry) MarshalBinary() ([]byte, error) {
br := e.reference.Bytes()
bm := e.metadata.Bytes()
b := append(br, bm...)
return b, nil
}
// UnmarshalBinary implements encoding.BinaryUnmarshaler
func (e *Entry) UnmarshalBinary(b []byte) error {
if len(b) != serializedDataSize {
return errors.New("invalid data length")
}
e.reference = swarm.NewAddress(b[:swarm.SectionSize])
e.metadata = swarm.NewAddress(b[swarm.SectionSize:])
return nil
}
| 1 | 11,523 | could you please explain a bit where these numbers come from? for example: why is there no `swarm.EncryptedSectionSize`? | ethersphere-bee | go |
@@ -39,9 +39,14 @@ func (r *Reader) Close() error {
return r.r.Close()
}
+// ContentType returns the MIME type of the object content.
+func (r *Reader) ContentType() string {
+ return r.r.Attrs().ContentType
+}
+
// Size returns the content size of the blob object.
func (r *Reader) Size() int64 {
- return r.r.Size()
+ return r.r.Attrs().Size
}
// Writer implements io.WriteCloser to write to blob. It must be closed after | 1 | // Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package blob provides an easy way to interact with Blob objects within
// a bucket. It utilizes standard io packages to handle reads and writes.
package blob
import (
"context"
"errors"
"github.com/google/go-cloud/blob/driver"
)
// Reader implements io.ReadCloser to read from blob. It must be closed after
// reads finished. It also provides the size of the blob.
type Reader struct {
r driver.Reader
}
// Read implements io.ReadCloser to read from this reader.
func (r *Reader) Read(p []byte) (int, error) {
return r.r.Read(p)
}
// Close implements io.ReadCloser to close this reader.
func (r *Reader) Close() error {
return r.r.Close()
}
// Size returns the content size of the blob object.
func (r *Reader) Size() int64 {
return r.r.Size()
}
// Writer implements io.WriteCloser to write to blob. It must be closed after
// all writes are done.
type Writer struct {
w driver.Writer
}
// Write implements the io.Writer interface.
//
// The writes happen asynchronously, which means the returned error can be nil
// even if the actual write fails. Use the error returned from Close method to
// check and handle error.
func (w *Writer) Write(p []byte) (n int, err error) {
return w.w.Write(p)
}
// Close flushes any buffered data and completes the Write. It is user's responsibility
// to call it after finishing the write and handle the error if returned.
func (w *Writer) Close() error {
return w.w.Close()
}
// Bucket manages the underlying blob service and provides read, write and delete
// operations on given object within it.
type Bucket struct {
b driver.Bucket
}
// NewBucket creates a new Bucket for a group of objects for a blob service.
func NewBucket(b driver.Bucket) *Bucket {
return &Bucket{b: b}
}
// NewReader returns a Reader to read from an object, or an error when the object
// is not found by the given key.
//
// The caller must call Close on the returned Reader when done reading.
func (b *Bucket) NewReader(ctx context.Context, key string) (*Reader, error) {
return b.NewRangeReader(ctx, key, 0, -1)
}
// NewRangeReader returns a Reader that reads part of an object, reading at most
// length bytes starting at the given offset. If length is 0, it will read only
// the metadata. If length is negative, it will read till the end of the object.
func (b *Bucket) NewRangeReader(ctx context.Context, key string, offset, length int64) (*Reader, error) {
if offset < 0 {
return nil, errors.New("new blob range reader: offset must be non-negative")
}
r, err := b.b.NewRangeReader(ctx, key, offset, length)
return &Reader{r}, err
}
// NewWriter returns Writer that writes to an object associated with key.
//
// A new object will be created unless an object with this key already exists.
// Otherwise any previous object with the same name will be replaced.
// The object will not be available (and any previous object will remain)
// until Close has been called.
//
// The caller must call Close on the returned Writer when done writing.
func (b *Bucket) NewWriter(ctx context.Context, key string, opt *WriterOptions) (*Writer, error) {
var dopt *driver.WriterOptions
if opt != nil {
dopt = &driver.WriterOptions{
BufferSize: opt.BufferSize,
}
}
w, err := b.b.NewWriter(ctx, key, dopt)
return &Writer{w}, err
}
// Delete deletes the object associated with key. It is a no-op if that object
// does not exist.
func (b *Bucket) Delete(ctx context.Context, key string) error {
return b.b.Delete(ctx, key)
}
// WriterOptions controls behaviors of Writer.
type WriterOptions struct {
// BufferSize changes the default size in byte of the maximum part Writer can
// write in a single request. Larger objects will be split into multiple requests.
//
// The support specification of this operation varies depending on the underlying
// blob service. If zero value is given, it is set to a reasonable default value.
// If negative value is given, it will be either disabled (if supported by the
// service), which means Writer will write as a whole, or reset to default value.
// It could be a no-op when not supported at all.
//
// If the Writer is used to write small objects concurrently, set the buffer size
// to a smaller size to avoid high memory usage.
BufferSize int
}
| 1 | 9,952 | s/object content/blob object/ (for consistency with the `Size` docs) | google-go-cloud | go |
@@ -109,16 +109,7 @@ public class CheckJUnitDependencies extends DefaultTask {
+ "'org.junit.jupiter:junit-jupiter' dependency "
+ "because tests use JUnit4 and useJUnitPlatform() is not enabled.");
}
- } else {
- String compileClasspath = ss.getCompileClasspathConfigurationName();
- boolean compilingAgainstOldJunit = hasDep(compileClasspath, CheckJUnitDependencies::isJunit4);
- Preconditions.checkState(
- !compilingAgainstOldJunit,
- "Extraneous dependency on JUnit4 (no test mentions JUnit4 classes). Please exclude "
- + "this from compilation to ensure developers don't accidentally re-introduce it, e.g.\n\n"
- + " configurations." + compileClasspath + ".exclude module: 'junit'\n\n");
}
-
// sourcesets might also contain Spock classes, but we don't have any special validation for these.
}
| 1 | /*
* (c) Copyright 2019 Palantir Technologies Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.palantir.baseline.tasks;
import com.google.common.base.Preconditions;
import com.palantir.baseline.plugins.BaselineTesting;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Stream;
import org.gradle.api.DefaultTask;
import org.gradle.api.artifacts.ModuleVersionIdentifier;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.TaskAction;
import org.gradle.api.tasks.testing.Test;
public class CheckJUnitDependencies extends DefaultTask {
public CheckJUnitDependencies() {
setGroup("Verification");
setDescription("Ensures the correct JUnit4/5 dependencies are present, otherwise tests may silently not run");
}
@TaskAction
public final void validateDependencies() {
getProject().getConvention()
.getPlugin(JavaPluginConvention.class)
.getSourceSets()
.forEach(ss -> {
if (ss.getName().equals("main")) {
return;
}
Optional<Test> maybeTestTask = BaselineTesting.getTestTaskForSourceSet(getProject(), ss);
if (!maybeTestTask.isPresent()) {
// source set doesn't have a test task, e.g. 'schema'
return;
}
Test task = maybeTestTask.get();
getProject().getLogger().info(
"Analyzing source set {} with task {}",
ss.getName(), task.getName());
validateSourceSet(ss, task);
});
}
private void validateSourceSet(SourceSet ss, Test task) {
boolean junitJupiterIsPresent = hasDep(
ss.getRuntimeClasspathConfigurationName(), CheckJUnitDependencies::isJunitJupiter);
// If some testing library happens to provide the junit-jupiter-api, then users might start using the
// org.junit.jupiter.api.Test annotation, but as JUnit4 knows nothing about these, they'll silently not run
// unless the user has wired up the dependency correctly.
if (sourceSetMentionsJUnit5Api(ss)) {
String implementation = ss.getImplementationConfigurationName();
Preconditions.checkState(
BaselineTesting.useJUnitPlatformEnabled(task),
"Some tests mention JUnit5, but the '" + task.getName() + "' task does not have "
+ "useJUnitPlatform() enabled. This means tests may be silently not running! Please "
+ "add the following:\n\n"
+ " " + implementation + " 'org.junit.jupiter:junit-jupiter'\n");
}
// When doing an incremental migration to JUnit5, a project may have some JUnit4 and some JUnit5 tests at the
// same time. It's crucial that they have the vintage engine set up correctly, otherwise tests may silently
// not run!
if (sourceSetMentionsJUnit4(ss)) {
if (BaselineTesting.useJUnitPlatformEnabled(task)) { // people might manually enable this
String testRuntimeOnly = ss.getRuntimeConfigurationName() + "Only";
Preconditions.checkState(
junitJupiterIsPresent,
"Tests may be silently not running! Some tests still use JUnit4, but Gradle has "
+ "been set to use JUnit Platform. "
+ "To ensure your old JUnit4 tests still run, please add the following:\n\n"
+ " " + testRuntimeOnly + " 'org.junit.jupiter:junit-jupiter'\n\n"
+ "Otherwise they will silently not run.");
boolean vintageEngineExists = hasDep(
ss.getRuntimeClasspathConfigurationName(), CheckJUnitDependencies::isVintageEngine);
Preconditions.checkState(
vintageEngineExists,
"Tests may be silently not running! Some tests still use JUnit4, but Gradle has "
+ "been set to use JUnit Platform. "
+ "To ensure your old JUnit4 tests still run, please add the following:\n\n"
+ " " + testRuntimeOnly + " 'org.junit.vintage:junit-vintage-engine'\n\n"
+ "Otherwise they will silently not run.");
} else {
Preconditions.checkState(
!junitJupiterIsPresent,
"Tests may be silently not running! Please remove "
+ "'org.junit.jupiter:junit-jupiter' dependency "
+ "because tests use JUnit4 and useJUnitPlatform() is not enabled.");
}
} else {
String compileClasspath = ss.getCompileClasspathConfigurationName();
boolean compilingAgainstOldJunit = hasDep(compileClasspath, CheckJUnitDependencies::isJunit4);
Preconditions.checkState(
!compilingAgainstOldJunit,
"Extraneous dependency on JUnit4 (no test mentions JUnit4 classes). Please exclude "
+ "this from compilation to ensure developers don't accidentally re-introduce it, e.g.\n\n"
+ " configurations." + compileClasspath + ".exclude module: 'junit'\n\n");
}
// sourcesets might also contain Spock classes, but we don't have any special validation for these.
}
private boolean hasDep(String configurationName, Predicate<ModuleVersionIdentifier> spec) {
return getProject().getConfigurations()
.getByName(configurationName)
.getIncoming()
.getResolutionResult()
.getAllComponents()
.stream()
.anyMatch(component -> spec.test(component.getModuleVersion()));
}
private boolean sourceSetMentionsJUnit4(SourceSet ss) {
return !ss.getAllSource()
.filter(file -> fileContainsSubstring(file, l ->
l.contains("org.junit.Test")
|| l.contains("org.junit.runner")
|| l.contains("org.junit.ClassRule")))
.isEmpty();
}
private boolean sourceSetMentionsJUnit5Api(SourceSet ss) {
return !ss.getAllSource()
.filter(file -> fileContainsSubstring(file, l -> l.contains("org.junit.jupiter.api.")))
.isEmpty();
}
private boolean fileContainsSubstring(File file, Predicate<String> substring) {
try (Stream<String> lines = Files.lines(file.toPath())) {
boolean hit = lines.anyMatch(substring::test);
getProject().getLogger().debug("[{}] {}", hit ? "hit" : "miss", file);
return hit;
} catch (IOException e) {
throw new RuntimeException("Unable to check file " + file, e);
}
}
private static boolean isJunitJupiter(ModuleVersionIdentifier dep) {
return "org.junit.jupiter".equals(dep.getGroup()) && "junit-jupiter".equals(dep.getName());
}
private static boolean isVintageEngine(ModuleVersionIdentifier dep) {
return "org.junit.vintage".equals(dep.getGroup()) && "junit-vintage-engine".equals(dep.getName());
}
private static boolean isJunit4(ModuleVersionIdentifier dep) {
return "junit".equals(dep.getGroup()) && "junit".equals(dep.getName());
}
}
| 1 | 7,525 | Rather than deleting this entirely, could we just emit it as a `warn` or `info` log line? | palantir-gradle-baseline | java |
@@ -215,7 +215,7 @@ func (cfg *Config) newACMEClient(interactive bool) (*acmeClient, error) {
// lockKey returns a key for a lock that is specific to the operation
// named op being performed related to domainName and this config's CA.
func (cfg *Config) lockKey(op, domainName string) string {
- return fmt.Sprintf("%s:%s:%s", op, domainName, cfg.CA)
+ return fmt.Sprintf("%s_%s_%s", op, domainName, cfg.CA)
}
// Obtain obtains a single certificate for name. It stores the certificate | 1 | // Copyright 2015 Matthew Holt
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package certmagic
import (
"fmt"
"log"
"net"
"net/url"
"strings"
"sync"
"time"
"github.com/xenolf/lego/certificate"
"github.com/xenolf/lego/challenge"
"github.com/xenolf/lego/challenge/http01"
"github.com/xenolf/lego/challenge/tlsalpn01"
"github.com/xenolf/lego/lego"
"github.com/xenolf/lego/registration"
)
// acmeMu ensures that only one ACME challenge occurs at a time.
var acmeMu sync.Mutex
// acmeClient is a wrapper over acme.Client with
// some custom state attached. It is used to obtain,
// renew, and revoke certificates with ACME.
type acmeClient struct {
config *Config
acmeClient *lego.Client
}
// listenerAddressInUse returns true if a TCP connection
// can be made to addr within a short time interval.
func listenerAddressInUse(addr string) bool {
conn, err := net.DialTimeout("tcp", addr, 250*time.Millisecond)
if err == nil {
conn.Close()
}
return err == nil
}
func (cfg *Config) newACMEClient(interactive bool) (*acmeClient, error) {
// look up or create the user account
leUser, err := cfg.getUser(cfg.Email)
if err != nil {
return nil, err
}
// ensure key type and timeout are set
keyType := cfg.KeyType
if keyType == "" {
keyType = KeyType
}
certObtainTimeout := cfg.CertObtainTimeout
if certObtainTimeout == 0 {
certObtainTimeout = CertObtainTimeout
}
// ensure CA URL (directory endpoint) is set
caURL := CA
if cfg.CA != "" {
caURL = cfg.CA
}
// ensure endpoint is secure (assume HTTPS if scheme is missing)
if !strings.Contains(caURL, "://") {
caURL = "https://" + caURL
}
u, err := url.Parse(caURL)
if err != nil {
return nil, err
}
if u.Scheme != "https" && !isLoopback(u.Host) && !isInternal(u.Host) {
return nil, fmt.Errorf("%s: insecure CA URL (HTTPS required)", caURL)
}
clientKey := caURL + leUser.Email + string(keyType)
// if an underlying client with this configuration already exists, reuse it
cfg.acmeClientsMu.Lock()
client, ok := cfg.acmeClients[clientKey]
if !ok {
// the client facilitates our communication with the CA server
legoCfg := lego.NewConfig(&leUser)
legoCfg.CADirURL = caURL
legoCfg.UserAgent = buildUAString()
legoCfg.HTTPClient.Timeout = HTTPTimeout
legoCfg.Certificate = lego.CertificateConfig{
KeyType: keyType,
Timeout: certObtainTimeout,
}
client, err = lego.NewClient(legoCfg)
if err != nil {
cfg.acmeClientsMu.Unlock()
return nil, err
}
cfg.acmeClients[clientKey] = client
}
cfg.acmeClientsMu.Unlock()
// if not registered, the user must register an account
// with the CA and agree to terms
if leUser.Registration == nil {
if interactive { // can't prompt a user who isn't there
termsURL := client.GetToSURL()
if !cfg.Agreed && termsURL != "" {
cfg.Agreed = cfg.askUserAgreement(client.GetToSURL())
}
if !cfg.Agreed && termsURL != "" {
return nil, fmt.Errorf("user must agree to CA terms")
}
}
reg, err := client.Registration.Register(registration.RegisterOptions{TermsOfServiceAgreed: cfg.Agreed})
if err != nil {
return nil, fmt.Errorf("registration error: %v", err)
}
leUser.Registration = reg
// persist the user to storage
err = cfg.saveUser(leUser)
if err != nil {
return nil, fmt.Errorf("could not save user: %v", err)
}
}
c := &acmeClient{
config: cfg,
acmeClient: client,
}
if cfg.DNSProvider == nil {
// Use HTTP and TLS-ALPN challenges by default
// figure out which ports we'll be serving the challenges on
useHTTPPort := HTTPChallengePort
useTLSALPNPort := TLSALPNChallengePort
if HTTPPort > 0 && HTTPPort != HTTPChallengePort {
useHTTPPort = HTTPPort
}
if HTTPSPort > 0 && HTTPSPort != TLSALPNChallengePort {
useTLSALPNPort = HTTPSPort
}
if cfg.AltHTTPPort > 0 {
useHTTPPort = cfg.AltHTTPPort
}
if cfg.AltTLSALPNPort > 0 {
useTLSALPNPort = cfg.AltTLSALPNPort
}
// If this machine is already listening on the HTTP or TLS-ALPN port
// designated for the challenges, then we need to handle the challenges
// a little differently: for HTTP, we will answer the challenge request
// using our own HTTP handler (the HandleHTTPChallenge function - this
// works only because challenge info is written to storage associated
// with cfg when the challenge is initiated); for TLS-ALPN, we will add
// the challenge cert to our cert cache and serve it up during the
// handshake. As for the default solvers... we are careful to honor the
// listener bind preferences by using cfg.ListenHost.
var httpSolver, alpnSolver challenge.Provider
httpSolver = http01.NewProviderServer(cfg.ListenHost, fmt.Sprintf("%d", useHTTPPort))
alpnSolver = tlsalpn01.NewProviderServer(cfg.ListenHost, fmt.Sprintf("%d", useTLSALPNPort))
if listenerAddressInUse(net.JoinHostPort(cfg.ListenHost, fmt.Sprintf("%d", useHTTPPort))) {
httpSolver = nil
}
if listenerAddressInUse(net.JoinHostPort(cfg.ListenHost, fmt.Sprintf("%d", useTLSALPNPort))) {
alpnSolver = tlsALPNSolver{certCache: cfg.certCache}
}
// because of our nifty Storage interface, we can distribute the HTTP and
// TLS-ALPN challenges across all instances that share the same storage -
// in fact, this is required now for successful solving of the HTTP challenge
// if the port is already in use, since we must write the challenge info
// to storage for the HTTPChallengeHandler to solve it successfully
c.acmeClient.Challenge.SetHTTP01Provider(distributedSolver{
config: cfg,
providerServer: httpSolver,
})
c.acmeClient.Challenge.SetTLSALPN01Provider(distributedSolver{
config: cfg,
providerServer: alpnSolver,
})
// disable any challenges that should not be used
if cfg.DisableHTTPChallenge {
c.acmeClient.Challenge.Remove(challenge.HTTP01)
}
if cfg.DisableTLSALPNChallenge {
c.acmeClient.Challenge.Remove(challenge.TLSALPN01)
}
} else {
// Otherwise, use DNS challenge exclusively
c.acmeClient.Challenge.Remove(challenge.HTTP01)
c.acmeClient.Challenge.Remove(challenge.TLSALPN01)
c.acmeClient.Challenge.SetDNS01Provider(cfg.DNSProvider)
}
return c, nil
}
// lockKey returns a key for a lock that is specific to the operation
// named op being performed related to domainName and this config's CA.
func (cfg *Config) lockKey(op, domainName string) string {
return fmt.Sprintf("%s:%s:%s", op, domainName, cfg.CA)
}
// Obtain obtains a single certificate for name. It stores the certificate
// on the disk if successful. This function is safe for concurrent use.
//
// Our storage mechanism only supports one name per certificate, so this
// function (along with Renew and Revoke) only accepts one domain as input.
// It could be easily modified to support SAN certificates if our storage
// mechanism is upgraded later, but that will increase logical complexity
// in other areas.
//
// Callers who have access to a Config value should use the ObtainCert
// method on that instead of this lower-level method.
func (c *acmeClient) Obtain(name string) error {
// ensure idempotency of the obtain operation for this name
lockKey := c.config.lockKey("cert_acme", name)
err := c.config.certCache.storage.Lock(lockKey)
if err != nil {
return err
}
defer func() {
if err := c.config.certCache.storage.Unlock(lockKey); err != nil {
log.Printf("[ERROR][%s] Obtain: Unable to unlock '%s': %v", name, lockKey, err)
}
}()
// check if obtain is still needed -- might have
// been obtained during lock
if c.config.storageHasCertResources(name) {
log.Printf("[INFO][%s] Obtain: Certificate already exists in storage", name)
return nil
}
for attempts := 0; attempts < 2; attempts++ {
request := certificate.ObtainRequest{
Domains: []string{name},
Bundle: true,
MustStaple: c.config.MustStaple,
}
acmeMu.Lock()
certificate, err := c.acmeClient.Certificate.Obtain(request)
acmeMu.Unlock()
if err != nil {
return fmt.Errorf("[%s] failed to obtain certificate: %s", name, err)
}
// double-check that we actually got a certificate, in case there's a bug upstream (see issue mholt/caddy#2121)
if certificate.Domain == "" || certificate.Certificate == nil {
return fmt.Errorf("returned certificate was empty; probably an unchecked error obtaining it")
}
// Success - immediately save the certificate resource
err = c.config.saveCertResource(certificate)
if err != nil {
return fmt.Errorf("error saving assets for %v: %v", name, err)
}
break
}
if c.config.OnEvent != nil {
c.config.OnEvent("acme_cert_obtained", name)
}
return nil
}
// Renew renews the managed certificate for name. It puts the renewed
// certificate into storage (not the cache). This function is safe for
// concurrent use.
//
// Callers who have access to a Config value should use the RenewCert
// method on that instead of this lower-level method.
func (c *acmeClient) Renew(name string) error {
// ensure idempotency of the renew operation for this name
lockKey := c.config.lockKey("cert_acme", name)
err := c.config.certCache.storage.Lock(lockKey)
if err != nil {
return err
}
defer func() {
if err := c.config.certCache.storage.Unlock(lockKey); err != nil {
log.Printf("[ERROR][%s] Renew: Unable to unlock '%s': %v", name, lockKey, err)
}
}()
// Prepare for renewal (load PEM cert, key, and meta)
certRes, err := c.config.loadCertResource(name)
if err != nil {
return err
}
// Check if renew is still needed - might have been renewed while waiting for lock
if !c.config.managedCertNeedsRenewal(certRes) {
log.Printf("[INFO][%s] Renew: Certificate appears to have been renewed already", name)
return nil
}
// Perform renewal and retry if necessary, but not too many times.
var newCertMeta *certificate.Resource
var success bool
for attempts := 0; attempts < 2; attempts++ {
acmeMu.Lock()
newCertMeta, err = c.acmeClient.Certificate.Renew(certRes, true, c.config.MustStaple)
acmeMu.Unlock()
if err == nil {
// double-check that we actually got a certificate; check a couple fields, just in case
if newCertMeta == nil || newCertMeta.Domain == "" || newCertMeta.Certificate == nil {
err = fmt.Errorf("returned certificate was empty; probably an unchecked error renewing it")
} else {
success = true
break
}
}
// wait a little bit and try again
wait := 10 * time.Second
log.Printf("[ERROR] Renewing [%v]: %v; trying again in %s", name, err, wait)
time.Sleep(wait)
}
if !success {
return fmt.Errorf("too many renewal attempts; last error: %v", err)
}
if c.config.OnEvent != nil {
c.config.OnEvent("acme_cert_renewed", name)
}
return c.config.saveCertResource(newCertMeta)
}
// Revoke revokes the certificate for name and deletes
// it from storage.
func (c *acmeClient) Revoke(name string) error {
if !c.config.certCache.storage.Exists(StorageKeys.SitePrivateKey(c.config.CA, name)) {
return fmt.Errorf("private key not found for %s", name)
}
certRes, err := c.config.loadCertResource(name)
if err != nil {
return err
}
err = c.acmeClient.Certificate.Revoke(certRes.Certificate)
if err != nil {
return err
}
if c.config.OnEvent != nil {
c.config.OnEvent("acme_cert_revoked", name)
}
err = c.config.certCache.storage.Delete(StorageKeys.SiteCert(c.config.CA, name))
if err != nil {
return fmt.Errorf("certificate revoked, but unable to delete certificate file: %v", err)
}
err = c.config.certCache.storage.Delete(StorageKeys.SitePrivateKey(c.config.CA, name))
if err != nil {
return fmt.Errorf("certificate revoked, but unable to delete private key: %v", err)
}
err = c.config.certCache.storage.Delete(StorageKeys.SiteMeta(c.config.CA, name))
if err != nil {
return fmt.Errorf("certificate revoked, but unable to delete certificate metadata: %v", err)
}
return nil
}
func buildUAString() string {
ua := "CertMagic"
if UserAgent != "" {
ua += " " + UserAgent
}
return ua
}
// Some default values passed down to the underlying lego client.
var (
UserAgent string
HTTPTimeout = 30 * time.Second
)
| 1 | 13,023 | Is there a chance of this being a BC break of somekind? I.e. what if an old instance of Caddy is running in a cluster with a newer one? | caddyserver-caddy | go |
@@ -758,6 +758,7 @@ class CaiDataAccess(object):
except SQLAlchemyError as e:
LOGGER.exception('Attempt to delete data from CAI temporary store '
'failed, disabling the use of CAI: %s', e)
+ session.rollback()
return num_rows
| 1 | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Inventory storage implementation."""
# pylint: disable=too-many-lines
import json
import enum
from sqlalchemy import and_
from sqlalchemy import BigInteger
from sqlalchemy import case
from sqlalchemy import Column
from sqlalchemy import DateTime
from sqlalchemy import Enum
from sqlalchemy import exists
from sqlalchemy import func
from sqlalchemy import Index
from sqlalchemy import Integer
from sqlalchemy import LargeBinary
from sqlalchemy import or_
from sqlalchemy import PrimaryKeyConstraint
from sqlalchemy import String
from sqlalchemy import Table
from sqlalchemy import Text
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import aliased
from sqlalchemy.orm import mapper
from google.cloud.asset_v1beta1.proto import assets_pb2
from google.protobuf import json_format
from google.cloud.forseti.common.util import date_time
from google.cloud.forseti.common.util import logger
from google.cloud.forseti.common.util.index_state import IndexState
# pylint: disable=line-too-long
from google.cloud.forseti.services.inventory.base.storage import Storage as BaseStorage
from google.cloud.forseti.services.scanner.dao import ScannerIndex
# pylint: enable=line-too-long
LOGGER = logger.get_logger(__name__)
BASE = declarative_base()
CURRENT_SCHEMA = 1
PER_YIELD = 1024
MAX_ALLOWED_PACKET = 32 * 1024 * 1024 # 32 Mb default mysql max packet size
class Categories(enum.Enum):
"""Inventory Categories."""
resource = 1
iam_policy = 2
gcs_policy = 3
dataset_policy = 4
billing_info = 5
enabled_apis = 6
kubernetes_service_config = 7
class ContentTypes(enum.Enum):
"""Cloud Asset Inventory Content Types."""
resource = 1
iam_policy = 2
SUPPORTED_CATEGORIES = frozenset(item.name for item in list(Categories))
SUPPORTED_CONTENT_TYPES = frozenset(item.name for item in list(ContentTypes))
class InventoryIndex(BASE):
"""Represents a GCP inventory."""
__tablename__ = 'inventory_index'
id = Column(BigInteger, primary_key=True)
created_at_datetime = Column(DateTime)
completed_at_datetime = Column(DateTime)
inventory_status = Column(Text)
schema_version = Column(Integer)
progress = Column(Text)
counter = Column(Integer)
inventory_index_warnings = Column(Text(16777215))
inventory_index_errors = Column(Text(16777215))
message = Column(Text(16777215))
def __repr__(self):
"""Object string representation.
Returns:
str: String representation of the object.
"""
return """<{}(id='{}', version='{}', timestamp='{}')>""".format(
self.__class__.__name__,
self.id,
self.schema_version,
self.created_at_datetime)
@classmethod
def create(cls):
"""Create a new inventory index row.
Returns:
object: InventoryIndex row object.
"""
utc_now = date_time.get_utc_now_datetime()
micro_timestamp = date_time.get_utc_now_microtimestamp(utc_now)
return InventoryIndex(
id=micro_timestamp,
created_at_datetime=utc_now,
completed_at_datetime=None,
inventory_status=IndexState.CREATED,
schema_version=CURRENT_SCHEMA,
counter=0)
def complete(self, status=IndexState.SUCCESS):
"""Mark the inventory as completed with a final inventory_status.
Args:
status (str): Final inventory_status.
"""
self.completed_at_datetime = date_time.get_utc_now_datetime()
self.inventory_status = status
def add_warning(self, session, warning):
"""Add a warning to the inventory.
Args:
session (object): session object to work on.
warning (str): Warning message
"""
warning_message = '{}\n'.format(warning)
if not self.inventory_index_warnings:
self.inventory_index_warnings = warning_message
else:
self.inventory_index_warnings += warning_message
session.add(self)
session.flush()
def set_error(self, session, message):
"""Indicate a broken import.
Args:
session (object): session object to work on.
message (str): Error message to set.
"""
self.inventory_index_errors = message
session.add(self)
session.flush()
def get_lifecycle_state_details(self, session, resource_type_input):
"""Count of lifecycle states of the specified resources.
Generate/return the count of lifecycle states (ACTIVE, DELETE_PENDING)
of the specific resource type input (project, folder) for this inventory
index.
Args:
session (object) : session object to work on.
resource_type_input (str) : resource type to get lifecycle states.
Returns:
dict: a (lifecycle state -> count) dictionary
"""
resource_data = Inventory.resource_data
details = dict(
session.query(func.json_extract(resource_data, '$.lifecycleState'),
func.count())
.filter(Inventory.inventory_index_id == self.id)
.filter(Inventory.category == 'resource')
.filter(Inventory.resource_type == resource_type_input)
.group_by(func.json_extract(resource_data, '$.lifecycleState'))
.all())
LOGGER.debug('Lifecycle details for %s:\n%s',
resource_type_input, details)
# Lifecycle can be None if Forseti is installed to a non-org level.
for key in details.keys():
if key is None:
continue
new_key = key.replace('\"', '').replace('_', ' ')
new_key = ' - '.join([resource_type_input, new_key])
details[new_key] = details.pop(key)
if len(details) == 1 and details.keys()[0] is None:
return {}
if len(details) == 1:
if 'ACTIVE' in details.keys()[0]:
added_key_str = 'DELETE PENDING'
elif 'DELETE PENDING' in details.keys()[0]:
added_key_str = 'ACTIVE'
added_key = ' - '.join([resource_type_input, added_key_str])
details[added_key] = 0
return details
def get_hidden_resource_details(self, session, resource_type):
"""Count of the hidden and shown specified resources.
Generate/return the count of hidden resources (e.g. dataset) for this
inventory index.
Args:
session (object) : session object to work on.
resource_type (str) : resource type to find details for.
Returns:
dict: a (hidden_resource -> count) dictionary
"""
details = {}
resource_id = Inventory.resource_id
field_label_hidden = resource_type + ' - HIDDEN'
field_label_shown = resource_type + ' - SHOWN'
hidden_label = (
func.count(case([(resource_id.contains('%:~_%', escape='~'), 1)])))
shown_label = (
func.count(case([(~resource_id.contains('%:~_%', escape='~'), 1)])))
details_query = (
session.query(hidden_label, shown_label)
.filter(Inventory.inventory_index_id == self.id)
.filter(Inventory.category == 'resource')
.filter(Inventory.resource_type == resource_type).one())
details[field_label_hidden] = details_query[0]
details[field_label_shown] = details_query[1]
return details
def get_summary(self, session):
"""Generate/return an inventory summary for this inventory index.
Args:
session (object): session object to work on.
Returns:
dict: a (resource type -> count) dictionary
"""
resource_type = Inventory.resource_type
summary = dict(
session.query(resource_type, func.count(resource_type))
.filter(Inventory.inventory_index_id == self.id)
.filter(Inventory.category == 'resource')
.group_by(resource_type).all())
return summary
def get_details(self, session):
"""Generate/return inventory details for this inventory index.
Includes delete pending/active resource types and hidden/shown datasets.
Args:
session (object): session object to work on.
Returns:
dict: a (resource type -> count) dictionary
"""
resource_types_with_lifecycle = ['folder', 'organization', 'project']
resource_types_hidden = ['dataset']
resource_types_with_details = {'lifecycle':
resource_types_with_lifecycle,
'hidden':
resource_types_hidden}
details = {}
for key, value in resource_types_with_details.items():
if key == 'lifecycle':
details_function = self.get_lifecycle_state_details
elif key == 'hidden':
details_function = self.get_hidden_resource_details
for resource in value:
resource_details = details_function(session, resource)
details.update(resource_details)
return details
class Inventory(BASE):
"""Resource inventory table."""
__tablename__ = 'gcp_inventory'
id = Column(Integer, primary_key=True, autoincrement=True)
inventory_index_id = Column(BigInteger)
category = Column(Enum(Categories))
resource_type = Column(String(255))
resource_id = Column(Text)
resource_data = Column(Text(16777215))
parent_id = Column(Integer)
other = Column(Text)
inventory_errors = Column(Text)
__table_args__ = (
Index('idx_resource_category',
'inventory_index_id',
'resource_type',
'category'),
Index('idx_parent_id',
'parent_id'))
@classmethod
def from_resource(cls, index, resource):
"""Creates a database row object from a crawled resource.
Args:
index (object): InventoryIndex to associate.
resource (object): Crawled resource.
Returns:
object: database row object.
"""
parent = resource.parent()
iam_policy = resource.get_iam_policy()
gcs_policy = resource.get_gcs_policy()
dataset_policy = resource.get_dataset_policy()
billing_info = resource.get_billing_info()
enabled_apis = resource.get_enabled_apis()
service_config = resource.get_kubernetes_service_config()
other = json.dumps({'timestamp': resource.get_timestamp()})
rows = [Inventory(
inventory_index_id=index.id,
category=Categories.resource,
resource_id=resource.key(),
resource_type=resource.type(),
resource_data=json.dumps(resource.data(), sort_keys=True),
parent_id=None if not parent else parent.inventory_key(),
other=other,
inventory_errors=resource.get_warning())]
if iam_policy:
rows.append(
Inventory(
inventory_index_id=index.id,
category=Categories.iam_policy,
resource_id=resource.key(),
resource_type=resource.type(),
resource_data=json.dumps(iam_policy, sort_keys=True),
other=other,
inventory_errors=None))
if gcs_policy:
rows.append(
Inventory(
inventory_index_id=index.id,
category=Categories.gcs_policy,
resource_id=resource.key(),
resource_type=resource.type(),
resource_data=json.dumps(gcs_policy, sort_keys=True),
other=other,
inventory_errors=None))
if dataset_policy:
rows.append(
Inventory(
inventory_index_id=index.id,
category=Categories.dataset_policy,
resource_id=resource.key(),
resource_type=resource.type(),
resource_data=json.dumps(dataset_policy, sort_keys=True),
other=other,
inventory_errors=None))
if billing_info:
rows.append(
Inventory(
inventory_index_id=index.id,
category=Categories.billing_info,
resource_id=resource.key(),
resource_type=resource.type(),
resource_data=json.dumps(billing_info, sort_keys=True),
other=other,
inventory_errors=None))
if enabled_apis:
rows.append(
Inventory(
inventory_index_id=index.id,
category=Categories.enabled_apis,
resource_id=resource.key(),
resource_type=resource.type(),
resource_data=json.dumps(enabled_apis, sort_keys=True),
other=other,
inventory_errors=None))
if service_config:
rows.append(
Inventory(
inventory_index_id=index.id,
category=Categories.kubernetes_service_config,
resource_id=resource.key(),
resource_type=resource.type(),
resource_data=json.dumps(service_config, sort_keys=True),
other=other,
inventory_errors=None))
return rows
def copy_inplace(self, new_row):
"""Update a database row object from a resource.
Args:
new_row (Inventory): the Inventory row of the new resource
"""
self.category = new_row.category
self.resource_id = new_row.resource_id
self.resource_type = new_row.resource_type
self.resource_data = new_row.resource_data
self.other = new_row.other
self.inventory_errors = new_row.inventory_errors
def __repr__(self):
"""String representation of the database row object.
Returns:
str: A description of inventory_index
"""
return ('<{}(inventory_index_id=\'{}\', resource_id=\'{}\','
' resource_type=\'{}\')>').format(
self.__class__.__name__,
self.inventory_index_id,
self.resource_id,
self.resource_type)
def get_resource_id(self):
"""Get the row's resource id.
Returns:
str: resource id.
"""
return self.resource_id
def get_resource_type(self):
"""Get the row's resource type.
Returns:
str: resource type.
"""
return self.resource_type
def get_category(self):
"""Get the row's data category.
Returns:
str: data category.
"""
return self.category.name
def get_parent_id(self):
"""Get the row's parent id.
Returns:
int: parent id.
"""
return self.parent_id
def get_resource_data(self):
"""Get the row's metadata.
Returns:
dict: row's metadata.
"""
return json.loads(self.resource_data)
def get_resource_data_raw(self):
"""Get the row's data json string.
Returns:
str: row's raw data.
"""
return self.resource_data
def get_other(self):
"""Get the row's other data.
Returns:
dict: row's other data.
"""
return json.loads(self.other)
def get_inventory_errors(self):
"""Get the row's error data.
Returns:
str: row's error data.
"""
return self.inventory_errors
class CaiTemporaryStore(object):
"""CAI temporary inventory table."""
__tablename__ = 'cai_temporary_store'
# Class members created in initialize() by mapper()
name = None
parent_name = None
content_type = None
asset_type = None
asset_data = None
def __init__(self, name, parent_name, content_type, asset_type, asset_data):
"""Initialize database column.
Manually defined so that the collation value can be overriden at run
time for this database table.
Args:
name (str): The asset name.
parent_name (str): The asset name of the parent resource.
content_type (ContentTypes): The asset data content type.
asset_type (str): The asset data type.
asset_data (str): The asset data as a serialized binary blob.
"""
self.name = name
self.parent_name = parent_name
self.content_type = content_type
self.asset_type = asset_type
self.asset_data = asset_data
@classmethod
def initialize(cls, metadata, collation='utf8_bin'):
"""Create the table schema based on run time arguments.
Used to fix the column collation value for non-MySQL database engines.
Args:
metadata (object): The sqlalchemy MetaData to associate the table
with.
collation (str): The collation value to use.
"""
if 'cai_temporary_store' not in metadata.tables:
my_table = Table('cai_temporary_store', metadata,
Column('name', String(512, collation=collation),
nullable=False),
Column('parent_name', String(255), nullable=True),
Column('content_type', Enum(ContentTypes),
nullable=False),
Column('asset_type', String(255), nullable=False),
Column('asset_data',
LargeBinary(length=(2**32) - 1),
nullable=False),
Index('idx_parent_name', 'parent_name'),
PrimaryKeyConstraint('content_type',
'asset_type',
'name',
name='cai_temp_store_pk'))
mapper(cls, my_table)
def extract_asset_data(self, content_type):
"""Extracts the data from the asset protobuf based on the content type.
Args:
content_type (ContentTypes): The content type data to extract.
Returns:
dict: The dict representation of the asset data.
"""
# The no-member is a false positive for the dynamic protobuf class.
# pylint: disable=no-member
asset_pb = assets_pb2.Asset.FromString(self.asset_data)
# pylint: enable=no-member
if content_type == ContentTypes.resource:
return json_format.MessageToDict(asset_pb.resource.data)
elif content_type == ContentTypes.iam_policy:
return json_format.MessageToDict(asset_pb.iam_policy)
return json_format.MessageToDict(asset_pb)
@classmethod
def from_json(cls, asset_json):
"""Creates a database row object from the json data in a dump file.
Args:
asset_json (str): The json representation of an Asset.
Returns:
object: database row object or None if there is no data.
"""
asset_pb = json_format.Parse(asset_json, assets_pb2.Asset())
if len(asset_pb.name) > 512:
LOGGER.warn('Skipping insert of asset %s, name too long.',
asset_pb.name)
return None
if asset_pb.HasField('resource'):
content_type = ContentTypes.resource
parent_name = cls._get_parent_name(asset_pb)
elif asset_pb.HasField('iam_policy'):
content_type = ContentTypes.iam_policy
parent_name = asset_pb.name
else:
return None
return cls(
name=asset_pb.name,
parent_name=parent_name,
content_type=content_type,
asset_type=asset_pb.asset_type,
asset_data=asset_pb.SerializeToString()
)
@classmethod
def delete_all(cls, session):
"""Deletes all rows from this table.
Args:
session (object): db session
Returns:
int: The number of rows deleted.
Raises:
Exception: Reraises any exception.
"""
try:
num_rows = session.query(cls).delete()
session.commit()
return num_rows
except Exception as e:
LOGGER.exception(e)
session.rollback()
raise
@staticmethod
def _get_parent_name(asset_pb):
"""Determines the parent name from the resource data.
Args:
asset_pb (assets_pb2.Asset): An Asset protobuf object.
Returns:
str: The parent name for the resource.
"""
if asset_pb.resource.parent:
return asset_pb.resource.parent
if asset_pb.asset_type == 'google.cloud.kms.KeyRing':
# KMS KeyRings are parented by a location under a project, but
# the location is not directly discoverable without iterating all
# locations, so instead this creates an artificial parent at the
# project level, which acts as an aggregated list of all keyrings
# in all locations to fix this broken behavior.
#
# Strip locations/{LOCATION}/keyRings/{RING} off name to get the
# parent project.
return '/'.join(asset_pb.name.split('/')[:-4])
elif asset_pb.asset_type == 'google.cloud.dataproc.Cluster':
# Dataproc Clusters are parented by a region under a project, but
# the region is not directly discoverable without iterating all
# regions, so instead this creates an artificial parent at the
# project level, which acts as an aggregated list of all clusters
# in all regions to fix this broken behavior.
#
# Strip regions/{REGION}/clusters/{CLUSTER_NAME} off name to get the
# parent project.
return '/'.join(asset_pb.name.split('/')[:-4])
elif (asset_pb.asset_type.startswith('google.appengine') or
asset_pb.asset_type.startswith('google.cloud.bigquery') or
asset_pb.asset_type.startswith('google.cloud.kms') or
asset_pb.asset_type.startswith('google.spanner')):
# Strip off the last two segments of the name to get the parent
return '/'.join(asset_pb.name.split('/')[:-2])
LOGGER.debug('Could not determine parent name for %s', asset_pb)
return ''
class BufferedDbWriter(object):
"""Buffered db writing."""
def __init__(self,
session,
max_size=1024,
max_packet_size=MAX_ALLOWED_PACKET * .75,
commit_on_flush=False):
"""Initialize
Args:
session (object): db session
max_size (int): max size of buffer
max_packet_size (int): max size of a packet to send to SQL
commit_on_flush (bool): If true, the session is committed to the
database when the data is flushed.
"""
self.session = session
self.buffer = []
self.estimated_packet_size = 0
self.max_size = max_size
self.max_packet_size = max_packet_size
self.commit_on_flush = commit_on_flush
def add(self, obj, estimated_length=0):
"""Add an object to the buffer to write to db.
Args:
obj (object): Object to write to db.
estimated_length (int): The estimated length of this object.
"""
self.buffer.append(obj)
self.estimated_packet_size += estimated_length
if (self.estimated_packet_size > self.max_packet_size or
len(self.buffer) >= self.max_size):
self.flush()
def flush(self):
"""Flush all pending objects to the database."""
self.session.bulk_save_objects(self.buffer)
self.session.flush()
if self.commit_on_flush:
self.session.commit()
self.estimated_packet_size = 0
self.buffer = []
class CaiDataAccess(object):
"""Access to the CAI temporary store table."""
@staticmethod
def clear_cai_data(session):
"""Deletes all temporary CAI data from the cai temporary table.
Args:
session (object): Database session.
Returns:
int: The number of rows deleted.
"""
num_rows = 0
try:
num_rows = CaiTemporaryStore.delete_all(session)
except SQLAlchemyError as e:
LOGGER.exception('Attempt to delete data from CAI temporary store '
'failed, disabling the use of CAI: %s', e)
return num_rows
@staticmethod
def populate_cai_data(data, session):
"""Add assets from cai data dump into cai temporary table.
Args:
data (file): A file like object, line delimeted text dump of json
data representing assets from Cloud Asset Inventory exportAssets
API.
session (object): Database session.
Returns:
int: The number of rows inserted
"""
# CAI data can be large, so limit the number of rows written at one
# time to 512.
commit_buffer = BufferedDbWriter(session,
max_size=512,
commit_on_flush=True)
num_rows = 0
try:
for line in data:
if not line:
continue
try:
row = CaiTemporaryStore.from_json(line.strip())
except json_format.ParseError as e:
# If the public protobuf definition differs from the
# internal representation of the resource content in CAI
# then the json_format module will throw a ParseError. The
# crawler automatically falls back to using the live API
# when this happens, so no content is lost.
resource = json.loads(line)
if 'iam_policy' in resource:
content_type = 'iam_policy'
elif 'resource' in resource:
content_type = 'resource'
else:
content_type = 'none'
LOGGER.info('Protobuf parsing error %s, falling back to '
'live API for resource %s, asset type %s, '
'content type %s', e, resource.get('name', ''),
resource.get('asset_type', ''), content_type)
continue
if row:
# Overestimate the packet length to ensure max size is never
# exceeded. The actual length is closer to len(line) * 1.5.
commit_buffer.add(row, estimated_length=len(line) * 2)
num_rows += 1
commit_buffer.flush()
except SQLAlchemyError as e:
LOGGER.exception('Error populating CAI data: %s', e)
session.rollback()
return num_rows
@staticmethod
def iter_cai_assets(content_type, asset_type, parent_name, session):
"""Iterate the objects in the cai temporary table.
Args:
content_type (ContentTypes): The content type to return.
asset_type (str): The asset type to return.
parent_name (str): The parent resource to iter children under.
session (object): Database session.
Yields:
object: The content_type data for each resource.
"""
filters = [
CaiTemporaryStore.content_type == content_type,
CaiTemporaryStore.asset_type == asset_type,
CaiTemporaryStore.parent_name == parent_name,
]
base_query = session.query(CaiTemporaryStore)
for qry_filter in filters:
base_query = base_query.filter(qry_filter)
base_query = base_query.order_by(CaiTemporaryStore.name.asc())
for row in base_query.yield_per(PER_YIELD):
yield row.extract_asset_data(content_type)
@staticmethod
def fetch_cai_asset(content_type, asset_type, name, session):
"""Returns a single resource from the cai temporary store.
Args:
content_type (ContentTypes): The content type to return.
asset_type (str): The asset type to return.
name (str): The resource to return.
session (object): Database session.
Returns:
dict: The content data for the specified resource.
"""
filters = [
CaiTemporaryStore.content_type == content_type,
CaiTemporaryStore.asset_type == asset_type,
CaiTemporaryStore.name == name,
]
base_query = session.query(CaiTemporaryStore)
for qry_filter in filters:
base_query = base_query.filter(qry_filter)
row = base_query.one_or_none()
if row:
return row.extract_asset_data(content_type)
return {}
class DataAccess(object):
"""Access to inventory for services."""
@classmethod
def delete(cls, session, inventory_index_id):
"""Delete an inventory index entry by id.
Args:
session (object): Database session.
inventory_index_id (str): Id specifying which inventory to delete.
Returns:
InventoryIndex: An expunged entry corresponding the
inventory_index_id.
Raises:
Exception: Reraises any exception.
"""
try:
result = cls.get(session, inventory_index_id)
session.query(Inventory).filter(
Inventory.inventory_index_id == inventory_index_id).delete()
session.query(InventoryIndex).filter(
InventoryIndex.id == inventory_index_id).delete()
session.commit()
return result
except Exception as e:
LOGGER.exception(e)
session.rollback()
raise
@classmethod
def list(cls, session):
"""List all inventory index entries.
Args:
session (object): Database session
Yields:
InventoryIndex: Generates each row
"""
for row in session.query(InventoryIndex).yield_per(PER_YIELD):
session.expunge(row)
yield row
@classmethod
def get(cls, session, inventory_index_id):
"""Get an inventory index entry by id.
Args:
session (object): Database session
inventory_index_id (str): Inventory id
Returns:
InventoryIndex: Entry corresponding the id
"""
result = (
session.query(InventoryIndex).filter(
InventoryIndex.id == inventory_index_id).one()
)
session.expunge(result)
return result
@classmethod
def get_latest_inventory_index_id(cls, session):
"""List all inventory index entries.
Args:
session (object): Database session
Returns:
int64: inventory index id
"""
inventory_index = (
session.query(InventoryIndex).filter(
or_(InventoryIndex.inventory_status == 'SUCCESS',
InventoryIndex.inventory_status == 'PARTIAL_SUCCESS')
).order_by(InventoryIndex.id.desc()).first())
session.expunge(inventory_index)
LOGGER.info(
'Latest success/partial_success inventory index id is: %s',
inventory_index.id)
return inventory_index.id
@classmethod
# pylint: disable=invalid-name
def get_inventory_index_id_by_scanner_index_id(cls,
session,
scanner_index_id):
"""List all inventory index entries.
Args:
session (object): Database session
scanner_index_id (int): id of the scanner in scanner_index table
Returns:
int64: inventory index id
"""
query_result = (
session.query(ScannerIndex).filter(
ScannerIndex.id == scanner_index_id
).order_by(ScannerIndex.inventory_index_id.desc()).first())
session.expunge(query_result)
LOGGER.info(
'Found inventory_index_id %s from scanner_index_id %s.',
query_result.inventory_index_id, scanner_index_id)
return query_result.inventory_index_id
@classmethod
def get_inventory_indexes_older_than_cutoff( # pylint: disable=invalid-name
cls, session, cutoff_datetime):
"""Get all inventory index entries older than the cutoff.
Args:
session (object): Database session
cutoff_datetime (datetime): The cutoff point to find any
older inventory index entries.
Returns:
list: InventoryIndex
"""
inventory_indexes = session.query(InventoryIndex).filter(
InventoryIndex.created_at_datetime < cutoff_datetime).all()
session.expunge_all()
return inventory_indexes
def initialize(engine):
"""Create all tables in the database if not existing.
Args:
engine (object): Database engine to operate on.
"""
dialect = engine.dialect.name
if dialect == 'sqlite':
collation = 'binary'
else:
collation = 'utf8_bin'
CaiTemporaryStore.initialize(BASE.metadata, collation)
BASE.metadata.create_all(engine)
class Storage(BaseStorage):
"""Inventory storage used during creation."""
def __init__(self, session, existing_id=0, readonly=False):
"""Initialize
Args:
session (object): db session.
existing_id (int64): The inventory id if wants to open an existing
inventory.
readonly (bool): whether to keep the inventory read-only.
"""
self.session = session
self.opened = False
self.inventory_index = None
self.buffer = BufferedDbWriter(self.session)
self._existing_id = existing_id
self.session_completed = False
self.readonly = readonly
def _require_opened(self):
"""Make sure the storage is in 'open' state.
Raises:
Exception: If storage is not opened.
"""
if not self.opened:
raise Exception('Storage is not opened')
def _create(self):
"""Create a new inventory.
Returns:
int: Index number of the created inventory.
Raises:
Exception: Reraises any exception.
"""
try:
index = InventoryIndex.create()
self.session.add(index)
except Exception as e:
LOGGER.exception(e)
self.session.rollback()
raise
else:
return index
def _open(self, inventory_index_id):
"""Open an existing inventory.
Args:
inventory_index_id (str): the id of the inventory to open.
Returns:
object: The inventory index db row.
"""
return (
self.session.query(InventoryIndex).filter(
InventoryIndex.id == inventory_index_id).filter(
InventoryIndex.inventory_status.in_(
[IndexState.SUCCESS, IndexState.PARTIAL_SUCCESS]))
.one())
def _get_resource_rows(self, key, resource_type):
""" Get the rows in the database for a certain resource
Args:
key (str): The key of the resource
resource_type (str): The type of the resource
Returns:
object: The inventory db rows of the resource,
IAM policy and GCS policy.
Raises:
Exception: if there is no such row or more than one.
"""
rows = self.session.query(Inventory).filter(
and_(
Inventory.inventory_index_id == self.inventory_index.id,
Inventory.resource_id == key,
Inventory.resource_type == resource_type
)).all()
if not rows:
raise Exception('Resource {} not found in the table'.format(key))
else:
return rows
def _get_resource_id(self, resource):
"""Checks if a resource exists already in the inventory.
Args:
resource (object): Resource object to check against the db.
Returns:
int: The resource id of the existing resource, else 0.
"""
row = self.session.query(Inventory.id).filter(
and_(
Inventory.inventory_index_id == self.inventory_index.id,
Inventory.category == Categories.resource,
Inventory.resource_type == resource.type(),
Inventory.resource_id == resource.key(),
)).one_or_none()
if row:
return row.id
return 0
def open(self, handle=None):
"""Open the storage, potentially create a new index.
Args:
handle (str): If None, create a new index instead
of opening an existing one.
Returns:
str: Index id of the opened or created inventory.
Raises:
Exception: if open was called more than once
"""
existing_id = handle
if self.opened:
raise Exception('open called before')
# existing_id in open overrides potential constructor given id
existing_id = existing_id if existing_id else self._existing_id
# Should we create a new entry or are we opening an existing one?
if existing_id:
self.inventory_index = self._open(existing_id)
else:
self.inventory_index = self._create()
self.session.commit() # commit only on create.
self.opened = True
if not self.readonly:
self.session.begin_nested()
return self.inventory_index.id
def rollback(self):
"""Roll back the stored inventory, but keep the index entry."""
try:
self.buffer.flush()
self.session.rollback()
self.inventory_index.complete(status=IndexState.FAILURE)
self.session.commit()
finally:
self.session_completed = True
def commit(self):
"""Commit the stored inventory."""
try:
self.buffer.flush()
self.session.commit()
self.inventory_index.complete()
self.session.commit()
finally:
self.session_completed = True
def close(self):
"""Close the storage.
Raises:
Exception: If the storage was not opened before or
if the storage is writeable but neither
rollback nor commit has been called.
"""
if not self.opened:
raise Exception('not open')
if not self.readonly and not self.session_completed:
raise Exception('Need to perform commit or rollback before close')
self.opened = False
def write(self, resource):
"""Write a resource to the storage and updates its row
Args:
resource (object): Resource object to store in db.
Raises:
Exception: If storage was opened readonly.
"""
if self.readonly:
raise Exception('Opened storage readonly')
previous_id = self._get_resource_id(resource)
if previous_id:
resource.set_inventory_key(previous_id)
self.update(resource)
return
rows = Inventory.from_resource(self.inventory_index, resource)
for row in rows:
if row.category == Categories.resource:
# Force flush to insert the resource row in order to get the
# inventory id value. This is used to tie child resources
# and related data back to the parent resource row and to
# check for duplicate resources.
self.session.add(row)
self.session.flush()
resource.set_inventory_key(row.id)
else:
row.parent_id = resource.inventory_key()
self.buffer.add(row)
self.inventory_index.counter += len(rows)
def update(self, resource):
"""Update a resource in the storage.
Args:
resource (object): Resource object to store in db.
Raises:
Exception: If storage was opened readonly.
"""
if self.readonly:
raise Exception('Opened storage readonly')
self.buffer.flush()
try:
new_rows = Inventory.from_resource(self.inventory_index, resource)
old_rows = self._get_resource_rows(
resource.key(), resource.type())
new_dict = {row.category.name: row for row in new_rows}
old_dict = {row.category.name: row for row in old_rows}
for category in SUPPORTED_CATEGORIES:
if category in new_dict:
if category in old_dict:
old_dict[category].copy_inplace(
new_dict[category])
else:
new_dict[category].parent_id = resource.inventory_key()
self.session.add(new_dict[category])
self.session.commit()
except Exception as e:
LOGGER.exception(e)
raise Exception('Resource Update Unsuccessful: {}'.format(e))
def error(self, message):
"""Store a fatal error in storage. This will help debug problems.
Args:
message (str): Error message describing the problem.
Raises:
Exception: If the storage was opened readonly.
"""
if self.readonly:
raise Exception('Opened storage readonly')
self.inventory_index.set_error(self.session, message)
def warning(self, message):
"""Store a Warning message in storage. This will help debug problems.
Args:
message (str): Warning message describing the problem.
Raises:
Exception: If the storage was opened readonly.
"""
if self.readonly:
raise Exception('Opened storage readonly')
self.inventory_index.add_warning(self.session, message)
def iter(self,
type_list=None,
fetch_iam_policy=False,
fetch_gcs_policy=False,
fetch_dataset_policy=False,
fetch_billing_info=False,
fetch_enabled_apis=False,
fetch_service_config=False,
with_parent=False):
"""Iterate the objects in the storage.
Args:
type_list (list): List of types to iterate over, or [] for all.
fetch_iam_policy (bool): Yield iam policies.
fetch_gcs_policy (bool): Yield gcs policies.
fetch_dataset_policy (bool): Yield dataset policies.
fetch_billing_info (bool): Yield project billing info.
fetch_enabled_apis (bool): Yield project enabled APIs info.
fetch_service_config (bool): Yield container service config info.
with_parent (bool): Join parent with results, yield tuples.
Yields:
object: Single row object or child/parent if 'with_parent' is set.
"""
filters = [Inventory.inventory_index_id == self.inventory_index.id]
if fetch_iam_policy:
filters.append(
Inventory.category == Categories.iam_policy)
elif fetch_gcs_policy:
filters.append(
Inventory.category == Categories.gcs_policy)
elif fetch_dataset_policy:
filters.append(
Inventory.category == Categories.dataset_policy)
elif fetch_billing_info:
filters.append(
Inventory.category == Categories.billing_info)
elif fetch_enabled_apis:
filters.append(
Inventory.category == Categories.enabled_apis)
elif fetch_service_config:
filters.append(
Inventory.category == Categories.kubernetes_service_config)
else:
filters.append(
Inventory.category == Categories.resource)
if type_list:
filters.append(Inventory.resource_type.in_(type_list))
if with_parent:
parent_inventory = aliased(Inventory)
p_id = parent_inventory.id
base_query = (
self.session.query(Inventory, parent_inventory)
.filter(Inventory.parent_id == p_id))
else:
base_query = self.session.query(Inventory)
for qry_filter in filters:
base_query = base_query.filter(qry_filter)
base_query = base_query.order_by(Inventory.id.asc())
for row in base_query.yield_per(PER_YIELD):
yield row
def get_root(self):
"""get the resource root from the inventory
Returns:
object: A row in gcp_inventory of the root
"""
# Comparison to None needed to compare to Null in SQL.
# pylint: disable=singleton-comparison
root = self.session.query(Inventory).filter(
and_(
Inventory.inventory_index_id == self.inventory_index.id,
Inventory.parent_id == None,
Inventory.category == Categories.resource,
Inventory.resource_type.in_(['organization',
'folder',
'project'])
)).first()
# pylint: enable=singleton-comparison
LOGGER.debug('Root resource: %s', root)
return root
def type_exists(self,
type_list=None):
"""Check if certain types of resources exists in the inventory
Args:
type_list (list): List of types to check
Returns:
bool: If these types of resources exists
"""
return self.session.query(exists().where(and_(
Inventory.inventory_index_id == self.inventory_index.id,
Inventory.category == Categories.resource,
Inventory.resource_type.in_(type_list)
))).scalar()
def __enter__(self):
"""To support with statement for auto closing.
Returns:
Storage: The inventory storage object
"""
self.open()
return self
def __exit__(self, type_p, value, traceback):
"""To support with statement for auto closing.
Args:
type_p (object): Unused.
value (object): Unused.
traceback (object): Unused.
"""
self.close()
| 1 | 33,367 | Thanks for this... is this the only place where the rollback is needed? Are there others? | forseti-security-forseti-security | py |
@@ -56,7 +56,7 @@ func TestTriangleEncoding(t *testing.T) {
}
t.Run("encoding block with zero fields works", func(t *testing.T) {
testRoundTrip(t, &blk.Block{
- BlockSig: crypto.Signature{Type: crypto.SigTypeSecp256k1, Data: []byte{}},
+ BlockSig: &crypto.Signature{Type: crypto.SigTypeSecp256k1, Data: []byte{}},
BLSAggregateSig: crypto.Signature{Type: crypto.SigTypeBLS, Data: []byte{}},
})
}) | 1 | package block_test
import (
"bytes"
"encoding/json"
"reflect"
"testing"
"github.com/filecoin-project/specs-actors/actors/abi"
fbig "github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
blk "github.com/filecoin-project/go-filecoin/internal/pkg/block"
"github.com/filecoin-project/go-filecoin/internal/pkg/constants"
"github.com/filecoin-project/go-filecoin/internal/pkg/crypto"
e "github.com/filecoin-project/go-filecoin/internal/pkg/enccid"
"github.com/filecoin-project/go-filecoin/internal/pkg/encoding"
tf "github.com/filecoin-project/go-filecoin/internal/pkg/testhelpers/testflags"
"github.com/filecoin-project/go-filecoin/internal/pkg/types"
vmaddr "github.com/filecoin-project/go-filecoin/internal/pkg/vm/address"
)
func TestTriangleEncoding(t *testing.T) {
tf.UnitTest(t)
// We want to be sure that:
// Block => json => Block
// yields exactly the same thing as:
// Block => IPLD node => CBOR => IPLD node => json => IPLD node => Block (!)
// because we want the output encoding of a Block directly from memory
// (first case) to be exactly the same as the output encoding of a Block from
// storage (second case). WTF you might say, and you would not be wrong. The
// use case is machine-parsing command output. For example dag_daemon_test
// dumps the block from memory as json (first case). It then dag gets
// the block by cid which yeilds a json-encoded ipld node (first half of
// the second case). It json decodes this ipld node and then decodes the node
// into a block (second half of the second case). I don't claim this is ideal,
// see: https://github.com/filecoin-project/go-filecoin/issues/599
newAddress := vmaddr.NewForTestGetter()
testRoundTrip := func(t *testing.T, exp *blk.Block) {
jb, err := json.Marshal(exp)
require.NoError(t, err)
var jsonRoundTrip blk.Block
err = json.Unmarshal(jb, &jsonRoundTrip)
require.NoError(t, err)
ipldNodeOrig, err := encoding.Encode(jsonRoundTrip)
assert.NoError(t, err)
var cborJSONRoundTrip blk.Block
err = encoding.Decode(ipldNodeOrig, &cborJSONRoundTrip)
assert.NoError(t, err)
types.AssertHaveSameCid(t, exp, &cborJSONRoundTrip)
}
t.Run("encoding block with zero fields works", func(t *testing.T) {
testRoundTrip(t, &blk.Block{
BlockSig: crypto.Signature{Type: crypto.SigTypeSecp256k1, Data: []byte{}},
BLSAggregateSig: crypto.Signature{Type: crypto.SigTypeBLS, Data: []byte{}},
})
})
t.Run("encoding block with nonzero fields works", func(t *testing.T) {
// We should ensure that every field is set -- zero values might
// pass when non-zero values do not due to nil/null encoding.
candidate1 := blk.NewEPoStCandidate(5, []byte{0x05}, 52)
candidate2 := blk.NewEPoStCandidate(3, []byte{0x04}, 3000)
postInfo := blk.NewEPoStInfo([]blk.EPoStProof{blk.NewEPoStProof(constants.DevRegisteredPoStProof, []byte{0x07})}, []byte{0x02, 0x06}, candidate1, candidate2)
b := &blk.Block{
Miner: newAddress(),
Ticket: blk.Ticket{VRFProof: []byte{0x01, 0x02, 0x03}},
Height: 2,
Messages: e.NewCid(types.CidFromString(t, "somecid")),
MessageReceipts: e.NewCid(types.CidFromString(t, "somecid")),
Parents: blk.NewTipSetKey(types.CidFromString(t, "somecid")),
ParentWeight: fbig.NewInt(1000),
StateRoot: e.NewCid(types.CidFromString(t, "somecid")),
Timestamp: 1,
BlockSig: crypto.Signature{
Type: crypto.SigTypeBLS,
Data: []byte{0x3},
},
BLSAggregateSig: crypto.Signature{
Type: crypto.SigTypeBLS,
Data: []byte{0x3},
},
EPoStInfo: postInfo,
ForkSignaling: 6,
}
s := reflect.TypeOf(*b)
// This check is here to request that you add a non-zero value for new fields
// to the above (and update the field count below).
// Also please add non zero fields to "b" and "diff" in TestSignatureData
// and add a new check that different values of the new field result in
// different output data.
require.Equal(t, 16, s.NumField()) // Note: this also counts private fields
testRoundTrip(t, b)
})
}
func TestBlockString(t *testing.T) {
tf.UnitTest(t)
var b blk.Block
cid := b.Cid()
got := b.String()
assert.Contains(t, got, cid.String())
}
func TestDecodeBlock(t *testing.T) {
tf.UnitTest(t)
t.Run("successfully decodes raw bytes to a Filecoin block", func(t *testing.T) {
addrGetter := vmaddr.NewForTestGetter()
c1 := types.CidFromString(t, "a")
c2 := types.CidFromString(t, "b")
cM := types.CidFromString(t, "messages")
cR := types.CidFromString(t, "receipts")
before := &blk.Block{
Miner: addrGetter(),
Ticket: blk.Ticket{VRFProof: []uint8{}},
Parents: blk.NewTipSetKey(c1),
Height: 2,
ParentWeight: fbig.Zero(),
Messages: e.NewCid(cM),
StateRoot: e.NewCid(c2),
MessageReceipts: e.NewCid(cR),
BlockSig: crypto.Signature{Type: crypto.SigTypeSecp256k1, Data: []byte{}},
BLSAggregateSig: crypto.Signature{Type: crypto.SigTypeBLS, Data: []byte{}},
}
after, err := blk.DecodeBlock(before.ToNode().RawData())
require.NoError(t, err)
assert.Equal(t, after.Cid(), before.Cid())
assert.Equal(t, before, after)
})
t.Run("decode failure results in an error", func(t *testing.T) {
_, err := blk.DecodeBlock([]byte{1, 2, 3})
assert.Error(t, err)
assert.Contains(t, err.Error(), "cbor: cannot unmarshal")
})
}
func TestEquals(t *testing.T) {
tf.UnitTest(t)
c1 := types.CidFromString(t, "a")
c2 := types.CidFromString(t, "b")
s1 := types.CidFromString(t, "state1")
s2 := types.CidFromString(t, "state2")
var h1 abi.ChainEpoch = 1
var h2 abi.ChainEpoch = 2
b1 := &blk.Block{Parents: blk.NewTipSetKey(c1), StateRoot: e.NewCid(s1), Height: h1}
b2 := &blk.Block{Parents: blk.NewTipSetKey(c1), StateRoot: e.NewCid(s1), Height: h1}
b3 := &blk.Block{Parents: blk.NewTipSetKey(c1), StateRoot: e.NewCid(s2), Height: h1}
b4 := &blk.Block{Parents: blk.NewTipSetKey(c2), StateRoot: e.NewCid(s1), Height: h1}
b5 := &blk.Block{Parents: blk.NewTipSetKey(c1), StateRoot: e.NewCid(s1), Height: h2}
b6 := &blk.Block{Parents: blk.NewTipSetKey(c2), StateRoot: e.NewCid(s1), Height: h2}
b7 := &blk.Block{Parents: blk.NewTipSetKey(c1), StateRoot: e.NewCid(s2), Height: h2}
b8 := &blk.Block{Parents: blk.NewTipSetKey(c2), StateRoot: e.NewCid(s2), Height: h1}
b9 := &blk.Block{Parents: blk.NewTipSetKey(c2), StateRoot: e.NewCid(s2), Height: h2}
assert.True(t, b1.Equals(b1))
assert.True(t, b1.Equals(b2))
assert.False(t, b1.Equals(b3))
assert.False(t, b1.Equals(b4))
assert.False(t, b1.Equals(b5))
assert.False(t, b1.Equals(b6))
assert.False(t, b1.Equals(b7))
assert.False(t, b1.Equals(b8))
assert.False(t, b1.Equals(b9))
assert.True(t, b3.Equals(b3))
assert.False(t, b3.Equals(b4))
assert.False(t, b3.Equals(b6))
assert.False(t, b3.Equals(b9))
assert.False(t, b4.Equals(b5))
assert.False(t, b5.Equals(b6))
assert.False(t, b6.Equals(b7))
assert.False(t, b7.Equals(b8))
assert.False(t, b8.Equals(b9))
assert.True(t, b9.Equals(b9))
}
func TestBlockJsonMarshal(t *testing.T) {
tf.UnitTest(t)
var parent, child blk.Block
child.Miner = vmaddr.NewForTestGetter()()
child.Height = 1
child.ParentWeight = fbig.Zero()
child.Parents = blk.NewTipSetKey(parent.Cid())
child.StateRoot = e.NewCid(parent.Cid())
child.Messages = e.NewCid(types.CidFromString(t, "somecid"))
child.MessageReceipts = e.NewCid(types.CidFromString(t, "somecid"))
marshalled, e1 := json.Marshal(&child)
assert.NoError(t, e1)
str := string(marshalled)
assert.Contains(t, str, child.Miner.String())
assert.Contains(t, str, parent.Cid().String())
assert.Contains(t, str, child.Messages.String())
assert.Contains(t, str, child.MessageReceipts.String())
// marshal/unmarshal symmetry
var unmarshalled blk.Block
e2 := json.Unmarshal(marshalled, &unmarshalled)
assert.NoError(t, e2)
assert.Equal(t, child, unmarshalled)
types.AssertHaveSameCid(t, &child, &unmarshalled)
assert.True(t, child.Equals(&unmarshalled))
}
func TestSignatureData(t *testing.T) {
tf.UnitTest(t)
newAddress := vmaddr.NewForTestGetter()
candidate1 := blk.NewEPoStCandidate(5, []byte{0x05}, 52)
candidate2 := blk.NewEPoStCandidate(3, []byte{0x04}, 3000)
postInfo := blk.NewEPoStInfo([]blk.EPoStProof{blk.NewEPoStProof(constants.DevRegisteredPoStProof, []byte{0x07})}, []byte{0x02, 0x06}, candidate1, candidate2)
b := &blk.Block{
Miner: newAddress(),
Ticket: blk.Ticket{VRFProof: []byte{0x01, 0x02, 0x03}},
Height: 2,
Messages: e.NewCid(types.CidFromString(t, "somecid")),
MessageReceipts: e.NewCid(types.CidFromString(t, "somecid")),
Parents: blk.NewTipSetKey(types.CidFromString(t, "somecid")),
ParentWeight: fbig.NewInt(1000),
ForkSignaling: 3,
StateRoot: e.NewCid(types.CidFromString(t, "somecid")),
Timestamp: 1,
EPoStInfo: postInfo,
BlockSig: crypto.Signature{
Type: crypto.SigTypeBLS,
Data: []byte{0x3},
},
}
diffCandidate1 := blk.NewEPoStCandidate(0, []byte{0x04}, 25)
diffCandidate2 := blk.NewEPoStCandidate(1, []byte{0x05}, 3001)
diffPoStInfo := blk.NewEPoStInfo([]blk.EPoStProof{blk.NewEPoStProof(constants.DevRegisteredPoStProof, []byte{0x17})}, []byte{0x12, 0x16}, diffCandidate1, diffCandidate2)
diff := &blk.Block{
Miner: newAddress(),
Ticket: blk.Ticket{VRFProof: []byte{0x03, 0x01, 0x02}},
Height: 3,
Messages: e.NewCid(types.CidFromString(t, "someothercid")),
MessageReceipts: e.NewCid(types.CidFromString(t, "someothercid")),
Parents: blk.NewTipSetKey(types.CidFromString(t, "someothercid")),
ParentWeight: fbig.NewInt(1001),
ForkSignaling: 2,
StateRoot: e.NewCid(types.CidFromString(t, "someothercid")),
Timestamp: 4,
EPoStInfo: diffPoStInfo,
BlockSig: crypto.Signature{
Type: crypto.SigTypeBLS,
Data: []byte{0x4},
},
}
// Changing BlockSig does not affect output
func() {
before := b.SignatureData()
cpy := b.BlockSig
defer func() { b.BlockSig = cpy }()
b.BlockSig = diff.BlockSig
after := b.SignatureData()
assert.True(t, bytes.Equal(before, after))
}()
// Changing all other fields does affect output
// Note: using reflectors doesn't seem to make this much less tedious
// because it appears that there is no generic field setting function.
func() {
before := b.SignatureData()
cpy := b.Miner
defer func() { b.Miner = cpy }()
b.Miner = diff.Miner
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.Ticket
defer func() { b.Ticket = cpy }()
b.Ticket = diff.Ticket
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.Height
defer func() { b.Height = cpy }()
b.Height = diff.Height
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.Messages
defer func() { b.Messages = cpy }()
b.Messages = diff.Messages
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.MessageReceipts
defer func() { b.MessageReceipts = cpy }()
b.MessageReceipts = diff.MessageReceipts
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.Parents
defer func() { b.Parents = cpy }()
b.Parents = diff.Parents
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.ParentWeight
defer func() { b.ParentWeight = cpy }()
b.ParentWeight = diff.ParentWeight
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.ForkSignaling
defer func() { b.ForkSignaling = cpy }()
b.ForkSignaling = diff.ForkSignaling
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.StateRoot
defer func() { b.StateRoot = cpy }()
b.StateRoot = diff.StateRoot
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.Timestamp
defer func() { b.Timestamp = cpy }()
b.Timestamp = diff.Timestamp
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.EPoStInfo.VRFProof
defer func() { b.EPoStInfo.VRFProof = cpy }()
b.EPoStInfo.VRFProof = diff.EPoStInfo.VRFProof
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy := b.EPoStInfo.PoStProofs
defer func() { b.EPoStInfo.PoStProofs = cpy }()
b.EPoStInfo.PoStProofs = diff.EPoStInfo.PoStProofs
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy0 := b.EPoStInfo.Winners[0].PartialTicket
cpy1 := b.EPoStInfo.Winners[1].PartialTicket
defer func() {
b.EPoStInfo.Winners[0].PartialTicket = cpy0
b.EPoStInfo.Winners[1].PartialTicket = cpy1
}()
b.EPoStInfo.Winners[0].PartialTicket = diff.EPoStInfo.Winners[0].PartialTicket
b.EPoStInfo.Winners[1].PartialTicket = diff.EPoStInfo.Winners[1].PartialTicket
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy0 := b.EPoStInfo.Winners[0].SectorID
cpy1 := b.EPoStInfo.Winners[1].SectorID
defer func() {
b.EPoStInfo.Winners[0].SectorID = cpy0
b.EPoStInfo.Winners[1].SectorID = cpy1
}()
b.EPoStInfo.Winners[0].SectorID = diff.EPoStInfo.Winners[0].SectorID
b.EPoStInfo.Winners[1].SectorID = diff.EPoStInfo.Winners[1].SectorID
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
func() {
before := b.SignatureData()
cpy0 := b.EPoStInfo.Winners[0].SectorChallengeIndex
cpy1 := b.EPoStInfo.Winners[1].SectorChallengeIndex
defer func() {
b.EPoStInfo.Winners[0].SectorChallengeIndex = cpy0
b.EPoStInfo.Winners[1].SectorChallengeIndex = cpy1
}()
b.EPoStInfo.Winners[0].SectorChallengeIndex = diff.EPoStInfo.Winners[0].SectorChallengeIndex
b.EPoStInfo.Winners[1].SectorChallengeIndex = diff.EPoStInfo.Winners[1].SectorChallengeIndex
after := b.SignatureData()
assert.False(t, bytes.Equal(before, after))
}()
}
| 1 | 23,366 | Should this also be a pointer? What happens if there are no BLS messages? I guess that's what this test is exercising, and Lotus also uses a non-pointer here. | filecoin-project-venus | go |
@@ -427,9 +427,9 @@ func (c *collection) actionToWrites(a *driver.Action) ([]*pb.Write, string, erro
case driver.Replace:
// If the given document has a revision, use it as the precondition (it implies existence).
- pc, err := revisionPrecondition(a.Doc)
- if err != nil {
- return nil, "", err
+ pc, perr := revisionPrecondition(a.Doc)
+ if perr != nil {
+ return nil, "", perr
}
// Otherwise, just require that the document exists.
if pc == nil { | 1 | // Copyright 2019 The Go Cloud Development Kit Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Package firedocstore provides a docstore implementation backed by GCP
// Firestore.
// Use OpenCollection to construct a *docstore.Collection.
//
// URLs
//
// For docstore.OpenCollection, firedocstore registers for the scheme
// "firestore".
// The default URL opener will create a connection using default credentials
// from the environment, as described in
// https://cloud.google.com/docs/authentication/production.
// To customize the URL opener, or for more details on the URL format,
// see URLOpener.
// See https://gocloud.dev/concepts/urls/ for background information.
//
// As
//
// firedocstore exposes the following types for As:
// - Collection.As: *firestore.Client
// - ActionList.BeforeDo: *pb.BatchGetDocumentRequest or *pb.CommitRequest.
// - Query.BeforeQuery: *firestore.RunQueryRequest
// - DocumentIterator: firestore.Firestore_RunQueryClient
package firedocstore
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"net/url"
"reflect"
"regexp"
"strings"
"sync"
vkit "cloud.google.com/go/firestore/apiv1"
tspb "github.com/golang/protobuf/ptypes/timestamp"
"gocloud.dev/gcp"
"gocloud.dev/internal/docstore"
"gocloud.dev/internal/docstore/driver"
"gocloud.dev/internal/gcerr"
"gocloud.dev/internal/useragent"
"google.golang.org/api/option"
pb "google.golang.org/genproto/googleapis/firestore/v1"
"google.golang.org/grpc/metadata"
)
func init() {
docstore.DefaultURLMux().RegisterCollection(Scheme, &lazyCredsOpener{})
}
type lazyCredsOpener struct {
init sync.Once
opener *URLOpener
err error
}
func (o *lazyCredsOpener) OpenCollectionURL(ctx context.Context, u *url.URL) (*docstore.Collection, error) {
o.init.Do(func() {
creds, err := gcp.DefaultCredentials(ctx)
if err != nil {
o.err = err
return
}
client, _, err := Dial(ctx, creds.TokenSource)
if err != nil {
o.err = err
return
}
o.opener = &URLOpener{Client: client}
})
if o.err != nil {
return nil, fmt.Errorf("open collection %s: %v", u, o.err)
}
return o.opener.OpenCollectionURL(ctx, u)
}
// Dial returns a client to use with Firestore and a clean-up function to close
// the client after used.
func Dial(ctx context.Context, ts gcp.TokenSource) (*vkit.Client, func(), error) {
c, err := vkit.NewClient(ctx, option.WithTokenSource(ts), useragent.ClientOption("docstore"))
return c, func() { c.Close() }, err
}
// Scheme is the URL scheme firestore registers its URLOpener under on
// docstore.DefaultMux.
const Scheme = "firestore"
// URLOpener opens firestore URLs like
// "firestore://myproject/mycollection?name_field=myID".
//
// - The URL's host holds the GCP projectID.
// - The only element of the URL's path holds the path to a Firestore collection.
// See https://firebase.google.com/docs/firestore/data-model for more details.
//
// The following query parameters are supported:
//
// - name_field (required): firedocstore requires that a single string field,
// name_field, be designated the primary key. Its values must be unique over all
// documents in the collection, and the primary key must be provided to retrieve
// a document.
type URLOpener struct {
// Client must be set to a non-nil client authenticated with Cloud Firestore
// scope or equivalent.
Client *vkit.Client
}
// OpenCollectionURL opens a docstore.Collection based on u.
func (o *URLOpener) OpenCollectionURL(ctx context.Context, u *url.URL) (*docstore.Collection, error) {
q := u.Query()
nameField := q.Get("name_field")
if nameField == "" {
return nil, errors.New("open collection %s: name_field is required to open a collection")
}
q.Del("name_field")
for param := range q {
return nil, fmt.Errorf("open collection %s: invalid query parameter %q", u, param)
}
project, collPath, err := collectionNameFromURL(u)
if err != nil {
return nil, fmt.Errorf("open collection %s: %v", u, err)
}
return OpenCollection(o.Client, project, collPath, nameField, nil)
}
func collectionNameFromURL(u *url.URL) (string, string, error) {
var project, collPath string
if project = u.Host; project == "" {
return "", "", errors.New("URL must have a non-empty Host (the project ID)")
}
if collPath = strings.TrimPrefix(u.Path, "/"); collPath == "" {
return "", "", errors.New("URL must have a non-empty Path (the collection path)")
}
return project, collPath, nil
}
type collection struct {
nameField string
nameFunc func(docstore.Document) string
client *vkit.Client
dbPath string // e.g. "projects/P/databases/(default)"
collPath string // e.g. "projects/P/databases/(default)/documents/States/Wisconsin/cities"
}
// Options contains optional arguments to the OpenCollection functions.
type Options struct{}
// OpenCollection creates a *docstore.Collection representing a Firestore collection.
//
// collPath is the path to the collection, starting from a root collection. It may
// refer to a top-level collection, like "States", or it may be a path to a nested
// collection, like "States/Wisconsin/Cities".
//
// firedocstore requires that a single string field, nameField, be designated the
// primary key. Its values must be unique over all documents in the collection, and
// the primary key must be provided to retrieve a document.
func OpenCollection(client *vkit.Client, projectID, collPath, nameField string, _ *Options) (*docstore.Collection, error) {
c, err := newCollection(client, projectID, collPath, nameField, nil)
if err != nil {
return nil, err
}
return docstore.NewCollection(c), nil
}
// OpenCollectionWithNameFunc creates a *docstore.Collection representing a Firestore collection.
//
// collPath is the path to the collection, starting from a root collection. It may
// refer to a top-level collection, like "States", or it may be a path to a nested
// collection, like "States/Wisconsin/Cities".
//
// The nameFunc argument is function that accepts a document and returns the value to
// be used for the document's primary key. It should return the empty string if the
// document is missing the information to construct a name. This will cause all
// actions, even Create, to fail.
func OpenCollectionWithNameFunc(client *vkit.Client, projectID, collPath string, nameFunc func(docstore.Document) string, _ *Options) (*docstore.Collection, error) {
c, err := newCollection(client, projectID, collPath, "", nameFunc)
if err != nil {
return nil, err
}
return docstore.NewCollection(c), nil
}
func newCollection(client *vkit.Client, projectID, collPath, nameField string, nameFunc func(docstore.Document) string) (*collection, error) {
if nameField == "" && nameFunc == nil {
return nil, gcerr.Newf(gcerr.InvalidArgument, nil, "one of nameField or nameFunc must be provided")
}
dbPath := fmt.Sprintf("projects/%s/databases/(default)", projectID)
return &collection{
client: client,
nameField: nameField,
nameFunc: nameFunc,
dbPath: dbPath,
collPath: fmt.Sprintf("%s/documents/%s", dbPath, collPath),
}, nil
}
// RunActions implements driver.RunActions.
func (c *collection) RunActions(ctx context.Context, actions []*driver.Action, opts *driver.RunActionsOptions) driver.ActionListError {
if opts.Unordered {
return c.runActionsUnordered(ctx, actions, opts)
}
return c.runActionsOrdered(ctx, actions, opts)
}
func (c *collection) runActionsOrdered(ctx context.Context, actions []*driver.Action, opts *driver.RunActionsOptions) driver.ActionListError {
// Split the actions into groups, each of which can be done with a single RPC.
// - Consecutive writes are grouped together.
// - Consecutive gets with the same field paths are grouped together.
// TODO(jba): when we have transforms, apply the constraint that at most one transform per document
// is allowed in a given request (see write.proto).
groups := driver.SplitActions(actions, shouldSplit)
nRun := 0 // number of actions successfully run
var n int
var err error
for _, g := range groups {
if g[0].Kind == driver.Get {
n, err = c.runGetsOrdered(ctx, g, opts)
nRun += n
} else {
err = c.runWrites(ctx, g, opts)
// Writes happen atomically: all or none.
if err != nil {
nRun += len(g)
}
}
if err != nil {
return driver.ActionListError{{nRun, err}}
}
}
return nil
}
// Reports whether two consecutive actions in a list should be split into different groups.
func shouldSplit(cur, new *driver.Action) bool {
// If the new action isn't a Get but the current group consists of Gets, split.
if new.Kind != driver.Get && cur.Kind == driver.Get {
return true
}
// If the new action is a Get and either (1) the current group consists of writes, or (2) the current group
// of gets has a different list of field paths to retrieve, then split.
// (The BatchGetDocuments RPC we use for Gets supports only a single set of field paths.)
return new.Kind == driver.Get && (cur.Kind != driver.Get || !fpsEqual(cur.FieldPaths, new.FieldPaths))
}
// Run a sequence of Get actions by calling the BatchGetDocuments RPC.
// It returns the number of initial successful gets, as well as an error.
func (c *collection) runGetsOrdered(ctx context.Context, gets []*driver.Action, opts *driver.RunActionsOptions) (int, error) {
errs := c.runGets(ctx, gets, opts)
for i, err := range errs {
if err != nil {
return i, err
}
}
return len(gets), nil
}
// runGets executes a group of Get actions by calling the BatchGetDocuments RPC.
// It returns the error for each Get action in order.
func (c *collection) runGets(ctx context.Context, gets []*driver.Action, opts *driver.RunActionsOptions) []error {
errs := make([]error, len(gets))
setErr := func(err error) {
for i := range errs {
errs[i] = err
}
}
req, err := c.newGetRequest(gets)
if err != nil {
setErr(err)
return errs
}
indexByPath := map[string]int{} // from document path to index in gets slice
for i, path := range req.Documents {
indexByPath[path] = i
}
if opts.BeforeDo != nil {
asFunc := func(i interface{}) bool {
p, ok := i.(**pb.BatchGetDocumentsRequest)
if !ok {
return false
}
*p = req
return true
}
if err := opts.BeforeDo(asFunc); err != nil {
setErr(err)
return errs
}
}
streamClient, err := c.client.BatchGetDocuments(withResourceHeader(ctx, req.Database), req)
if err != nil {
setErr(err)
return errs
}
for {
resp, err := streamClient.Recv()
if err == io.EOF {
break
}
if err != nil {
setErr(err)
return errs
}
switch r := resp.Result.(type) {
case *pb.BatchGetDocumentsResponse_Found:
pdoc := r.Found
i, ok := indexByPath[pdoc.Name]
if !ok {
errs[i] = gcerr.Newf(gcerr.Internal, nil, "no index for path %s", pdoc.Name)
} else {
errs[i] = decodeDoc(pdoc, gets[i].Doc, c.nameField)
}
case *pb.BatchGetDocumentsResponse_Missing:
i := indexByPath[r.Missing]
errs[i] = gcerr.Newf(gcerr.NotFound, nil, "document at path %q is missing", r.Missing)
default:
setErr(gcerr.Newf(gcerr.Internal, nil, "unknown BatchGetDocumentsResponse result type"))
return errs
}
}
return errs
}
func (c *collection) newGetRequest(gets []*driver.Action) (*pb.BatchGetDocumentsRequest, error) {
req := &pb.BatchGetDocumentsRequest{Database: c.dbPath}
seen := map[string]bool{}
for _, a := range gets {
docName, _, err := c.docName(a.Doc)
if err != nil {
return nil, err
}
if seen[docName] {
return nil, gcerr.Newf(gcerr.InvalidArgument, nil, "duplicate document name in Get: %q", docName)
}
req.Documents = append(req.Documents, c.collPath+"/"+docName)
seen[docName] = true
}
// groupActions has already made sure that all the actions have the same field paths,
// so just use the first one.
var fps []string // field paths that will go in the mask
for _, fp := range gets[0].FieldPaths {
fps = append(fps, toServiceFieldPath(fp))
}
if fps != nil {
req.Mask = &pb.DocumentMask{FieldPaths: fps}
}
return req, nil
}
// runWrites executes all the actions in a single RPC. The actions are done atomically,
// so either they all succeed or they all fail.
func (c *collection) runWrites(ctx context.Context, actions []*driver.Action, opts *driver.RunActionsOptions) error {
// Convert each action to one or more writes, collecting names for newly created
// documents along the way.
var pws []*pb.Write
newNames := make([]string, len(actions)) // from Creates without a name
for i, a := range actions {
ws, nn, err := c.actionToWrites(a)
if err != nil {
return err
}
newNames[i] = nn
pws = append(pws, ws...)
}
// Call the Commit RPC with the list of writes.
wrs, err := c.commit(ctx, pws, opts)
if err != nil {
return err
}
// Now that we've successfully done the action, set the names for newly created docs
// that weren't given a name by the caller.
for i, nn := range newNames {
if nn != "" {
_ = actions[i].Doc.SetField(c.nameField, nn)
}
}
// TODO(jba): should we set the revision fields of all docs to the returned update times?
// We should only do this if we can for all providers.
_ = wrs
// for i, wr := range wrs {
// // Ignore errors. It's fine if the doc doesn't have a revision field.
// // (We also could get an error if that field is unsettable for some reason, but
// // we just decide to ignore those as well.)
// _ = actions[i].Doc.SetField(docstore.RevisionField, wr.UpdateTime)
// }
return nil
}
// Convert an action to one or more Firestore Write protos.
func (c *collection) actionToWrites(a *driver.Action) ([]*pb.Write, string, error) {
docName, missingField, err := c.docName(a.Doc)
// Return the error unless the field is missing and this is a Create action.
if err != nil && !(missingField && a.Kind == driver.Create) {
return nil, "", err
}
var (
w *pb.Write
ws []*pb.Write
newName string // for Create with no name
)
switch a.Kind {
case driver.Create:
// Make a name for this document if it doesn't have one.
if missingField {
docName = driver.UniqueString()
newName = docName
}
w, err = c.putWrite(a.Doc, docName, &pb.Precondition{ConditionType: &pb.Precondition_Exists{Exists: false}})
case driver.Replace:
// If the given document has a revision, use it as the precondition (it implies existence).
pc, err := revisionPrecondition(a.Doc)
if err != nil {
return nil, "", err
}
// Otherwise, just require that the document exists.
if pc == nil {
pc = &pb.Precondition{ConditionType: &pb.Precondition_Exists{Exists: true}}
}
w, err = c.putWrite(a.Doc, docName, pc)
case driver.Put:
pc, err := revisionPrecondition(a.Doc)
if err != nil {
return nil, "", err
}
w, err = c.putWrite(a.Doc, docName, pc)
case driver.Update:
ws, err = c.updateWrites(a.Doc, docName, a.Mods)
case driver.Delete:
w, err = c.deleteWrite(a.Doc, docName)
default:
err = gcerr.Newf(gcerr.Internal, nil, "bad action %+v", a)
}
if err != nil {
return nil, "", err
}
if ws == nil {
ws = []*pb.Write{w}
}
return ws, newName, nil
}
func (c *collection) putWrite(doc driver.Document, docName string, pc *pb.Precondition) (*pb.Write, error) {
pdoc, err := encodeDoc(doc, c.nameField)
if err != nil {
return nil, err
}
pdoc.Name = c.collPath + "/" + docName
return &pb.Write{
Operation: &pb.Write_Update{Update: pdoc},
CurrentDocument: pc,
}, nil
}
func (c *collection) deleteWrite(doc driver.Document, docName string) (*pb.Write, error) {
pc, err := revisionPrecondition(doc)
if err != nil {
return nil, err
}
return &pb.Write{
Operation: &pb.Write_Delete{Delete: c.collPath + "/" + docName},
CurrentDocument: pc,
}, nil
}
// updateWrites returns a slice of writes because we may need two: one for setting
// and deleting values, the other for transforms.
func (c *collection) updateWrites(doc driver.Document, docName string, mods []driver.Mod) ([]*pb.Write, error) {
ts, err := revisionTimestamp(doc)
if err != nil {
return nil, err
}
fields, paths, transforms, err := processMods(mods)
if err != nil {
return nil, err
}
return newUpdateWrites(c.collPath+"/"+docName, ts, fields, paths, transforms)
}
func newUpdateWrites(docPath string, ts *tspb.Timestamp, fields map[string]*pb.Value, paths []string, transforms []*pb.DocumentTransform_FieldTransform) ([]*pb.Write, error) {
pc := preconditionFromTimestamp(ts)
// If there is no revision in the document, add a precondition that the document exists.
if pc == nil {
pc = &pb.Precondition{ConditionType: &pb.Precondition_Exists{Exists: true}}
}
var ws []*pb.Write
if len(fields) > 0 || len(paths) > 0 {
ws = []*pb.Write{{
Operation: &pb.Write_Update{Update: &pb.Document{
Name: docPath,
Fields: fields,
}},
UpdateMask: &pb.DocumentMask{FieldPaths: paths},
CurrentDocument: pc,
}}
pc = nil // If the precondition is in the write, we don't need it in the transform.
}
// TODO(jba): test an increment-only update.
if len(transforms) > 0 {
ws = append(ws, &pb.Write{
Operation: &pb.Write_Transform{
Transform: &pb.DocumentTransform{
Document: docPath,
FieldTransforms: transforms,
},
},
CurrentDocument: pc,
})
}
return ws, nil
}
// To update a document, we need to send:
// - A document with all the fields we want to add or change.
// - A mask with the field paths of all the fields we want to add, change or delete.
// processMods converts the mods into the fields for the document, and a list of
// valid Firestore field paths for the mask.
func processMods(mods []driver.Mod) (fields map[string]*pb.Value, maskPaths []string, transforms []*pb.DocumentTransform_FieldTransform, err error) {
fields = map[string]*pb.Value{}
for _, m := range mods {
sfp := toServiceFieldPath(m.FieldPath)
// If m.Value is nil, we want to delete it. In that case, we put the field in
// the mask but not in the doc.
if inc, ok := m.Value.(driver.IncOp); ok {
pv, err := encodeValue(inc.Amount)
if err != nil {
return nil, nil, nil, err
}
transforms = append(transforms, &pb.DocumentTransform_FieldTransform{
FieldPath: sfp,
TransformType: &pb.DocumentTransform_FieldTransform_Increment{
Increment: pv,
},
})
} else {
// The field path of every other mod belongs in the mask.
maskPaths = append(maskPaths, sfp)
if m.Value != nil {
pv, err := encodeValue(m.Value)
if err != nil {
return nil, nil, nil, err
}
if err := setAtFieldPath(fields, m.FieldPath, pv); err != nil {
return nil, nil, nil, err
}
}
}
}
return fields, maskPaths, transforms, nil
}
func (c *collection) runActionsUnordered(ctx context.Context, actions []*driver.Action, opts *driver.RunActionsOptions) driver.ActionListError {
// Split into groups the same way, but run them concurrently.
// TODO(jba): group without considering order.
groups := driver.SplitActions(actions, shouldSplit)
errs := make([]error, len(actions))
var wg sync.WaitGroup
groupBaseIndex := 0 // index in actions of first action in group
for _, g := range groups {
g := g
base := groupBaseIndex
wg.Add(1)
go func() {
defer wg.Done()
if g[0].Kind == driver.Get {
for i, err := range c.runGets(ctx, g, opts) {
errs[base+i] = err
}
} else {
err := c.runWrites(ctx, g, opts)
// Writes run in a transaction, so there is a single error for the group.
for i := 0; i < len(g); i++ {
errs[base+i] = err
}
}
}()
groupBaseIndex += len(g)
}
wg.Wait()
return driver.NewActionListError(errs)
}
////////////////
// From memdocstore/mem.go.
// setAtFieldPath sets m's value at fp to val. It creates intermediate maps as
// needed. It returns an error if a non-final component of fp does not denote a map.
func setAtFieldPath(m map[string]*pb.Value, fp []string, val *pb.Value) error {
m2, err := getParentMap(m, fp, true)
if err != nil {
return err
}
m2[fp[len(fp)-1]] = val
return nil
}
// getParentMap returns the map that directly contains the given field path;
// that is, the value of m at the field path that excludes the last component
// of fp. If a non-map is encountered along the way, an InvalidArgument error is
// returned. If nil is encountered, nil is returned unless create is true, in
// which case a map is added at that point.
func getParentMap(m map[string]*pb.Value, fp []string, create bool) (map[string]*pb.Value, error) {
for _, k := range fp[:len(fp)-1] {
if m[k] == nil {
if !create {
return nil, nil
}
m[k] = &pb.Value{ValueType: &pb.Value_MapValue{&pb.MapValue{Fields: map[string]*pb.Value{}}}}
}
mv := m[k].GetMapValue()
if mv == nil {
return nil, gcerr.Newf(gcerr.InvalidArgument, nil, "invalid field path %q at %q", strings.Join(fp, "."), k)
}
m = mv.Fields
}
return m, nil
}
////////////////
// From fieldpath.go in cloud.google.com/go/firestore.
// Convert a docstore field path, which is a []string, into the kind of field path
// that the Firestore service expects: a string of dot-separated components, some of
// which may be quoted.
func toServiceFieldPath(fp []string) string {
cs := make([]string, len(fp))
for i, c := range fp {
cs[i] = toServiceFieldPathComponent(c)
}
return strings.Join(cs, ".")
}
// Google SQL syntax for an unquoted field.
var unquotedFieldRegexp = regexp.MustCompile("^[A-Za-z_][A-Za-z_0-9]*$")
// toServiceFieldPathComponent returns a string that represents key and is a valid
// Firestore field path component. Components must be quoted with backticks if
// they don't match the above regexp.
func toServiceFieldPathComponent(key string) string {
if unquotedFieldRegexp.MatchString(key) {
return key
}
var buf bytes.Buffer
buf.WriteRune('`')
for _, r := range key {
if r == '`' || r == '\\' {
buf.WriteRune('\\')
}
buf.WriteRune(r)
}
buf.WriteRune('`')
return buf.String()
}
// revisionPrecondition returns a Firestore precondition that asserts that the stored document's
// revision matches the revision of doc.
func revisionPrecondition(doc driver.Document) (*pb.Precondition, error) {
rev, err := revisionTimestamp(doc)
if err != nil {
return nil, err
}
return preconditionFromTimestamp(rev), nil
}
// revisionTimestamp extracts the timestamp from the revision field of doc, if there is one.
// It only returns an error if the revision field is present and does not contain the right type.
func revisionTimestamp(doc driver.Document) (*tspb.Timestamp, error) {
v, err := doc.GetField(docstore.RevisionField)
if err != nil { // revision field not present
return nil, nil
}
if v == nil { // revision field is present, but nil
return nil, nil
}
rev, ok := v.(*tspb.Timestamp)
if !ok {
return nil, gcerr.Newf(gcerr.InvalidArgument, nil,
"%s field contains wrong type: got %T, want proto Timestamp",
docstore.RevisionField, v)
}
return rev, nil
}
func preconditionFromTimestamp(ts *tspb.Timestamp) *pb.Precondition {
if ts == nil || (ts.Seconds == 0 && ts.Nanos == 0) { // ignore a missing or zero revision
return nil
}
return &pb.Precondition{ConditionType: &pb.Precondition_UpdateTime{ts}}
}
// TODO(jba): make sure we enforce these Firestore commit constraints:
// - At most one `transform` per document is allowed in a given request.
// - An `update` cannot follow a `transform` on the same document in a given request.
// These should actually happen in groupActions.
func (c *collection) commit(ctx context.Context, ws []*pb.Write, opts *driver.RunActionsOptions) ([]*pb.WriteResult, error) {
req := &pb.CommitRequest{
Database: c.dbPath,
Writes: ws,
}
if opts.BeforeDo != nil {
asFunc := func(i interface{}) bool {
p, ok := i.(**pb.CommitRequest)
if !ok {
return false
}
*p = req
return true
}
if err := opts.BeforeDo(asFunc); err != nil {
return nil, err
}
}
res, err := c.client.Commit(withResourceHeader(ctx, req.Database), req)
if err != nil {
return nil, err
}
if len(res.WriteResults) != len(ws) {
return nil, gcerr.Newf(gcerr.Internal, nil, "wrong number of WriteResults from firestore commit")
}
return res.WriteResults, nil
}
// docName returns the name of the document. This is either the value of the field
// called c.nameField, or the result of calling c.nameFunc. It must be a
// string.
// docName returns an error if:
// 1. c.nameField is not empty, but the field isn't present in the doc, or
// 2. c.nameFunc is non-nil, but returns "".
// The second return value reports whether c.nameField is not-empty and the field is
// missing. This is to support the Create action, which can create new document
// names.
func (c *collection) docName(doc driver.Document) (string, bool, error) {
if c.nameField != "" {
name, err := doc.GetField(c.nameField)
if err != nil {
return "", true, gcerr.Newf(gcerr.InvalidArgument, nil, "missing name field %s", c.nameField)
}
// Check that the reflect kind is String so we can support any type whose underlying type
// is string. E.g. "type DocName string".
vn := reflect.ValueOf(name)
if vn.Kind() != reflect.String {
return "", false, gcerr.Newf(gcerr.InvalidArgument, nil, "key field %q with value %v is not a string",
c.nameField, name)
}
return vn.String(), false, nil
}
name := c.nameFunc(doc.Origin)
if name == "" {
return "", false, gcerr.Newf(gcerr.InvalidArgument, nil, "missing name")
}
return name, false, nil
}
// Report whether two lists of field paths are equal.
func fpsEqual(fps1, fps2 [][]string) bool {
// TODO?: We really care about sets of field paths, but that's too tedious to determine.
if len(fps1) != len(fps2) {
return false
}
for i, fp1 := range fps1 {
if !fpEqual(fp1, fps2[i]) {
return false
}
}
return true
}
// Report whether two field paths are equal.
func fpEqual(fp1, fp2 []string) bool {
if len(fp1) != len(fp2) {
return false
}
for i, s1 := range fp1 {
if s1 != fp2[i] {
return false
}
}
return true
}
func (c *collection) ErrorCode(err error) gcerr.ErrorCode {
return gcerr.GRPCCode(err)
}
// resourcePrefixHeader is the name of the metadata header used to indicate
// the resource being operated on.
const resourcePrefixHeader = "google-cloud-resource-prefix"
// withResourceHeader returns a new context that includes resource in a special header.
// Firestore uses the resource header for routing.
func withResourceHeader(ctx context.Context, resource string) context.Context {
md, _ := metadata.FromOutgoingContext(ctx)
md = md.Copy()
md[resourcePrefixHeader] = []string{resource}
return metadata.NewOutgoingContext(ctx, md)
}
func (c *collection) As(i interface{}) bool {
p, ok := i.(**vkit.Client)
if !ok {
return false
}
*p = c.client
return true
}
| 1 | 17,770 | This was definitely a subtle bug right here. | google-go-cloud | go |
@@ -35,6 +35,12 @@ class GithubApi
@access_token = data['access_token'].first
end
+ def secondary_emails
+ return @secondary_emails if @secondary_emails
+ @secondary_emails = fetch_email_responses.select { |hsh| !hsh['primary'] && hsh['verified'] }
+ .map { |response| response['email'] }.compact
+ end
+
private
def request | 1 | class GithubApi
GITHUB_USER_URI = 'https://api.github.com/user'.freeze
GITHUB_ACCESS_TOKEN_URI = 'https://github.com/login/oauth/access_token'.freeze
REPO_LIMIT = 10
def initialize(code)
@code = code
end
def login
user_response['login']
end
def email
return user_response['email'] if user_response['email']
fetch_private_email
end
def created_at
Time.zone.parse(user_response['created_at'])
end
def repository_has_language?
repositories_response.any? do |repository_hash|
repository_hash['language'].present?
end
end
def access_token
return @access_token if @access_token
response = request.send_request('POST', token_uri.path, config)
data = CGI.parse(response.body)
raise StandardError, data['error_description'] if data['error'].present?
@access_token = data['access_token'].first
end
private
def request
Net::HTTP.new(token_uri.host, token_uri.port).tap { |http| http.use_ssl = true }
end
def user_response
return @user_response if @user_response
user_uri = URI(GITHUB_USER_URI)
@user_response = get_response_using_token(user_uri)
end
def repositories_response
params = { type: :owner, sort: :pushed, per_page: REPO_LIMIT }
repositories_uri = URI(GITHUB_USER_URI + "/repos?#{params.to_query}")
get_response_using_token(repositories_uri)
end
def config
CGI.unescape({ code: @code, client_id: ENV['GITHUB_CLIENT_ID'], client_secret: ENV['GITHUB_CLIENT_SECRET'],
redirect_uri: ENV['GITHUB_REDIRECT_URI'] }.to_query)
end
def token_uri
@token_uri ||= URI(GITHUB_ACCESS_TOKEN_URI)
end
def fetch_private_email
return @private_email if @private_email
email_uri = URI(GITHUB_USER_URI + '/emails')
email_responses = get_response_using_token(email_uri)
primary_email_response = email_responses.find { |hsh| hsh['primary'] && hsh['verified'] }
@private_email = primary_email_response['email'] if primary_email_response
end
def get_response_using_token(uri)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
response = http.get2(uri.request_uri, 'Authorization' => "token #{access_token}")
JSON.parse(response.body)
end
end
| 1 | 9,290 | If this method gets all the emails, it should be named appropriately. **all_emails** or just **emails**. | blackducksoftware-ohloh-ui | rb |
@@ -48,7 +48,7 @@ func TestBroadcast(t *testing.T) {
}
}
u := func(_ context.Context, _ uint32, _ peerstore.PeerInfo, _ proto.Message) {}
- bootnodePort := testutil.RandomPort()
+ bootnodePort := 14689
cfg := config.Config{
Network: config.Network{Host: "127.0.0.1", Port: bootnodePort},
} | 1 | // Copyright (c) 2019 IoTeX Foundation
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
// License 2.0 that can be found in the LICENSE file.
package p2p
import (
"context"
"net"
"sync"
"testing"
"time"
"github.com/golang/protobuf/proto"
peerstore "github.com/libp2p/go-libp2p-peerstore"
"github.com/stretchr/testify/require"
"github.com/iotexproject/iotex-core/config"
"github.com/iotexproject/iotex-core/testutil"
"github.com/iotexproject/iotex-proto/golang/testingpb"
)
func TestBroadcast(t *testing.T) {
ctx := context.Background()
n := 10
agents := make([]*Agent, 0)
defer func() {
var err error
for _, agent := range agents {
err = agent.Stop(ctx)
}
require.NoError(t, err)
}()
counts := make(map[uint8]int)
var mutex sync.RWMutex
b := func(_ context.Context, _ uint32, msg proto.Message) {
mutex.Lock()
defer mutex.Unlock()
testMsg, ok := msg.(*testingpb.TestPayload)
require.True(t, ok)
idx := testMsg.MsgBody[0]
if _, ok = counts[idx]; ok {
counts[idx]++
} else {
counts[idx] = 1
}
}
u := func(_ context.Context, _ uint32, _ peerstore.PeerInfo, _ proto.Message) {}
bootnodePort := testutil.RandomPort()
cfg := config.Config{
Network: config.Network{Host: "127.0.0.1", Port: bootnodePort},
}
bootnode := NewAgent(cfg, b, u)
require.NoError(t, bootnode.Start(ctx))
require.NoError(t, testutil.WaitUntil(100*time.Millisecond, 10*time.Second, func() (b bool, e error) {
ip := net.ParseIP("127.0.0.1")
tcpAddr := net.TCPAddr{
IP: ip,
Port: bootnodePort,
}
_, err := net.DialTCP("tcp", nil, &tcpAddr)
return err == nil, nil
}))
for i := 0; i < n; i++ {
port := testutil.RandomPort()
cfg := config.Config{
Network: config.Network{
Host: "127.0.0.1",
Port: port,
BootstrapNodes: []string{bootnode.Self()[0].String()},
},
}
agent := NewAgent(cfg, b, u)
require.NoError(t, agent.Start(ctx))
require.NoError(t, testutil.WaitUntil(100*time.Millisecond, 10*time.Second, func() (b bool, e error) {
ip := net.ParseIP("127.0.0.1")
tcpAddr := net.TCPAddr{
IP: ip,
Port: port,
}
_, err := net.DialTCP("tcp", nil, &tcpAddr)
return err == nil, nil
}))
agents = append(agents, agent)
}
for i := 0; i < n; i++ {
require.NoError(t, agents[i].BroadcastOutbound(WitContext(ctx, Context{ChainID: 1}), &testingpb.TestPayload{
MsgBody: []byte{uint8(i)},
}))
require.NoError(t, testutil.WaitUntil(100*time.Millisecond, 20*time.Second, func() (bool, error) {
mutex.RLock()
defer mutex.RUnlock()
// Broadcast message will be skipped by the source node
return counts[uint8(i)] == n, nil
}))
}
}
func TestUnicast(t *testing.T) {
ctx := context.Background()
n := 10
agents := make([]*Agent, 0)
defer func() {
var err error
for _, agent := range agents {
err = agent.Stop(ctx)
}
require.NoError(t, err)
}()
counts := make(map[uint8]int)
var src string
var mutex sync.RWMutex
b := func(_ context.Context, _ uint32, _ proto.Message) {}
u := func(_ context.Context, _ uint32, peer peerstore.PeerInfo, msg proto.Message) {
mutex.Lock()
defer mutex.Unlock()
testMsg, ok := msg.(*testingpb.TestPayload)
require.True(t, ok)
idx := testMsg.MsgBody[0]
if _, ok = counts[idx]; ok {
counts[idx]++
} else {
counts[idx] = 1
}
src = peer.ID.Pretty()
}
bootnode := NewAgent(config.Config{
Network: config.Network{Host: "127.0.0.1", Port: testutil.RandomPort()},
}, b, u)
require.NoError(t, bootnode.Start(ctx))
for i := 0; i < n; i++ {
cfg := config.Config{
Network: config.Network{
Host: "127.0.0.1",
Port: testutil.RandomPort(),
BootstrapNodes: []string{bootnode.Self()[0].String()},
},
}
agent := NewAgent(cfg, b, u)
require.NoError(t, agent.Start(ctx))
agents = append(agents, agent)
}
for i := 0; i < n; i++ {
neighbors, err := agents[i].Neighbors(ctx)
require.NoError(t, err)
require.True(t, len(neighbors) > 0)
for _, neighbor := range neighbors {
require.NoError(t, agents[i].UnicastOutbound(WitContext(ctx, Context{ChainID: 1}), neighbor, &testingpb.TestPayload{
MsgBody: []byte{uint8(i)},
}))
}
require.NoError(t, testutil.WaitUntil(100*time.Millisecond, 20*time.Second, func() (bool, error) {
mutex.RLock()
defer mutex.RUnlock()
return counts[uint8(i)] == len(neighbors) && src == agents[i].Info().ID.Pretty(), nil
}))
}
}
| 1 | 18,717 | Can we still random, but if we randomly get a port is used before, we randomly pick again? | iotexproject-iotex-core | go |
@@ -24,7 +24,7 @@ class Service(service.ChromiumService):
"""
def __init__(self, executable_path, port=0, service_args=None,
- log_path=None, env=None):
+ log_path=None, env=None, create_no_window=False):
"""
Creates a new instance of the Service
| 1 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from selenium.webdriver.chromium import service
class Service(service.ChromiumService):
"""
Object that manages the starting and stopping of the ChromeDriver
"""
def __init__(self, executable_path, port=0, service_args=None,
log_path=None, env=None):
"""
Creates a new instance of the Service
:Args:
- executable_path : Path to the ChromeDriver
- port : Port the service is running on
- service_args : List of args to pass to the chromedriver service
- log_path : Path for the chromedriver service to log to"""
super(Service, self).__init__(
executable_path,
port,
service_args,
log_path,
env,
"Please see https://chromedriver.chromium.org/home")
| 1 | 17,876 | I would rather no have this as a `kwarg` as it encourages "growth" which lead to an unweildy constructor in other classes. Let's add a method or property to take care of this instead as I think it's usage is going to be quite low. | SeleniumHQ-selenium | py |
@@ -11,5 +11,17 @@ module Gsa18f
super && self.gsa_if_restricted!
end
alias_method :can_new!, :can_create!
+
+ def can_cancel!
+ not_cancelled! && check((approver? || delegate? || requester?) && !purchaser?,
+ "Sorry, you are neither the requester, approver or delegate")
+ end
+ alias_method :can_cancel_form!, :can_cancel!
+
+ protected
+
+ def purchaser?
+ @procurement.purchaser == @user
+ end
end
end | 1 | module Gsa18f
class ProcurementPolicy < ProposalPolicy
include GsaPolicy
def initialize(user, record)
super(user, record.proposal)
@procurement = record
end
def can_create!
super && self.gsa_if_restricted!
end
alias_method :can_new!, :can_create!
end
end
| 1 | 15,602 | what if a purchaser is also an approver? or would that not happen? | 18F-C2 | rb |
@@ -125,9 +125,12 @@ def sweep(privkeys, network, config, recipient, fee=None, imax=100):
raise BaseException(_('No inputs found. (Note that inputs need to be confirmed)'))
total = sum(i.get('value') for i in inputs)
if fee is None:
+ if not network.config.has_fee_estimates():
+ raise BaseException('Dynamic fee estimates not available')
outputs = [(TYPE_ADDRESS, recipient, total)]
tx = Transaction.from_io(inputs, outputs)
fee = config.estimate_fee(tx.estimated_size())
+
if total - fee < 0:
raise BaseException(_('Not enough funds on address.') + '\nTotal: %d satoshis\nFee: %d'%(total, fee))
if total - fee < dust_threshold(network): | 1 | # Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Wallet classes:
# - Imported_Wallet: imported address, no keystore
# - Standard_Wallet: one keystore, P2PKH
# - Multisig_Wallet: several keystores, P2SH
import os
import threading
import random
import time
import json
import copy
import errno
from functools import partial
from collections import defaultdict
from .i18n import _
from .util import NotEnoughFunds, PrintError, UserCancelled, profiler, format_satoshis
from .bitcoin import *
from .version import *
from .keystore import load_keystore, Hardware_KeyStore
from .storage import multisig_type
from . import transaction
from .transaction import Transaction
from .plugins import run_hook
from . import bitcoin
from . import coinchooser
from .synchronizer import Synchronizer
from .verifier import SPV
from . import paymentrequest
from .paymentrequest import PR_PAID, PR_UNPAID, PR_UNKNOWN, PR_EXPIRED
from .paymentrequest import InvoiceStore
from .contacts import Contacts
TX_STATUS = [
_('Replaceable'),
_('Unconfirmed parent'),
_('Low fee'),
_('Unconfirmed'),
_('Not Verified'),
]
def relayfee(network):
RELAY_FEE = 5000
MAX_RELAY_FEE = 50000
f = network.relay_fee if network and network.relay_fee else RELAY_FEE
return min(f, MAX_RELAY_FEE)
def dust_threshold(network):
# Change <= dust threshold is added to the tx fee
return 182 * 3 * relayfee(network) / 1000
def append_utxos_to_inputs(inputs, network, pubkey, txin_type, imax):
if txin_type != 'p2pk':
address = bitcoin.pubkey_to_address(txin_type, pubkey)
sh = bitcoin.address_to_scripthash(address)
else:
script = bitcoin.public_key_to_p2pk_script(pubkey)
sh = bitcoin.script_to_scripthash(script)
address = '(pubkey)'
u = network.synchronous_get(('blockchain.scripthash.listunspent', [sh]))
for item in u:
if len(inputs) >= imax:
break
item['address'] = address
item['type'] = txin_type
item['prevout_hash'] = item['tx_hash']
item['prevout_n'] = item['tx_pos']
item['pubkeys'] = [pubkey]
item['x_pubkeys'] = [pubkey]
item['signatures'] = [None]
item['num_sig'] = 1
inputs.append(item)
def sweep(privkeys, network, config, recipient, fee=None, imax=100):
def find_utxos_for_privkey(txin_type, privkey, compressed):
pubkey = bitcoin.public_key_from_private_key(privkey, compressed)
append_utxos_to_inputs(inputs, network, pubkey, txin_type, imax)
keypairs[pubkey] = privkey, compressed
inputs = []
keypairs = {}
for sec in privkeys:
txin_type, privkey, compressed = bitcoin.deserialize_privkey(sec)
find_utxos_for_privkey(txin_type, privkey, compressed)
# do other lookups to increase support coverage
if is_minikey(sec):
# minikeys don't have a compressed byte
# we lookup both compressed and uncompressed pubkeys
find_utxos_for_privkey(txin_type, privkey, not compressed)
elif txin_type == 'p2pkh':
# WIF serialization does not distinguish p2pkh and p2pk
# we also search for pay-to-pubkey outputs
find_utxos_for_privkey('p2pk', privkey, compressed)
if not inputs:
raise BaseException(_('No inputs found. (Note that inputs need to be confirmed)'))
total = sum(i.get('value') for i in inputs)
if fee is None:
outputs = [(TYPE_ADDRESS, recipient, total)]
tx = Transaction.from_io(inputs, outputs)
fee = config.estimate_fee(tx.estimated_size())
if total - fee < 0:
raise BaseException(_('Not enough funds on address.') + '\nTotal: %d satoshis\nFee: %d'%(total, fee))
if total - fee < dust_threshold(network):
raise BaseException(_('Not enough funds on address.') + '\nTotal: %d satoshis\nFee: %d\nDust Threshold: %d'%(total, fee, dust_threshold(network)))
outputs = [(TYPE_ADDRESS, recipient, total - fee)]
locktime = network.get_local_height()
tx = Transaction.from_io(inputs, outputs, locktime=locktime)
tx.set_rbf(True)
tx.sign(keypairs)
return tx
class Abstract_Wallet(PrintError):
"""
Wallet classes are created to handle various address generation methods.
Completion states (watching-only, single account, no seed, etc) are handled inside classes.
"""
max_change_outputs = 3
def __init__(self, storage):
self.electrum_version = ELECTRUM_VERSION
self.storage = storage
self.network = None
# verifier (SPV) and synchronizer are started in start_threads
self.synchronizer = None
self.verifier = None
self.gap_limit_for_change = 6 # constant
# saved fields
self.use_change = storage.get('use_change', True)
self.multiple_change = storage.get('multiple_change', False)
self.labels = storage.get('labels', {})
self.frozen_addresses = set(storage.get('frozen_addresses',[]))
self.history = storage.get('addr_history',{}) # address -> list(txid, height)
self.load_keystore()
self.load_addresses()
self.load_transactions()
self.build_reverse_history()
# load requests
self.receive_requests = self.storage.get('payment_requests', {})
# Transactions pending verification. A map from tx hash to transaction
# height. Access is not contended so no lock is needed.
self.unverified_tx = defaultdict(int)
# Verified transactions. Each value is a (height, timestamp, block_pos) tuple. Access with self.lock.
self.verified_tx = storage.get('verified_tx3', {})
# there is a difference between wallet.up_to_date and interface.is_up_to_date()
# interface.is_up_to_date() returns true when all requests have been answered and processed
# wallet.up_to_date is true when the wallet is synchronized (stronger requirement)
self.up_to_date = False
self.lock = threading.Lock()
self.transaction_lock = threading.Lock()
self.check_history()
# save wallet type the first time
if self.storage.get('wallet_type') is None:
self.storage.put('wallet_type', self.wallet_type)
# invoices and contacts
self.invoices = InvoiceStore(self.storage)
self.contacts = Contacts(self.storage)
def diagnostic_name(self):
return self.basename()
def __str__(self):
return self.basename()
def get_master_public_key(self):
return None
@profiler
def load_transactions(self):
self.txi = self.storage.get('txi', {})
self.txo = self.storage.get('txo', {})
self.tx_fees = self.storage.get('tx_fees', {})
self.pruned_txo = self.storage.get('pruned_txo', {})
tx_list = self.storage.get('transactions', {})
self.transactions = {}
for tx_hash, raw in tx_list.items():
tx = Transaction(raw)
self.transactions[tx_hash] = tx
if self.txi.get(tx_hash) is None and self.txo.get(tx_hash) is None and (tx_hash not in self.pruned_txo.values()):
self.print_error("removing unreferenced tx", tx_hash)
self.transactions.pop(tx_hash)
@profiler
def save_transactions(self, write=False):
with self.transaction_lock:
tx = {}
for k,v in self.transactions.items():
tx[k] = str(v)
self.storage.put('transactions', tx)
self.storage.put('txi', self.txi)
self.storage.put('txo', self.txo)
self.storage.put('tx_fees', self.tx_fees)
self.storage.put('pruned_txo', self.pruned_txo)
self.storage.put('addr_history', self.history)
if write:
self.storage.write()
def clear_history(self):
with self.transaction_lock:
self.txi = {}
self.txo = {}
self.tx_fees = {}
self.pruned_txo = {}
self.save_transactions()
with self.lock:
self.history = {}
self.tx_addr_hist = {}
@profiler
def build_reverse_history(self):
self.tx_addr_hist = {}
for addr, hist in self.history.items():
for tx_hash, h in hist:
s = self.tx_addr_hist.get(tx_hash, set())
s.add(addr)
self.tx_addr_hist[tx_hash] = s
@profiler
def check_history(self):
save = False
mine_addrs = list(filter(lambda k: self.is_mine(self.history[k]), self.history.keys()))
if len(mine_addrs) != len(self.history.keys()):
save = True
for addr in mine_addrs:
hist = self.history[addr]
for tx_hash, tx_height in hist:
if tx_hash in self.pruned_txo.values() or self.txi.get(tx_hash) or self.txo.get(tx_hash):
continue
tx = self.transactions.get(tx_hash)
if tx is not None:
self.add_transaction(tx_hash, tx)
save = True
if save:
self.save_transactions()
def basename(self):
return os.path.basename(self.storage.path)
def save_addresses(self):
self.storage.put('addresses', {'receiving':self.receiving_addresses, 'change':self.change_addresses})
def load_addresses(self):
d = self.storage.get('addresses', {})
if type(d) != dict: d={}
self.receiving_addresses = d.get('receiving', [])
self.change_addresses = d.get('change', [])
def synchronize(self):
pass
def set_up_to_date(self, up_to_date):
with self.lock:
self.up_to_date = up_to_date
if up_to_date:
self.save_transactions(write=True)
def is_up_to_date(self):
with self.lock: return self.up_to_date
def set_label(self, name, text = None):
changed = False
old_text = self.labels.get(name)
if text:
text = text.replace("\n", " ")
if old_text != text:
self.labels[name] = text
changed = True
else:
if old_text:
self.labels.pop(name)
changed = True
if changed:
run_hook('set_label', self, name, text)
self.storage.put('labels', self.labels)
return changed
def is_mine(self, address):
return address in self.get_addresses()
def is_change(self, address):
if not self.is_mine(address):
return False
return address in self.change_addresses
def get_address_index(self, address):
if address in self.receiving_addresses:
return False, self.receiving_addresses.index(address)
if address in self.change_addresses:
return True, self.change_addresses.index(address)
raise Exception("Address not found", address)
def export_private_key(self, address, password):
""" extended WIF format """
if self.is_watching_only():
return []
index = self.get_address_index(address)
pk, compressed = self.keystore.get_private_key(index, password)
if self.txin_type in ['p2sh', 'p2wsh', 'p2wsh-p2sh']:
pubkeys = self.get_public_keys(address)
redeem_script = self.pubkeys_to_redeem_script(pubkeys)
else:
redeem_script = None
return bitcoin.serialize_privkey(pk, compressed, self.txin_type), redeem_script
def get_public_keys(self, address):
sequence = self.get_address_index(address)
return self.get_pubkeys(*sequence)
def add_unverified_tx(self, tx_hash, tx_height):
if tx_height == 0 and tx_hash in self.verified_tx:
self.verified_tx.pop(tx_hash)
self.verifier.merkle_roots.pop(tx_hash, None)
# tx will be verified only if height > 0
if tx_hash not in self.verified_tx:
self.unverified_tx[tx_hash] = tx_height
def add_verified_tx(self, tx_hash, info):
# Remove from the unverified map and add to the verified map and
self.unverified_tx.pop(tx_hash, None)
with self.lock:
self.verified_tx[tx_hash] = info # (tx_height, timestamp, pos)
height, conf, timestamp = self.get_tx_height(tx_hash)
self.network.trigger_callback('verified', tx_hash, height, conf, timestamp)
def get_unverified_txs(self):
'''Returns a map from tx hash to transaction height'''
return self.unverified_tx
def undo_verifications(self, blockchain, height):
'''Used by the verifier when a reorg has happened'''
txs = set()
with self.lock:
for tx_hash, item in list(self.verified_tx.items()):
tx_height, timestamp, pos = item
if tx_height >= height:
header = blockchain.read_header(tx_height)
# fixme: use block hash, not timestamp
if not header or header.get('timestamp') != timestamp:
self.verified_tx.pop(tx_hash, None)
txs.add(tx_hash)
return txs
def get_local_height(self):
""" return last known height if we are offline """
return self.network.get_local_height() if self.network else self.storage.get('stored_height', 0)
def get_tx_height(self, tx_hash):
""" return the height and timestamp of a verified transaction. """
with self.lock:
if tx_hash in self.verified_tx:
height, timestamp, pos = self.verified_tx[tx_hash]
conf = max(self.get_local_height() - height + 1, 0)
return height, conf, timestamp
else:
height = self.unverified_tx[tx_hash]
return height, 0, False
def get_txpos(self, tx_hash):
"return position, even if the tx is unverified"
with self.lock:
x = self.verified_tx.get(tx_hash)
y = self.unverified_tx.get(tx_hash)
if x:
height, timestamp, pos = x
return height, pos
elif y > 0:
return y, 0
else:
return 1e12 - y, 0
def is_found(self):
return self.history.values() != [[]] * len(self.history)
def get_num_tx(self, address):
""" return number of transactions where address is involved """
return len(self.history.get(address, []))
def get_tx_delta(self, tx_hash, address):
"effect of tx on address"
# pruned
if tx_hash in self.pruned_txo.values():
return None
delta = 0
# substract the value of coins sent from address
d = self.txi.get(tx_hash, {}).get(address, [])
for n, v in d:
delta -= v
# add the value of the coins received at address
d = self.txo.get(tx_hash, {}).get(address, [])
for n, v, cb in d:
delta += v
return delta
def get_wallet_delta(self, tx):
""" effect of tx on wallet """
addresses = self.get_addresses()
is_relevant = False
is_mine = False
is_pruned = False
is_partial = False
v_in = v_out = v_out_mine = 0
for item in tx.inputs():
addr = item.get('address')
if addr in addresses:
is_mine = True
is_relevant = True
d = self.txo.get(item['prevout_hash'], {}).get(addr, [])
for n, v, cb in d:
if n == item['prevout_n']:
value = v
break
else:
value = None
if value is None:
is_pruned = True
else:
v_in += value
else:
is_partial = True
if not is_mine:
is_partial = False
for addr, value in tx.get_outputs():
v_out += value
if addr in addresses:
v_out_mine += value
is_relevant = True
if is_pruned:
# some inputs are mine:
fee = None
if is_mine:
v = v_out_mine - v_out
else:
# no input is mine
v = v_out_mine
else:
v = v_out_mine - v_in
if is_partial:
# some inputs are mine, but not all
fee = None
else:
# all inputs are mine
fee = v_in - v_out
if not is_mine:
fee = None
return is_relevant, is_mine, v, fee
def get_tx_info(self, tx):
is_relevant, is_mine, v, fee = self.get_wallet_delta(tx)
exp_n = None
can_broadcast = False
can_bump = False
label = ''
height = conf = timestamp = None
tx_hash = tx.txid()
if tx.is_complete():
if tx_hash in self.transactions.keys():
label = self.get_label(tx_hash)
height, conf, timestamp = self.get_tx_height(tx_hash)
if height > 0:
if conf:
status = _("%d confirmations") % conf
else:
status = _('Not verified')
else:
status = _('Unconfirmed')
if fee is None:
fee = self.tx_fees.get(tx_hash)
if fee and self.network.config.has_fee_estimates():
size = tx.estimated_size()
fee_per_kb = fee * 1000 / size
exp_n = self.network.config.reverse_dynfee(fee_per_kb)
can_bump = is_mine and not tx.is_final()
else:
status = _("Signed")
can_broadcast = self.network is not None
else:
s, r = tx.signature_count()
status = _("Unsigned") if s == 0 else _('Partially signed') + ' (%d/%d)'%(s,r)
if is_relevant:
if is_mine:
if fee is not None:
amount = v + fee
else:
amount = v
else:
amount = v
else:
amount = None
return tx_hash, status, label, can_broadcast, can_bump, amount, fee, height, conf, timestamp, exp_n
def get_addr_io(self, address):
h = self.history.get(address, [])
received = {}
sent = {}
for tx_hash, height in h:
l = self.txo.get(tx_hash, {}).get(address, [])
for n, v, is_cb in l:
received[tx_hash + ':%d'%n] = (height, v, is_cb)
for tx_hash, height in h:
l = self.txi.get(tx_hash, {}).get(address, [])
for txi, v in l:
sent[txi] = height
return received, sent
def get_addr_utxo(self, address):
coins, spent = self.get_addr_io(address)
for txi in spent:
coins.pop(txi)
out = {}
for txo, v in coins.items():
tx_height, value, is_cb = v
prevout_hash, prevout_n = txo.split(':')
x = {
'address':address,
'value':value,
'prevout_n':int(prevout_n),
'prevout_hash':prevout_hash,
'height':tx_height,
'coinbase':is_cb
}
out[txo] = x
return out
# return the total amount ever received by an address
def get_addr_received(self, address):
received, sent = self.get_addr_io(address)
return sum([v for height, v, is_cb in received.values()])
# return the balance of a bitcoin address: confirmed and matured, unconfirmed, unmatured
def get_addr_balance(self, address):
received, sent = self.get_addr_io(address)
c = u = x = 0
for txo, (tx_height, v, is_cb) in received.items():
if is_cb and tx_height + COINBASE_MATURITY > self.get_local_height():
x += v
elif tx_height > 0:
c += v
else:
u += v
if txo in sent:
if sent[txo] > 0:
c -= v
else:
u -= v
return c, u, x
def get_spendable_coins(self, domain, config):
confirmed_only = config.get('confirmed_only', False)
return self.get_utxos(domain, exclude_frozen=True, mature=True, confirmed_only=confirmed_only)
def get_utxos(self, domain = None, exclude_frozen = False, mature = False, confirmed_only = False):
coins = []
if domain is None:
domain = self.get_addresses()
if exclude_frozen:
domain = set(domain) - self.frozen_addresses
for addr in domain:
utxos = self.get_addr_utxo(addr)
for x in utxos.values():
if confirmed_only and x['height'] <= 0:
continue
if mature and x['coinbase'] and x['height'] + COINBASE_MATURITY > self.get_local_height():
continue
coins.append(x)
continue
return coins
def dummy_address(self):
return self.get_receiving_addresses()[0]
def get_addresses(self):
out = []
out += self.get_receiving_addresses()
out += self.get_change_addresses()
return out
def get_frozen_balance(self):
return self.get_balance(self.frozen_addresses)
def get_balance(self, domain=None):
if domain is None:
domain = self.get_addresses()
cc = uu = xx = 0
for addr in domain:
c, u, x = self.get_addr_balance(addr)
cc += c
uu += u
xx += x
return cc, uu, xx
def get_address_history(self, address):
with self.lock:
return self.history.get(address, [])
def find_pay_to_pubkey_address(self, prevout_hash, prevout_n):
dd = self.txo.get(prevout_hash, {})
for addr, l in dd.items():
for n, v, is_cb in l:
if n == prevout_n:
self.print_error("found pay-to-pubkey address:", addr)
return addr
def add_transaction(self, tx_hash, tx):
is_coinbase = tx.inputs()[0]['type'] == 'coinbase'
with self.transaction_lock:
# add inputs
self.txi[tx_hash] = d = {}
for txi in tx.inputs():
addr = txi.get('address')
if txi['type'] != 'coinbase':
prevout_hash = txi['prevout_hash']
prevout_n = txi['prevout_n']
ser = prevout_hash + ':%d'%prevout_n
if addr == "(pubkey)":
addr = self.find_pay_to_pubkey_address(prevout_hash, prevout_n)
# find value from prev output
if addr and self.is_mine(addr):
dd = self.txo.get(prevout_hash, {})
for n, v, is_cb in dd.get(addr, []):
if n == prevout_n:
if d.get(addr) is None:
d[addr] = []
d[addr].append((ser, v))
break
else:
self.pruned_txo[ser] = tx_hash
# add outputs
self.txo[tx_hash] = d = {}
for n, txo in enumerate(tx.outputs()):
ser = tx_hash + ':%d'%n
_type, x, v = txo
if _type == TYPE_ADDRESS:
addr = x
elif _type == TYPE_PUBKEY:
addr = bitcoin.public_key_to_p2pkh(bfh(x))
else:
addr = None
if addr and self.is_mine(addr):
if d.get(addr) is None:
d[addr] = []
d[addr].append((n, v, is_coinbase))
# give v to txi that spends me
next_tx = self.pruned_txo.get(ser)
if next_tx is not None:
self.pruned_txo.pop(ser)
dd = self.txi.get(next_tx, {})
if dd.get(addr) is None:
dd[addr] = []
dd[addr].append((ser, v))
# save
self.transactions[tx_hash] = tx
def remove_transaction(self, tx_hash):
with self.transaction_lock:
self.print_error("removing tx from history", tx_hash)
#tx = self.transactions.pop(tx_hash)
for ser, hh in list(self.pruned_txo.items()):
if hh == tx_hash:
self.pruned_txo.pop(ser)
# add tx to pruned_txo, and undo the txi addition
for next_tx, dd in self.txi.items():
for addr, l in list(dd.items()):
ll = l[:]
for item in ll:
ser, v = item
prev_hash, prev_n = ser.split(':')
if prev_hash == tx_hash:
l.remove(item)
self.pruned_txo[ser] = next_tx
if l == []:
dd.pop(addr)
else:
dd[addr] = l
try:
self.txi.pop(tx_hash)
self.txo.pop(tx_hash)
except KeyError:
self.print_error("tx was not in history", tx_hash)
def receive_tx_callback(self, tx_hash, tx, tx_height):
self.add_transaction(tx_hash, tx)
self.add_unverified_tx(tx_hash, tx_height)
def receive_history_callback(self, addr, hist, tx_fees):
with self.lock:
old_hist = self.history.get(addr, [])
for tx_hash, height in old_hist:
if (tx_hash, height) not in hist:
# remove tx if it's not referenced in histories
self.tx_addr_hist[tx_hash].remove(addr)
if not self.tx_addr_hist[tx_hash]:
self.remove_transaction(tx_hash)
self.history[addr] = hist
for tx_hash, tx_height in hist:
# add it in case it was previously unconfirmed
self.add_unverified_tx(tx_hash, tx_height)
# add reference in tx_addr_hist
s = self.tx_addr_hist.get(tx_hash, set())
s.add(addr)
self.tx_addr_hist[tx_hash] = s
# if addr is new, we have to recompute txi and txo
tx = self.transactions.get(tx_hash)
if tx is not None and self.txi.get(tx_hash, {}).get(addr) is None and self.txo.get(tx_hash, {}).get(addr) is None:
self.add_transaction(tx_hash, tx)
# Store fees
self.tx_fees.update(tx_fees)
def get_history(self, domain=None):
# get domain
if domain is None:
domain = self.get_addresses()
# 1. Get the history of each address in the domain, maintain the
# delta of a tx as the sum of its deltas on domain addresses
tx_deltas = defaultdict(int)
for addr in domain:
h = self.get_address_history(addr)
for tx_hash, height in h:
delta = self.get_tx_delta(tx_hash, addr)
if delta is None or tx_deltas[tx_hash] is None:
tx_deltas[tx_hash] = None
else:
tx_deltas[tx_hash] += delta
# 2. create sorted history
history = []
for tx_hash in tx_deltas:
delta = tx_deltas[tx_hash]
height, conf, timestamp = self.get_tx_height(tx_hash)
history.append((tx_hash, height, conf, timestamp, delta))
history.sort(key = lambda x: self.get_txpos(x[0]))
history.reverse()
# 3. add balance
c, u, x = self.get_balance(domain)
balance = c + u + x
h2 = []
for tx_hash, height, conf, timestamp, delta in history:
h2.append((tx_hash, height, conf, timestamp, delta, balance))
if balance is None or delta is None:
balance = None
else:
balance -= delta
h2.reverse()
# fixme: this may happen if history is incomplete
if balance not in [None, 0]:
self.print_error("Error: history not synchronized")
return []
return h2
def get_label(self, tx_hash):
label = self.labels.get(tx_hash, '')
if label is '':
label = self.get_default_label(tx_hash)
return label
def get_default_label(self, tx_hash):
if self.txi.get(tx_hash) == {}:
d = self.txo.get(tx_hash, {})
labels = []
for addr in d.keys():
label = self.labels.get(addr)
if label:
labels.append(label)
return ', '.join(labels)
return ''
def get_tx_status(self, tx_hash, height, conf, timestamp):
from .util import format_time
if conf == 0:
tx = self.transactions.get(tx_hash)
if not tx:
return 3, 'unknown'
is_final = tx and tx.is_final()
fee = self.tx_fees.get(tx_hash)
if fee and self.network and self.network.config.has_fee_estimates():
size = len(tx.raw)/2
low_fee = int(self.network.config.dynfee(0)*size/1000)
is_lowfee = fee < low_fee * 0.5
else:
is_lowfee = False
if height==0 and not is_final:
status = 0
elif height < 0:
status = 1
elif height == 0 and is_lowfee:
status = 2
elif height == 0:
status = 3
else:
status = 4
else:
status = 4 + min(conf, 6)
time_str = format_time(timestamp) if timestamp else _("unknown")
status_str = TX_STATUS[status] if status < 5 else time_str
return status, status_str
def relayfee(self):
return relayfee(self.network)
def dust_threshold(self):
return dust_threshold(self.network)
def make_unsigned_transaction(self, inputs, outputs, config, fixed_fee=None, change_addr=None):
# check outputs
i_max = None
for i, o in enumerate(outputs):
_type, data, value = o
if _type == TYPE_ADDRESS:
if not is_address(data):
raise BaseException("Invalid bitcoin address:" + data)
if value == '!':
if i_max is not None:
raise BaseException("More than one output set to spend max")
i_max = i
# Avoid index-out-of-range with inputs[0] below
if not inputs:
raise NotEnoughFunds()
if fixed_fee is None and config.fee_per_kb() is None:
raise BaseException('Dynamic fee estimates not available')
for item in inputs:
self.add_input_info(item)
# change address
if change_addr:
change_addrs = [change_addr]
else:
addrs = self.get_change_addresses()[-self.gap_limit_for_change:]
if self.use_change and addrs:
# New change addresses are created only after a few
# confirmations. Select the unused addresses within the
# gap limit; if none take one at random
change_addrs = [addr for addr in addrs if
self.get_num_tx(addr) == 0]
if not change_addrs:
change_addrs = [random.choice(addrs)]
else:
change_addrs = [inputs[0]['address']]
# Fee estimator
if fixed_fee is None:
fee_estimator = config.estimate_fee
else:
fee_estimator = lambda size: fixed_fee
if i_max is None:
# Let the coin chooser select the coins to spend
max_change = self.max_change_outputs if self.multiple_change else 1
coin_chooser = coinchooser.get_coin_chooser(config)
tx = coin_chooser.make_tx(inputs, outputs, change_addrs[:max_change],
fee_estimator, self.dust_threshold())
else:
sendable = sum(map(lambda x:x['value'], inputs))
_type, data, value = outputs[i_max]
outputs[i_max] = (_type, data, 0)
tx = Transaction.from_io(inputs, outputs[:])
fee = fee_estimator(tx.estimated_size())
amount = max(0, sendable - tx.output_value() - fee)
outputs[i_max] = (_type, data, amount)
tx = Transaction.from_io(inputs, outputs[:])
# Sort the inputs and outputs deterministically
tx.BIP_LI01_sort()
# Timelock tx to current height.
tx.locktime = self.get_local_height()
run_hook('make_unsigned_transaction', self, tx)
return tx
def mktx(self, outputs, password, config, fee=None, change_addr=None, domain=None):
coins = self.get_spendable_coins(domain, config)
tx = self.make_unsigned_transaction(coins, outputs, config, fee, change_addr)
self.sign_transaction(tx, password)
return tx
def is_frozen(self, addr):
return addr in self.frozen_addresses
def set_frozen_state(self, addrs, freeze):
'''Set frozen state of the addresses to FREEZE, True or False'''
if all(self.is_mine(addr) for addr in addrs):
if freeze:
self.frozen_addresses |= set(addrs)
else:
self.frozen_addresses -= set(addrs)
self.storage.put('frozen_addresses', list(self.frozen_addresses))
return True
return False
def prepare_for_verifier(self):
# review transactions that are in the history
for addr, hist in self.history.items():
for tx_hash, tx_height in hist:
# add it in case it was previously unconfirmed
self.add_unverified_tx(tx_hash, tx_height)
# if we are on a pruning server, remove unverified transactions
with self.lock:
vr = list(self.verified_tx.keys()) + list(self.unverified_tx.keys())
for tx_hash in self.transactions.keys():
if tx_hash not in vr:
self.print_error("removing transaction", tx_hash)
self.transactions.pop(tx_hash)
def start_threads(self, network):
self.network = network
if self.network is not None:
self.prepare_for_verifier()
self.verifier = SPV(self.network, self)
self.synchronizer = Synchronizer(self, network)
network.add_jobs([self.verifier, self.synchronizer])
else:
self.verifier = None
self.synchronizer = None
def stop_threads(self):
if self.network:
self.network.remove_jobs([self.synchronizer, self.verifier])
self.synchronizer.release()
self.synchronizer = None
self.verifier = None
# Now no references to the syncronizer or verifier
# remain so they will be GC-ed
self.storage.put('stored_height', self.get_local_height())
self.save_transactions()
self.storage.put('verified_tx3', self.verified_tx)
self.storage.write()
def wait_until_synchronized(self, callback=None):
def wait_for_wallet():
self.set_up_to_date(False)
while not self.is_up_to_date():
if callback:
msg = "%s\n%s %d"%(
_("Please wait..."),
_("Addresses generated:"),
len(self.addresses(True)))
callback(msg)
time.sleep(0.1)
def wait_for_network():
while not self.network.is_connected():
if callback:
msg = "%s \n" % (_("Connecting..."))
callback(msg)
time.sleep(0.1)
# wait until we are connected, because the user
# might have selected another server
if self.network:
wait_for_network()
wait_for_wallet()
else:
self.synchronize()
def can_export(self):
return not self.is_watching_only() and hasattr(self.keystore, 'get_private_key')
def is_used(self, address):
h = self.history.get(address,[])
c, u, x = self.get_addr_balance(address)
return len(h) > 0 and c + u + x == 0
def is_empty(self, address):
c, u, x = self.get_addr_balance(address)
return c+u+x == 0
def address_is_old(self, address, age_limit=2):
age = -1
h = self.history.get(address, [])
for tx_hash, tx_height in h:
if tx_height == 0:
tx_age = 0
else:
tx_age = self.get_local_height() - tx_height + 1
if tx_age > age:
age = tx_age
return age > age_limit
def bump_fee(self, tx, delta):
if tx.is_final():
raise BaseException(_("Cannot bump fee: transaction is final"))
inputs = copy.deepcopy(tx.inputs())
outputs = copy.deepcopy(tx.outputs())
for txin in inputs:
txin['signatures'] = [None] * len(txin['signatures'])
self.add_input_info(txin)
# use own outputs
s = list(filter(lambda x: self.is_mine(x[1]), outputs))
# ... unless there is none
if not s:
s = outputs
x_fee = run_hook('get_tx_extra_fee', self, tx)
if x_fee:
x_fee_address, x_fee_amount = x_fee
s = filter(lambda x: x[1]!=x_fee_address, s)
# prioritize low value outputs, to get rid of dust
s = sorted(s, key=lambda x: x[2])
for o in s:
i = outputs.index(o)
otype, address, value = o
if value - delta >= self.dust_threshold():
outputs[i] = otype, address, value - delta
delta = 0
break
else:
del outputs[i]
delta -= value
if delta > 0:
continue
if delta > 0:
raise BaseException(_('Cannot bump fee: could not find suitable outputs'))
locktime = self.get_local_height()
return Transaction.from_io(inputs, outputs, locktime=locktime)
def cpfp(self, tx, fee):
txid = tx.txid()
for i, o in enumerate(tx.outputs()):
otype, address, value = o
if otype == TYPE_ADDRESS and self.is_mine(address):
break
else:
return
coins = self.get_addr_utxo(address)
item = coins.get(txid+':%d'%i)
if not item:
return
self.add_input_info(item)
inputs = [item]
outputs = [(TYPE_ADDRESS, address, value - fee)]
locktime = self.get_local_height()
return Transaction.from_io(inputs, outputs, locktime=locktime)
def add_input_info(self, txin):
address = txin['address']
if self.is_mine(address):
txin['type'] = self.get_txin_type(address)
# segwit needs value to sign
if txin.get('value') is None and txin['type'] in ['p2wpkh', 'p2wsh', 'p2wpkh-p2sh', 'p2wsh-p2sh']:
received, spent = self.get_addr_io(address)
item = received.get(txin['prevout_hash']+':%d'%txin['prevout_n'])
tx_height, value, is_cb = item
txin['value'] = value
self.add_input_sig_info(txin, address)
def can_sign(self, tx):
if tx.is_complete():
return False
for k in self.get_keystores():
if k.can_sign(tx):
return True
return False
def get_input_tx(self, tx_hash):
# First look up an input transaction in the wallet where it
# will likely be. If co-signing a transaction it may not have
# all the input txs, in which case we ask the network.
tx = self.transactions.get(tx_hash)
if not tx and self.network:
request = ('blockchain.transaction.get', [tx_hash])
tx = Transaction(self.network.synchronous_get(request))
return tx
def add_hw_info(self, tx):
# add previous tx for hw wallets
for txin in tx.inputs():
tx_hash = txin['prevout_hash']
txin['prev_tx'] = self.get_input_tx(tx_hash)
# add output info for hw wallets
info = {}
xpubs = self.get_master_public_keys()
for txout in tx.outputs():
_type, addr, amount = txout
if self.is_change(addr):
index = self.get_address_index(addr)
pubkeys = self.get_public_keys(addr)
# sort xpubs using the order of pubkeys
sorted_pubkeys, sorted_xpubs = zip(*sorted(zip(pubkeys, xpubs)))
info[addr] = index, sorted_xpubs, self.m if isinstance(self, Multisig_Wallet) else None
tx.output_info = info
def sign_transaction(self, tx, password):
if self.is_watching_only():
return
# hardware wallets require extra info
if any([(isinstance(k, Hardware_KeyStore) and k.can_sign(tx)) for k in self.get_keystores()]):
self.add_hw_info(tx)
# sign
for k in self.get_keystores():
try:
if k.can_sign(tx):
k.sign_transaction(tx, password)
except UserCancelled:
continue
def get_unused_addresses(self):
# fixme: use slots from expired requests
domain = self.get_receiving_addresses()
return [addr for addr in domain if not self.history.get(addr)
and addr not in self.receive_requests.keys()]
def get_unused_address(self):
addrs = self.get_unused_addresses()
if addrs:
return addrs[0]
def get_receiving_address(self):
# always return an address
domain = self.get_receiving_addresses()
if not domain:
return
choice = domain[0]
for addr in domain:
if not self.history.get(addr):
if addr not in self.receive_requests.keys():
return addr
else:
choice = addr
return choice
def get_payment_status(self, address, amount):
local_height = self.get_local_height()
received, sent = self.get_addr_io(address)
l = []
for txo, x in received.items():
h, v, is_cb = x
txid, n = txo.split(':')
info = self.verified_tx.get(txid)
if info:
tx_height, timestamp, pos = info
conf = local_height - tx_height
else:
conf = 0
l.append((conf, v))
vsum = 0
for conf, v in reversed(sorted(l)):
vsum += v
if vsum >= amount:
return True, conf
return False, None
def get_payment_request(self, addr, config):
r = self.receive_requests.get(addr)
if not r:
return
out = copy.copy(r)
out['URI'] = 'bitcoin:' + addr + '?amount=' + format_satoshis(out.get('amount'))
status, conf = self.get_request_status(addr)
out['status'] = status
if conf is not None:
out['confirmations'] = conf
# check if bip70 file exists
rdir = config.get('requests_dir')
if rdir:
key = out.get('id', addr)
path = os.path.join(rdir, 'req', key[0], key[1], key)
if os.path.exists(path):
baseurl = 'file://' + rdir
rewrite = config.get('url_rewrite')
if rewrite:
baseurl = baseurl.replace(*rewrite)
out['request_url'] = os.path.join(baseurl, 'req', key[0], key[1], key, key)
out['URI'] += '&r=' + out['request_url']
out['index_url'] = os.path.join(baseurl, 'index.html') + '?id=' + key
websocket_server_announce = config.get('websocket_server_announce')
if websocket_server_announce:
out['websocket_server'] = websocket_server_announce
else:
out['websocket_server'] = config.get('websocket_server', 'localhost')
websocket_port_announce = config.get('websocket_port_announce')
if websocket_port_announce:
out['websocket_port'] = websocket_port_announce
else:
out['websocket_port'] = config.get('websocket_port', 9999)
return out
def get_request_status(self, key):
r = self.receive_requests.get(key)
if r is None:
return PR_UNKNOWN
address = r['address']
amount = r.get('amount')
timestamp = r.get('time', 0)
if timestamp and type(timestamp) != int:
timestamp = 0
expiration = r.get('exp')
if expiration and type(expiration) != int:
expiration = 0
conf = None
if amount:
if self.up_to_date:
paid, conf = self.get_payment_status(address, amount)
status = PR_PAID if paid else PR_UNPAID
if status == PR_UNPAID and expiration is not None and time.time() > timestamp + expiration:
status = PR_EXPIRED
else:
status = PR_UNKNOWN
else:
status = PR_UNKNOWN
return status, conf
def make_payment_request(self, addr, amount, message, expiration):
timestamp = int(time.time())
_id = bh2u(Hash(addr + "%d"%timestamp))[0:10]
r = {'time':timestamp, 'amount':amount, 'exp':expiration, 'address':addr, 'memo':message, 'id':_id}
return r
def sign_payment_request(self, key, alias, alias_addr, password):
req = self.receive_requests.get(key)
alias_privkey = self.export_private_key(alias_addr, password)[0]
pr = paymentrequest.make_unsigned_request(req)
paymentrequest.sign_request_with_alias(pr, alias, alias_privkey)
req['name'] = pr.pki_data
req['sig'] = bh2u(pr.signature)
self.receive_requests[key] = req
self.storage.put('payment_requests', self.receive_requests)
def add_payment_request(self, req, config):
addr = req['address']
amount = req.get('amount')
message = req.get('memo')
self.receive_requests[addr] = req
self.storage.put('payment_requests', self.receive_requests)
self.set_label(addr, message) # should be a default label
rdir = config.get('requests_dir')
if rdir and amount is not None:
key = req.get('id', addr)
pr = paymentrequest.make_request(config, req)
path = os.path.join(rdir, 'req', key[0], key[1], key)
if not os.path.exists(path):
try:
os.makedirs(path)
except OSError as exc:
if exc.errno != errno.EEXIST:
raise
with open(os.path.join(path, key), 'wb') as f:
f.write(pr.SerializeToString())
# reload
req = self.get_payment_request(addr, config)
with open(os.path.join(path, key + '.json'), 'w') as f:
f.write(json.dumps(req))
return req
def remove_payment_request(self, addr, config):
if addr not in self.receive_requests:
return False
r = self.receive_requests.pop(addr)
rdir = config.get('requests_dir')
if rdir:
key = r.get('id', addr)
for s in ['.json', '']:
n = os.path.join(rdir, 'req', key[0], key[1], key, key + s)
if os.path.exists(n):
os.unlink(n)
self.storage.put('payment_requests', self.receive_requests)
return True
def get_sorted_requests(self, config):
def f(x):
try:
addr = x.get('address')
return self.get_address_index(addr) or addr
except:
return addr
return sorted(map(lambda x: self.get_payment_request(x, config), self.receive_requests.keys()), key=f)
def get_fingerprint(self):
raise NotImplementedError()
def can_import_privkey(self):
return False
def can_import_address(self):
return False
def can_delete_address(self):
return False
def add_address(self, address):
if address not in self.history:
self.history[address] = []
if self.synchronizer:
self.synchronizer.add(address)
def has_password(self):
return self.storage.get('use_encryption', False)
def check_password(self, password):
self.keystore.check_password(password)
def sign_message(self, address, message, password):
index = self.get_address_index(address)
return self.keystore.sign_message(index, message, password)
def decrypt_message(self, pubkey, message, password):
addr = self.pubkeys_to_address(pubkey)
index = self.get_address_index(addr)
return self.keystore.decrypt_message(index, message, password)
class Simple_Wallet(Abstract_Wallet):
# wallet with a single keystore
def get_keystore(self):
return self.keystore
def get_keystores(self):
return [self.keystore]
def is_watching_only(self):
return self.keystore.is_watching_only()
def can_change_password(self):
return self.keystore.can_change_password()
def update_password(self, old_pw, new_pw, encrypt=False):
if old_pw is None and self.has_password():
raise InvalidPassword()
self.keystore.update_password(old_pw, new_pw)
self.save_keystore()
self.storage.set_password(new_pw, encrypt)
self.storage.write()
def save_keystore(self):
self.storage.put('keystore', self.keystore.dump())
class Imported_Wallet(Simple_Wallet):
# wallet made of imported addresses
wallet_type = 'imported'
txin_type = 'address'
def __init__(self, storage):
Abstract_Wallet.__init__(self, storage)
def is_watching_only(self):
return self.keystore is None
def get_keystores(self):
return [self.keystore] if self.keystore else []
def can_import_privkey(self):
return bool(self.keystore)
def load_keystore(self):
self.keystore = load_keystore(self.storage, 'keystore') if self.storage.get('keystore') else None
def save_keystore(self):
self.storage.put('keystore', self.keystore.dump())
def load_addresses(self):
self.addresses = self.storage.get('addresses', {})
# fixme: a reference to addresses is needed
if self.keystore:
self.keystore.addresses = self.addresses
def save_addresses(self):
self.storage.put('addresses', self.addresses)
def can_change_password(self):
return not self.is_watching_only()
def can_import_address(self):
return self.is_watching_only()
def can_delete_address(self):
return True
def has_seed(self):
return False
def is_deterministic(self):
return False
def is_used(self, address):
return False
def is_change(self, address):
return False
def get_master_public_keys(self):
return []
def is_beyond_limit(self, address, is_change):
return False
def get_fingerprint(self):
return ''
def get_addresses(self, include_change=False):
return sorted(self.addresses.keys())
def get_receiving_addresses(self):
return self.get_addresses()
def get_change_addresses(self):
return []
def import_address(self, address):
if not bitcoin.is_address(address):
return ''
if address in self.addresses:
return ''
self.addresses[address] = {}
self.storage.put('addresses', self.addresses)
self.storage.write()
self.add_address(address)
return address
def delete_address(self, address):
if address not in self.addresses:
return
transactions_to_remove = set() # only referred to by this address
transactions_new = set() # txs that are not only referred to by address
with self.lock:
for addr, details in self.history.items():
if addr == address:
for tx_hash, height in details:
transactions_to_remove.add(tx_hash)
else:
for tx_hash, height in details:
transactions_new.add(tx_hash)
transactions_to_remove -= transactions_new
self.history.pop(address, None)
for tx_hash in transactions_to_remove:
self.remove_transaction(tx_hash)
self.tx_fees.pop(tx_hash, None)
self.verified_tx.pop(tx_hash, None)
self.unverified_tx.pop(tx_hash, None)
self.transactions.pop(tx_hash, None)
# FIXME: what about pruned_txo?
self.storage.put('verified_tx3', self.verified_tx)
self.save_transactions()
self.set_label(address, None)
self.remove_payment_request(address, {})
self.set_frozen_state([address], False)
pubkey = self.get_public_key(address)
self.addresses.pop(address)
if pubkey:
self.keystore.delete_imported_key(pubkey)
self.save_keystore()
self.storage.put('addresses', self.addresses)
self.storage.write()
def get_address_index(self, address):
return self.get_public_key(address)
def get_public_key(self, address):
return self.addresses[address].get('pubkey')
def import_private_key(self, sec, pw, redeem_script=None):
try:
txin_type, pubkey = self.keystore.import_privkey(sec, pw)
except Exception:
raise BaseException('Invalid private key', sec)
if txin_type in ['p2pkh', 'p2wpkh', 'p2wpkh-p2sh']:
if redeem_script is not None:
raise BaseException('Cannot use redeem script with', txin_type, sec)
addr = bitcoin.pubkey_to_address(txin_type, pubkey)
elif txin_type in ['p2sh', 'p2wsh', 'p2wsh-p2sh']:
if redeem_script is None:
raise BaseException('Redeem script required for', txin_type, sec)
addr = bitcoin.redeem_script_to_address(txin_type, redeem_script)
else:
raise NotImplementedError(txin_type)
self.addresses[addr] = {'type':txin_type, 'pubkey':pubkey, 'redeem_script':redeem_script}
self.save_keystore()
self.save_addresses()
self.storage.write()
self.add_address(addr)
return addr
def export_private_key(self, address, password):
d = self.addresses[address]
pubkey = d['pubkey']
redeem_script = d['redeem_script']
sec = pw_decode(self.keystore.keypairs[pubkey], password)
return sec, redeem_script
def get_txin_type(self, address):
return self.addresses[address].get('type', 'address')
def add_input_sig_info(self, txin, address):
if self.is_watching_only():
x_pubkey = 'fd' + address_to_script(address)
txin['x_pubkeys'] = [x_pubkey]
txin['signatures'] = [None]
return
if txin['type'] in ['p2pkh', 'p2wpkh', 'p2wpkh-p2sh']:
pubkey = self.addresses[address]['pubkey']
txin['num_sig'] = 1
txin['x_pubkeys'] = [pubkey]
txin['signatures'] = [None]
else:
redeem_script = self.addresses[address]['redeem_script']
num_sig = 2
num_keys = 3
txin['num_sig'] = num_sig
txin['redeem_script'] = redeem_script
txin['signatures'] = [None] * num_keys
def pubkeys_to_address(self, pubkey):
for addr, v in self.addresses.items():
if v.get('pubkey') == pubkey:
return addr
class Deterministic_Wallet(Abstract_Wallet):
def __init__(self, storage):
Abstract_Wallet.__init__(self, storage)
self.gap_limit = storage.get('gap_limit', 20)
def has_seed(self):
return self.keystore.has_seed()
def is_deterministic(self):
return self.keystore.is_deterministic()
def get_receiving_addresses(self):
return self.receiving_addresses
def get_change_addresses(self):
return self.change_addresses
def get_seed(self, password):
return self.keystore.get_seed(password)
def add_seed(self, seed, pw):
self.keystore.add_seed(seed, pw)
def change_gap_limit(self, value):
'''This method is not called in the code, it is kept for console use'''
if value >= self.gap_limit:
self.gap_limit = value
self.storage.put('gap_limit', self.gap_limit)
return True
elif value >= self.min_acceptable_gap():
addresses = self.get_receiving_addresses()
k = self.num_unused_trailing_addresses(addresses)
n = len(addresses) - k + value
self.receiving_addresses = self.receiving_addresses[0:n]
self.gap_limit = value
self.storage.put('gap_limit', self.gap_limit)
self.save_addresses()
return True
else:
return False
def num_unused_trailing_addresses(self, addresses):
k = 0
for a in addresses[::-1]:
if self.history.get(a):break
k = k + 1
return k
def min_acceptable_gap(self):
# fixme: this assumes wallet is synchronized
n = 0
nmax = 0
addresses = self.get_receiving_addresses()
k = self.num_unused_trailing_addresses(addresses)
for a in addresses[0:-k]:
if self.history.get(a):
n = 0
else:
n += 1
if n > nmax: nmax = n
return nmax + 1
def create_new_address(self, for_change=False):
assert type(for_change) is bool
addr_list = self.change_addresses if for_change else self.receiving_addresses
n = len(addr_list)
x = self.derive_pubkeys(for_change, n)
address = self.pubkeys_to_address(x)
addr_list.append(address)
self.save_addresses()
self.add_address(address)
return address
def synchronize_sequence(self, for_change):
limit = self.gap_limit_for_change if for_change else self.gap_limit
while True:
addresses = self.get_change_addresses() if for_change else self.get_receiving_addresses()
if len(addresses) < limit:
self.create_new_address(for_change)
continue
if list(map(lambda a: self.address_is_old(a), addresses[-limit:] )) == limit*[False]:
break
else:
self.create_new_address(for_change)
def synchronize(self):
with self.lock:
if self.is_deterministic():
self.synchronize_sequence(False)
self.synchronize_sequence(True)
else:
if len(self.receiving_addresses) != len(self.keystore.keypairs):
pubkeys = self.keystore.keypairs.keys()
self.receiving_addresses = [self.pubkeys_to_address(i) for i in pubkeys]
self.save_addresses()
for addr in self.receiving_addresses:
self.add_address(addr)
def is_beyond_limit(self, address, is_change):
addr_list = self.get_change_addresses() if is_change else self.get_receiving_addresses()
i = addr_list.index(address)
prev_addresses = addr_list[:max(0, i)]
limit = self.gap_limit_for_change if is_change else self.gap_limit
if len(prev_addresses) < limit:
return False
prev_addresses = prev_addresses[max(0, i - limit):]
for addr in prev_addresses:
if self.history.get(addr):
return False
return True
def get_master_public_keys(self):
return [self.get_master_public_key()]
def get_fingerprint(self):
return self.get_master_public_key()
def get_txin_type(self, address):
return self.txin_type
class Simple_Deterministic_Wallet(Simple_Wallet, Deterministic_Wallet):
""" Deterministic Wallet with a single pubkey per address """
def __init__(self, storage):
Deterministic_Wallet.__init__(self, storage)
def get_public_key(self, address):
sequence = self.get_address_index(address)
pubkey = self.get_pubkey(*sequence)
return pubkey
def load_keystore(self):
self.keystore = load_keystore(self.storage, 'keystore')
try:
xtype = bitcoin.xpub_type(self.keystore.xpub)
except:
xtype = 'standard'
self.txin_type = 'p2pkh' if xtype == 'standard' else xtype
def get_pubkey(self, c, i):
return self.derive_pubkeys(c, i)
def get_public_keys(self, address):
return [self.get_public_key(address)]
def add_input_sig_info(self, txin, address):
derivation = self.get_address_index(address)
x_pubkey = self.keystore.get_xpubkey(*derivation)
txin['x_pubkeys'] = [x_pubkey]
txin['signatures'] = [None]
txin['num_sig'] = 1
def get_master_public_key(self):
return self.keystore.get_master_public_key()
def derive_pubkeys(self, c, i):
return self.keystore.derive_pubkey(c, i)
class Standard_Wallet(Simple_Deterministic_Wallet):
wallet_type = 'standard'
def pubkeys_to_address(self, pubkey):
return bitcoin.pubkey_to_address(self.txin_type, pubkey)
class Multisig_Wallet(Deterministic_Wallet):
# generic m of n
gap_limit = 20
def __init__(self, storage):
self.wallet_type = storage.get('wallet_type')
self.m, self.n = multisig_type(self.wallet_type)
Deterministic_Wallet.__init__(self, storage)
def get_pubkeys(self, c, i):
return self.derive_pubkeys(c, i)
def pubkeys_to_address(self, pubkeys):
redeem_script = self.pubkeys_to_redeem_script(pubkeys)
return bitcoin.redeem_script_to_address(self.txin_type, redeem_script)
def pubkeys_to_redeem_script(self, pubkeys):
return transaction.multisig_script(sorted(pubkeys), self.m)
def derive_pubkeys(self, c, i):
return [k.derive_pubkey(c, i) for k in self.get_keystores()]
def load_keystore(self):
self.keystores = {}
for i in range(self.n):
name = 'x%d/'%(i+1)
self.keystores[name] = load_keystore(self.storage, name)
self.keystore = self.keystores['x1/']
xtype = bitcoin.xpub_type(self.keystore.xpub)
self.txin_type = 'p2sh' if xtype == 'standard' else xtype
def save_keystore(self):
for name, k in self.keystores.items():
self.storage.put(name, k.dump())
def get_keystore(self):
return self.keystores.get('x1/')
def get_keystores(self):
return [self.keystores[i] for i in sorted(self.keystores.keys())]
def update_password(self, old_pw, new_pw, encrypt=False):
if old_pw is None and self.has_password():
raise InvalidPassword()
for name, keystore in self.keystores.items():
if keystore.can_change_password():
keystore.update_password(old_pw, new_pw)
self.storage.put(name, keystore.dump())
self.storage.set_password(new_pw, encrypt)
self.storage.write()
def has_seed(self):
return self.keystore.has_seed()
def can_change_password(self):
return self.keystore.can_change_password()
def is_watching_only(self):
return not any([not k.is_watching_only() for k in self.get_keystores()])
def get_master_public_key(self):
return self.keystore.get_master_public_key()
def get_master_public_keys(self):
return [k.get_master_public_key() for k in self.get_keystores()]
def get_fingerprint(self):
return ''.join(sorted(self.get_master_public_keys()))
def add_input_sig_info(self, txin, address):
# x_pubkeys are not sorted here because it would be too slow
# they are sorted in transaction.get_sorted_pubkeys
# pubkeys is set to None to signal that x_pubkeys are unsorted
derivation = self.get_address_index(address)
txin['x_pubkeys'] = [k.get_xpubkey(*derivation) for k in self.get_keystores()]
txin['pubkeys'] = None
# we need n place holders
txin['signatures'] = [None] * self.n
txin['num_sig'] = self.m
wallet_types = ['standard', 'multisig', 'imported']
def register_wallet_type(category):
wallet_types.append(category)
wallet_constructors = {
'standard': Standard_Wallet,
'old': Standard_Wallet,
'xpub': Standard_Wallet,
'imported': Imported_Wallet
}
def register_constructor(wallet_type, constructor):
wallet_constructors[wallet_type] = constructor
# former WalletFactory
class Wallet(object):
"""The main wallet "entry point".
This class is actually a factory that will return a wallet of the correct
type when passed a WalletStorage instance."""
def __new__(self, storage):
wallet_type = storage.get('wallet_type')
WalletClass = Wallet.wallet_class(wallet_type)
wallet = WalletClass(storage)
# Convert hardware wallets restored with older versions of
# Electrum to BIP44 wallets. A hardware wallet does not have
# a seed and plugins do not need to handle having one.
rwc = getattr(wallet, 'restore_wallet_class', None)
if rwc and storage.get('seed', ''):
storage.print_error("converting wallet type to " + rwc.wallet_type)
storage.put('wallet_type', rwc.wallet_type)
wallet = rwc(storage)
return wallet
@staticmethod
def wallet_class(wallet_type):
if multisig_type(wallet_type):
return Multisig_Wallet
if wallet_type in wallet_constructors:
return wallet_constructors[wallet_type]
raise RuntimeError("Unknown wallet type: " + wallet_type)
| 1 | 11,976 | Not sure why this change. You forgot to handle the case where the user has dynamic fees disabled and there are no fee estimates available. He should be able to sweep none-the-less (as he is using static fees anyway). The line with `config.fee_per_kb()` below, that you have deleted, handled that. | spesmilo-electrum | py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.