HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
_explain.php
Go to the documentation of this file.
1 <?php
8 // Пробелы после знаков препинания для компактного вывода в таблицу
9 if ($connection->driverName == 'mysql') {
10  foreach ($explainRows as &$row) {
11  foreach ($row as &$cell) {
12  $cell = preg_replace('/\s*[,:;]\s*/', '$0 ', $cell);
13  $cell = preg_replace('/\s*[\[({]\s*/', ' $0', $cell);
14  $cell = preg_replace('/\s*[\])}]\s*/', '$0 ', $cell);
15  $cell = preg_replace('/([\[({])\s+([\[({])/', '$1$2', $cell);
16  $cell = preg_replace('/([\])}])\s+([\])}.,:;])/', '$1$2', $cell);
17  }
18  unset($cell);
19  }
20  unset($row);
21 }
22 ?>
23 <?php if (($first = reset($explainRows)) !== false): ?>
24  <table class="table table-condensed table-bordered">
25  <thead>
26  <tr>
27  <?php foreach (array_keys($first) as $key): ?>
28  <th><?php echo CHtml::encode($key); ?></th>
29  <?php endforeach; ?>
30  </tr>
31  </thead>
32  <tbody>
33  <?php foreach ($explainRows as $row): ?>
34  <tr>
35  <?php foreach ($row as $value): ?>
36  <td><?php echo CHtml::encode($value); ?></td>
37  <?php endforeach; ?>
38  </tr>
39  <?php endforeach; ?>
40  </tbody>
41  </table>
42 <?php else: ?>
43  <p>Empty</p>
44 <?php endif; ?>