The Dependency plugin for CakePHP provides a dependency injection container and service registry/locator. The plugin includes the Di utility class, which is used to register and resolve dependencies.
To inject dependencies you only need a class which is accessible to the framework. This can be from CakePHP itself, from a plugin, or even a vendor library.
To get working quickly check out the Quick Start tutorial from the documentation.
- CakePHP 2+
- PHP 5.3+
Full documentation is included with the plugin, and can be found in the Docs directory of this repository.
For support, bugs and feature requests, please use the issues section of this repository.
If you'd like to contribute new features, enhancements or bug fixes to the code base just follow these steps:
- Create a GitHub account, if you don't own one already
- Then, fork the Cake Dependency repository to your account
- Create a new branch from the develop branch in your forked repository
- Modify the existing code, or add new code to your branch, making sure you follow the CakePHP Coding Standards
- Modify or add unit tests which confirm the correct functionality of your code (requires PHPUnit 3.5+)
- Consider using the CakePHP Code Sniffer to check the quality of your code
- When ready, make a pull request to the main repository
There may be some discussion regarding your contribution to the repository before any code is merged in, so be prepared to provide feedback on your contribution if required.
A list of contributors to the Cake Dependency plugin can be found here.
Copyright 2013 James Watts (CakeDC). All rights reserved.
Licensed under the MIT License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.