Download the PHP package simplemediacode/hooks without Composer
On this page you can find all versions of the php package simplemediacode/hooks. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package hooks
Modern PHP Hooks System
A lightweight, dependency-free implementation of an action and filter hook system inspired by WordPress hooks but designed for modern PHP applications.
Features
- Modern PHP Support: Fully typed, supports PHP 8.0+
- Dependency Injection Ready: Use the
HooksInterfacein your classes - Static Facade: Convenient static methods for quick integration
- No Dependencies: Lightweight implementation with zero dependencies
- WordPress Inspired: Familiar API if you're coming from WordPress
Installation
Via composer:
Usage
Using the Static Facade
Using Dependency Injection
Extending with Custom Implementations
You can implement your own version of HooksInterface to provide custom hook functionality:
Migration from WP_Hook
This package is a complete rewrite of the original WordPress hook system. Key differences:
- Renamed
WP_HooktoHook - Introduced proper interfaces for better type safety
- Added dependency injection support
- Replaced global variables with proper class properties
- Improved naming conventions and method signatures
Changelog
Read at CHANGELOG.md.
License
This library is released under the GPL-2.0 license. See the complete license in the bundled LICENSE file.
All versions of hooks with dependencies
PHP Build Version
Package Version
Requires
php Version
~8.0|~8.1|~8.2|~8.3|~8.4
The package simplemediacode/hooks contains the following files
Loading the files please wait ...