Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A collection of PHP utility classes
PHP C++ Bison Other
branch: master

Automatically compile aggregate stack traces for complex exceptions

Summary: Fixes T8156. I think this is a little simpler/cleaner than D12796 + D12851?

Test Plan:
With `--trace`:

```
[2015-05-25 08:28:38] EXCEPTION: (PhutilAggregateException) Some linters failed:
    - Exception: QUACK QUACK QUACK at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:275]
arcanist(head=master, ref.master=9b7c6786cdc9), phutil(head=master, ref.master=65819efa43f1)
  #0 <#2> ArcanistPhutilXHPASTLinter::lintRaggedClasstreeEdges(XHPASTNode) called at [<arcanist>/src/lint/linter/ArcanistPhutilXHPASTLinter.php:269]
  #1 <#2> call_user_func(array, XHPASTNode) called at [<arcanist>/src/lint/linter/ArcanistPhutilXHPASTLinter.php:120]
  #2 <#2> ArcanistPhutilXHPASTLinter::resolveFuture(string, ExecFuture) called at [<arcanist>/src/lint/linter/ArcanistFutureLinter.php:34]
  #3 <#2> ArcanistFutureLinter::didLintPaths(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:602]
  #4 <#2> ArcanistLintEngine::executeDidLintOnPaths(ArcanistPhutilXHPASTLinter, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:553]
  #5 <#2> ArcanistLintEngine::executeLintersOnChunk(array, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:481]
  #6 <#2> ArcanistLintEngine::executeLinters(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:219]
  #7 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:331]
  #8 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:387]
```

Without `--trace`:

```
Exception
Some linters failed:
    - Exception: QUACK QUACK QUACK
(Run with `--trace` for a full exception trace.)
```

Reviewers: joshuaspence

Reviewed By: joshuaspence

Subscribers: epriestley

Maniphest Tasks: T8156

Differential Revision: https://secure.phabricator.com/D13007
latest commit c2cd90ee7a
@epriestley epriestley authored

README.md

libphutil is a collection of utility classes and functions for PHP. Some features of the library include:

libphutil Library System A system for organizing, loading and introspecting PHP classes and functions. Uses static analysis to generate, validate and update library contents and includes. Based on Facebook's similar flib system.

Futures Futures (also known as "promises") are objects which act as placeholders for some future result of computation. They let you express parallel and asynchronous execution with a natural syntax. There are three provided concrete Future implementations: ExecFuture for executing system commands, HTTPFuture for making HTTP requests, and QueryFuture for executing database queries.

Filesystem The builtin PHP filesystem functions return error codes and emit warnings. It is tedious to check these consistently. The Filesystem class provides a simple API for common filesystem operations that throws exceptions on failure.

xsprintf This module allows you to build sprintf()-style functions that have arbitrary conversions. This is particularly useful for escaping data correctly. Three concrete implementations are provided:

  • csprintf(): safely escape data for system commands
  • jsprintf(): safely escape data for Javascript
  • qsprintf(): safely escape data for MySQL

AAST/PHPAST An abstract, abstract syntax tree which can make it easier to perform simple static analysis, and a concrete AST for PHP.

Remarkup A Markdown-like lightweight markup language. Remarkup's syntax is defined by parser plugins and fairly easy to extend and configure.

Daemons Enables running PHP scripts as stable, long-lived daemons.

Utilities A handful of solid utility functions.

libphutil is used by


BUG REPORTS

Please update libphutil to HEAD before filing bug reports. Follow our bug reporting guide for complete instructions.

PULL REQUESTS

We do not accept pull requests through GitHub. If you would like to contribute code, please read our Contributor's Guide for more information.

LICENSE

libphutil is released under the Apache 2.0 license except as otherwise noted.

Something went wrong with that request. Please try again.