Example #1
0
/**
*   Download a backup file
*
*   @param  string  $file   Filename (without the path)
*   @return void
*   @note   Filename should have been sanitized and checked before calling this.
*
*/
function DBADMIN_download($file)
{
    global $_CONF;
    require_once $_CONF['path_system'] . 'classes/downloader.class.php';
    $dl = new downloader();
    $dl->setLogFile($_CONF['path'] . 'logs/error.log');
    $dl->setLogging(true);
    $dl->setDebug(true);
    $dl->setPath($_CONF['backup_path']);
    $dl->setAllowedExtensions(array('sql' => 'application/x-gzip-compressed', 'gz' => 'application/x-gzip-compressed'));
    $dl->downloadFile($file);
}
 public function testSetDebug()
 {
     $this->dl->setDebug(true);
     // there is no getDebug() method ...
     $this->assertTrue($this->dl->isDebug());
 }