PHP Classes

File: ReadMe.txt

Recommend this page to a friend!
  Classes of Marko Tapio Manninen  >  Config Tool  >  ReadMe.txt  >  Download  
File: ReadMe.txt
Role: Documentation
Content type: text/plain
Description: Instructions
Class: Config Tool
Read and write configuration text files
Author: By
Last change: Added new version number and some links.
Date: 18 years ago
Size: 4,118 bytes


Class file image Download

CONFIGTOOL (v. 0.02)

This class is meant to read configuration information from the external text file.
Configuration information is placed in the text file with normal format as name-value pairs. 
With this class you can read and use configuration variables with object reference, modify 
key value pairs and save modified object back to the file. Class supports commenting with 
your favourite marks. Only alphabetically started key names will be used as a configuration 
variables. Class can use automatic key type conversion (AKTC) to set configuration variables 
to the native data types of php.

Class can also be used to read language specific information to your application. Please see
more from example files and documentation how to use (or modify) this class.



This package (at: includes the 
following files and directories:

ReadMe.txt			Actually you are reading it now!

index.html			HTML-format of ReadMe file


Config_definitions.txt		Tells you, how to write config files, 
				that are compatible with ConfigTool class.

ConfigTool.php			Main class. Include this to your applications.

./docs/				Directory. Includes documentation for the class 
				developer and simplified documentation to the
				end user. Use the one, that fits to your need.

./examples/			Directory. Includes example configuration file and
				examples (simple_example.php, advanced_example.php, 
				form_example.php) how to use it. There is also one 
				example, how to use language files with ConfigTool on 
				your applications.

If you somehow want to take a look at it:



Althought specific documentation is included with this class, class is fairly simple to use.
Here you find simple example, how to get started without reading the documentation:

// include the class with proper relative path
include( "path/to/class/ConfigTool.php" );
// make object
$conf = new ConfigTool();
// get configuration information from the text file
// any relative path can be used
$conf->setConfigFromFile( "path/to/file/config.txt" );
// now it's up to you... echo value of the key, 
// that you have defined on the config.txt
echo $conf->your_key_name;

See more advanced examples from the examples directory.

Class and examples are distributed under the GPL, so you can modify them freely to your need.
Since i'm developing this class betweenwhiles, i'd be glad to hear from you, if you use it 
on your scripts and applications, or find some retouching suggestions or even bugs on it.

Some of the ideas to this class are from freely distributed ConfigReader class. But as class
doesn't relay on it, or connects to it very loosely, i have prefered to show only web reference 
to it. See copyright at:

Thera are also some other projects on the world, that goes side by side with ConfigTool. If 
you are interested, take a look at: : This is almost same like ConfigTool! But
i've never seen it but after i made my own. :) Still some new features in ConfigTool version 
0.02 are derived from that class.

Marko Manninen
6.5.2004, Kajaani

mob: +358 44 2927529
For more information send a message to info at phpclasses dot org.