Download .zip |
Info | Example | View files (46) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2017-11-12 (1 month ago) | Not yet rated by the users | Total: Not yet counted | Not yet ranked |
Version | License | PHP version | Categories | |||
redbox-hooks 1.0 | MIT/X Consortium ... | 5 | PHP 5, Language |
Description | Author | |
This package can listen to events and execute registered actions. |
Redbox-hooks allow you use Wordpress actions and filters in your own code. The syntax is easy to use as you expect it to be after seeing it in Wordpress it self.
If you want to look at some demo's in details then read the manual for:
This package was created because i am building a new modulair cms. I figured i could use a package like this and started building.
I a am not a TDD guy but 50% of this code was written with the TDD concept in mind. Actually i was pretty much surprised on how it worked out and the speed the development came in.
The following versions of PHP are supported by this version.
If you come across a bug/issue you can always report them to the issue tracker. While developing this package this is something things i noticed. Those things are listed below.
If you have functions inside a namespace. So should add the full namespace to the callback function like this example here.
namespace Sandbox\Demos;
use Sandbox\Filters;
function func_first($text = '')
{
return '!!' . $text;
}
Filters::addFilter('prepend_at', 'Sandbox\Demos\func_first', 0);
This package is created and maintained by Johnny Mast.
The MIT License (MIT)
Copyright (c) 2017 Johnny Mast
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Files |
File | Role | Description | ||
---|---|---|---|---|
demos (12 files) | ||||
src (3 files, 1 directory) | ||||
tests (1 file, 4 directories) | ||||
.scrutinizer.yml | Data | Auxiliary data | ||
.travis.yml | Data | Auxiliary data | ||
ACTIONS.md | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
FILTERS.md | Data | Auxiliary data | ||
LICENSE.md | Lic. | License text | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | demos |
File | Role | Description |
---|---|---|
actions_chaining.php | Example | Auxiliary script |
actions_classes.php | Example | Class source |
actions_closures.php | Example | Auxiliary script |
actions_functions.php | Example | Auxiliary script |
actions_priority.php | Example | Auxiliary script |
autoload.php | Aux. | Auxiliary script |
filters_annotation.php | Example | Class source |
filters_chaining.php | Example | Auxiliary script |
filters_classes.php | Example | Class source |
filters_closures.php | Example | Auxiliary script |
filters_functions.php | Example | Auxiliary script |
filters_priority.php | Example | Auxiliary script |
Files | / | src |
File | Role | Description | ||
---|---|---|---|---|
Annotations (2 files) | ||||
Actions.php | Class | Class source | ||
Filters.php | Class | Class source | ||
Hook.php | Class | Class source |
Files | / | src | / | Annotations |
File | Role | Description |
---|---|---|
Filter.php | Class | Class source |
FilterAnnotationHandler.php | Class | Class source |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
Actions (5 files, 1 directory) | ||||
Demos (1 file) | ||||
Filters (6 files, 1 directory) | ||||
Hook (1 file) | ||||
bootstrap.php | Aux. | Auxiliary script |
Files | / | tests | / | Actions |
File | Role | Description | ||
---|---|---|---|---|
Assets (3 files) | ||||
ActionsChainedTest.php | Class | Class source | ||
ActionsClassesTest.php | Class | Class source | ||
ActionsClosuresTest.php | Class | Class source | ||
ActionsFunctionsTest.php | Class | Class source | ||
ActionsStaticTest.php | Class | Class source |
Files | / | tests | / | Actions | / | Assets |
File | Role | Description |
---|---|---|
CallbackFunctions.php | Aux. | Auxiliary script |
MockClass1.php | Class | Class source |
MockClass2.php | Class | Class source |
Files | / | tests | / | Filters |
File | Role | Description | ||
---|---|---|---|---|
Assets (4 files) | ||||
FilterObjectTest.php | Class | Class source | ||
FiltersChainedTest.php | Class | Class source | ||
FiltersClassesTest.php | Class | Class source | ||
FiltersClosuresTest.php | Class | Class source | ||
FiltersFunctionsTest.php | Class | Class source | ||
FiltersStaticTest.php | Class | Class source |
Files | / | tests | / | Filters | / | Assets |
File | Role | Description |
---|---|---|
CallbackFunctions.php | Aux. | Auxiliary script |
FilterObject.php | Class | Class source |
MockClass1.php | Class | Class source |
MockClass2.php | Class | Class source |
Version Control | Unique User Downloads | |||||||
100% |
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.