r2906 - maintenance->trunk sync of changesets 2886~2894
[racktables] / install.php
index 9ed3d5ef98d119d25b3de3b4ddaedf1d1d448d48..48727727d0e786a32ba5f39011e2650c3793d968 100644 (file)
@@ -25,6 +25,7 @@ if ($step > count ($stepfunc))
        exit;
 }
 $title = "RackTables installation: step ${step} of " . count ($stepfunc);
        exit;
 }
 $title = "RackTables installation: step ${step} of " . count ($stepfunc);
+require_once ('inc/dictionary.php');
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
@@ -307,7 +308,7 @@ function init_database_static ()
        echo '<table border=1>';
        echo "<tr><th>file</th><th>queries</th><th>errors</th></tr>";
        $errlist = array();
        echo '<table border=1>';
        echo "<tr><th>file</th><th>queries</th><th>errors</th></tr>";
        $errlist = array();
-       foreach (array ('structure', 'dictbase', 'dictvendors') as $part)
+       foreach (array ('structure', 'dictbase') as $part)
        {
                $filename = "install/init-${part}.sql";
                echo "<tr><td>${filename}</td>";
        {
                $filename = "install/init-${part}.sql";
                echo "<tr><td>${filename}</td>";
@@ -341,6 +342,23 @@ function init_database_static ()
                }
                echo "<td>${nq}</td><td>${nerrs}</td></tr>\n";
        }
                }
                echo "<td>${nq}</td><td>${nerrs}</td></tr>\n";
        }
+       // (re)load dictionary by pure PHP means w/o any external file
+       echo "<tr><th>dictionary</th>";
+       $nq = $nerrs = 0;
+       global $dictreload;
+       $dictq = array();
+       foreach ($dictreload as $tmp)
+               foreach (reloadDictionary ($tmp['from'], $tmp['to']) as $query)
+               {
+                       $nq++;
+                       if ($dbxlink->exec ($query) === FALSE)
+                       {
+                               $nerrs++;
+                               $errlist[] = $query;
+                       }
+               }
+       echo "<td>${nq}</td><td>${nerrs}</td></tr>\n";
+                       
        echo '</table>';
        if (count ($errlist))
        {
        echo '</table>';
        if (count ($errlist))
        {