| Conditions | 3 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 3 | function es_root($request, $args) |
||
| 4 | { |
||
| 5 | global $esConn; |
||
| 6 | |||
| 7 | $indices = array_keys($esConn->indices()->getAliases()); |
||
| 8 | $indexes = []; |
||
| 9 | $params = []; |
||
| 10 | foreach ($indices as $index) { |
||
| 11 | if (strpos($index, '.') !== 0) { |
||
| 12 | $params['index'] = $index; |
||
| 13 | $index_data = []; |
||
| 14 | $index_data['name'] = $index; |
||
| 15 | $index_info = $esConn->indices()->getMapping($params); |
||
| 16 | $index_data['types'] = array_keys($index_info[$index]['mappings']); |
||
| 17 | $indexes[] = $index_data; |
||
| 18 | } |
||
| 19 | } |
||
| 20 | |||
| 21 | return ['data' => ['indexes' => $indexes], 'app_title' => 'Indices']; |
||
| 22 | } |
||
| 23 |