Download the PHP package micropackage/dochooks without Composer

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

DocHooks

BracketSpace Micropackage Latest Stable Version PHP from Packagist Total Downloads License

Micropackage logo

🧬 About DocHooks

The Laravel or Symfony projects are using method annotations for various things. This helps to have the project organized without too much code. WordPress has no implementation of such concept and this package is a remedy.

DocHooks package allows you to do:

Instead of old:

💾 Installation

🕹 Usage

Annotations

The hook and shortcode name is required while default priority is 10.

You don't provide the argument count, the class will figure it out. Just use the callback params you want.

Test if DocHooks are working

When OPCache has the save_comments and load_comments disabled, this package won't work, because the comments are stripped down. See the fallback solution.

Using within the class

You can extend the HookAnnotations class:

Or use the Trait:

Using as a standalone object

Fallback

Because the HookAnnotations object stores the called hooks in _called_doc_hooks property, you are able to pull them out and parse them into a list of old add_action, add_filter and add_shortcode functions.

For this you'll need a central "repository" of all objects with hooks ie. Runtime class. See the example of this approach in the Notification plugin, which uses the WP CLI to dump all the hooks into separate file.

📦 About the Micropackage project

Micropackages - as the name suggests - are micro packages with a tiny bit of reusable code, helpful particularly in WordPress development.

The aim is to have multiple packages which can be put together to create something bigger by defining only the structure.

Micropackages are maintained by BracketSpace.

📖 Changelog

See the changelog file.

📃 License

This software is released under MIT license. See the LICENSE file for more information.


All versions of dochooks with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
micropackage/singleton Version ^1.1
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 micropackage/dochooks contains the following files

Loading the files please wait ....