/program/lib/toolslib.php - tools
main entry point for tools (called from /program/main_admin.php)
this routine dispatches the tasks, If the specified task is not recognised, the default task TASK_TOOLS_INTRO is executed.
display an introductory text for tools + menu
display the tools menu
show an introductory text for backup tool OR stream a ZIP-file to the browser
If we arrive here via the tools menu, the parameter download is not set. In that case we show an introductory text with a link that yields a ZIP-file with the backup.
If the user follows the download link, we arrive here too but with the download parameter set. We then dump the database in a variable and subsequently compress it in a ZIP-file which we stream to the browser. We do code some things in the basename of the backup:
The parameter download is currently set to 'zip'. However, we do attempt to send the plain uncompressed data if that parameter is set to 'sql' (quick and dirty). Oh well. hopefully there is enough memory to accomodate backups of moderate sized sites.
Note that we need space to compress the data; a informal test yielded that we need about 160% of the uncompressed size of the backup (tested with a small testset). Rule of the thumb for memory: the more the merrier but at least twice the size of the uncompressed backup.
quick and dirty logfile viewer
this constructs a table with the contents of the logtable. fields displayed are: datim, IP-address, username, logpriority and message we use a LEFT JOIN in order to get to a meaningful username rather than a numeric user_id an attempt is made to start with the last page of the logs because that would probably be the most interesting part. We paginate the log in order to keep it manageable.
Documentation generated on Wed, 11 May 2011 23:45:39 +0200 by phpDocumentor 1.4.0