/** * A method for dropping a database. Connects to the database server using * the "default" database for that database server type, and attempts to * drop the database. * * @static * @param string $name The name of the database to drop. * @return boolean True if the database was dropped correctly, false otherwise. */ static function dropDatabase($name) { $dsn = OA_DB::_getDefaultDsn(); $oDbh = OA_DB::singleton($dsn); OA::disableErrorHandling(); $result = $oDbh->manager->dropDatabase($name); OA::enableErrorHandling(); if (PEAR::isError($result)) { return false; } // Throw away any connections to this database since it doesn't exist anymore unset($GLOBALS['_OA']['CONNECTIONS']); $GLOBALS['_MDB2_databases'] = array(); return true; }