Download the PHP package lotharthesavior/hook without Composer

On this page you can find all versions of the php package lotharthesavior/hook. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package hook

Hook

Hook is a hook system for PHP projects. This project is a fork of a fork of a fork, from a long time ago, and now got revived for posterity.

Installation

Context

Hooks are a way for one piece of code to interact/modify another piece of code. They are a way for a piece of code to be executed at a certain point in an application. This is a very powerful concept and is used in many applications, including WordPress, to allow developers to modify the behavior of the application without modifying the core code.

Customization points that use hooks are often called "actions" and "filters". An action is a point in the code where something happens, and a filter is a point in the code where something is modified. For example, in WordPress, the wp_head action is a point in the code where the <head> section of the HTML is output, and the the_content filter is a point in the code where the content of a post is modified before it is output.

This class is a rewritten of a fork of the original PHP Hooks which is a fork of the original PHP Hooks by John Kolbert. The original class was designed to be used in WordPress plugins and themes, but this class can be used in any PHP project.

Usage

Filters

Filters are functions that an application passes data through, at certain points in execution, just before taking some action with the data (such as adding it to the database or writing it to the output buffer - a terminal or a browser). As an example, most input and output in WordPress passes through at least one filter. Filter hooks is a great way to allow other developers to modify or extend the default behavior of any code.

This registers a filter:

Now, anywhere in your application, you can execute that filter:

Actions

Actions are functions that an application executes at specific points during execution, or when specific events occur. Actions are a way to make your application do something at a certain point, without modifying the code. In a sense it is like an event listener, but with a different name.

This registers an action:

Now, anywhere in your application, you can execute that action:

The output will be: <div id="extra_header">this came from a hooked function</div>

Methods

Filters

Actions

Shortcodes

License

Since this class is derived from the WordPress Plugin API so are the license, and they are GPL http://www.gnu.org/licenses/gpl.html

Credits


All versions of hook with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2
phpro/grumphp Version ^2.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lotharthesavior/hook contains the following files

Loading the files please wait ....