Releases: caffeinated/modules
v2.1.5
v2.1.4
v2.1.3
v2.1.2
v2.1.1
v2.1
This release sees some major improvements to the code structure. There have also been some minor changes compared to the previous release (as will be shown below). This release paves way for the inclusion of the means to store and manage module manifest information within a database as well as caching capabilities to speed up your application.
A lot of focus was put into improving the performance in this release (even without caching capabilities). Basic tests show that the loading time of a single module went from roughly 10ms - 15ms
to between 1ms - 5ms
. A lot of this had to do with unnecessary file reads taking place upon every page load. The inclusion of caching as well as the ability to store and retrieve manifest information from the database in future releases should also drastically improve performance.
Notable Changes
- Extracted methods out into Repositories, opening the door for multiple storage options (e.g. database), as well as Decoration (e.g. caching)
- All facade methods now return Collections in place of arrays.
- The following is the complete list of Facade methods available:
Method | Description |
---|---|
all() |
Get all modules. |
slugs() |
Get all module slugs. |
where($key, $value) |
Get modules based on where clause. |
sortBy($key) |
Sort modules by the given key in ascending order. |
sortByDesc($key) |
Sort modules by the given key in descending order. |
exists($slug) |
Determines if the given module exists. |
count() |
Returns a count of all modules. |
getProperties($slug) |
Returns the modules defined properties. |
getProperty($property, $default = null) |
Returns the given module property. |
setProperty($property, $value) |
Set the given module property value. |
enabled() |
Get all enabled modules. |
disabled() |
Get all disabled modules. |
isEnabled($slug) |
Determines if the specified module is enabled. |
isDisabled($slug) |
Determines if the specified module is disabled. |
enable($slug) |
Enables the specified module. |
disable($slug) |
Disables the specified module. |