libphutil Technical Documentation
libphutil Technical Documentation
Technical documentation for developers using libphutil.
libphutil Overview
libphutil Overview
Conduit
Conduit
Console
Console
ArcanistGridCellClassArcanistGridColumnClassArcanistGridRowClassArcanistGridViewClassphutil_console_confirm()Functionphutil_console_format()Functionphutil_console_get_terminal_width()FunctionDetermine the width of the terminal, if possible. Returns `null` on failure.phutil_console_prompt()Functionphutil_console_require_tty()Functionphutil_console_select()Functionphutil_console_wrap()FunctionSoft wrap text for display on a console, respecting UTF8 character boundaries
and ANSI color escape sequences.PhutilConsoleClassProvides access to the command-line console. Instead of reading from or
writing to stdin/stdout/stderr directly, this class provides a richer API
including support for ANSI color and formatting, convenience methods for
prompting the user, and the ability to interact with stdin/stdout/stderr
in some other process instead of this one.PhutilConsoleBlockClassPhutilConsoleErrorClassPhutilConsoleFormatterClassPhutilConsoleInfoClassPhutilConsoleListClassPhutilConsoleLogLineClassPhutilConsoleMessageClassPhutilConsoleMetricsClassPhutilConsoleProgressBarClassShow a progress bar on the console. Usage:PhutilConsoleServerClassPhutilConsoleServerChannelClassPhutilConsoleSkipClassPhutilConsoleStdinNotInteractiveExceptionClassThrown when you prompt the user with @{function:phutil_console_prompt} or
@{function:phutil_console_confirm} but stdin is not an interactive TTY so
the user can't possibly respond. Usually this means the user ran the command
with something piped into stdin.PhutilConsoleTableClassShow a table in the console. Usage:PhutilConsoleViewClassPhutilConsoleWarningClassPhutilConsoleWrapTestCaseClassPhutilInteractiveEditorClassEdit a document interactively, by launching $EDITOR (like vi or nano).
Errors
Errors
phlog()Functionlibphutil log function for development debugging. Takes any argument and
forwards it to registered listeners. This is essentially a more powerful
version of `error_log()`.phutil_error_listener_example()FunctionExample @{class:PhutilErrorHandler} error listener callback. When you call
`PhutilErrorHandler::setErrorListener()`, you must pass a callback function
with the same signature as this one.PhutilAggregateExceptionClassException that aggregates other exceptions into a single exception. For
example, if you have several objects which can perform a task and just want
at least one of them to succeed, you can do something like this:PhutilErrorHandlerClassImprove PHP error logs and optionally route errors, exceptions and debugging
information to a central listener.PhutilErrorHandlerTestCaseClassPhutilErrorTrapClassTrap PHP errors while this object is alive, so they can be accessed and
included in exceptions or other types of logging. For example, if you have
code like this:PhutilMethodNotImplementedExceptionClassAn exception thrown when a method is called on a class which does not
provide an implementation for the called method. This is sometimes the case
when a base class expects subclasses to provide their own implementations,
for example.PhutilOpaqueEnvelopeClassOpaque reference to a string (like a password) that won't put any sensitive
data in stack traces, var_dump(), print_r(), error logs, etc. Usage:PhutilOpaqueEnvelopeKeyClassHolds the key for @{class:PhutilOpaqueEnvelope} in a logically distant
location so it will never appear in stack traces, etc. You should never need
to use this class directly. See @{class:PhutilOpaqueEnvelope} for
information about opaque envelopes.PhutilOpaqueEnvelopeTestCaseClassPhutilProxyExceptionClassPrior to PHP 5.3, PHP does not support nested exceptions; this class provides
limited support for nested exceptions. Use methods on
@{class:PhutilErrorHandler} to unnest exceptions in a forward-compatible way.
Filesystem
Filesystem
ArcanistHostMemorySnapshotClassArcanistHostMemorySnapshotTestCaseClassFileFinderClassFind files on disk matching criteria, like the 'find' system utility. Use of
this class is straightforward:FileFinderTestCaseClassFileListClassA list of files, primarily useful for parsing command line arguments. This
class makes it easier to deal with user-specified lists of files and
directories used by command line tools.FilesystemClassSimple wrapper class for common filesystem tasks like reading and writing
files. When things go wrong, this class throws detailed exceptions with
good information about what didn't work.FilesystemExceptionClassException thrown by Filesystem to indicate an error accessing the file
system.FilesystemTestCaseClassLinesOfALargeClassAbstraction for processing large inputs without holding them in memory. This
class implements line-oriented, buffered reads of some external stream, where
a "line" is characterized by some delimiter character. This provides a
straightforward interface for most large-input tasks, with relatively good
performance.LinesOfALargeExecFutureClassRead the output stream of an @{class:ExecFuture} one line at a time. This
abstraction allows you to process large inputs without holding them in
memory. If you know your inputs fit in memory, it is generally more efficient
(and certainly simpler) to read the entire input and `explode()` it. For
more information, see @{class:LinesOfALarge}. See also
@{class:LinesOfALargeFile} for a similar abstraction that works on files.LinesOfALargeExecFutureTestCaseClassLinesOfALargeFileClassRead the lines of a file, one at a time. This allows you to process large
files without holding them in memory. In most cases, it is more efficient
(and certainly simpler) to read the entire file and `explode()` it. For more
information, see @{class:LinesOfALarge}. See also
@{class:LinesOfALargeExecFuture}, for a similar abstraction that works on
executed commands.LinesOfALargeFileTestCaseClassPhutilBinaryAnalyzerClassPhutilBinaryAnalyzerTestCaseClassPhutilDeferredLogClassObject that writes to a logfile when it is destroyed. This allows you to add
more data to the log as execution unfolds, while still ensuring a write in
normal circumstances (see below for discussion of cases where writes may not
occur).PhutilDeferredLogTestCaseClassPhutilDiffBinaryAnalyzerClassPhutilDirectoryFixtureClassPhutilErrorLogClassPhutilFileLockClassWrapper around `flock()` for advisory filesystem locking. Usage is
straightforward:PhutilFileLockTestCaseClassPhutilGitBinaryAnalyzerClassPhutilLockClassBase class for locks, like file locks.PhutilLockExceptionClassPhutilMercurialBinaryAnalyzerClassPhutilProcessQueryClassPhutilProcessRefClassPhutilProcessRefTestCaseClassPhutilPygmentizeBinaryAnalyzerClassPhutilSubversionBinaryAnalyzerClassTempFileClassSimple wrapper to create a temporary file and guarantee it will be deleted on
object destruction. Used like a string to path:
Futures
Futures
Using FuturesArticleOverview of how futures work in libphutil.BaseHTTPFutureClassExecute HTTP requests with a future-oriented API. For example:CommandExceptionClassException thrown when a system command fails.exec_manual()FunctionExecute a command and capture stdout, stderr, and the return value.ExecFutureClassExecute system commands in parallel using futures.ExecFutureTestCaseClassExecPassthruTestCaseClassexecx()FunctionExecute a command and capture stdout and stderr. If the command exits with
a nonzero error code, a @{class:CommandException} will be thrown. If you need
to manually handle error conditions, use @{function:exec_manual}.FutureClassA 'future' or 'promise' is an object which represents the result of some
pending computation. For a more complete overview of futures, see
@{article:Using Futures}.FutureIteratorClassFutureIterator aggregates @{class:Future}s and allows you to respond to them
in the order they resolve. This is useful because it minimizes the amount of
time your program spends waiting on parallel processes.FutureIteratorTestCaseClassFuturePoolClassFutureProxyClassWraps another @{class:Future} and allows you to post-process its result once
it resolves.HTTPFutureClassSocket-based HTTP future, for making HTTP requests using future semantics.
This is an alternative to @{class:CURLFuture} which has better resolution
behavior (select()-based wait instead of busy wait) but fewer features. You
should prefer this class to @{class:CURLFuture} unless you need its advanced
features (like HTTP/1.1, chunked transfer encoding, gzip, etc.).HTTPFutureCertificateResponseStatusClassHTTPFutureCURLResponseStatusClassHTTPFutureHTTPResponseStatusClassHTTPFutureParseResponseStatusClassHTTPFutureResponseStatusClassHTTPFutureTransportResponseStatusClassHTTPSFutureClassVery basic HTTPS future.ImmediateFutureClassDegenerate future which returns an already-existing result without performing
any computation.MethodCallFutureClassDegenerate future which resolves by calling a method.MethodCallFutureTestCaseClassphutil_get_signal_name()FunctionReturn a human-readable signal name (like "SIGINT" or "SIGKILL") for a given
signal number.phutil_passthru()FunctionWrapper for @{class:PhutilExecPassthru}.PhutilAsanaFutureClassPhutilAWSCloudFormationFutureClassPhutilAWSCloudWatchFutureClassPhutilAWSEC2FutureClassPhutilAWSExceptionClassPhutilAWSFutureClassPhutilAWSManagementWorkflowClassPhutilAWSS3DeleteManagementWorkflowClassPhutilAWSS3FutureClassPhutilAWSS3GetManagementWorkflowClassPhutilAWSS3ManagementWorkflowClassPhutilAWSS3PutManagementWorkflowClassPhutilAWSv4SignatureClassPhutilAWSv4SignatureTestCaseClassPhutilBacktraceSignalHandlerClassSignal handler for SIGHUP which prints the current backtrace out to a
file. This is particularly helpful in debugging hung/spinning processes.PhutilCallbackSignalHandlerClassPhutilCloudWatchMetricClassPhutilConsoleMetricsSignalHandlerClassPhutilExecPassthruClassExecute a command which takes over stdin, stdout and stderr, similar to
`passthru()`, but which preserves TTY semantics, escapes arguments, and is
traceable.PhutilExecutableFutureClassPhutilGitHubFutureClassPhutilGitHubResponseClassPhutilHTTPEngineExtensionClassExtend HTTP behavior by injecting proxies or compromising SSL.PhutilOAuth1FutureClassProxy future that implements OAuth1 request signing. For references, see:PhutilOAuth1FutureTestCaseClassPhutilPayPalAPIFutureClassPhutilPostmarkFutureClassPhutilSignalHandlerClassPhutilSignalRouterClassPhutilSlackFutureClassPhutilTwitchFutureClassPhutilWordPressFutureClass
Internationalization
Internationalization
ArcanistUSEnglishTranslationClassLibphutilUSEnglishTranslationClasspht()FunctionTranslate a string. It uses a translator set by
`PhutilTranslator::setInstance()` or translations specified by
`PhutilTranslator::getInstance()->setTranslations()` and language rules set
by `PhutilTranslator::getInstance()->setLocale()`.pht_list()Functionphutil_count()FunctionCount all elements in an array, or something in an object.phutil_person()FunctionProvide a gendered argument to the translation engine.PhutilAllCapsEnglishLocaleClassA test locale which transforms strings into uppercase.PhutilBritishEnglishLocaleClassSerious, legitimate British English locale.PhutilCzechLocaleClassLocale for "Czech (Czech Republic)".PhutilEmojiLocaleClassA picture is worth a thousand words.PhutilEnglishCanadaLocaleClassLocale for "English (Canada)".PhutilFrenchLocaleClassLocale for "French (France)".PhutilGermanLocaleClassLocale for "German (Germany)".PhutilKoreanLocaleClassThe Korean (Republic of Korea) LocalePhutilLocaleClassDefines a locale for translations.PhutilLocaleTestCaseClassPhutilNumberClassPhutilPersonInterfacePhutilPersonTestClassPhutilPhtTestCaseClassTest cases for functions in pht.php.PhutilPirateEnglishLocaleClassArrr!PhutilPortugueseBrazilLocaleClassLocale for "Portuguese (Brazil)".PhutilPortuguesePortugalLocaleClassLocale for "Portuguese (Portugal)".PhutilRawEnglishLocaleClassA test locale which displays the raw strings which are fed into
the translation engine.PhutilSimplifiedChineseLocaleClassLocale for "Chinese (Simplified)".PhutilSpanishSpainLocaleClassThe Spanish (Spain) LocalePhutilTraditionalChineseLocaleClassLocale for "Chinese (Traditional)".PhutilTranslationClassPhutilTranslationTestCaseClassPhutilTranslatorClassPhutilTranslatorTestCaseClassPhutilUSEnglishLocaleClassThe default English locale.PhutilVeryWowEnglishLocaleClassMuch locale! Very English! Wow!
Lexers
Lexers
PhutilJavaFragmentLexerClassPhutilJSONFragmentLexerClassSyntax highlighting lexer for JSON fragments.PhutilLexerClassSlow, inefficient regexp-based lexer. Define rules like this:PhutilPHPFragmentLexerClassPHP lexer which can handle fragments of source code, e.g. for syntax
highlighting of inline snippets. This is largely based on Pygments, but
alters some rules to better annotate symbols from source fragments.PhutilPHPFragmentLexerTestCaseClassPhutilPythonFragmentLexerClassPython lexer which can handle fragments of source code, e.g. for syntax
highlighting of inline snippets. This is largely based on Pygments:PhutilShellLexerClassLexer for shell-like argument strings. Somewhat similar to Python's shlex.PhutilShellLexerTestCaseClassPhutilSimpleOptionsLexerClassLexer for simple options, like:PhutilSimpleOptionsLexerTestCaseClassPhutilTypeLexerClassLexer for a simple type grammar. See @{class:PhutilTypeSpec} for a
description.
libphutil Library System
libphutil Library System
Parsers
Parsers
AASTNodeClassAASTNodeListClassAASTTokenClassAASTTreeClassAn abstract abstract syntax tree.ArcanistBaseCommitParserClassArcanistBaseCommitParserTestCaseClassArcanistBundleClassConverts changesets between different formats.ArcanistBundleTestCaseClassArcanistCommentRemoverClassArcanistCommentRemoverTestCaseClassArcanistDiffChangeClassRepresents a change to an individual path.ArcanistDiffChangeTypeClassDefines constants for file types and operations in changesets.ArcanistDiffHunkClassRepresents a contiguous set of added and removed lines in a diff.ArcanistDiffParserClassParses diffs from a working copy.ArcanistDiffParserTestCaseClassTest cases for @{class:ArcanistDiffParser}.PHPASTParserTestCaseClassPhutilArgumentParserClassParser for command-line arguments for scripts. Like similar parsers, this
class allows you to specify, validate, and render help for command-line
arguments. For example:PhutilArgumentParserExceptionClassPhutilArgumentParserTestCaseClassPhutilArgumentSpecificationClassPhutilArgumentSpecificationExceptionClassPhutilArgumentSpecificationTestCaseClassPhutilArgumentSpellingCorrectorClassPhutilArgumentSpellingCorrectorTestCaseClassPhutilArgumentUsageExceptionClassPhutilArgumentWorkflowClassUsed with @{class:PhutilArgumentParser} to build command line tools which
operate in several modes, called "workflows", like `git`, `svn`, `arc`,
`apt-get`. For example, you might build a simple calculator like this:PhutilBugtraqParserClassReplaces ticket or issue IDs in a block of text with links. This mechanism
is based on (and compatible with) the Bugtraq system in TortiseSVN. SeePhutilBugtraqParserTestCaseClassPhutilDocblockParserClassParse a docblock comment from source code into raw text documentation and
metadata (like "@author" and "@return").PhutilDocblockParserTestCaseClassTest cases for @{class:PhutilDocblockParser}.PhutilDOMNodeClassPhutilEditorConfigClassParser for [[http://editorconfig.org/ | EditorConfig]] files.PhutilEditorConfigTestCaseClassPhutilEmailAddressClassBasic email address parser. This parser is very liberal and does not attempt
to be fully RFC-compliant, because trying to do so is a crazy mess. However,
it should parse all reasonable addresses which are actually in use on the
internet today.PhutilEmailAddressTestCaseClassTest cases for @{class:PhutilEmailAddress} parser.PhutilGitURIClassParser for the alternate URI scheme used by SCP and Git, which look
like this:PhutilGitURITestCaseClassPhutilHelpArgumentWorkflowClassPhutilHTMLParserClassPhutilHTMLParserTestCaseClassPhutilHTTPResponseClassPhutilHTTPResponseParserClassPhutilHTTPResponseParserTestCaseClassPhutilINIParserExceptionClassPhutilInvalidRuleParserGeneratorExceptionClassPhutilIrreducibleRuleParserGeneratorExceptionClassPhutilJSONClassUtilities for wrangling JSON.PhutilJSONParserClassA JSON parser.PhutilJSONParserExceptionClassPhutilJSONParserTestCaseClassPhutilJSONTestCaseClassPhutilLanguageGuesserClassVery simple class to guess the languages of source files which we failed to
determine by examining file name/extension rules.PhutilLanguageGuesserTestCaseClassPhutilParserGeneratorClassSimple LR(1) parser generator. Generally, build a parser by setting terminals
and rules, then calling @{method:processGrammar}. For example, here is a
simple grammar which accepts one or more "a" followed by exactly one "b":PhutilParserGeneratorExceptionClassPhutilParserGeneratorTestCaseClassPhutilQueryStringParserClassUtilities for parsing HTTP query strings.PhutilQueryStringParserTestCaseClassTest cases for @{class:PhutilQueryStringParser} parser.PhutilSimpleOptionsClassUtilities for parsing simple option lists used in Remarkup, like codeblocks:PhutilSimpleOptionsTestCaseClassPhutilTypeCheckExceptionClassPhutilTypeExtraParametersExceptionClassPhutilTypeMissingParametersExceptionClassPhutilTypeSpecClassPerform type checks using a simple type grammar. The grammar supports the
following basic types:PhutilTypeSpecTestCaseClassPhutilUnknownSymbolParserGeneratorExceptionClassPhutilUnreachableRuleParserGeneratorExceptionClassPhutilUnreachableTerminalParserGeneratorExceptionClassPhutilURIClassStructural representation of a URI.PhutilURITestCaseClassTest cases for @{class:PhutilURI} parser.PhutilXHPASTBinaryClassXHPASTNodeClassXHPASTNodeTestCaseClassXHPASTSyntaxErrorExceptionClassXHPASTTokenClassXHPASTTreeClassXHPASTTreeTestCaseClass
Phage
Phage
PhageActionClassPhageAgentActionClassPhageAgentBootloaderClassPhageAgentTestCaseClassPhageExecuteActionClassPhageExecWorkflowClassPhageLocalActionClassPhagePHPAgentClassPhagePHPAgentBootloaderClassPhagePlanActionClassPhageToolsetClassPhageWorkflowClassPhutilBallOfPHPClassConcatenates PHP files together into a single stream. Used by Phage to
transmit bootloading code.
Core Utilities
Core Utilities
Core Utilities Quick ReferenceArticleSummary of libphutil core utilities.AbstractDirectedGraphClassModels a directed graph in a generic way that works well with graphs stored
in a database, and allows you to perform operations like cycle detection.AbstractDirectedGraphTestCaseClassArcanistNonblockingGuardClassarray_fuse()FunctionSimplifies a common use of `array_combine()`. Specifically, this:array_interleave()FunctionAdd an element between every two elements of some array. That is, given a
list `A, B, C, D`, and some element to interleave, `x`, this function returns
`A, x, B, x, C, x, D`. This works like `implode()`, but does not concatenate
the list into a string. In particular:array_mergev()FunctionMerge a vector of arrays performantly. This has the same semantics as
array_merge(), so these calls are equivalent:array_select_keys()FunctionSelects a list of keys from an array, returning a new array with only the
key-value pairs identified by the selected keys, in the specified order.assert_instances_of()FunctionChecks if all values of array are instances of the passed class. Throws
`InvalidArgumentException` if it isn't true for any value.assert_same_keys()FunctionAssert that two arrays have the exact same keys, in any order.assert_stringlike()FunctionAssert that passed data can be converted to string.CaseInsensitiveArrayClassA case-insensitive associative array.CaseInsensitiveArrayTestCaseClasscoalesce()FunctionReturns the first argument which is not strictly null, or `null` if there
are no such arguments. Identical to the MySQL function of the same name.head()FunctionReturns the first element of an array. Exactly like reset(), but doesn't
choke if you pass it some non-referenceable value like the return value of
a function.head_key()FunctionReturns the first key of an array.id()FunctionIdentity function, returns its argument unmodified.idx()FunctionAccess an array index, retrieving the value stored there if it exists or
a default if it does not. This function allows you to concisely access an
index which may or may not exist without raising a warning.idxv()FunctionAccess a sequence of array indexes, retrieving a deeply nested value if
it exists or a default if it does not.ifilter()FunctionFilter a list of arrays by removing the ones with an empty() value for some
index. This function works just like @{function:mfilter}, except that it
operates on a list of arrays instead of a list of objects.igroup()FunctionGroup a list of arrays by the value of some index. This function is the same
as @{function:mgroup}, except it operates on the values of array indexes
rather than the return values of method calls.ipull()FunctionChoose an index from a list of arrays. Short for "index pull", this function
works just like @{function:mpull}, except that it operates on a list of
arrays and selects an index from them instead of operating on a list of
objects and calling a method on them.isort()FunctionSort a list of arrays by the value of some index. This method is identical to
@{function:msort}, but operates on a list of arrays instead of a list of
objects.last()FunctionReturns the last element of an array. This is exactly like `end()` except
that it won't warn you if you pass some non-referencable array to
it -- e.g., the result of some other array operation.last_key()FunctionReturns the last key of an array.mfilter()FunctionFilter a list of objects by executing a method across all the objects and
filter out the ones with empty() results. this function works just like
@{function:ifilter}, except that it operates on a list of objects instead
of a list of arrays.MFilterTestHelperClassmgroup()FunctionGroup a list of objects by the result of some method, similar to how
GROUP BY works in an SQL query. This function simplifies grouping objects
by some property:mpull()FunctionCall a method on a list of objects. Short for "method pull", this function
works just like @{function:ipull}, except that it operates on a list of
objects instead of a list of arrays. This function simplifies a common type
of mapping operation:msort()FunctionSort a list of objects by the return value of some method. In PHP, this is
often vastly more efficient than `usort()` and similar.msortv()FunctionSort a list of objects by a sort vector.msortv_internal()Functionmsortv_natural()Functionnewv()FunctionInvokes the "new" operator with a vector of arguments. There is no way to
`call_user_func_array()` on a class constructor, so you can instead use this
function:nonempty()FunctionSimilar to @{function:coalesce}, but less strict: returns the first
non-`empty()` argument, instead of the first argument that is strictly
non-`null`. If no argument is nonempty, it returns the last argument. This
is useful idiomatically for setting defaults:phutil_build_http_querystring()FunctionBuild a query string from a dictionary.phutil_build_http_querystring_from_pairs()FunctionBuild a query string from a list of parameter pairs.phutil_censor_credentials()FunctionAttempt to censor any plaintext credentials from a string.phutil_date_format()Functionphutil_decode_mime_header()Functionphutil_describe_type()FunctionReturn a short, human-readable description of an object's type.phutil_encode_log()Functionphutil_escape_uri()FunctionEscape text for inclusion in a URI or a query parameter. Note that this
method does NOT escape '/', because "%2F" is invalid in paths and Apache
will automatically 404 the page if it's present. This will produce correct
(the URIs will work) and desirable (the URIs will be readable) behavior in
these cases:phutil_escape_uri_path_component()FunctionEscape text for inclusion as an infix URI substring. See discussion at
@{function:phutil_escape_uri}. This function covers an unusual special case;
@{function:phutil_escape_uri} is usually the correct function to use.phutil_fnmatch()FunctionAn improved version of `fnmatch`.phutil_format_bytes()FunctionFormat a byte count for human consumption, e.g. "10MB" instead of
"10485760".phutil_format_relative_time()Functionphutil_format_relative_time_detailed()FunctionFormat a relative time (duration) into weeks, days, hours, minutes,
seconds, but unlike phabricator_format_relative_time, does so for more than
just the largest unit.phutil_format_units_generic()Functionphutil_fwrite_nonblocking_stream()FunctionPerform an `fwrite()` which distinguishes between EAGAIN and EPIPE.phutil_get_system_locale()FunctionReturn the current system locale setting (LC_ALL).phutil_glue()FunctionInsert a value in between each pair of elements in a list.phutil_hashes_are_identical()FunctionCompare two hashes for equality.phutil_http_parameter_pair()FunctionTypecheck and cast an HTTP key-value parameter pair.phutil_ini_decode()FunctionDecode an INI string.phutil_is_hiphop_runtime()Functionphutil_is_interactive()Functionphutil_is_natural_list()FunctionTest if a list has the natural numbers (1, 2, 3, and so on) as keys, in
order.phutil_is_noninteractive()Functionphutil_is_system_locale_available()FunctionTest if a system locale (LC_ALL) is available on the system.phutil_is_utf8()FunctionDetermine if a string is valid UTF-8.phutil_is_utf8_slowly()FunctionDetermine if a string is valid UTF-8, slowly.phutil_is_utf8_with_only_bmp_characters()FunctionDetermine if a string is valid UTF-8, with only basic multilingual plane
characters. This is particularly important because MySQL's `utf8` column
types silently truncate strings which contain characters outside of this
set.phutil_is_windows()Functionphutil_json_decode()FunctionDecode a JSON dictionary.phutil_json_encode()FunctionEncode a value in JSON, raising an exception if it can not be encoded.phutil_loggable_string()FunctionConverts a string to a loggable one, with unprintables and newlines escaped.phutil_microseconds_since()FunctionCompute the number of microseconds that have elapsed since an earlier
timestamp (from `microtime(true)`).phutil_nonempty_scalar()FunctionTest if a value is a nonempty, scalar value.phutil_nonempty_string()FunctionTest if a value is a nonempty string.phutil_nonempty_stringlike()FunctionTest if a value is a nonempty, stringlike value.phutil_parse_bytes()FunctionParse a human-readable byte description (like "6MB") into an integer.phutil_partition()Functionphutil_preg_match()Functionphutil_preg_match_all()Functionphutil_raise_preg_exception()Functionphutil_set_system_locale()FunctionSet the system locale (LC_ALL) to a particular value.phutil_split_lines()FunctionSplit a corpus of text into lines. This function splits on "\n", "\r\n", or
a mixture of any of them.phutil_string_cast()FunctionPerform a "(string)" cast without disabling standard exception behavior.phutil_unescape_uri_path_component()FunctionUnescape text that was escaped by
@{function:phutil_escape_uri_path_component}. See
@{function:phutil_escape_uri} for discussion.phutil_units()FunctionConvert a human-readable unit description into a numeric one. This function
allows you to replace this:phutil_utf8_console_strlen()FunctionFind the console display length of a UTF-8 string. This may differ from the
character length of the string if it contains double-width characters, like
many Chinese characters.phutil_utf8_convert()FunctionConvert a string from one encoding (like ISO-8859-1) to another encoding
(like UTF-8).phutil_utf8_encode_codepoint()FunctionConvert a Unicode codepoint into a UTF8-encoded string.phutil_utf8_hard_wrap()FunctionHard-wrap a block of UTF-8 text with no embedded HTML tags and entities.phutil_utf8_hard_wrap_html()FunctionHard-wrap a block of UTF-8 text with embedded HTML tags and entities.phutil_utf8_is_cjk()FunctionTest if a string contains Chinese, Japanese, or Korean characters.phutil_utf8_is_combining_character()FunctionDetermine if a given unicode character is a combining character or not.phutil_utf8_strlen()FunctionFind the character length of a UTF-8 string.phutil_utf8_strtolower()FunctionConvert a string to lower case in a UTF8-aware way. Similar to
@{function:strtolower}.phutil_utf8_strtoupper()FunctionConvert a string to upper case in a UTF8-aware way. Similar to
@{function:strtoupper}.phutil_utf8_strtr()FunctionReplace characters in a string in a UTF-aware way. Similar to
@{function:strtr}.phutil_utf8_ucwords()FunctionConvert a string to title case in a UTF8-aware way. This function doesn't
necessarily do a great job, but the builtin implementation of `ucwords()` can
completely destroy inputs, so it just has to be better than that. Similar to
@{function:ucwords}.phutil_utf8ize()FunctionConvert a string into valid UTF-8. This function is quite slow.phutil_utf8v()FunctionSplit a UTF-8 string into an array of characters. Combining characters are
also split.phutil_utf8v_codepoints()FunctionSplit a UTF-8 string into an array of codepoints (as integers).phutil_utf8v_combine_characters()FunctionMerge combining characters in a UTF-8 string.phutil_utf8v_combined()FunctionSplit a UTF-8 string into an array of characters. Combining characters
are not split.phutil_validate_json()FunctionProduce a human-readable explanation why a value can not be JSON-encoded.phutil_var_export()FunctionReturns a parsable string representation of a variable.PhutilArrayClassAbstract base class for implementing objects that behave like arrays. This
class wraps a basic array and provides trivial implementations for
`Countable`, `ArrayAccess` and `Iterator`, so subclasses need only implement
specializations.PhutilArrayCheckClassPhutilArrayTestCaseClassTest cases for @{class:PhutilArray} subclasses.PhutilArrayWithDefaultValueClassArray-like object with a default value that is populated when nonexistent
keys are accessed. This is particularly useful to avoid constructs like this:PhutilBufferedIteratorClassSimple iterator that loads results page-by-page and handles buffering. In
particular, this maps well to iterators that load database results page
by page and allows you to implement an iterator over a large result set
without needing to hold the entire set in memory.PhutilBufferedIteratorTestCaseClassTest cases for @{class:PhutilExampleBufferedIterator}.PhutilCallbackFilterIteratorClassNOTE: This class has the same purpose as `CallbackFilterIterator` in PHP 5.4.PhutilChunkedIteratorClassThis is an iterator version of `array_chunk()`.PhutilChunkedIteratorTestCaseClassTest cases for @{class:PhutilChunkedIterator}.PhutilCowsayClassParser and renderer for ".cow" files used by the `cowsay` program.PhutilCowsayTestCaseClassPhutilDirectedScalarGraphClassConcrete subclass of @{class:AbstractDirectedGraph} which can not load any
data from external sources.PhutilEditDistanceMatrixClassCompute edit distance between two scalar sequences. This class uses
Levenshtein (or Damerau-Levenshtein) to compute the edit distance between
two inputs. The inputs are arrays containing any scalars (not just strings)
so it can be used with, e.g., utf8 sequences.PhutilEditDistanceMatrixTestCaseClassPhutilExampleBufferedIteratorClassExample implementation and test case for @{class:PhutilBufferedIterator}.PhutilExecutionEnvironmentClassGet information about the current execution environment.PhutilHashingIteratorClassPhutilHashingIteratorTestCaseClassPhutilLunarPhaseClassCompute the phase of the terran moon for a given epoch.PhutilLunarPhaseTestCaseClassPhutilProxyIteratorClassPhutilRopeClassString-like object which reduces the cost of managing large strings. This
is particularly useful for buffering large amounts of data that is being
passed to `fwrite()`.PhutilRopeTestCaseClassPhutilSortVectorClassPhutilStreamIteratorClassPhutilSystemClassInteract with the operating system.PhutilSystemTestCaseClassPhutilUTF8StringTruncatorClassTruncate a UTF-8 string to a some maximum number of bytes, codepoints, or
glyphs.PhutilUTF8TestCaseClassTest cases for functions in utf8.php.PhutilUtilsTestCaseClassTest cases for functions in utils.php.ppull()FunctionAccess a property on a list of objects. Short for "property pull", this
function works just like @{function:mpull}, except that it accesses object
properties instead of methods. This function simplifies a common type of
mapping operation:TestAbstractDirectedGraphClass
Free Radicals
Free Radicals
__phutil_autoload()FunctionArcanistAbstractMethodBodyXHPASTLinterRuleClassArcanistAbstractMethodBodyXHPASTLinterRuleTestCaseClassArcanistAbstractPrivateMethodXHPASTLinterRuleClassArcanistAbstractPrivateMethodXHPASTLinterRuleTestCaseClassArcanistAliasClassArcanistAliasEffectClassArcanistAliasEngineClassArcanistAliasesConfigOptionClassArcanistAliasFunctionXHPASTLinterRuleClassArcanistAliasFunctionXHPASTLinterRuleTestCaseClassArcanistAliasWorkflowClassManages aliases for commands with options.ArcanistAmendWorkflowClassArcanistAnoidWorkflowClassArcanistArcConfigurationEngineExtensionClassArcanistArcToolsetClassArcanistArcWorkflowClassArcanistArrayCombineXHPASTLinterRuleClassArcanistArrayCombineXHPASTLinterRuleTestCaseClassArcanistArrayIndexSpacingXHPASTLinterRuleClassArcanistArrayIndexSpacingXHPASTLinterRuleTestCaseClassArcanistArraySeparatorXHPASTLinterRuleClassArcanistArraySeparatorXHPASTLinterRuleTestCaseClassArcanistArrayValueXHPASTLinterRuleClassArcanistArrayValueXHPASTLinterRuleTestCaseClassArcanistBaseXHPASTLinterClassArcanistBinaryExpressionSpacingXHPASTLinterRuleClassArcanistBinaryExpressionSpacingXHPASTLinterRuleTestCaseClassArcanistBinaryNumericScalarCasingXHPASTLinterRuleClassArcanistBinaryNumericScalarCasingXHPASTLinterRuleTestCaseClassArcanistBlacklistedFunctionXHPASTLinterRuleClassArcanistBlacklistedFunctionXHPASTLinterRuleTestCaseClassArcanistBlindlyTrustHTTPEngineExtensionClassArcanistBookmarksWorkflowClassArcanistBoolConfigOptionClassArcanistBraceFormattingXHPASTLinterRuleClassArcanistBraceFormattingXHPASTLinterRuleTestCaseClassArcanistBranchesWorkflowClassArcanistBrowseCommitHardpointQueryClassArcanistBrowseCommitURIHardpointQueryClassArcanistBrowseObjectNameURIHardpointQueryClassArcanistBrowsePathURIHardpointQueryClassArcanistBrowseRefClassArcanistBrowseRefInspectorClassArcanistBrowseRevisionURIHardpointQueryClassArcanistBrowseURIHardpointQueryClassArcanistBrowseURIRefClassArcanistBrowseWorkflowClassBrowse files or objects in the Phabricator web interface.ArcanistBuildableBuildsHardpointQueryClassArcanistBuildableRefClassArcanistBuildableSymbolRefClassArcanistBuildBuildplanHardpointQueryClassArcanistBuildPlanRefClassArcanistBuildPlanSymbolRefClassArcanistBuildRefClassArcanistBuildSymbolRefClassArcanistCallConduitWorkflowClassArcanistCallParenthesesXHPASTLinterRuleClassArcanistCallParenthesesXHPASTLinterRuleTestCaseClassArcanistCallTimePassByReferenceXHPASTLinterRuleClassArcanistCallTimePassByReferenceXHPASTLinterRuleTestCaseClassArcanistCapabilityNotSupportedExceptionClassArcanistCastSpacingXHPASTLinterRuleClassArcanistCastSpacingXHPASTLinterRuleTestCaseClassArcanistCheckstyleXMLLintRendererClassArcanistChmodLinterClassEnsures that files are not executable unless they are either binary or
contain a shebang.ArcanistChmodLinterTestCaseClassArcanistClassExtendsObjectXHPASTLinterRuleClassArcanistClassExtendsObjectXHPASTLinterRuleTestCaseClassArcanistClassFilenameMismatchXHPASTLinterRuleClassLint that if the file declares exactly one interface or class, the name of
the file matches the name of the class, unless the class name is funky like
an XHP element.ArcanistClassMustBeDeclaredAbstractXHPASTLinterRuleClassArcanistClassMustBeDeclaredAbstractXHPASTLinterRuleTestCaseClassArcanistClassNameLiteralXHPASTLinterRuleClassArcanistClassNameLiteralXHPASTLinterRuleTestCaseClassArcanistCloseRevisionWorkflowClassExplicitly closes Differential revisions.ArcanistClosureLinterClassUses `gjslint` to detect errors and potential problems in JavaScript code.ArcanistClosureLinterTestCaseClassArcanistCoffeeLintLinterClassArcanistCoffeeLintLinterTestCaseClassArcanistCommandClassArcanistCommentSpacingXHPASTLinterRuleClassArcanistCommentStyleXHPASTLinterRuleClassArcanistCommentStyleXHPASTLinterRuleTestCaseClassArcanistCommitGraphClassArcanistCommitGraphPartitionClassArcanistCommitGraphPartitionQueryClassArcanistCommitGraphQueryClassArcanistCommitGraphSetClassArcanistCommitGraphSetQueryClassArcanistCommitGraphSetTreeViewClassArcanistCommitGraphSetViewClassArcanistCommitGraphTestCaseClassArcanistCommitNodeClassArcanistCommitRefClassArcanistCommitSymbolRefClassArcanistCommitSymbolRefInspectorClassArcanistCommitUpstreamHardpointQueryClassArcanistCommitWorkflowClassExecutes "svn commit" once a revision has been "Accepted".ArcanistCompilerLintRendererClassArcanistComposerLinterClassArcanistComprehensiveLintEngineClassBasic lint engine which just applies several linters based on the file types.ArcanistConcatenationOperatorXHPASTLinterRuleClassArcanistConcatenationOperatorXHPASTLinterRuleTestCaseClassArcanistConduitAuthenticationExceptionClassArcanistConfigOptionClassArcanistConfigurationClassRuntime workflow configuration. In Arcanist, commands you type like
"arc diff" or "arc lint" are called "workflows". This class allows you to add
new workflows (and extend existing workflows) by subclassing it and then
pointing to your subclass in your project configuration.ArcanistConfigurationDrivenLintEngineClassArcanistConfigurationDrivenUnitTestEngineClassArcanistConfigurationEngineClassArcanistConfigurationEngineExtensionClassArcanistConfigurationManagerClassThis class holds everything related to configuration and configuration files.ArcanistConfigurationSourceClassArcanistConfigurationSourceListClassArcanistConfigurationSourceValueClassArcanistConsoleLintRendererClassArcanistConsoleLintRendererTestCaseClassArcanistConstructorParenthesesXHPASTLinterRuleClassArcanistConstructorParenthesesXHPASTLinterRuleTestCaseClassArcanistContinueInsideSwitchXHPASTLinterRuleClassArcanistContinueInsideSwitchXHPASTLinterRuleTestCaseClassArcanistControlStatementSpacingXHPASTLinterRuleClassArcanistControlStatementSpacingXHPASTLinterRuleTestCaseClassArcanistCoverWorkflowClassCovers your professional reputation by blaming changes to locate reviewers.ArcanistCppcheckLinterClassUses Cppcheck to do basic checks in a C++ file.ArcanistCppcheckLinterTestCaseClassArcanistCpplintLinterClassUses Google's `cpplint.py` to check code.ArcanistCpplintLinterTestCaseClassArcanistCSharpLinterClassC# linter for Arcanist.ArcanistCSSLintLinterClassUses "CSS Lint" to detect checkstyle errors in CSS code.ArcanistCSSLintLinterTestCaseClassArcanistCurlyBraceArrayIndexXHPASTLinterRuleClassArcanistCurlyBraceArrayIndexXHPASTLinterRuleTestCaseClassArcanistDeclarationParenthesesXHPASTLinterRuleClassArcanistDeclarationParenthesesXHPASTLinterRuleTestCaseClassArcanistDefaultParametersXHPASTLinterRuleClassArcanistDefaultParametersXHPASTLinterRuleTestCaseClassArcanistDefaultsConfigurationSourceClassArcanistDeprecationXHPASTLinterRuleClassArcanistDeprecationXHPASTLinterRuleTestCaseClassArcanistDictionaryConfigurationSourceClassArcanistDiffByteSizeExceptionClassArcanistDifferentialCommitMessageClassRepresents a parsed commit message.ArcanistDifferentialCommitMessageParserExceptionClassThrown when a commit message isn't parseable.ArcanistDifferentialDependencyGraphClassArcanistDifferentialRevisionHashClassArcanistDifferentialRevisionStatusClassArcanistDiffUtilsClassDumping ground for diff- and diff-algorithm-related miscellany.ArcanistDiffUtilsTestCaseClassTest cases for @{class:ArcanistDiffUtils}.ArcanistDiffVectorNodeClassArcanistDiffVectorTreeClassArcanistDiffWorkflowClassSends changes from your working copy to Differential for code review.ArcanistDoubleQuoteXHPASTLinterRuleClassArcanistDoubleQuoteXHPASTLinterRuleTestCaseClassArcanistDownloadWorkflowClassArcanistDuplicateKeysInArrayXHPASTLinterRuleClassFinds duplicate keys in array initializers, as in
`array(1 => 'anything', 1 => 'foo')`. Since the first entry is ignored, this
is almost certainly an error.ArcanistDuplicateKeysInArrayXHPASTLinterRuleTestCaseClassArcanistDuplicateSwitchCaseXHPASTLinterRuleClassArcanistDuplicateSwitchCaseXHPASTLinterRuleTestCaseClassArcanistDynamicDefineXHPASTLinterRuleClassArcanistDynamicDefineXHPASTLinterRuleTestCaseClassArcanistEachUseXHPASTLinterRuleClassArcanistEachUseXHPASTLinterRuleTestCaseClassArcanistElseIfUsageXHPASTLinterRuleClassArcanistElseIfUsageXHPASTLinterRuleTestCaseClassArcanistEmptyFileXHPASTLinterRuleClassArcanistEmptyStatementXHPASTLinterRuleClassArcanistEmptyStatementXHPASTLinterRuleTestCaseClassArcanistEventTypeClassArcanistExitExpressionXHPASTLinterRuleClassExit is parsed as an expression, but using it as such is almost always
wrong. That is, this is valid:ArcanistExitExpressionXHPASTLinterRuleTestCaseClassArcanistExportWorkflowClassExports changes from Differential or the working copy to a file.ArcanistExternalLinterClassBase class for linters which operate by invoking an external program and
parsing results.ArcanistExternalLinterTestCaseClassArcanistExtractUseXHPASTLinterRuleClassArcanistExtractUseXHPASTLinterRuleTestCaseClassArcanistFileConfigurationSourceClassArcanistFileDataRefClassReference to a file or block of file data which can be uploaded using
@{class:ArcanistFileUploader}.ArcanistFilenameLinterClassStifles creativity in choosing imaginative file names.ArcanistFilenameLinterTestCaseClassArcanistFileRefClassArcanistFileSymbolRefClassArcanistFilesystemAPIClassArcanistFilesystemConfigurationSourceClassArcanistFilesystemWorkingCopyClassArcanistFileUploaderClassUpload a list of @{class:ArcanistFileDataRef} objects over Conduit.ArcanistFlake8LinterClassUses "flake8" to detect various errors in Python code.
Requires version 1.7.0 or newer of flake8.ArcanistFlake8LinterTestCaseClassArcanistFormattedStringXHPASTLinterRuleClassArcanistFormattedStringXHPASTLinterRuleTestCaseClassArcanistFunctionCallShouldBeTypeCastXHPASTLinterRuleClassArcanistFunctionCallShouldBeTypeCastXHPASTLinterRuleTestCaseClassArcanistFutureLinterClassArcanistGeneratedLinterClassStops other linters from running on generated code.ArcanistGeneratedLinterTestCaseClassArcanistGetConfigWorkflowClassRead configuration settings.ArcanistGitAPIClassInterfaces with Git working copies.ArcanistGitCommitGraphQueryClassArcanistGitCommitMessageHardpointQueryClassArcanistGitCommitSymbolCommitHardpointQueryClassArcanistGitLandEngineClassArcanistGitLocalStateClassArcanistGitRawCommitClassArcanistGitRawCommitTestCaseClassArcanistGitRepositoryMarkerQueryClassArcanistGitRepositoryRemoteQueryClassArcanistGitUpstreamPathClassArcanistGitWorkEngineClassArcanistGitWorkingCopyClassArcanistGitWorkingCopyRevisionHardpointQueryClassArcanistGlobalVariableXHPASTLinterRuleClassArcanistGlobalVariableXHPASTLinterRuleTestCaseClassArcanistGoLintLinterClassArcanistGoLintLinterTestCaseClassArcanistGoTestResultParserClassGo Test Result Parsing utilityArcanistGoTestResultParserTestCaseClassTest for @{class:ArcanistGoTestResultParser}.ArcanistHardpointClassArcanistHardpointEngineClassArcanistHardpointFutureListClassArcanistHardpointListClassArcanistHardpointObjectClassArcanistHardpointQueryClassArcanistHardpointRequestClassArcanistHardpointRequestListClassArcanistHardpointTaskClassArcanistHardpointTaskResultClassArcanistHelpWorkflowClassArcanistHexadecimalNumericScalarCasingXHPASTLinterRuleClassArcanistHexadecimalNumericScalarCasingXHPASTLinterRuleTestCaseClassArcanistHgClientChannelClassChannel to a Mercurial "cmdserver" client. For a detailed description of the
"cmdserver" protocol, see @{class:ArcanistHgServerChannel}. This channel
implements the other half of the protocol: it decodes messages from the
client and encodes messages from the server.ArcanistHgProxyClientClassClient for an @{class:ArcanistHgProxyServer}. This client talks to a PHP
process which serves as a proxy in front of a Mercurial server process.
The PHP proxy allows multiple clients to use the same Mercurial server.ArcanistHgProxyServerClassServer which @{class:ArcanistHgProxyClient} clients connect to. This
server binds to a Mercurial working copy and creates a Mercurial process and
a unix domain socket in that working copy. It listens for connections on
the socket, reads commands from them, and forwards their requests to the
Mercurial process. It then returns responses to the original clients.ArcanistHgServerChannelClassChannel to a Mercurial "cmdserver" server. Messages sent to the server
look like this:ArcanistHLintLinterClassCalls `hlint` and parses its results.ArcanistHLintLinterTestCaseClassArcanistImplicitConstructorXHPASTLinterRuleClassArcanistImplicitConstructorXHPASTLinterRuleTestCaseClassArcanistImplicitFallthroughXHPASTLinterRuleClassArcanistImplicitFallthroughXHPASTLinterRuleTestCaseClassArcanistImplicitVisibilityXHPASTLinterRuleClassArcanistImplicitVisibilityXHPASTLinterRuleTestCaseClassArcanistImplodeArgumentOrderXHPASTLinterRuleClassArcanistImplodeArgumentOrderXHPASTLinterRuleTestCaseClassArcanistInlineHTMLXHPASTLinterRuleClassArcanistInlineHTMLXHPASTLinterRuleTestCaseClassArcanistInnerFunctionXHPASTLinterRuleClassArcanistInnerFunctionXHPASTLinterRuleTestCaseClassArcanistInspectWorkflowClassArcanistInstallCertificateWorkflowClassInstalls arcanist certificates.ArcanistInstanceOfOperatorXHPASTLinterRuleClassArcanistInstanceofOperatorXHPASTLinterRuleTestCaseClassArcanistInterfaceAbstractMethodXHPASTLinterRuleClassArcanistInterfaceAbstractMethodXHPASTLinterRuleTestCaseClassArcanistInterfaceMethodBodyXHPASTLinterRuleClassArcanistInterfaceMethodBodyXHPASTLinterRuleTestCaseClassArcanistInvalidDefaultParameterXHPASTLinterRuleClassArcanistInvalidDefaultParameterXHPASTLinterRuleTestCaseClassArcanistInvalidModifiersXHPASTLinterRuleClassArcanistInvalidModifiersXHPASTLinterRuleTestCaseClassArcanistInvalidOctalNumericScalarXHPASTLinterRuleClassArcanistInvalidOctalNumericScalarXHPASTLinterRuleTestCaseClassArcanistIsAShouldBeInstanceOfXHPASTLinterRuleClassArcanistIsAShouldBeInstanceOfXHPASTLinterRuleTestCaseClassArcanistJscsLinterClassArcanistJscsLinterTestCaseClassArcanistJSHintLinterClassUses JSHint to detect errors and potential problems in JavaScript code.ArcanistJSHintLinterTestCaseClassArcanistJSONLinterClassA linter for JSON files.ArcanistJSONLinterTestCaseClassArcanistJSONLintLinterClassA linter for JSON files.ArcanistJSONLintRendererClassArcanistKeywordCasingXHPASTLinterRuleClassArcanistKeywordCasingXHPASTLinterRuleTestCaseClassArcanistLambdaFuncFunctionXHPASTLinterRuleClassArcanistLambdaFuncFunctionXHPASTLinterRuleTestCaseClassArcanistLandCommitClassArcanistLandCommitSetClassArcanistLandEngineClassArcanistLandPushFailureExceptionClassArcanistLandSymbolClassArcanistLandTargetClassArcanistLandWorkflowClassLands a branch by rebasing, merging and amending it.ArcanistLanguageConstructParenthesesXHPASTLinterRuleClassArcanistLanguageConstructParenthesesXHPASTLinterRuleTestCaseClassArcanistLesscLinterClassA linter for LESSCSS files.ArcanistLesscLinterTestCaseClassArcanistLiberateWorkflowClassArcanistLintEngineClassManages lint execution. When you run 'arc lint' or 'arc diff', Arcanist
attempts to run lint rules using a lint engine.ArcanistLinterClassImplements lint rules, like syntax checks for a specific language.ArcanistLinterStandardClassA "linter standard" is a collection of linter rules with associated
severities and configuration.ArcanistLinterStandardTestCaseClassArcanistLintersWorkflowClassList available linters.ArcanistLinterTestCaseClassFacilitates implementation of test cases for @{class:ArcanistLinter}s.ArcanistLintMessageClassMessage emitted by a linter, like an error or warning.ArcanistLintMessageTestCaseClassArcanistLintPatcherClassApplies lint patches to the working copy.ArcanistLintRendererClassArcanistLintResultClassA group of @{class:ArcanistLintMessage}s that apply to a file.ArcanistLintSeverityClassDescribes the severity of an @{class:ArcanistLintMessage}.ArcanistLintWorkflowClassRuns lint rules on changes.ArcanistListAssignmentXHPASTLinterRuleClassArcanistListAssignmentXHPASTLinterRuleTestCaseClassArcanistListConfigOptionClassArcanistListWorkflowClassLists open revisions in Differential.ArcanistLocalConfigurationSourceClassArcanistLogEngineClassArcanistLogicalOperatorsXHPASTLinterRuleClassArcanistLogicalOperatorsXHPASTLinterRuleTestCaseClassArcanistLogMessageClassArcanistLookWorkflowClassArcanistLowercaseFunctionsXHPASTLinterRuleClassArcanistLowercaseFunctionsXHPASTLinterRuleTestCaseClassArcanistMarkerRefClassArcanistMarkersWorkflowClassArcanistMercurialAPIClassInterfaces with the Mercurial working copies.ArcanistMercurialCommitGraphQueryClassArcanistMercurialCommitMessageHardpointQueryClassArcanistMercurialCommitSymbolCommitHardpointQueryClassArcanistMercurialLandEngineClassArcanistMercurialLocalStateClassArcanistMercurialParserClassParses output from various "hg" commands into structured data. This class
provides low-level APIs for reading "hg" output.ArcanistMercurialParserTestCaseClassArcanistMercurialRepositoryMarkerQueryClassArcanistMercurialRepositoryRemoteQueryClassArcanistMercurialWorkEngineClassArcanistMercurialWorkingCopyClassArcanistMercurialWorkingCopyRevisionHardpointQueryClassArcanistMergeConflictLinterClassChecks files for unresolved merge conflicts.ArcanistMergeConflictLinterTestCaseClassArcanistMessageRevisionHardpointQueryClassArcanistMissingArgumentTerminatorExceptionClassArcanistMissingLinterExceptionClassArcanistModifierOrderingXHPASTLinterRuleClassArcanistModifierOrderingXHPASTLinterRuleTestCaseClassArcanistMultiSourceConfigOptionClassArcanistNamespaceFirstStatementXHPASTLinterRuleClassArcanistNamespaceFirstStatementXHPASTLinterRuleTestCaseClassArcanistNamingConventionsXHPASTLinterRuleClassArcanistNamingConventionsXHPASTLinterRuleTestCaseClassArcanistNestedNamespacesXHPASTLinterRuleClassArcanistNestedNamespacesXHPASTLinterRuleTestCaseClassArcanistNewlineAfterOpenTagXHPASTLinterRuleClassArcanistNewlineAfterOpenTagXHPASTLinterRuleTestCaseClassArcanistNoEffectExceptionClassThrown when lint or unit tests have no effect, i.e. no paths are affected
by any linter or no unit tests provide coverage.ArcanistNoEngineExceptionClassThrown when no engine is configured for linting or running unit tests.ArcanistNoLintLinterClassStops other linters from running on code marked with a nolint annotation.ArcanistNoLintLinterTestCaseClassArcanistNoneLintRendererClassArcanistNoParentScopeXHPASTLinterRuleClassArcanistNoParentScopeXHPASTLinterRuleTestCaseClassArcanistObjectListHardpointClassArcanistObjectOperatorSpacingXHPASTLinterRuleClassArcanistObjectOperatorSpacingXHPASTLinterRuleTestCaseClassArcanistPaamayimNekudotayimSpacingXHPASTLinterRuleClassArcanistPaamayimNekudotayimSpacingXHPASTLinterRuleTestCaseClassArcanistParenthesesSpacingXHPASTLinterRuleClassArcanistParenthesesSpacingXHPASTLinterRuleTestCaseClassArcanistParentMemberReferenceXHPASTLinterRuleClassArcanistParentMemberReferenceXHPASTLinterRuleTestCaseClassArcanistParseStrUseXHPASTLinterRuleClassArcanistParseStrUseXHPASTLinterRuleTestCaseClassArcanistPartialCatchXHPASTLinterRuleClassArcanistPartialCatchXHPASTLinterRuleTestCaseClassArcanistPasteRefClassArcanistPasteSymbolRefClassArcanistPasteWorkflowClassArcanistPatchWorkflowClassApplies changes from Differential or a file to the working copy.ArcanistPEP8LinterClassUses "pep8.py" to enforce PEP8 rules for Python.ArcanistPEP8LinterTestCaseClassArcanistPHPCloseTagXHPASTLinterRuleClassArcanistPHPCloseTagXHPASTLinterRuleTestCaseClassArcanistPHPCompatibilityXHPASTLinterRuleClassArcanistPHPCompatibilityXHPASTLinterRuleTestCaseClassArcanistPhpcsLinterClassUses "PHP_CodeSniffer" to detect checkstyle errors in PHP code.ArcanistPhpcsLinterTestCaseClassArcanistPHPEchoTagXHPASTLinterRuleClassArcanistPHPEchoTagXHPASTLinterRuleTestCaseClassArcanistPhpLinterClassUses "php -l" to detect syntax errors in PHP code.ArcanistPhpLinterTestCaseClassArcanistPHPOpenTagXHPASTLinterRuleClassArcanistPHPOpenTagXHPASTLinterRuleTestCaseClassArcanistPHPShortTagXHPASTLinterRuleClassArcanistPHPShortTagXHPASTLinterRuleTestCaseClassArcanistPhpunitTestResultParserClassPHPUnit Result Parsing utilityArcanistPhutilLibraryLinterClassApplies lint rules for Phutil libraries. We enforce three rules:ArcanistPhutilWorkflowClassArcanistPhutilXHPASTLinterStandardClassArcanistPlusOperatorOnStringsXHPASTLinterRuleClassArcanistPlusOperatorOnStringsXHPASTLinterRuleTestCaseClassArcanistProductNameLiteralXHPASTLinterRuleClassArcanistProjectConfigurationSourceClassArcanistPromptClassArcanistPromptResponseClassArcanistPromptsConfigOptionClassArcanistPromptsWorkflowClassArcanistPublicPropertyXHPASTLinterRuleClassArcanistPublicPropertyXHPASTLinterRuleTestCaseClassArcanistPuppetLintLinterClassA linter for Puppet files.ArcanistPuppetLintLinterTestCaseClassArcanistPyFlakesLinterClassUses "PyFlakes" to detect various errors in Python code.ArcanistPyFlakesLinterTestCaseClassArcanistPyLintLinterClassUses "PyLint" to detect various errors in Python code.ArcanistPyLintLinterTestCaseClassArcanistRaggedClassTreeEdgeXHPASTLinterRuleClassArcanistRaggedClassTreeEdgeXHPASTLinterRuleTestCaseClassArcanistRefClassArcanistRefInspectorClassArcanistRefViewClassArcanistRemoteRefClassArcanistRemoteRefInspectorClassArcanistRemoteRepositoryRefsHardpointQueryClassArcanistRepositoryAPIClassInterfaces with the VCS in the working copy.ArcanistRepositoryAPIMiscTestCaseClassArcanistRepositoryAPIStateTestCaseClassArcanistRepositoryLocalStateClassArcanistRepositoryMarkerQueryClassArcanistRepositoryQueryClassArcanistRepositoryRefClassArcanistRepositoryRemoteQueryClassArcanistRepositoryURINormalizerClassNormalize repository URIs. For example, these URIs are generally equivalent
and all point at the same repository:ArcanistRepositoryURINormalizerTestCaseClassArcanistReusedAsIteratorXHPASTLinterRuleClassArcanistReusedAsIteratorXHPASTLinterRuleTestCaseClassArcanistReusedIteratorReferenceXHPASTLinterRuleClassFind cases where a `foreach` loop is being iterated using a variable
reference and the same variable is used outside of the loop without calling
`unset()` or reassigning the variable to another variable reference.ArcanistReusedIteratorReferenceXHPASTLinterRuleTestCaseClassArcanistReusedIteratorXHPASTLinterRuleClassFind cases where loops get nested inside each other but use the same
iterator variable. For example:ArcanistReusedIteratorXHPASTLinterRuleTestCaseClassArcanistRevisionAuthorHardpointQueryClassArcanistRevisionBuildableHardpointQueryClassArcanistRevisionCommitMessageHardpointQueryClassArcanistRevisionParentRevisionsHardpointQueryClassArcanistRevisionRefClassArcanistRevisionRefSourceClassArcanistRevisionSymbolRefClassArcanistRuboCopLinterClassArcanistRuboCopLinterTestCaseClassArcanistRubyLinterClassUses `ruby` to detect various errors in Ruby code.ArcanistRubyLinterTestCaseClassArcanistRuntimeClassArcanistRuntimeConfigurationSourceClassArcanistRuntimeHardpointQueryClassArcanistScalarHardpointClassArcanistScriptAndRegexLinterClassSimple glue linter which runs some script on each path, and then uses a
regex to parse lint messages from the script's output. (This linter uses a
script and a regex to interpret the results of some real linter, it does
not itself lint both scripts and regexes).ArcanistSelfClassReferenceXHPASTLinterRuleClassArcanistSelfClassReferenceXHPASTLinterRuleTestCaseClassArcanistSelfMemberReferenceXHPASTLinterRuleClassArcanistSelfMemberReferenceXHPASTLinterRuleTestCaseClassArcanistSemicolonSpacingXHPASTLinterRuleClassArcanistSemicolonSpacingXHPASTLinterRuleTestCaseClassArcanistSetConfigWorkflowClassWrite configuration settings.ArcanistSettingClassArcanistSettingsClassArcanistShellCompleteWorkflowClassArcanistSimpleCommitGraphQueryClassArcanistSimpleSymbolHardpointQueryClassArcanistSimpleSymbolRefClassArcanistSimpleSymbolRefInspectorClassArcanistSingleLintEngineClassRun a single linter on every path unconditionally. This is a glue engine for
linters like @{class:ArcanistScriptAndRegexLinter}, if you are averse to
writing a phutil library. Your linter will receive every path, including
paths which have been moved or deleted.ArcanistSingleSourceConfigOptionClassArcanistSlownessXHPASTLinterRuleClassArcanistSlownessXHPASTLinterRuleTestCaseClassArcanistSpellingLinterClassEnforces basic spelling. Spelling inside code is actually pretty hard to
get right without false positives. I take a conservative approach and just
use a blacklisted set of words that are commonly spelled incorrectly.ArcanistSpellingLinterTestCaseClassArcanistStaticThisXHPASTLinterRuleClassArcanistStaticThisXHPASTLinterRuleTestCaseClassArcanistStringConfigOptionClassArcanistStringListConfigOptionClassArcanistSubversionAPIClassInterfaces with Subversion working copies.ArcanistSubversionWorkingCopyClassArcanistSummaryLintRendererClassArcanistSymbolEngineClassArcanistSymbolRefClassArcanistSyntaxErrorXHPASTLinterRuleClassArcanistSystemConfigurationSourceClassArcanistTaskRefClassArcanistTasksWorkflowClassDisplays User Tasks.ArcanistTaskSymbolRefClassArcanistTautologicalExpressionXHPASTLinterRuleClassArcanistTautologicalExpressionXHPASTLinterRuleTestCaseClassArcanistTerminalStringInterfaceInterfaceArcanistTestResultParserClassAbstract base class for test result parsers.ArcanistTestXHPASTLintSwitchHookClassArcanistTextLinterClassEnforces basic text file rules.ArcanistTextLinterTestCaseClassArcanistThisReassignmentXHPASTLinterRuleClassArcanistThisReassignmentXHPASTLinterRuleTestCaseClassArcanistTodoCommentXHPASTLinterRuleClassArcanistTodoCommentXHPASTLinterRuleTestCaseClassArcanistTodoWorkflowClassQuickly create a task.ArcanistToolsetClassArcanistToStringExceptionXHPASTLinterRuleClassArcanistToStringExceptionXHPASTLinterRuleTestCaseClassArcanistUnableToParseXHPASTLinterRuleClassArcanistUnaryPostfixExpressionSpacingXHPASTLinterRuleClassArcanistUnaryPostfixExpressionSpacingXHPASTLinterRuleTestCaseClassArcanistUnaryPrefixExpressionSpacingXHPASTLinterRuleClassArcanistUnaryPrefixExpressionSpacingXHPASTLinterRuleTestCaseClassArcanistUndeclaredVariableXHPASTLinterRuleClassArcanistUndeclaredVariableXHPASTLinterRuleTestCaseClassArcanistUnexpectedReturnValueXHPASTLinterRuleClassArcanistUnexpectedReturnValueXHPASTLinterRuleTestCaseClassArcanistUnitConsoleRendererClassArcanistUnitRendererClassArcanistUnitTestableLintEngineClassLint engine for use in constructing test cases. See
@{class:ArcanistLinterTestCase}.ArcanistUnitTestEngineClassManages unit test execution.ArcanistUnitTestResultClassRepresents the outcome of running a unit test.ArcanistUnitTestResultTestCaseClassArcanistUnitWorkflowClassRuns unit tests which cover your changes.ArcanistUnnecessaryFinalModifierXHPASTLinterRuleClassArcanistUnnecessaryFinalModifierXHPASTLinterRuleTestCaseClassArcanistUnnecessarySemicolonXHPASTLinterRuleClassArcanistUnnecessarySymbolAliasXHPASTLinterRuleClassArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCaseClassArcanistUnsafeDynamicStringXHPASTLinterRuleClassArcanistUnsafeDynamicStringXHPASTLinterRuleTestCaseClassArcanistUpgradeWorkflowClassArcanistUploadWorkflowClassArcanistUsageExceptionClassThrown when there is a problem with how a user is invoking a command, rather
than a technical problem.ArcanistUselessOverridingMethodXHPASTLinterRuleClassArcanistUselessOverridingMethodXHPASTLinterRuleTestCaseClassArcanistUserAbortExceptionClassThrown when the user chooses not to continue when warned that they're about
to do something dangerous.ArcanistUserConfigurationSourceClassArcanistUserRefClassArcanistUserSymbolHardpointQueryClassArcanistUserSymbolRefClassArcanistUserSymbolRefInspectorClassArcanistUseStatementNamespacePrefixXHPASTLinterRuleClassArcanistUseStatementNamespacePrefixXHPASTLinterRuleTestCaseClassArcanistVariableReferenceSpacingXHPASTLinterRuleClassArcanistVariableReferenceSpacingXHPASTLinterRuleTestCaseClassArcanistVariableVariableXHPASTLinterRuleClassArcanistVariableVariableXHPASTLinterRuleTestCaseClassArcanistVectorHardpointClassArcanistVersionWorkflowClassDisplay the current version of Arcanist.ArcanistWeldWorkflowClassArcanistWhichWorkflowClassShow which revision or revisions are in the working copy.ArcanistWildConfigOptionClassThis option type makes it easier to manage unknown options with unknown
types.ArcanistWorkEngineClassArcanistWorkflowClassImplements a runnable command, like "arc diff" or "arc help".ArcanistWorkflowArgumentClassArcanistWorkflowEngineClassArcanistWorkflowGitHardpointQueryClassArcanistWorkflowInformationClassArcanistWorkflowMercurialHardpointQueryClassArcanistWorkingCopyClassArcanistWorkingCopyConfigurationSourceClassArcanistWorkingCopyIdentityClassInterfaces with basic information about the working copy.ArcanistWorkingCopyPathClassArcanistWorkingCopyStateRefClassArcanistWorkingCopyStateRefInspectorClassArcanistWorkWorkflowClassArcanistXHPASTLinterClassUses XHPAST to apply lint rules to PHP.ArcanistXHPASTLinterRuleClassArcanistXHPASTLinterRuleTestCaseClassFacilitates implementation of test cases for
@{class:ArcanistXHPASTLinterRule}s.ArcanistXHPASTLinterTestCaseClassArcanistXHPASTLintNamingHookClassYou can extend this class and set `xhpast.naminghook` in your `.arclint` to
have an opportunity to override lint results for symbol names.ArcanistXHPASTLintNamingHookTestCaseClassTest cases for @{class:ArcanistXHPASTLintNamingHook}.ArcanistXHPASTLintSwitchHookClassYou can extend this class and set `xhpast.switchhook` in your `.arclint`
to have an opportunity to override results for linting `switch` statements.ArcanistXMLLinterClassA linter which uses [[http://php.net/simplexml | SimpleXML]] to detect
errors and potential problems in XML files.ArcanistXMLLinterTestCaseClassTest cases were mostly taken from
https://git.gnome.org/browse/libxml2/tree/test.ArcanistXUnitTestResultParserClassParser for JUnit, NUnit, etc results formatCSharpToolsTestEngineClassUses cscover (http://github.com/hach-que/cstools) to report code coverage.csprintf()FunctionFormat a shell command string. This function behaves like `sprintf`, except
that all the normal conversions (like "%s") will be properly escaped, and
additional conversions are supported:gitsprintf()FunctionFormat a Git ref selector. This formatting is important when executing
commands like "git log" which can not unambiguously parse all values as
ref selectors.hgsprintf()FunctionFormat a Mercurial revset expression. Supports the following conversions:jsprintf()FunctionFormat a Javascript string, using JSON to export complex values. This
function behaves like `sprintf`, except that all the normal conversions
(like "%s") will be properly escaped, and additional conversions are
supported:ldap_sprintf()FunctionFormat an LDAP string. This function behaves like `sprintf`, except that all
the normal conversions (like "%s") will be properly escaped, and additional
conversions are supported:NoseTestEngineClassVery basic 'nose' unit test engine wrapper.PhobjectClassBase class for libphutil objects. Enforces stricter object semantics than
PHP.PhobjectTestCaseClassPhpunitTestEngineClassPHPUnit wrapper.PhpunitTestEngineTestCaseClassTests for @{class:PhpunitTestEngine}.phutil_get_current_library_name()Functionphutil_get_library_name_for_root()Functionphutil_get_library_root()Functionphutil_get_library_root_for_path()Functionphutil_load_library()Functionphutil_register_library()Functionphutil_register_library_map()FunctionPhutilBootloaderClassIMPORTANT: Do not call any libphutil functions in this class, including
functions like @{function:id}, @{function:idx} and @{function:pht}. They
may not have loaded yet.PhutilBootloaderExceptionClassPhutilChannelClassWrapper around streams, pipes, and other things that have basic read/write
I/O characteristics.PhutilChannelChannelClassChannel that wraps some other channel. This class is not interesting on its
own and just serves as a no-op proxy, but extending it allows you to compose
channels to mutate their characteristics (for instance, to add protocol
semantics with @{class:PhutilProtocolChannel}).PhutilChannelTestCaseClassPhutilCIDRBlockClassCIDR notation IP block, like "172.30.0.0/16".PhutilCIDRListClassList of CIDR notation IP blocks, like "172.30.0.0/16".PhutilClassMapQueryClassLoad a map of concrete subclasses of some abstract parent class.PhutilCommandStringClassPhutilConsoleProgressSinkClassPhutilCsprintfTestCaseClassPhutilEventClassPhutilEventConstantsClassPhutilEventEngineClassPhutilEventListenerClassPhutilEventTypeClassPhutilExecChannelClassChannel on an underlying @{class:ExecFuture}. For a description of channels,
see @{class:PhutilChannel}.PhutilGitsprintfTestCaseClassPhutilHgsprintfTestCaseClassPhutilInvalidStateExceptionClassPhutilInvalidStateExceptionTestCaseClassPhutilIPAddressClassRepresent and manipulate IPv4 and IPv6 addresses.PhutilIPAddressTestCaseClassPhutilIPv4AddressClassRepresent and manipulate IPv4 addresses.PhutilIPv6AddressClassRepresent and manipulate IPv6 addresses.PhutilJSONProtocolChannelClassChannel that transmits dictionaries of primitives using JSON serialization.
This channel is not binary safe.PhutilJSONProtocolChannelTestCaseClassPhutilLibraryConflictExceptionClassThrown when you attempt to load two different copies of a library with the
same name. Trying to load the second copy of the library will trigger this,
and the library will not be loaded.PhutilLibraryTestCaseClassPhutilLogFileChannelClassA @{class:PhutilChannelChannel} which wraps some other channel and writes
data passed over it to a log file.PhutilMetricsChannelClassA @{class:PhutilChannelChannel} which wraps some other channel and provides
metrics about its use (e.g., bytes read and bytes written).PhutilMissingSymbolExceptionClassPhutilModuleUtilsTestCaseClassPhutilPHPObjectProtocolChannelClassChannel that transmits PHP objects using PHP serialization. This channel
is binary safe.PhutilPHPObjectProtocolChannelTestCaseClassPhutilPregsprintfTestCaseClassPhutilProgressSinkClassPhutilProtocolChannelClassWraps a @{class:PhutilChannel} and implements a message-oriented protocol
on top of it. A protocol channel behaves like a normal channel, except that
@{method:read} and @{method:write} are message-oriented and the protocol
channel handles encoding and parsing messages for transmission.PhutilReadableSerializerClassSerialize PHP values and objects into a human-readable format, useful for
displaying errors.PhutilReadableSerializerTestCaseClassPhutilRegexExceptionClassPhutilServiceProfilerClassSimple event store for service calls, so they can be printed to stdout or
displayed in a debug console.PhutilSocketChannelClassChannel on an underlying stream socket or socket pair. For a description of
channels, see @{class:PhutilChannel}.PhutilSymbolLoaderClassQuery and load Phutil classes, interfaces and functions.PhutilTerminalStringClassString escaped for terminal output. See @{function:tsprintf}.PhutilTestCaseClassBase test case for the very simple libphutil test framework.PhutilTestCaseTestCaseClassTest for @{class:PhutilUnitTestEngineTestCase}.PhutilTestPhobjectClassPhutilTestSkippedExceptionClassThrown to skip test execution.PhutilTestTerminatedExceptionClassThrown to prematurely end test execution.PhutilTsprintfTestCaseClassPhutilUnitTestEngineClassVery basic unit test engine which runs libphutil tests.PhutilUnitTestEngineTestCaseClassVery meta test for @{class:PhutilUnitTestEngine}.PhutilUrisprintfTestCaseClassPlatformSymbolsClasspregsprintf()FunctionFormat a regular expression. Supports the following conversions:PytestTestEngineClassVery basic 'py.test' unit test engine wrapper.tsprintf()FunctionFormat text for terminal output. This function behaves like `sprintf`,
except that all the normal conversions (like "%s") will be properly escaped,
and additional conversions are supported:urisprintf()FunctionFormat a URI. This function behaves like `sprintf`, except that all the
normal conversions (like "%s") will be properly escaped, and additional
conversions are supported:vcsprintf()FunctionVersion of @{function:csprintf} that takes a vector of arguments.vjsprintf()Functionvurisprintf()Functionxsprintf()FunctionParse a `sprintf()`-style format string in an extensible way.xsprintf_callback_example()FunctionExample @{function:xsprintf} callback. When you call `xsprintf`, you must
pass a callback like this one. `xsprintf` will invoke the callback when it
encounters a conversion (like "%Z") in the pattern string.xsprintf_command()Function@{function:xsprintf} callback for @{function:csprintf}.xsprintf_git()Function@{function:xsprintf} callback for Git encoding.xsprintf_javascript()Function@{function:xsprintf} callback for JavaScript encoding.xsprintf_ldap()Function@{function:ldap_sprintf} callback for LDAP encoding.xsprintf_mercurial()Function@{function:xsprintf} callback for Mercurial encoding.xsprintf_regex()Function@{function:xsprintf} callback for regular expressions.xsprintf_terminal()FunctionCallback for terminal encoding, see @{function:tsprintf} for use.xsprintf_uri()Function@{function:urisprintf} callback for URI encoding.XsprintfUnknownConversionExceptionClassXUnitTestEngineClassUses xUnit (http://xunit.codeplex.com/) to test C# code.XUnitTestResultParserTestCaseClassTest for @{class:ArcanistXUnitTestResultParser}.