Software / code / prosody
Comparison
core/configmanager.lua @ 4530:40905e7bf680
configmanager: get(): Make section (core) optional (hurrah)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sat, 10 Dec 2011 17:21:19 +0000 |
| parent | 4358:86be454168fb |
| child | 5021:85b2689dbcfe |
comparison
equal
deleted
inserted
replaced
| 4433:f0e72fbe4d6a | 4530:40905e7bf680 |
|---|---|
| 39 function getconfig() | 39 function getconfig() |
| 40 return config; | 40 return config; |
| 41 end | 41 end |
| 42 | 42 |
| 43 function get(host, section, key) | 43 function get(host, section, key) |
| 44 if not key then | |
| 45 section, key = "core", section; | |
| 46 end | |
| 44 local sec = config[host][section]; | 47 local sec = config[host][section]; |
| 45 if sec then | 48 if sec then |
| 46 return sec[key]; | 49 return sec[key]; |
| 47 end | 50 end |
| 48 return nil; | 51 return nil; |