Dragonfly plugins | Dragonfly web framework

Plugins

You can extend and modify Dragonfly's behavior through the use of plugins.

There are two types of plugins, those in the plugins-active folder, and those in the plugins-inactive folder. The ones in the former are loaded when listener is called, prior to running the routes. Every .lsp file in the plugins-active folder is loaded at that point, so you'll only want your most frequently used files in there.

Active Plugins

A good example of an active plugin is a custom route. A small library of frequently used functions would also be something that makes sense to turn into an "always active" plugin.

Inactive Plugins

Inactive plugins are simply those that should be loaded on a "need to use" basis. Most plugins will probably fall into this category. Use DF:activate-plugin to load them. All plugins are loaded exactly once, no matter how many times activate-plugin is called on them.

For example, to load Dragonfly's Sqlite3 database interface:

(DF:activate-plugin "db/database_sqlite3")

Modules

In addition to Dragonfly's plugins, you can use the modules that come with newLISP. You can load them using the module function like this:

(module "sqlite3.lsp")

INFORMATION
Dragonfly overloads the load function (which module uses) to ensure that modules, like plugins, are loaded only once.

CONTINUE »

Rendered in 1 milliseconds. Used 83 KB of memory, 58 KB for Lisp Cells.