irm-1.6-b3/lib/IRMDB.php
/* Testing only: remove all tables from the database
	 * Not something you want to try at home, kids.
	 *
	 * This method has a kink -- since a table may fail to drop
	 * because of key constraints, we need to keep dropping tables over
	 * and over until they're all gone or we can't drop any more.  This
	 * problem makes this method about an order of magnitude more complex
	 * than it otherwise would need to be.
	 */
Testing only: remove all tables from the database
Not something you want to try at home, kids.

This method has a kink -- since a table may fail to drop
because of key constraints, we need to keep dropping tables over
and over until they're all gone or we can't drop any more.  This
problem makes this method about an order of magnitude more complex
than it otherwise would need to be.
Testing only : remove all tables from the database Not something you want to try at home kids . This method has a kink -- since a table may fail to drop because of key constraints we need to keep dropping tables over and over until they ' re all gone or we can ' t drop any more . This problem makes this method about an order of magnitude more complex than it otherwise would need to be .
function _EmptyDatabase()
	{
		$tbls = $this->_dbh->getCol('SHOW TABLES');
		$continue = true;
		$this->pushErrorHandling(PEAR_ERROR_RETURN);
		while ($continue)
		{
			$continue = false;
			$faileds = array();
			foreach ($tbls as $t)
			{
				$err = $this->_dbh->query("DROP TABLE $t");
				if (MDB::isError($err))
				{
					$faileds[] = $t;
				}
				else
				{
					$continue = true;
				}
			}
			$tbls = $faileds;
		}
		$this->popErrorHandling();
		if (count($tbls))
		{
			trigger_error("Failed to drop the following tables: ".join(' ', $tbls), E_USER_ERROR);
		}
	}
function _EmptyDatabase ( ) { $ tbls = $ this -> _dbh -> getCol ( 'SHOW TABLES' ) ; $ continue = true ; $ this -> pushErrorHandling ( PEAR_ERROR_RETURN ) ; while ( $ continue ) { $ continue = false ; $ faileds = array ( ) ; foreach ( $ tbls as $ t ) { $ err = $ this -> _dbh -> query ( " DROP TABLE  $ t " ) ; if ( MDB :: isError ( $ err ) ) { $ faileds [ ] = $ t ; } else { $ continue = true ; } } $ tbls = $ faileds ; } $ this -> popErrorHandling ( ) ; if ( count ( $ tbls ) ) { trigger_error ( " Failed to drop the following tables:  " . join ( ' ' , $ tbls ) , E_USER_ERROR ) ; } }
Testing only: remove all tables from the database
 Not something you want to try at home, kids.
Testing only : remove all tables from the database Not something you want to try at home kids .
// Didn't drop all tables