Download the PHP package em4nl/unplug without Composer
On this page you can find all versions of the php package em4nl/unplug. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package unplug
Short Description WordPress microframework
License MIT
Homepage https://github.com/em4nl/unplug
Informations about the package unplug
Unplug
WordPress microframework
Installation
Via composer:
Usage
Unplug is a microframework for use in a WordPress theme when you need more control over the frontend of your website than WordPress gives you by default. It's highly recommended to use it together with the Twig template engine.
The basic idea is to bypass WordPress' routing/template hierarchy mechanisms completely and roll our own.
I assume you're using autoloading and your composer vendor dir is
at ./vendor
.
functions.php
To make sure WordPress doesn't run its default query/template,
you'll need to add a call to Em4nl\Unplug\unplug
in your theme's
functions.php
.
index.php
For most themes, this will probably be the only other PHP file you'll need (especially if using Twig).
index.php (WordPress root) (CACHING!)
While you can just use Unplug's caching from inside your theme, the
most efficient way is to circumvent WordPress completely and only
load it when we can't or don't want to serve a page from cache. In
order to do so, you'll need to replace WP's root index.php
file
with your own.
Rename index.php
---the one at the root of your WordPress
installation, not the one in your theme, to something else,
like wp-index.php
.
Then create a new index.php
file in its place and put the
following code in it:
This will serve files from the cache and only load WordPress if a file isn't found or invalidated by a custom function given through the optional `invalidate** parameter.
Read on, you need that file, too
unplug-config.php
While it won't hurt to have this file if you're not using the
custom front controller, you need to have it if you do. You can
put this in the WordPres root next to the index.php
or in any
other directory really as long as it's above the vendor
dir where
you installed unplug.
At the moment, you'll need to have these two definitions in there:
Development
Install dependencies
Run tests
License
All versions of unplug with dependencies
em4nl/urouter Version ^0.0.4
em4nl/ucache Version ^0.0.4
em4nl/uresponse Version ^0.0.3