irm/lib/Databases.php
/** List of uninitialised databases.
     * Similar in concept to Databases::List(), but instead does a
     * check on each configured database to see if it looks like a
     * configured IRM database, and if so, does not put it in the list.
     */
List of uninitialised databases.
Similar in concept to Databases::List(), but instead does a
check on each configured database to see if it looks like a
configured IRM database, and if so, does not put it in the list.
List of uninitialised databases . Similar in concept to Databases :: List () but instead does a check on each configured database to see if it looks like a configured IRM database and if so does not put it in the list .
static function unInitialised()
    {
        $rv = array();
        $data = Config::ReadConfig('database');
        foreach ($data as $id => $vals)
        {
            if (!is_array($vals)) throw new \Exception("Config file is malformed");
            $DSN = $vals['DSN'];
            try
            {
                $dbh = new IRMDB($DSN);
            }
            catch (\Exception $e)
            {
            }
            if (!$dbh->isConnected()) break;
            try
            {
                $dbh->query5("SELECT * FROM computers WHERE ID=0");
            }
            catch (\Exception $e)
            {
                $rv[$id] = $vals['name'];
            }
            unset($dbh);
        }
        return $rv;
    }
static function unInitialised ( ) { $ rv = array ( ) ; $ data = Config :: ReadConfig ( 'database' ) ; foreach ( $ data as $ id => $ vals ) { if ( ! is_array ( $ vals ) ) throw new \ Exception ( " Config file is malformed " ) ; $ DSN = $ vals [ 'DSN' ] ; try { $ dbh = new IRMDB ( $ DSN ) ; } catch ( \ Exception $ e ) { } if ( ! $ dbh -> isConnected ( ) ) break ; try { $ dbh -> query5 ( " SELECT * FROM computers WHERE ID=0 " ) ; } catch ( \ Exception $ e ) { $ rv [ $ id ] = $ vals [ 'name' ] ; } unset ( $ dbh ) ; } return $ rv ; }
List of uninitialised databases.
List of uninitialised databases .
//echo('could not connect'); // Bollocks query just to try and trigger an error if // there's no table.  Can't use a query that isn't // guaranteed to work on any version of IRM.