History of SamplePackageDissection
Version 7
SamplePackageDissection
A Breakdown of the files that make up the SamplePackage
Created by: WaterDragon, Last modification: 13 Jun 2006 (13:33 UTC) by WaterDragon
A Breakdown of the files included in the SamplePackage
This is an attempt to list and explain all of the files in the SamplePackage put together by spiderr. Any corrections you make or additions you have to this document are warmly appreciated. After all, that is what a wiki is for, right?
These files are being tackled in an order that seems a bit odd - Start where bitweaver starts - I.E. the install. After that - index.php and bit_setup_inc.php. Then a list of everything in a directory one at a time.
sample/admin/schema_inc.php
sample/admin/schema_inc.php is the file responsible for integrating SamplePackage into the InstallPackage and thus into bitweaver. When you go to the kernal/admin/index.php page and click on Packages this file gets automatically loaded in order to display the information about your package as provided in the call to registerPackageInfo. When you click on "Activate bitweaver packages" the various things you registered are actually stored into the database for use by your package.
At the top of the file is the array of tables that the package will use to do its job. The format for the schema is not straight SQL but rather is ADOdb style DataDict style code as documented in the
ADOdb Data Dictionary Documentation
The next bit of code tells bitweaver that this package can be used as
a homepage:
<?php
$gBitInstaller->makePackageHomeable( SAMPLE_PKG_NAME );
?>
The rest of the code registers the tables, indexes, sequences, pacakge information, preferences and permissions for the package. This is all relatively straight forward and is largely self explanatory.
sample/admin/admin_sample_inc.php
This file is the interface for administrating the package itself. It is used when you go to kernel/admin/index.php and click on Sample Settings. This page creates the options page that you see.
sample/mkpackage.sh
This script can be used to rename the sample package in order to make it easier to use it as a base for new packages. See SamplePackage for more information on using this to repackage the sample package as your own.