Login   Register  
PHP Classes
elePHPant
Icontem

File: Config_definitions.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Marko Tapio Manninen  >  Config Tool  >  Config_definitions.txt  >  Download  
File: Config_definitions.txt
Role: Documentation
Content type: text/plain
Description: Configuration format and description
Class: Config Tool
Read and write configuration text files
Author: By
Last change:
Date: 10 years ago
Size: 4,388 bytes
 

Contents

Class file image Download
## CONFIGURATION DEFINITIONS
## 
## This file describes how to write ConfigTool v 0.01 compatible configurations.
## First of all, there is nothing special, if you want to make it simple and fast.
## Just write your name value pairs to the text file keeping next few things in
## your mind.
## 
## 1. Key name must be started with alphabeth. Numeric, special characters and scandic
## letters are not allowed on key names. Name cannot start with empty space!
## 
## 2. Key name should not start with predefined AKTC prefixes ( b_, i_, a_, s_ ) if you
## don't want to use AKTC in your application. More about that, see part advanced configuration.
## In addition to that, there are some preserved words in ConfigTool. Don't use these words in your
## key names: LINES, INDENT, FILENAME, RESERVED_WORDS, AUTOBOOL, AUTOINTEGER, AUTOARRAY, AUTOSTRING
## 
## 3. ConfigTool interprets anything else but alphabeth starts of key names, as a comment
## This means, that you may use any non-alphabeth character as a start of comment, 
## but it's good practice to use some common characters as #, //, ;, *,... to start a 
## comment line
## 
## 4. Long string values, that contains empty spaces, must be started and ended with ' marks
## One-word values doesn't need '-marks. There are some examples:
## 
name1 = 'This is a right form of long string sentence'
name2 = This is not going to work properly.
name3 = Right!
 name4 = 'Not well, because of the empty space at the start of the key name!'
5name = 'Not good, this is interpreted as a comment!'
## 
## 5. You don't need to put any line ending marks after value
## 
name5 = 'Special mark for ending is not needed';
## 
## 6. You don't need to worry about empty spaces before and after = -mark. Empty spaces are 
## removed automatic. How ever, prefer using emty spaces before = -mark than using tabs!
## 
name6=Value
name7          = Value
##
## 7. Last but not least, there must be at least one = mark on configuration line to separate name from 
## value. Otherwise ConfigTool will produce a warning error.
##  
## And that's all folks. Now you should be able to write configuration files succesfully.
## You don't need to use commenting, just put name value pairs to the file, and that's it.
## But keeping your work in proper development cycle and later modifications, it's good 
## practice to comment everything you do.
##
## ADVANCED CONFIGURATIONS
##
## If you want to take full advantage of the all features of the ConfigTool, you should follow
## next directions in addition of above described formats.
## All key names, that starts with predefined prefixes: b_, i_, a_, s_ are interpreted in ConfigTool
## as a automatic key type conversion (AKTC) name. That means, that every key name, that starts with
## those prefixes are converted to native data types in ConfigTool (if autotype flags are setted 
## true, that is default in class).
##
## About b_
##
## Boolean type. You have to use one of the 8 values to make boolean type conversion to work:
## yes, no, true, false, on, off, 1, 0
## Any other values cause error message in application. don't start values with ' -marks.
##
## About a_
##
## Array type. Array must be in a form of comma separated list.
## Associative arrays are not supported in this version of ConfigTool (v. 0.01).
## You can make lists that contain mixed numbers and letters. Don't use empty spaces after
## commas in the list, if you don't want empty space before value of array.
## 
## About i_
## 
## Integer type. You have to set decimals with dot, not with commas. Don't start and end numbers with ' -marks
## 
## About s_
## 
## String type. Actually it's not necessary to start key names with s_, because every name is conserned as a
## string by default. But it's good practice to use s_ if you use other automatic key type conversion
## prefixes in the configuration file. 
##
## Finally there are some examples of working key name and value pairs:
## 
b_my_boolean1   = true
b_my_boolean2   = 0
b_my_boolean3   = off
b_my_boolean4   = yes
a_my_array      = 1,2,3,word,words after words
i_my_integer    = 1024.768
s_my_string1    = 'Many words and spaces'
s_my_string2    = Only_one_word;)
## 
## Copyright (c) 2004, Marko Manninen
## Licence GPL (GNU General Public License)
## 
## END OF DESCRIPTION