History of SamplePackage

Version 22


An example bitweaver package that is fully functional

Created by: WaterDragon, Last modification: 13 Jun 2006 (10:53 UTC) by WaterDragon
Sample is a fully functional bitweaver package that demonstrates capabilities and best practices for building your own package that extends the bitweaver and Liberty CMS core. This package makes a great starting place to building your own package. Bear in mind, you are not *required* to follow this coding technique. A bare bones package only needs a directory and a ))bit_setup_inc.php(( file. However, many package developers will want to integrate nicely with other bitweaver packages, and utilize other packages' services like the LibertyPackage CMS core.

Sample is entirely community driven. It is suggested that you begin here as this is a good starting point for anyone wanting to cut their teeth on getting to know the bitweaver architecture.

To Download:

To get this to work on your system:

First, extract and copy the sample folder to your bitweaver root directory.

This package requires you to run the installer because it creates its own database. If you are interesed, there is more information about the installer on the InstallPackage page.

Go to Administration -> Kernel -> Packages

Across the top, you should see an "Install Packages" tab. Click that. At the bottom of the list there is a link to the installer - Not the "Activate bitweaver Packages" button! Look where it says "To install more packages, please run the installer to choose your desired packages". Click the word "installer".

Now you are at the Package Installation page. You should see the "sample" package all checked off and ready to go. Click on the "Install Packages" link at the bottom. The table "bit_sample" will now be created in your database. When that is complete, click "continue with install", and BitWeaver will check for conflicts with other existing packages. If there are no conflicts, click on "Continue Install Process", and you will be at the "Installation is complete" page.

Click "Enter your bitweaver site" at the bottom, and the new Sample application should be active in the menu system. WaHoo!

For an exploration of these files, and how they work - visit the SamplePackageDissection page.

Use the Sample package as a place to start your own package

Here are some simple instructions you can use to quickly convert the sample package into a package you can use as a starting point for your own custom package. They are only for unix users.

A bash script based on these instructions to make packages is available in the sample package (included in the above download locations: sample/mkpackage.sh)

  1. Get a copy of the sample code and place it in your bitweaver root directory alongside all other package directories.

You can then either do the following:

  1. Rename the sample to a package for your choice, in our example "music" and change into your new directory:
mv sample music; cd music

  1. Case sensitive Search and Replace all occureneces of 'sample' with your package name:
find . -name "*" -exec perl -i -wpe "s/sample/music/g" {} \; ; find . -name "*" -exec perl -i -wpe "s/SAMPLE/MUSIC/g" {} \; ; find . -name "*" -exec perl -i -wpe "s/Sample/Music/g" {} \;

  1. Rename all the files containing 'sample' with your package name:
find . -name "*sample*" -exec rename sample music {} \; ; find . -name "*Sample*" -exec rename Sample Music {} \;

Or else you can:
  1. Run the mkpackage.sh script within the sample directory from your bitweaver root directory:
sample/mkpackage.sh music

which will do all of the above for you.

Finally you need to:
  1. Run the package installer to install your new package and you are up and running!
Page History
30 Mar 2009 (00:13 UTC)
Derek Simkowiak71.231.59.10529
Current • Source
Derek Simkowiak71.231.59.10528
View • Compare • Difference • Source
Daniel Sutcliffe71.161.102.627
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source
Sean Lee71.241.129.1748
View • Compare • Difference • Source
Chaim Krause69.23.127.717
View • Compare • Difference • Source
View • Compare • Difference • Source
Kevin Olbrich152.16.227.1624
View • Compare • Difference • Source
View • Compare • Difference • Source
View • Compare • Difference • Source