1
0
Fork 0
MySQLDumper/application/controllers/DumpController.php

71 Zeilen
1,8 KiB
PHP

2011-06-10 21:55:32 +00:00
<?php
/**
* This file is part of MySQLDumper released under the GNU/GPL 2 license
* http://www.mysqldumper.net
*
* @package MySQLDumper
* @subpackage Controllers
* @version SVN: $Rev$
* @author $Author$
*/
/**
* Dump Controller
*
* Controller to handle actions triggered on dump screen
*
* @package MySQLDumper
* @subpackage Controllers
*/
class DumpController extends Msd_Controller_Action
2011-06-10 21:55:32 +00:00
{
/**
* Show dump page
*
* @return void
*/
public function indexAction()
{
$dump = new Msd_Dump();
$dump->prepareDumpProcess();
$this->view->dumpData = '';
$this->view->dumpData->nrOfDatabasesToBackup =
count($dump->dbsToBackup);
$this->view->dumpData->databasesToBackup =
implode(', ', array_keys($dump->dbsToBackup));
$this->view->dumpData->sumTotal = $dump->sumTotal;
//TODO get comment from config profile
$this->view->dumpData->comment = '';
}
/**
* Start dump action
*
* @return void
*/
public function startDumpAction()
{
$taskList = Msd_TaskManager::getInstance('backupTasks');
$tasks = $taskList->getTasks();
$this->view->sessionId = Zend_Session::getId();
}
/**
* Do dump action
*
* @return void
*/
public function doDumpAction()
{
Zend_Layout::getMvcInstance()->disableLayout();
Zend_Controller_Front::getInstance()->setParam('noViewRenderer', true);
$taskList = Msd_TaskManager::getInstance('backupTasks');
$tasks = $taskList->getTasks();
$ret = array(
'backup_in_progress' => false,
'config_file' => $this->view->dynamicConfig->getParam('configFile')
2011-06-10 21:55:32 +00:00
);
echo json_encode($ret);
}
}