Login   Register  
PHP Classes
elePHPant
Icontem

File: metascannerclass.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Fred Benson  >  Meta Scanner  >  metascannerclass.txt  >  Download  
File: metascannerclass.txt
Role: Documentation
Content type: text/plain
Description: class description and functions
Class: Meta Scanner
Retrieve and show structure metadata from MySQL
Author: By
Last change:
Date: 2004-11-05 13:40
Size: 4,015 bytes
 

Contents

Class file image Download
/************************************************************************************************/
/*	CLASS NAME	: MetaScanner								*/
/*	DEVELOPER	: Fryderyk Benigni							*/
/*	LICENSE		: GPL(Generic Public License)						*/
/*	DATE		: 05 November 2004							*/
/*	DESCRIPTION	: This class is intended to retrieve MetaData from any MySql Server. It */
/* 	many different methods. It also offer a simple method called showAll that sows a 	*/
/*	simple table style representation of the MySql server. Anothe method very useful is 	*/
/*	getAll a simple method that scann the all MySql Server and store server information 	*/
/*	about the strocture on determined variables called: $dblists(Lists of all 		*/
/*	Databases), $tblists(List of all tables indexed by the name of the relative 		*/
/*	database) and $fllists(List of all field of all the tabels indexed by the name of 	*/
/*	the tables.										*/
/************************************************************************************************/

CLASS OBJECTIVE:	Retrieve and show Metadata from a MySql DataBase Server		

CLASS DESCRIPTION:	This class is intended to retrieve MetaData from any MySql Server. It 
		 	many different methods. It also offer a simple method called showAll 
			that sows a simple table style representation of the MySql server. 
			AnotheR method very useful is getAll() a simple method that scann the
			all MySql Server and store server information about the strUcture on 
			determined variables called: $dblists(Lists of all Databases), $tblists
			(List of all tables indexed by the name of the relative	database) and 
			$fllists(List of all field of all the tabels indexed by the name of the 
			tables.

CLASS ATTRIBUTES:	
			$connection:	Attribute that holds the connection information to a determined 
					server.
			
			$dblists:	Attribute that holds the lists of all the databases on a determ-
					ined server.
			
			$tblists:	Attribute that holds the lists of all the tables of a specific
					DataBase or many DataBases.

			$fllists:	Attribute that holds the lists of all the fields of a determ-
					ined table or a list of tables.

CLASS METHODS:		
			__Construct():	Method responsable for the instantiation of the class, it receives
					the connection especification as a parameter.

			connect():	Method responsable of establishing a connection to a determined 
					server.

			disconnect():	Method responsable on closing the connection to the DataBase Server.

			returndblist():	Method that return the list of databases in the $dblists attribute.

			returntblist(): Method that return the list of tables in the $tblists attribute.

			returnfllist(): Method that return the list of fields in the $fllists attribute.

			getDataBases(): Method that return the list of databases of a specific server and store
					the list in the $dblists attribute.***

			getTables($__Database):    
					Method the return the list of Table of a specific Database
					and stores the list in the $tblists attribute.***

			getFields($__DataBase, $__Table):
					Method that return a list of fileds of a determined Table of a specific 
					Database, this list is also stored in the $fllists attribute.***

			scanAll():	Method that scan the all server and stores all data in the attributes 
					$dblists, $tblists, $fllists.***

			showAll():	Method that scan the all server and stores all data in the attributes 
					$dblists, $tblists, $fllists and shows all Data in a simple Table style
					appearance.***


***ADDITIONAL INFORMATION:
The attributes $tblists, $fllists use as index the relative father.

EXAMPLE :

		Table1 and Table 2 is part of DB1
	
			$tblists = ["DB1"] =>[Table1]
					   =>[Table2]


DB1 is the father of Table 1 and 2 and is also the index.
		
SAME IDEA IS FOR FIELDS BECAUSE TABLES ARE THEIR RELATIVE FATHER
THIS WAY IS EASY TO NAVIGATE TRUE DATABASE METADATA STORED IN METASCANNER ATTRIBUTES!!!