irm-1.6-b3/lib/Databases.php
/** List of databases that aren't at the given version.
     * Similar in concept to Databases::List(), but instead does a
     * check on each configured database to see if it is at the given
     * version or not.
     */
List of databases that aren't at the given version.
Similar in concept to Databases::List(), but instead does a
check on each configured database to see if it is at the given
version or not.
List of databases that aren ' t at the given version . Similar in concept to Databases :: List () but instead does a check on each configured database to see if it is at the given version or not .
function NotAtVersion($ver)
    {
        $data = Config::ReadConfig('database');
        $rv = array();
        foreach ($data as $id => $vals)
        {
            $DSN = @$vals['DSN'];
            $name = @$vals['name'];
            if (!$name)
            {
                $name = _('Unknown database');
            }
            $DB = new IRMDB(@$vals['DSN'], @$vals['socket']);
            if ($DB->error)
            {
                continue;
            }
            $dbver = $DB->GetDatabaseVersion();
            PRINT "<table>";
            PRINT "<tr>";
            PRINT "<th>" . _("Installation Name") . "</th>";
            PRINT "<th>" . _("Current Version") . "</th>";
            PRINT "<th>" . _("Upgrade Version Available") . "</th>";
            PRINT "</tr>";
            PRINT "<tr>";
            PRINT "<td>" . $name . "</td>";
            PRINT "<td>" . $dbver . "</td>";
            PRINT "<td>" . $ver. "</td>";
            PRINT "</tr>";
            PRINT "</table>";
            if ($dbver and $ver != $dbver)
            {
                $rv[$id] = $name;
            }
            $DB->disconnect();
        }
        return $rv;
    }
function NotAtVersion ( $ ver ) { $ data = Config :: ReadConfig ( 'database' ) ; $ rv = array ( ) ; foreach ( $ data as $ id => $ vals ) { $ DSN = @ $ vals [ 'DSN' ] ; $ name = @ $ vals [ 'name' ] ; if ( ! $ name ) { $ name = _ ( 'Unknown database' ) ; } $ DB = new IRMDB ( @ $ vals [ 'DSN' ] , @ $ vals [ 'socket' ] ) ; if ( $ DB -> error ) { continue ; } $ dbver = $ DB -> GetDatabaseVersion ( ) ; PRINT " <table> " ; PRINT " <tr> " ; PRINT " <th> " . _ ( " Installation Name " ) . " </th> " ; PRINT " <th> " . _ ( " Current Version " ) . " </th> " ; PRINT " <th> " . _ ( " Upgrade Version Available " ) . " </th> " ; PRINT " </tr> " ; PRINT " <tr> " ; PRINT " <td> " . $ name . " </td> " ; PRINT " <td> " . $ dbver . " </td> " ; PRINT " <td> " . $ ver . " </td> " ; PRINT " </tr> " ; PRINT " </table> " ; if ( $ dbver and $ ver != $ dbver ) { $ rv [ $ id ] = $ name ; } $ DB -> disconnect ( ) ; } return $ rv ; }
List of databases that aren't at the given version.
List of databases that aren ' t at the given version .
// What the fuck is going on here ? Why would this ever evaluate true ? 