[zzoss-devel] installer: how to create a package
Status: Alpha
Brought to you by:
czonsius
|
From: Christian Z. <chr...@zo...> - 2003-02-27 11:38:21
|
hi, here are the basics for creating a package for the zzoss installer. your package must have at least following directory/file structure: my_package-1.0/=09=09=09// unique name of package (name + version) =09zzoss_installer/ =09=09package.xml package.xml contains all package relevant information for the installer. if you want to make use of plugins, just create a directory named after t= he plugin to use below zzoss_installer. e.g. if you want to use the zzoss_co= nfig plugin, your pacakge structure might look like this: my_package-1.0/ =09zzoss_installer/ =09=09zzoss_config/=09=09=09// name of plugin to use =09=09=09configuration.php=09=09// plugin-specific file =09=09=09config.xml-dist=09 =09// plugin-specific file =09=09package.xml per default, the installer only contains the "_plugins" plugin. this is a special plugin for installing new plugins. e.g. if your package also contains the new plugin "my_plugin", your packa= ge structure might look like this: my_package-1.0/ =09zzoss_installer/ =09=09_plugins/ =09=09=09my_plugin/=09=09=09// name of new plugin =09=09=09=09exec_install.php=09// plugin file =09=09=09=09exec_uninstall.php=09// plugin file =09=09zzoss_config/=09=09=09// name of plugin to use =09=09=09configuration.php=09=09// plugin-specific file =09=09=09config.xml-dist=09 =09// plugin-specific file =09=09package.xml a package might install plugins and use them for installing itself. e.g. = if=20 you install "my_plugin" and want to use it afterwards your structure migh= t=20 look like this: my_package-1.0/ =09zzoss_installer/ =09=09_plugins/ =09=09=09my_plugin/=09=09=09// name of new plugin =09=09=09=09exec_install.php=09// plugin file =09=09=09=09exec_uninstall.php=09// plugin file =09=09my_plugin/=09=09=09// make use of new plugin =09=09=09my_data.dat=09=09// plugin-specific file =09=09zzoss_config/=09=09=09// name of plugin to use =09=09=09configuration.php=09=09// plugin-specific file =09=09=09config.xml-dist=09 =09// plugin-specific file =09=09package.xml the plugins below zzoss_installer are processed in alphabetic order. to complete the sample package, i will add some package-specific files: my_package-1.0/ =09lib/=09=09=09=09// package files =09=09my_package-1.0/=09=09// must be defined =09=09=09my_class.php=09// in package.xml =09modules/=09=09=09// for proper =09=09my_package-1.0/=09=09// copying / installing =09=09=09my_script.php=09// =09zzoss_installer/ =09=09_plugins/ =09=09=09my_plugin/=09=09=09// name of new plugin =09=09=09=09exec_install.php=09// plugin file =09=09=09=09exec_uninstall.php=09// plugin file =09=09my_plugin/=09=09=09// make use of new plugin =09=09=09my_data.dat=09=09// plugin-specific file =09=09zzoss_config/=09=09=09// name of plugin to use =09=09=09configuration.php=09// plugin-specific file =09=09=09config.xml-dist=09 =09// plugin-specific file =09=09package.xml =09=09 now the stuff can be tarred + zipped and then the package is done. what is development mode ? if you run the installer in development mode (in installer/config/config.= xml,=20 set development_mode to true), the installer scans per default for module= s in=20 "<application_root>/lib/", "<application_root>/modules/" and=20 "<application_root>/utils/". if there is a module in one of these directories, containing a zzoss_inst= aller=20 directorsy as subdir,the installer detects this as package. the only=20 difference to production mode when installing a package is the missing=20 copying of the source files, since when developing the source files and = the=20 targets are the same. a developer dir structure might look like this: my_app/=09=09=09=09// application root =09installer/=09=09=09// the zzoss_installer =09=09... =09modules/=09=09// the application module directory =09=09my_package/ =09=09=09my_script.php =09=09=09zzoss_installer/ =09=09=09=09my_plugins/ =09=09=09=09=09my_data.dat =09=09=09=09package.xml =09lib/=09=09=09=09// application libs / classes =09=09... =09=09 when installing "my_package (dev)", all plugins are executed but the=20 package-files are left untouched. (no copy). so the dev mode makes debugg= ing much easier. questions are welcome ;) christian |