NAME
Web::VWF - Versatile Web Framework - easily build a website to support different languages and client platforms
VERSION
Version 0.001.0
DESCRIPTION
Web::VWF is VWF, the Versatile Web Framework, packaged as a CPAN distribution. It is an MVC framework for building responsive websites that adapt to the client's language, to the kind of client (web, mobile, robot, search engine or AI crawler) and to whichever database back end the site uses.
This module is the distribution's front door: it holds the version number, this overview, and the one thing a site builds by hand - "new", the site's configuration and the directory the server keeps it in. Working the framework does these modules:
- Web::VWF::Display
-
The page renderer. Given the configuration, the browser's language and the kind of client it is, it finds the right template for a page and renders it. A site subclasses it for each of its pages.
- Web::VWF::Config
-
Reads the site's XML configuration.
- Web::VWF::Allow
-
Access control and rate limiting.
- Web::VWF::Blacklist
-
The country blacklist, shared by the page script, Web::VWF::Allow and Web::VWF::Display.
- Web::VWF::Utils
-
Cache initialisation and the Haversine distance calculation.
- Web::VWF::CAPTCHA
-
reCAPTCHA integration and the bypass that follows a solved challenge.
- Web::VWF::Data::<source>
-
The data access layer: CSV, XML and SQLite, through Database::Abstraction.
cgi-bin/page.fcgi in this distribution is a working page script to copy and adapt into a site's own cgi-bin; templates/, conf/example.com and data/ beside it are the small site it serves, and the starting point for a new one. examples/basic-site/ is that site laid out on its own - the script, the configuration, the templates and the data - and its README.md documents it as an example to copy: where a site's configuration is read from, what root_dir is, and how to run it before it is deployed. examples/links.nigelhorne.com/ is the other kind of site: one page of its own, a Web::VWF::Display subclass whose answer is a redirect rather than a rendering of a template, and whose own script it keeps - the example documents the four changes to this one that it takes, and why.
A site's templates sit under a path built from the page's class name, so the file to change when the page module is Web::VWF::Display::index is templates/en/web/HTTP/VWF/Display/index.tmpl - see Web::VWF::Display for the rest of the search order. CLAUDE.md records how a request is handled once it arrives.
A site that used to carry a renamed copy of VWF of its own deletes that copy, installs this distribution, renames VWF:: to Web::VWF:: in its own code, and moves its templates from .../VWF/Display/ to .../HTTP/VWF/Display/.
SUBROUTINES/METHODS
new
The configuration of a site, and the directory the server keeps it in.
Parameters:
directory- The directory the server keeps the configuration of the sites it serves in: one directory per site, named after the site, so that a site reached as example.com is configured from /usr/lib/vwf/example.com. Any other root can be named here - /etc/vwf, /usr/local/etc/vwf - and the default is /usr/lib/vwf. Optional.info,logger,config_directory,config_file,config- handed to Web::VWF::Config, which describes them.
directory
The directory the server keeps this site's configuration in: what new() was given, or /usr/lib/vwf. Web::VWF::Config adds the site's own name to it.
config
The site's configuration, read once and kept: a site that has no conf/ of its own beside cgi-bin/ is configured from the server's directory for it, and Web::VWF::Config describes the rest of the search.
AUTHOR
Nigel Horne, <njh at nigelhorne.com>
LICENCE AND COPYRIGHT
Copyright 2010-2026 Nigel Horne.
Usage is subject to the GPL2 licence terms. If you use it, please let me know.