| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | function init() |
||
|
|
|||
| 14 | { |
||
| 15 | $alias = str_replace(App::$cur->config['site']['domain'], '', INJI_DOMAIN_NAME); |
||
| 16 | $city = null; |
||
| 17 | if ($alias) { |
||
| 18 | $alias = str_replace('.', '', $alias); |
||
| 19 | $city = Geography\City::get($alias, 'alias'); |
||
| 20 | } |
||
| 21 | if (!$city) { |
||
| 22 | $city = Geography\City::get(1, 'default'); |
||
| 23 | } |
||
| 24 | Geography\City::$cur = $city; |
||
| 25 | } |
||
| 26 | |||
| 28 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.