phpDocumentor/phpDocumentor2 — pull request #1495 by mvriel (2014-12-08 07:41:33+00:00)
Title: [WIP] Add support for backends and revise parser architecture

> Important: this is not a good example of a PR; a PR should only address, and fix, a single issue. This PR is the size it is because it is an extensive re-architect of the Parsing component for phpDocumentor v3

The goals for this PR are:

1. Remove business logic from the Parse Command class so that it becomes easier to use
the parser from another context.
2. Decouple the Caching from the Parser so that the caching layer becomes entirely
optional.
3. Separate the parser coordination from the actual parsing by introducing 'backends';
these can deal with the actual parsing of individual files and populating the
ProjectDescriptor.
4. Separate logging from the business logic.
5. Replace Zend Framework components with more light-weight versions to reduce number of packages.
6. Improve performance by disabling Garbage Collection

> Important: In general I do not recommend disabling the Garbage Collection for any application. Testing has shown that the overall performance of phpDocumentor is improved by 10% to 50% by disabling Garbage Collection.
> We have investigated the impact of removing cyclic dependencies but this will impose too many restrictions on the functioning and generated graph of phpDocumentor.

In order to do this the architecture has been changed to make the parser responsible
for collecting files; booting the backends with the configuration and emitting events
so that logging and caching can be event-driven instead of coupled inside the parser.

While parsing a file the parser will find a suitable backend and, if one is found,
pass the file to the backend for parsing and to populate the project descriptor.

Todo:

- [ ]: Change configuration handling to use Parser only configuration and not global configuration
- [ ]: Document the various classes
- [ ]: (Re)write unit tests