PHP Classes
elePHPant
Icontem

iniRWC: Read and write configuration settings in INI files

Recommend this page to a friend!
  Info   View files View files (11)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2005-01-02 (11 years ago) RSS 2.0 feedNot enough user ratingsTotal: 870 All time: 3,868 This week: 1,045Up
Version License Categories
inirwc 1.0FreewareFiles and Folders, Configuration
Description Author

This class can read and write configuration settings in files in the .INI format.

It can:
-Parse .INI files and return an associative array with the names of the defined parameters and the respective values
-Create .INI files from an associative array of parameter values.
-Change or add parameters to existing .INI files.

It may also generate PHP files with code that assigns PHP variables corresponding to parameters defined in an INI file for faster usage with PHP application scripts.

Picture of Kozak Andrey
Name: Kozak Andrey <contact>
Classes: 1 package by
Country: Ukraine Ukraine

Details
iniRWC CLASS

This class will help you with settings in your programms. It can Read, Create and Change ini files. Also If you have variables in php files you can change it's value or add new, include this file and use your variables.

Class has 2 variables and 9 functions.

Variables:
	readError - this variable contains error messages of reading actions;
	writeError - this variable contains error messages of writing actions;

Functions:
	array ReadIni(string filename) - main function for reading Ini file;
	int WriteIni(string filename, array iniarray) - main function for writing Ini file;
	int WritePhp(string filename, array iniarray [, string prefix]) - main function for writing Php file;
	int ChangeIni(string filename, array inihash) - main function for changing Ini file;
	int ChangePhp(string filename, array inihash) - main function for changing Php file;
	array ReadFile(string filename) - read file;
	array ReadPhp(string filename) - function for reading Php file;
	array iniParse(array file) - parse ini file;
	array phpParse(array file:array) - parse php file;

FILE LISTING:
	iniRWC.inc.php - class file;
	ex01.php - example of reading simple ini;
	ex02.php - example of writing simple ini;
	ex03.php - example of changing simple ini;
	ex04.php - example of writing php;
	ex05.php - example of changing php;
	read_test.ini - ini file for ex01.php example;
	test.ini - ini file for ex02.php and ex03.php examples;
	test.php - php file for ex04.php and ex05.php examples;
	examples.html - examples listing;
	readme.txt - this file :-)

Installation:
Copy all files into your server. Get 0777 or rwxrwxrwx rights on files read_test.ini, test.ini and test.php.

For Examples please open examples.html

Information of work with class.
With ini files:
-all lines that start with ';' or '[' will be removed;
-all ' ' and '\t' will be removed at the end of key and at the start of value;

With php files:
-you can use a prefix for your variables in writing;

!!!WARNING!!!
THIS CLASS CAN WRITE PROPERLY ONLY IN PHP FILES THAT WAS CREATED BY ITSELF! PLEASE, LOOK EXAMPLES!!!

If you have questions please contact me admin@trek.dp.ua
  Files folder image Files  
File Role Description
Accessible without login Plain text file ex01.php Example example file
Accessible without login Plain text file ex02.php Example example file
Accessible without login Plain text file ex03.php Example example file
Accessible without login Plain text file ex04.php Example example file
Accessible without login Plain text file ex05.php Example example file
Accessible without login HTML file example.html Data examples listing
Plain text file iniRWC.inc.php Class class file
Accessible without login Plain text file readme.txt Doc. Readme
Accessible without login Plain text file read_test.ini Data ini read example
Accessible without login Plain text file test.ini Data ini examples file
Accessible without login Plain text file test.php Aux. php examples file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:870
This week:0
All time:3,868
This week:1,045Up