PHP Classes
elePHPant
Icontem

PHP Filters and Actions: Listen to events and execute registered actions

Recommend this page to a friend!
  Info   View files Example   View files View files (46)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-11-12 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
redbox-hooks 1.0MIT/X Consortium ...5PHP 5, Language
Description Author

This package can listen to events and execute registered actions.

It can register filter action handler functions that will be called before, during and after a given event is triggered.

It can also dispatch events and call all handler functions registered for the events when they are triggered.

  Performance   Level  
Innovation award
Innovation award
Nominee: 3x

Details

redbox-hooks-logo-klein

Redbox-hooks

Build StatusScrutinizer Code Quality Twitter URL

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:

Why was this package created?

This package was created because i am building a new modulair cms. I figured i could use a package like this and started building.

Fun fact

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.

Requirements

The following versions of PHP are supported by this version.

  • PHP 5.6
  • PHP 7.0
  • PHP 7.1
  • HHVM

Known issues

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.

Filter/Action function callback is not called

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);

Author

This package is created and maintained by Johnny Mast.

License

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 folder image Files  
File Role Description
Files folder imagedemos (12 files)
Files folder imagesrc (3 files, 1 directory)
Files folder imagetests (1 file, 4 directories)
Accessible without login Plain text file .scrutinizer.yml Data Auxiliary data
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file ACTIONS.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file FILTERS.md Data Auxiliary data
Accessible without login Plain text file LICENSE.md Lic. License text
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

 Version Control Unique User Downloads  
 100%
Total:0
This week:0