Developing New Packages

Developers Note compiling packages:

When compiling packages for installer all files and images must be at the root of the 'zip' file with no folders withing the package. Directories will be created by the install plug-in and all files copied into their proper directories. The package must contain information on how to build the install, this is done in arrays within the 'install_info.php' script within the package. Here is a simplified example:

<?php
// istall info for package WPC Auto Installer Menu v1.0
// any value to the right of '-' will be removed during install

$install_dir=array(
'/core/system/fortomb/secure/menu/installer_menu'
);

$install_files=array(
'/core/system/fortomb/secure/menu/installer_menu/delete.php-x.php',
'/core/system/fortomb/secure/menu/installer_menu/index.html-x.html',
'/core/system/fortomb/secure/menu/installer_menu/menu.php-x.php',
'/core/system/fortomb/secure/menu/installer_menu/menu_name.php-x.php'
);

$chmod_dir=array(
'/core/system/fortomb/secure/menu/installer_menu-0755'
);
?>

This syntax must remain the same for all packages.

Database is handled as 'db_info.php':

<?php
$wpc_core = array(
array('PID' => '47','pagename' => 'pgd.secure_package_upload_default','content' => 'Package+Installer','id' => NULL),
array('PID' => '48','pagename' => 'pg.secure_package_upload_default','content' => '%3C%2Ftable%3E','id' => NULL)
);

$con=mysql_connect($db_host,$db_user,$db_pass);
@mysql_select_db($db_name, $con) or die(mysql_error());

foreach($wpc_core as $data) {
@mysql_query("DELETE QUICK FROM wpc_core WHERE pagename = '$data[pagename]'");
@mysql_query("INSERT INTO wpc_core(pagename, content) VALUES( '$data[pagename]',
'$data[content]')");
}
mysql_close($con);

?>

No comments:

Post a Comment