Instalation

Sense is designed to work with Composer.

If you are not acquainted with the use of WPackagist with Composer for WordPress, we encourage the use of our WordPress composer base installation.

That comes with best practices in order to maintain WordPress platforms using Composer and deploy your code to different environments.

Adding Sense to your project

Once you have setup your WordPress project with composer, you need to edit composer.json file to specify that Sense is a requisity. For this, find the require block of code, and add "simettric/Sense" as in this example:

"require": {
    "php": ">=5.4",
    "composer/installers": "1.*",
    "johnpbloch/wordpress": "4.*",
    "wpackagist-theme/twentysixteen": "*",
    "simettric/Sense" : "*"
},

Initialize and configure the Sense Kernel

Once you have installed WordPress, you ptionally can configure Sense paramaters, you need to do this in your wp-config.php

//wp-config.php

require_once dirname(__FILE__)."/../vendor/autoload.php";

\Simettric\Sense\Kernel::configure(array(
    "plugins_order" => array(
         "my_first_plugin", 
         "my_second_plugin", 
         "my_theme_plugin"
    )
));

At this time, Sense only have one global configuration parameter: the plugins_order parameter. This parameter is used to customize the order in which your plugins and themes are registered in Sense.

Sense Plugins

You can use Sense in your plugins and themes. Both can be registered as a Sense Plugin.

We will see how to register them in the next chapter.