Download the PHP package sciactive/requirephp without Composer
On this page you can find all versions of the php package sciactive/requirephp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sciactive/requirephp
More information about sciactive/requirephp
Files in sciactive/requirephp
Package requirephp
Short Description An implementation of dependency injection (like RequireJS) in PHP.
License LGPL
Homepage http://requirephp.org/
Informations about the package requirephp
RequirePHP
An implementation of dependency injection and service locator (like RequireJS) in PHP.
Installation
You can install RequirePHP with Composer or Bower.
Getting Started
If you don't use an autoloader, all you need to do is include the RequirePHP.php file.
Now you can start giving code that requires a module, or modules, to run. This code will not run until all the required modules (in this case, only 'test') are available.
You can define modules. This module has no dependencies, hence the empty array.
You can create aliases to modules (and other aliases).
You can keep using the same instance in other code, using RequirePHP as a service locator. This function uses the alias from above.
You can also retrieve modules outside of a closure. However, if this module is not available at the time you request it, RequirePHP will throw a RequireModuleFailedException. Such is the price of not using a closure.
Service Location
The repository contains an example of using RequirePHP as a service locator.
Dependency Injection
The repository contains an example of using RequirePHP as a dependency injector.
Contacting the Developer
There are several ways to contact RequirePHP's developer with your questions, concerns, comments, bug reports, or feature requests.
- RequirePHP is part of SciActive on Twitter.
- Bug reports, questions, and feature requests can be filed at the issues page.
- You can directly email Hunter Perrin, the creator of RequirePHP.