{maketoc index=1}

__This documentation page refers to Bitweaver version 1.__

! Moving files
Implement the new bitweaverArchitecture file structure. bitweaver starts with the TikiWiki code base and reorganizes it. The idea is to start with the ReleaseAl code base, and to move what was and TikiWiki's lib/ directory, which is nicely organized, to the root. Then, move all the templates, modules, and php files related to that lib, into its lib directory. See bitweaverArchitecture for example of the new file structure.

! Creating SQL file
SQL file adds the only required database ALTER:
{code source=php}ALTER TABLE tiki_modules ADD COLUMN package VARCHAR(255);{/code}
This column is necessary to know which Package directory to go dig the module file from. Also, the "tikiIndex" preference must be deleted if it is "tiki-index.php" since that now longer exists. These SQL changes are in tikiroot/db/spidercore.sql

! Updating include and require
Use the new naming convention and PathDefine's. This involves testing and running a lot of multi-file search and replace.
{code source=php}
OLD WAY: include_once ('lib/notifications/notificationlib.php');
NEW WAY: include_once ( KERNEL_PKG_PATH.'notification_lib.php' );
I run lots and lot of find commands to do multi-file search and replace. For example, this replaces all include and requires of bloglib.php with the define for the blog package location and new name convention:
{code source=php}
find . -name "*php" -exec perl -i -wpe \
"s/_once[ ]*\(['\"]lib\/blogs\/bloglib.php['\"]\)/_once\( BLOGS_PKG_PATH.'blog_lib.php' \)/g" {} \;

! Updating template references
Follow the new ((TemplatesPackage)) resource method.

{code source=php}
// In the *template files*, change as follows. Note addition of QUOTES and removal of tiki- prefix from file name:
OLD WAY: {include file=tiki-directory_bar.tpl}
NEW WAY:{include file="tikipackage:directory/directory_bar.tpl"}

// or

OLD WAY: {popup_init src="lib/overlib.js"}
NEW WAY:{popup_init src="`$gTikiLoc.THEMES_PKG_URL`overlib.js"}

{code source=php}
// In *PHP files*, the smarty load and assigns should look like
OLD WAY: $smarty->assign('mid', 'tiki-my_tiki.tpl');
NEW WAY: $smarty->assign('mid', 'tikipackge:users/my_tiki.tpl');

// or

OLD WAY: $smarty->fetch("debug/tiki-debug_console_tab.tpl");
NEW WAY: $smarty->fetch( "tikipackage:debug/debug_console_tab.tpl' );

// An example find command I often run is replacing template include files
// with the package location url prefix and new file name convention:
find . -name "*tpl" -exec perl -i -wpe \
's/tiki-view_blog.php/\{\$tiki_url\.blogs_url\}view_blog.php/g' {} \;

{code source=php}
// PHP *lib references** should look like:
OLD WAY: include_once ('lib/charts/chartlib.php');
NEW WAY: require_once( CHARTS_PKG_PATH.'chart_lib.php' );

// *other PHP references* should look like:
OLD WAY: return "<img border='0' src='img/icn/else.gif' alt='icon' />";
NEW WAY: return '<img border="0" src="'.IMG_PKG_URL.'icn/else.gif" alt="icon" />';

! see also
* ((TransitionSignUp))
* ((bitweaverArchitecture))
* ((TemplatesPackage))
* ((KernelPackage))


{attachment id=1}
Page History
26 Oct 2008 (10:36 UTC)
correct format
Current • Source
View • Compare • Difference • Source