Geeklog
[ class tree: Geeklog ] [ index: Geeklog ] [ all elements ]

Procedural File: database.php

Source Location: /public_html/admin/database.php



Page Details:

This admin panel provides some simple database backup and administration abilities. You can create and download database backups, optimize tables, or convert tables to InnoDB.

All of these functions are currently only available for MySQL. The link to this admin panel is actually hidden when not using MySQL.




Includes:

require_once('auth.inc.php') [line 51]
Security check to ensure user even belongs on this page

require_once('../lib-common.php') [line 46]
Geeklog common function library







already_converted [line 401]

boolean already_converted( )

Check if all the tables have already been converted to InnoDB



Tags:

return:  true: all tables are InnoDB, otherwise false


[ Top ]



compareBackupFiles [line 71]

void compareBackupFiles( $pFileA, $pFileB)

Sort backup files with newest first, oldest last.

For use with usort() function. This is needed because the sort order of the backup files, coming from the 'readdir' function, might not be that way.




Parameters

   $pFileA  
   $pFileB  
[ Top ]



deletebackups [line 294]

string deletebackups( )

Delete selected backup files



Tags:

return:  empty string (nothing to do), or HTML error or success msg


[ Top ]



dobackup [line 197]

string dobackup( )

Perform database backup



Tags:

return:  HTML success or error message


[ Top ]



doinnodb [line 469]

int doinnodb( [string $startwith = ''], [int $failures = 0])

Convert to InnoDB tables



Tags:

return:  number of errors during conversion


Parameters

string   $startwith   table to start with
int   $failures   number of previous errors
[ Top ]



dooptimize [line 575]

int dooptimize( [string $startwith = ''], [int $failures = 0])

Optimize database tables



Tags:

return:  number of errors during conversion


Parameters

string   $startwith   table to start with
int   $failures   number of previous errors
[ Top ]



downloadbackup [line 270]

void downloadbackup( string $file)

Download a backup file

NOTE: Filename should have been sanitized and checked before calling this.




Parameters

string   $file   Filename (without the path)
[ Top ]



innodb [line 438]

string innodb( )

Prepare for conversion to InnoDB tables



Tags:

return:  HTML form


[ Top ]



innodb_supported [line 371]

true innodb_supported( )

Check for InnoDB table support (usually as of MySQL 4.0, but may be available in earlier versions, e.g. "Max" or custom builds).



Tags:

return:  = InnoDB tables supported, false = not supported


[ Top ]



listbackups [line 90]

string listbackups( )

List all backups, i.e. all files ending in .sql



Tags:

return:  HTML for the list of files or an error when not writable


[ Top ]



miniform_DoOrCancel [line 336]

string miniform_DoOrCancel( string $buttontext, string $mode, [string $token = ''])

Create a simple form with two buttons

Creates a simple form that has a Cancel and an "action" button, where the latter invokes a POST request with $_POST['mode'] set to the given value.




Tags:

return:  HTML form


Parameters

string   $buttontext   text string for the "action" button
string   $mode   mode value
string   $token   CSRF token, will be created if empty
[ Top ]



optimize [line 540]

string optimize( )

Prepare for optimizing tables



Tags:

return:  HTML form


[ Top ]



Documentation generated on Wed, 17 Mar 2010 02:07:04 -0400 by phpDocumentor 1.4.3