Download manual
Transcript
Lakmus manual 30 / 42 Chapter 13 Creating your own applications Group applications are the best way to enhance Lakmus – the best way to add new functionality to it and they are the highlight of Lakmus. This chapter will show you how to write your own application. If you are reading this chapter it shall be safe to assume that your are familiar with Lakmus not only from the user point of view but you shall also know something about its administration. Also, reading only this chapter will not be enough – you shall at least skim all chapters in this part of the manual. As the opening speech about applications and your knowledge has been made, there is no need for any delay – let’s go and learn how to create our very own application. 13.1 Getting ready As you learned earlier, the applications itself are distributed in form of a ZIP package that contains all files needed for running the application. In this chapter we will explore format of this package in greater detail and also we will build our own. There are several shell scripts in the development version of Lakmus to simplify building your own application. We will use them to generate the initial application skeleton and also to install it without using the web interface (to speed things up). To start a new application, execute the generate_application_skeleton.sh script (if you run it without arguments, it will print out a short help of its usage). It requires a single argument – the identification of the newly created application. Generally, you could choice as identification (please, note, that this is not application name – which could be duplicate with other application – but its unique identification) any name that would be a valid identifier in PHP. However, best practice is to use only letters of English alphabet (as a matter of fact, with national characters involved you are risking that the application would not work on all systems due to localization differences). Although you can the script with only single argument, it is worth mentioning other options you may use. • The -v turns on verbose messages about tasks the script is executing. • With the -n you can specify the application name (contrary to application identification, here you are not limited to certain set of characters). This it the "human-readable" version that will be displayed in application listings. • With -d option you can specify directory where the skeleton would be created. By default, this option has the value of application identification. • Finally, to display list of these options, run the script with -h. The script will create a new directory and will populate it with files that are vital for writing a new application. Below is a list of created files and their purpose. IDF This file contains only the identification of the application. Makefile Prepared Makefile for most common tasks (see below for more information).