source: alternc/trunk/bureau/class/local.php @ 2115

Revision 2115, 734 bytes checked in by anarcat, 5 years ago (diff)

cosmetic change: better alignment in variable decl.

Line 
1<?php
2
3/* Read global variables (AlternC configuration) */
4$L_VERSION="v. @@REPLACED_DURING_BUILD@@";
5
6/* To ease the transition, we define a lookup table for old names */
7$compat = array('DEFAULT_MX'   => 'MX',
8                'MYSQL_USER'   => 'MYSQL_LOGIN',
9                'MYSQL_PASS'   => 'MYSQL_PWD',
10                'NS1_HOSTNAME' => 'NS1',
11                'NS2_HOSTNAME' => 'NS2');
12
13
14$config_file = fopen('/etc/alternc/local.sh', 'r');
15while (FALSE !== ($line = fgets($config_file))) {
16    if (ereg('^([A-Z0-9_]*)="([^"]*)"', $line, $regs)) {
17        $GLOBALS['L_'.$regs[1]] = $regs[2];
18        if (isset($compat[$regs[1]])) {
19            $GLOBALS['L_'.$compat[$regs[1]]] = $regs[2];
20        }
21    }
22}
23
24fclose($config_file);
Note: See TracBrowser for help on using the repository browser.