Database Tool Library



( ZN >= 1.0.0 )

Database is a library designed to perform a number of functions such as backing up, optimizing and repairing tables, and getting information about tables.

 

 

# Methods


Array listDatabases ( Void )
Array listTables ( Void )
Object statusTables ( Mixed $ table = '*' )
String optimizeTables ( Mixed $ table = '*' )
String repairTables ( Mixed $ table = '*' )
String backup ( Mixed $ tables = '*' , String $ fileName = NULL , String $ path = STORAGE_DIR )
Bool import ( String $ file )

 

 

# ListDatabases ( ZN >= 1.0.0 )


Gets a list of created databases.

Parameters
void
return Array
Use of
output( DBTool::listDatabases() );

 

 

# ListTables ( ZN >= 1.0.0 )


Gives a list of tables created in the database.

Parameters
void
return Array
Use of
output( DBTool::listTables() );

 

 

# StatusTables ( ZN> = 4.0.1-EIP )


Used to get information about tables or tables. This method is the same as the DB :: status () method.

Parameters
Mixed $ tables = '*' Tables to include in processing.
return Array  
Use of
output( DBTool::statusTables('tbl1, tbl2, tbl3') );
output( DBTool::statusTables(['tbl1', 'tbl2', 'tbl3']) ); 
output( DBTool::statusTables('*') );

 

 

# OptimizeTables ( ZN> = 1.0.0 )


Used to optimize tables.

Parameters
Mixed $ tables = '*' Tables to include in processing.
return Array  
Use of
DBTool::optimizeTables('*');
DBTool::optimizeTables('tbl1, tbl2, tbl3');
DBTool::optimizeTables(['tbl1', 'tbl2', 'tbl3']);

 

 

# RepairTables ( ZN> = 1.0.0 )


Used to repair tables.

Parameters
Mixed $ tables = '*' Tables to include in processing.
return Array  
Use of
DBTool::repairTables('*');
DBTool::repairTables('tbl1, tbl2, tbl3');
DBTool::repairTables(['tbl1', 'tbl2', 'tbl3']);

 

 

# Backup ( ZN> = 2.0.0 )


Used to backup the database.

Parameters
Mixed $ tables = '*' Tables to include in processing.
return Array  
Use of
DBTool::backup('tbl1, tbl2, tbl3', 'a.sql', 'Resources/Uploads');
DBTool::backup(['tbl1', 'tbl2', 'tbl3']); 
DBTool::backup('*');

 

 

# Import ( ZN >= 5.3.9 )


Used to run a file containing SQL queries.

Parameters
String $ file The SQL file to load .
return Bool  
Use of
DBTool::import(FILES_DIR . 'example.sql');