5 Jappix - An open social platform
6 This is the main configuration reader
8 -------------------------------------------------
12 Last revision: 26/08/11
16 // Someone is trying to hack us?
17 if(!defined('JAPPIX_BASE'))
20 // Define the default main configuration values
23 'desc' => 'a free social network',
24 'resource' => 'Jappix',
27 'registration' => 'on',
29 'manager_link' => 'on',
30 'groupchats_join' => '',
32 'https_storage' => 'off',
33 'https_force' => 'off',
34 'compression' => 'off',
35 'multi_files' => 'off',
39 // Define a default values array
40 $main_default = $main_conf;
42 // Read the main configuration file
43 $main_data = readXML('conf', 'main');
45 // Read the main configuration file
47 // Initialize the main configuration XML data
48 $main_xml = new SimpleXMLElement($main_data);
50 // Loop the main configuration elements
51 foreach($main_xml->children() as $main_child) {
52 $main_value = $main_child->getName();
54 // Only push this to the array if it exists
55 if(isset($main_conf[$main_value]) && $main_child)
56 $main_conf[$main_value] = $main_child;
60 // Finally, define the main configuration globals
61 define('SERVICE_NAME', $main_conf['name']);
62 define('SERVICE_DESC', $main_conf['desc']);
63 define('JAPPIX_RESOURCE', $main_conf['resource']);
64 define('LOCK_HOST', $main_conf['lock']);
65 define('ANONYMOUS', $main_conf['anonymous']);
66 define('REGISTRATION', $main_conf['registration']);
67 define('BOSH_PROXY', $main_conf['bosh_proxy']);
68 define('MANAGER_LINK', $main_conf['manager_link']);
69 define('GROUPCHATS_JOIN', $main_conf['groupchats_join']);
70 define('ENCRYPTION', $main_conf['encryption']);
71 define('HTTPS_STORAGE', $main_conf['https_storage']);
72 define('HTTPS_FORCE', $main_conf['https_force']);
73 define('COMPRESSION', $main_conf['compression']);
74 define('MULTI_FILES', $main_conf['multi_files']);
75 define('DEVELOPER', $main_conf['developer']);