-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.php
More file actions
74 lines (33 loc) · 1.05 KB
/
config.php
File metadata and controls
74 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
set_include_path(realpath(dirname(__FILE__) . '/inc'));
/**
* General usage of config ini
*
*
*/
/*
$configFile = 'config.ini';
require_once 'Zend/Config/Ini.php';
$env = 'production';
$env = 'development';
$config = new Zend_Config_Ini($configFile, $env);
echo $config->db->username . ' : ' . $config->db->password;
*/
/**
* Writing of INI files
*
*
*/
/*
$configFile = 'config.ini';
require_once 'Zend/Config/Ini.php';
require_once 'Zend/Config/Writer/Ini.php';
$config = new Zend_Config_Ini($configFile, null, array('skipExtends' => true, 'allowModifications' => true));
echo $config->production->db->username . ' : ' . $config->production->db->password . '<br /><br />';
$config->production->db->username = 'new_username';
$config->production->db->password = 'new_password';
$writer = new Zend_Config_Writer_Ini(array('config' => $config, 'filename' => $configFile));
$writer->write();
$newConfig = new Zend_Config_Ini($configFile, 'production');
echo $newConfig->db->username . ' : ' . $newConfig->db->password;
*/