wwphp-fb/facebook-bot — pull request #7 by dennisdegryse (2014-12-28 01:17:14+00:00)
Title: Feature/modulemanager

Please review this code before merging. Also please **don't** merge with fast-forward, so the branch is not destroyed.

# New dependencies
- PECL pthreads >= 2.0.0

# Change log
* Created factory classes for two main components: Modules and Connections
* Created a treaded abstract Module that supports autoloading.
* Created a factory method for Modules that allows creation based on a name (string)
* The auto-membership approval is running in a separate thread (using the threaded abstract Module).
* The auto-membership approval is extended so it can approve multiple requests during a single run.
* The auto-membership approval constructs an entity that keeps the approval action URL and parameters + the name and profile url of the member.

# Future improvements & justification
After merging this branch, new modules can be added under the namespace `PHPWorldWide\FacebookBot\Module`. They must have a sub directory named `*Module` and a main class with the same name. The main class must implement the `Module` class and (unless there is a sane reason) should extend the `ModuleAbstract` class. After creation they can be loaded in the `app.php` file by supplying the module name without the _Module_ postfix.

The reason why tasks are multi-threaded is so that the main program is available for I/O. Example use case: after adding a module, it should be safe to pull the latest version and dynamically load the new module using a basic I/O instruction.