Changeset View
Changeset View
Standalone View
Standalone View
README.md
- This file was moved from README.
| = WHAT IS LIBPHUTIL? = | |||||
| `libphutil` is a collection of utility classes and functions for PHP. Some | `libphutil` is a collection of utility classes and functions for PHP. Some | ||||
| features of the library include: | features of the library include: | ||||
| == libphutil Library System == | **libphutil Library System** | ||||
| A system for organizing, loading and introspecting PHP classes and functions. | A system for organizing, loading and introspecting PHP classes and functions. | ||||
| Uses static analysis to generate, validate and update library contents and | Uses static analysis to generate, validate and update library contents and | ||||
| includes. Based on Facebook's similar `flib` system. | includes. Based on Facebook's similar `flib` system. | ||||
| == Futures == | **Futures** | ||||
| Futures (also known as "promises") are objects which act as placeholders for | Futures (also known as "promises") are objects which act as placeholders for | ||||
| some future result of computation. They let you express parallel and | some future result of computation. They let you express parallel and | ||||
| asynchronous execution with a natural syntax. There are three provided | asynchronous execution with a natural syntax. There are three provided | ||||
| concrete `Future` implementations: `ExecFuture` for executing system commands, | concrete `Future` implementations: `ExecFuture` for executing system commands, | ||||
| `HTTPFuture` for making HTTP requests, and `QueryFuture` for executing database | `HTTPFuture` for making HTTP requests, and `QueryFuture` for executing database | ||||
| queries. | queries. | ||||
| == Filesystem == | **Filesystem** | ||||
| The builtin PHP filesystem functions return error codes and emit warnings. It is | The builtin PHP filesystem functions return error codes and emit warnings. It is | ||||
| tedious to check these consistently. The `Filesystem` class provides a simple | tedious to check these consistently. The `Filesystem` class provides a simple | ||||
| API for common filesystem operations that throws exceptions on failure. | API for common filesystem operations that throws exceptions on failure. | ||||
| == xsprintf == | **xsprintf** | ||||
| This module allows you to build `sprintf()`-style functions that have arbitrary | This module allows you to build `sprintf()`-style functions that have arbitrary | ||||
| conversions. This is particularly useful for escaping data correctly. Three | conversions. This is particularly useful for escaping data correctly. Three | ||||
| concrete implementations are provided: | concrete implementations are provided: | ||||
| - `csprintf()`: safely escape data for system commands | - `csprintf()`: safely escape data for system commands | ||||
| - `jsprintf()`: safely escape data for Javascript | - `jsprintf()`: safely escape data for Javascript | ||||
| - `qsprintf()`: safely escape data for MySQL | - `qsprintf()`: safely escape data for MySQL | ||||
| == AAST/PHPAST == | **AAST/PHPAST** | ||||
| An abstract, abstract syntax tree which can make it easier to perform simple | An abstract, abstract syntax tree which can make it easier to perform simple | ||||
| static analysis, and a concrete AST for PHP. | static analysis, and a concrete AST for PHP. | ||||
| == Remarkup == | **Remarkup** | ||||
| A Markdown-like lightweight markup language. Remarkup's syntax is defined by | A Markdown-like lightweight markup language. Remarkup's syntax is defined by | ||||
| parser plugins and fairly easy to extend and configure. | parser plugins and fairly easy to extend and configure. | ||||
| == Daemons == | **Daemons** | ||||
| Enables running PHP scripts as stable, long-lived daemons. | Enables running PHP scripts as stable, long-lived daemons. | ||||
| == Utilities == | **Utilities** | ||||
| A handful of solid utility functions. | A handful of solid utility functions. | ||||
| `libphutil` is used by | `libphutil` is used by | ||||
| [[https://secure.phabricator.com/diffusion/P/ | Phabricator]], | - [Phabricator](https://secure.phabricator.com/diffusion/P/) | ||||
| [[https://secure.phabricator.com/diffusion/ARC/ | Arcanist]] and Diviner. | - [Arcnaist](https://secure.phabricator.com/diffusion/ARC/) | ||||
| - [Diviner](https://secure.phabricator.com/book/phabricator/article/diviner/) | |||||
| ---------- | |||||
| **BUG REPORTS** | |||||
| Please update `libphutil` to **HEAD** before filing bug reports. Follow our [bug reporting guide](https://secure.phabricator.com/book/phabcontrib/article/bug_reports/) 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](https://secure.phabricator.com/book/phabcontrib/article/contributing_code/) for more information. | |||||
| **LICENSE** | |||||
| = LICENSE = | |||||
| `libphutil` is released under the Apache 2.0 license except as otherwise noted. | `libphutil` is released under the Apache 2.0 license except as otherwise noted. | ||||