PostNuke: A Flexible Open Source Content Management System
home | forum | international support | contact us

Documentation Wiki

How to build a distribution

Intended audience: developers, distributors
minimum version: PostNuke .8

An distribution is a collection of preconfigured module that are going to be installed during the systems setup. So you can create a package that is aimed at blogger, communities aso. If you ever installed Postnuke .8 you must already have seen the needed function: During the installation you are asked to chose Basic oder Full installation. These are types of installations you can now define yourself.

Step 1 - Assemble your Modules
In a first step make sure that all modules run on Postnuke .8, then copy all the modules you need for your package into /modules/ - just like you wanted to install them.

Step 2 - The installation file
An installation type is basically described as a PHP file which follows certain rules. You can call the file anything you like - in this example we call it blog.php. This file has up to two functions and is located in /install/pninstalltypes/ (eg. as install/pninstalltype/blog.php). The installer will always scan this folder and offer the options found to the user. The name of the file used as the common name for the install file.

function installer_[common_name]_modules()

This function returns an array of arrays containing all the modules to be installed. Each of the module needs an pninit.php with the corresponding mymodule_init() function, which all modern module should already have.

Example:

    return array(array('module'   => 'pagesetter',
                       'category' => _ADMIN_CATEGORY_03_a))


This installs Pagesetter and stores it in the category _ADMIN_CATEGORY_03_a (see the Admin modules language files for more information).

function installer_[common_name]_post_install()

This function will be executed, when the installation of all modules has been done successfully. You can use any PHP command here and certain functions of the PostNuke API. Not everything has been loaded by this time and will be available, eg. themes and sessions cannot be used.
installer_[common_name]_post_install() is optional, if it is not found, nothing will happen, no error will be thrown.

Example
See install/pninstalltypes/basic.php

XML Revisions of $tag
Page history :: Last Editor [ markwest ] :: Owner [ Landseer ] ::
Valid XHTML :: Valid CSS :: Powered by pnWikka 1.0 (A wiki fork from WikkaWiki)
 

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to PostNuke