View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Nate Lewis > FWS-V2-1.13091122 > FWS::V2



Annotate this POD


New  1
Open  0
View/Report Bugs
Module Version: 1.13091122   Source  


FWS::V2 - Framework Sites version 2


Version 1.13091122


    use FWS::V2;
    my $fws = FWS::V2->new( DBName        => 'myDB',
                            DBUser        => 'theUser',
                            DBPassword    => 'superSecret',
                            DBHost        => 'localhost',
                            DBType        => 'MySQL');


FWS::V2 is the utility counterpart to the web based content management development platform provided at The web based version of this module is derived from this source with additional web specific features and packaging. The web based version enables the FWS to function on most any modern hosting environment, be upgraded in real time via the web based FWS administration, and control shared plugins between all of your installations even on different servers.

Using this version is ideal for accessing any plugin feature, or data stored within a FWS installation from a standalone script. Examples of this would be scripts to do site maintenance, imports, exports, mass data updates, data mining, 3rd party data synchronization, web services, APIs... and more!

The syntax and usage of the FWS::V2 is identical to the web based element and plugin development available within the FWS web based administration. Code from either is interchangeable between both distributions of FWS::V2 and the web based distribution of FWS available from


Wait a second... why does FWS V2 seem to have its own home grown methods that are already in popular well established packages????

One of the main goals of FWS is to have a bundled, autonomous version of the FWS that can be picked up and sat on almost any major ISP or Linux hosting environment without any care for what is present on the server. Packages the FWS does use have been carefully picked and validated to be supported on most all major ISPs. For more information on this bundled web optimized version visit



Construct a FWS version 2 object. Like the highly compatible web optimized distribution this will initiate access to all the FWS methods to access data, file, session, formatting and network methods. You can pass a variety of different parameters which could be required depending on what methods you are using and the context of your usage. MySQL and SQLite are supported with FWS 2, but MySQL should always be used if it is available. On medium or high traffic sites and sites with any significance of a data footprint, you will see quite a bit of latency with SQLite.

Example of using FWS with MySQL:

    # Create FWS with MySQL connectivity
    use FWS::V2;
    my $fws = FWS::V2->new(       DBName          => "theDBName",
                                  DBUser          => "myUser",
                                  DBPassword      => "myPass");

Example of using FWS with SQLite:

    # create FWS with SQLite connectivity
    use FWS::V2;
    my $fws = FWS::V2->new(      DBType          => "SQLite",
                                 DBName          => "/home/user/your.db");

Any variable passed or derived can be accessed with the following syntax:

    print $fws->{'someParameter'}."\n";

With common uses of FWS, you should never need to change any of these settings. If for some reason, although it is NOT recommended you can set any of these variables with the following syntax:

    $fws->{'someParameter'} = 'new settings';

Required Parameters

Non-Required Parameters

Non-required parameters for FWS installations can be added, but depending on the scope of your task they usually are not needed unless your testing code, or interacting with web elements that display rendered content from a stand alone script.


Accessable after setFormValues() is called

Accessable after setSiteFiendly() is called

Accessable after setSession() is called

Accessable after setSiteValues() is called

Accessable after processLogin() is called



To use the web based rendering you can use this module, or the current web optimized version that is available from When using this module as opposed to the web based version you still need to run the FWS core upgrade to receive the admin modules to your local installation. Any time running an FWS core upgrade you of course not have your core updated, only the admin elements and supporting JavaScript and files..

Simple Web Rendering Sequence

    # Load FWS
    use FWS::V2;
    $fws = new ( 
        #....  FWS Settings ...
    # add any plugins we have installed
    # Get the form values
    # Connect to the DB
    # Page descisions and friendly url conversions
    # Run any init scripts if needed
    # Set session and or get session vars
    # Set site values based on any information we have collected, created or changed
    # Do login procedures
    # Run Internal Admin Actions
    # Display the content we just created

For a more robust version of this sequence use the file creation for manual installation located on



Any plugin that is actived via the plugin list in developer menu will attempt to be loaded.

    # register all plugins applied to this instance


Apply a plugin to an installation without using the GUI, to force an always on state for the plugin. If server wide plugins are being added for this instance they will be under the FWS::V2 Namespace, if not they can be added just as the plugin name.

    # register plugins that are available server wide 
    # register some plugin added via the FWS 2.1 Plugin manager

Additionally if you want to check if a plugin is active inside of element or scripts you can use the following conditional:

    # check to see if ECommerce is loaded and active
    if ($fws->{plugins}->{ECommerce} eq '1') {     print "ECommerce is installed!\n" }
    else {                                         print "No ECommerce for you!\n" }


Nate Lewis, <nlewis at>


Please report any bugs or feature requests to bug-fws-v2 at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc FWS::V2

You can also look for information at:


Copyright 2013 Nate Lewis.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.

syntax highlighting: