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 433]

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 70]

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 327]

string deletebackups( )

Delete selected backup files



Tags:

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


[ Top ]



dobackup [line 234]

string dobackup( )

Perform database backup



Tags:

return:  HTML success or error message


[ Top ]



doinnodb [line 500]

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 602]

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 304]

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 ]



filesizeHelper [line 99]

mixed filesizeHelper( string $filename)

Helper function to get a file's size The PHP filesize() method may fail on 32 bit systems with files > 2 GB or may return negative values (Windows only?). So this function tries some workarounds, but may eventually just give up and return zero ...



Tags:

return:  int or float value: size of the file


Parameters

string   $filename   full path of the file
[ Top ]



innodb [line 469]

string innodb( )

Prepare for conversion to InnoDB tables



Tags:

return:  HTML form


[ Top ]



innodb_supported [line 402]

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 129]

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 368]

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 570]

string optimize( )

Prepare for optimizing tables



Tags:

return:  HTML form


[ Top ]



Documentation generated on Sun, 02 Oct 2016 07:47:08 +0000 by phpDocumentor 1.4.3