wak.ini files format
Each file have to include a meta-data file, named wak.ini
, at the root of the kit. Here is the file's format description :
[kit] section
The first section contains kit-wide informations.
- version
- The kit's version number. Will be used later for dependancies.
- desc
- A short, one-line description
- phpversion (optional but recommanded)
- Indicate for which PHP versions range the kit will work. Ex. 4.3-5.1 ou 5.*
- class (optional)
- The kit's instance class.
Webappkit
by default.
[kit]
; kit-wide meta informations
version = "0.1"
; kit version. Will be used later.
desc = "This is my first kit. It will rocks !"
; a short description. Single line to be INI compliant !
phpversion = "4.3-5.*"
; define which PHP versions range compatibility (optional)
; you can use a single version string with jokers, as 4.*
Libraries and dependancies
Those sections tell which kits have to be loaded before, then which kit's files have to be included, and finally which subkits have to be loaded. They are all optional. Elements order is important and will be the order in which they will be loaded.
- [load_kits]
- Other kits to load before this one, as index = "kit id". Index value is not significant, only order is important.
- [load_files]
- Own PHP files to include, as index = "relative/path/to/file". Index value is not significant, only order is important. The path is relative to the kit's root.
- You can include a file for each PHP version, by naming them
.php4
,.php5
etc. If so, indicate.php*
in this list and the included file will be the one corresponding to the current PHP version. - [load_classes]
- List class definition files. When running PHP5, they will by indexed and auto-loaded when requested in your scripts. When running PHP4, will be loaded just as [load_files]. You can use the
.php*
trick there too. - [load_subkits]
- Subkits to load, as index = "subkit id". Index value is not significant, only order is important. The subkit id have to omit the parent kit id part. Ex.
hello.world
references hereexample.hello.world
[load_kits]
; kits to load before self resources, order will be preserved.
; n = "absolute kit id"
10 = "datapath"
[load_files]
; self resources to load, order will be preserved.
; n = "relative/path/to/file"
10 = "myclass.class.php4"
20 = "mychildclass.class.php*"
[load_classes]
; classes index
; class = "relative/path/to/definition/file"
; class names MUST be lower case
anotherclass = "lib/anotherclass.php*"
[load_subkits]
; subkits to load after self resources, order will be preserved
; n = "relative subkit id"
0 = "hello.world"
[tools] section
This section lists Kit's Tools members. Keys are member's name and values the class to use.
[tools]
; name = "class"
realm = "HttpRealmTool"
In this example, an HttpRealmTool
instance will be available as $kit->realm.