PHP Classes
elePHPant
Icontem

File: ABG_IniParser_Test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Gilbert BENABOU  >  ABG_IniParser  >  ABG_IniParser_Test.php  >  Download  
File: ABG_IniParser_Test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: ABG_IniParser
Parse and write ini format configuration files
Author: By
Last change: -
Date: 9 years ago
Size: 1,381 bytes
 

Contents

Class file image Download
<?
 
##############################################################################
  # ABG_IniParser.test.php #
  # V1.0.0 04/04/2006 : Initial #
  # V1.1.0 09/04/2006 : Debug mode #
  # (cy) G. BENABOU / ABG Soft PARIS FRANCE #
  # #
  # A PHP 4 script to test the ABG_IniParser Class #
  ##############################################################################

   
require ("ABG_IniParse.inc.php");
 
/*** Instantiate object and run **********************************************/
 
$ini = new ABG_IniParser("test.ini", TRUE);
  if (isset(
$ini)) {
    if(
$ini->ov_Status){
      print(
"Before : ");
     
print_r($ini->ov_Tbl);
     
$x = $ini->om_GetItem("Sec2", "Tok21", TRUE);
      print(
"<br />\n");
      print(
"Item Sec2/Tok21 = $x<br />\n");
 
//..
     
$x = $ini->om_GetItem("Sec3", "Tok31", TRUE);
     
$x = isset($x) ? strrev($x) : "abc";
     
$ini->om_SetItem("Sec3", "Tok31", $x);
      print(
"After : ");
     
print_r($ini->ov_Tbl);
      print(
"<br />\n");
     
$ini->om_WriteFile();
    }
  }
  else
    die(
"Object creation failed");
?>