views:

53

answers:

2

hi,

i want to create the configuration file , which will have the application id and update path two variable , when i will pass the application id in the api it will return the update path of that application id . how i will achieve this making of configuration file.

regards

rahul

A: 

You can create an INI configuration file for your project and the parse it using php parse_ini_file function.

http://php.net/manual/en/function.parse-ini-file.php

Sample INI file

; This is a sample configuration file
; Comments start with ';', as in php.ini

[first_section]
one = 1
five = 5
animal = BIRD

[second_section]
path = "/usr/local/bin"
URL = "http://www.example.com/~username"

[third_section]
phpversion[] = "5.0"
phpversion[] = "5.1"
phpversion[] = "5.2"
phpversion[] = "5.3"

Here is another example for PHP configuration patterns

h++p://www.ibm.com/developerworks/library/os-php-config/index.html

Gaurav Jassal
A: 

i have done it by making an array

    $config = array (
        "{b0ff543d-d294-42c8-83eb-d72161ec6771}"  => '/var/www/youngib/rahul/'
    );
$source=$config[$_REQUEST['applicationid']];

thanks

rahul

Rahul Mehta