PHP Classes
elePHPant
Icontem

Config Tool: Read and write configuration text files

Recommend this page to a friend!
  Info   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2004-05-06 (13 years ago) RSS 2.0 feedStarStarStarStar 71%Total: 4,664 This week: 1All time: 576 This week: 675Down
Version License PHP version Categories
configtool 1.0.0GNU Lesser Genera...3Files and Folders, Configuration
Description Author

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.

The class can use automatic key type conversion (AKTC) to set configuration variables to the native data types of php.

The 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.

Name: Marko Tapio Manninen <contact>
Classes: 3 packages by
Country: Finland Finland
Age: 41
All time rank: 3322 in Finland Finland
Week rank: 522 Down2 in Finland Finland Equal

Details
*********************************************************************************************

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.

*********************************************************************************************

INCLUDED FILES

This package (at: http://www.hmv-systems.fi/marko/ConfigTool/ConfigTool.zip) includes the 
following files and directories:

ReadMe.txt			Actually you are reading it now!

index.html			HTML-format of ReadMe file

License.txt			GNU LESSER GENERAL PUBLIC LICENSE.

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.
				
VERSION 0.01

If you somehow want to take a look at it: http://www.hmv-systems.fi/marko/ConfigTool/v001/

*********************************************************************************************

QUICK START

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:

<?php
// 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.

*********************************************************************************************
	
FINAL NOTES
			
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: http://www.thewebmasters.net/php/ConfigReader.phtml.

Thera are also some other projects on the world, that goes side by side with ConfigTool. If 
you are interested, take a look at: 

http://wiki.ciaweb.net/yawiki/index.php?area=Yawp

http://www.phpclasses.org/browse/package/508.html : 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.

http://www.phpclasses.org/browse/package/93.html

http://www.php-tools.de/site.php?&file=patConfiguration/overview.xml

Marko Manninen
6.5.2004, Kajaani

mob: +358 44 2927529
email: marko.manninen@hmv-systems.fi
web: http://www.hmv-systems.fi/marko/ConfigTool/
  Files folder image Files  
File Role Description
Accessible without login Plain text file advanced_example.php Example Example2 how to use the class
Plain text file ConfigTool.php Class Main class
Accessible without login Plain text file Config_definitions.txt Doc. Configuration format and description
Accessible without login Plain text file example_config_file.txt Conf. Example configuration file
Accessible without login HTML file index.html Doc. ReadMe in HTML format
Accessible without login Plain text file ReadMe.txt Doc. Instructions
Accessible without login Plain text file simple_example.php Example Example1 how to use class

 Version Control Unique User Downloads Download Rankings  
 0%
Total:4,664
This week:1
All time:576
This week:675Down
 User Ratings  
 
 All time
Utility:90%StarStarStarStarStar
Consistency:86%StarStarStarStarStar
Documentation:84%StarStarStarStarStar
Examples:86%StarStarStarStarStar
Tests:-
Videos:-
Overall:71%StarStarStarStar
Rank:293