Download the PHP package veronalabs/rabbit without Composer

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

Rabbit Framework - A modern way of building WordPress plugins.

Total Downloads Latest Stable Version

About

Rabbit Framework is a modern framework designed to be a solid foundation for your WordPress plugins. the project is based on Backyard

Benefits

  1. Dependency injection container & service providers.
  2. template that helps you load the view easily.
  3. OOP Nonces wrapper & Factory methods.
  4. Caching helpers.
  5. HTTP Redirects with admin notices flashing.
  6. Macroable classes.
  7. LoggerWP
  8. Illuminate Database (Eloquent)

Requirements

  1. PHP 7.4 or higher.
  2. Composer

Usage

Plugin header fields

When creating a WordPress plugin, you are required to add header fields to your plugin's entry file. The Rabbit framework requires 1 additional field: Plugin Prefix.

The Plugin Prefix field is used by the framework to automatically define constants about the plugin.

Load Composer autoloader

Copy and paste the code below right after the header fields to load all the dependencies of your plugin, including the Rabbit framework.

Create a new Application instance

Every Rabbit powered plugin must create an instance of a Rabbit Application. The application is responsible for the loading of the plugin.

Create a new application instance by using the get() method.

The plugin container

The framework handles a plugin through the Plugin class. The Plugin class is an extension of the PHP League dependency injection container. The container is responsible for the loading of configuration files, the registration & booting process of service providers and more.

Load your plugin into the application

After the instantiation of a Rabbit Application, you need to load your plugin into the application via the loadPlugin() method.

The loadPlugin() method takes 3 arguments, the third is optional.

  1. The path to the plugin.
  2. The path to plugin's entry file.
  3. The name of the folder that holds the configuration files.

    $myPlugin = $myPlugin->loadPlugin( DIR, FILE, 'config' );

The loadPlugin() method returns the Plugin container. You will then use the container to add functionalities to your plugin.

Configuration files

Configuration files provide an easy way to set options required by parts of application to work. Values can then be easily accessed by the plugin. A configuration file returns an associative array.

Use the config() method to access values. Keys use dot notation starting with the name of the configuration file. Take a look at the example below:

File: config/plugin.php

In order to access the my_key value, you need to call the config() method this way:

Configuration files are used by some features provided by Rabbit.

Add service providers

Service providers in Rabbit are used to add functionalities to your plugin. Providers can be loaded by using the addServiceProvider() method of the container class.

The activation & deactivation hook

Activation and deactivation hooks provide ways to execute actions when the plugin is activated or deactivated. If you're familiar with these hooks, you may remember they are called with the register_activation_hook and register_deactivation_hook functions.

In Rabbit you can register the activation and deactivation process by using the onActivation and onDeactivation methods of the Plugin class. Both methods use a Closure as argument.

Boot the plugin

Use the boot() method of the Plugin class to boot your plugin. The boot() method uses a Closure that allows you to add more functionalities to your plugin.

When booting, the plugin boots the registered service providers on the plugins_loaded hook.

To boot your plugin use the following snippet:

Load plugin textdomain

If your plugin requires localization, you can use the loadPluginTextDomain method inside the boot method. The framework will use the information in your header fields to set the correct textdomain and languages folder path.

Include files

The Rabbit framework comes with an easy way to include() files in your WordPress plugin. Use the includes() method of the Plugin class to include files from a specific folder. Files are loaded alphabetically.

The example above will automatically include *.php files from the includes subfolder of your plugin.

Example entry file

Example plugin

There is an example of using the Rabbit Framework in this repository

License

Distributed under the MIT License. See LICENSE for more information.


All versions of rabbit with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
caseyamcl/configula Version ^3.1
illuminate/database Version ^8.61
illuminate/macroable Version ^8.7
laminas/laminas-diactoros Version ^2.5
laminas/laminas-escaper Version ^2.7
laminas/laminas-form Version ^2.15
laminas/laminas-i18n Version ^2.11
laminas/laminas-view Version ^2.11
league/container Version ^3.3
symfony/finder Version ^5.1
symfony/http-foundation Version ^5.1
veronalabs/logger-wp Version ^1.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 veronalabs/rabbit contains the following files

Loading the files please wait ....