PHP Classes
elePHPant
Icontem

File: ini_fn.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Kenan Savas  >  ini_manager  >  ini_fn.php  >  Download  
File: ini_fn.php
Role: Auxiliary script
Content type: text/plain
Description: ini_fn
Class: ini_manager
Manipulate configuration files in the ini format
Author: By
Last change:
Date: 6 years ago
Size: 2,363 bytes
 

Contents

Class file image Download
<?php

require_once( "ini_manager.php" );

function
list_entry_values( $ini_path, $key )
{
   
$iniMANAGER = new ini_manager();
   
$list_values = $iniMANAGER->list_entry_values( $ini_path, $key ) ;
    return
$list_values;
}


function
list_key_values( $ini_path )
{
   
$iniMANAGER = new ini_manager();
   
$list_values = $iniMANAGER->list_key_values( $ini_path ) ;
    return
$list_values;
}

function
find_key( $ini_path, $key )
{
   
$iniMANAGER = new ini_manager();
   
$found = $iniMANAGER->find_key( $ini_path, $key ) ;
    return
$found;
}

function
find_entry( $ini_path, $section, $entry )
{
   
$iniMANAGER = new ini_manager();
   
$found = $iniMANAGER->find_entry( $ini_path, $section, $entry ) ;
    return
$found;
}


function
add_entry( $ini_path, $section, $entry, $entry_val )
{
   
$iniMANAGER = new ini_manager();
   
$iniMANAGER->add_entry( $ini_path, $section, $entry, $entry_val ) ;
}

function
show_ini( $ini_path )
{
   
$iniMANAGER = new ini_manager();
   
$iniMANAGER->show_ini( $ini_path ) ;
}

function
get_params_ini( $section, $entry, $ini_path )
{
   
$iniMANAGER = new ini_manager();
   
$entry_val = $iniMANAGER->get_entry( $ini_path, $section, $entry ) ;

    return
special_chars_out( $entry_val );
}

function
set_params_ini( $section, $entry, $entry_val, $ini_path )
{
   
$iniMANAGER = new ini_manager();
   
   
$entry_val = special_chars_in( $entry_val );
   
   
$iniMANAGER->add_entry( $ini_path, $section, $entry, $entry_val ) ;
}

function
delete_entry_ini( $section, $entry, $ini_path )
{
   
$iniMANAGER = new ini_manager();
// $iniMANAGER->parse_ini_file( $ini_path ) ;
   
$iniMANAGER->delete_entry( $ini_path, $section, $entry ) ;
}

function
delete_key( $KEYname, $ini_path)
{
   
$iniMANAGER = new ini_manager();
// $iniMANAGER->parse_ini_file( $ini_path ) ;
   
$iniMANAGER->delete_key( $ini_path, $KEYname );
}

function
delete_all_keys( $ini_path )
{
   
$iniMANAGER = new ini_manager();
// $iniMANAGER->parse_ini_file( $ini_path ) ;
   
$iniMANAGER->delete_all_keys( $ini_path );
}

function
special_chars_in( $str )
{
   
$str = str_replace( "'", "\'", $str );
   
    return
$str ;
}

function
special_chars_out( $str )
{
   
$str = str_replace( "\'", "'", $str );
   
    return
$str ;
}

?>