Download the PHP package jenryollivierre/php-application-hooks without Composer

On this page you can find all versions of the php package jenryollivierre/php-application-hooks. 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 php-application-hooks

PHP Application Hooks

Introduction

PHP Application Hooks is a lightweight standalone package that lets you control when and where specific blocks of code can be executed within your application.

Installation

install via composer with composer require "jenryollivierre/php-application-hooks": "2.0.*" or simply download from github

How To Use

Get things started by creating an instance that can be accessed globally.

Then, at the point in your application where you will want 3rd party apps to be able to do something, you call on either of the following methods.

Actions

We use actions when we want an action/task to be carried out. To let 3rd party apps be able to carry out actions at a specific point in your application, you call on the $hooks->applyActions() method, which takes 3 arguments.

Example of Actions

Now, for the 3rd party apps to hook into the action of your application, they would call on the global $hook instance and call on the addAction() method.

The addAction() method takes 4 parameters.

To resolve the example above, the given callback to use was Post::cleanUpDatabase(). It would work like this:

Filters

We use filters when we want to filter a value. To let filters be carried out at a specific point in your application, you call on the $hooks->applyFilters() method, which takes 3 arguments.

** Note that the $value parameter will also be passed to the $arguments as the first parameter. So technically, everything in the $arguments array will be passed to 3rd party apps as the 2nd parameter onwards.

Example of Filters

Now, for 3rd party apps to hook into our filter, they would call on the global $hook instance and call on the addFilter() method.

The addFilter() method takes 4 parameters.

Extending & Making Your Own

The package is fully extensible, allowing you to create your own 'hooks'. You simply extend the 'JenryOllivierre\Hooks\HooksFoundation' class and then define your own methods. For example:

Or rolling your own:

The HooksFoundation class has a lot of useful methods to allow you to fully extend and make your own hooks class. They are:

Security Vulnerability

If you discover any security vulnerability, please email Jenry Ollivierre at [email protected]

License

PHP Application Hooks is open source software licensed under the MIT License


All versions of php-application-hooks with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
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 jenryollivierre/php-application-hooks contains the following files

Loading the files please wait ....