function shutdownAction($actionId, $actionType, $filePath, $dbFilePath, $backupObj) { if ($backupObj->getReloading()) { return; } $action = SGBackup::getAction($actionId); if ($action && ($action['status'] == SG_ACTION_STATUS_IN_PROGRESS_DB || $action['status'] == SG_ACTION_STATUS_IN_PROGRESS_FILES)) { SGBackupLog::writeExceptionObject(new SGExceptionServerError('Execution time abort')); SGBackup::changeActionStatus($actionId, SG_ACTION_STATUS_ERROR); if ($actionType == SG_ACTION_TYPE_BACKUP) { @unlink($filePath); @unlink($dbFilePath); } } }
<?php require_once dirname(__FILE__) . '/../boot.php'; require_once SG_BACKUP_PATH . 'SGBackup.php'; if (isAjax() && count($_POST)) { $actionId = (int) $_POST['actionId']; $currentAction = SGBackup::getAction($actionId); if ($currentAction) { if ($currentAction['status'] == SG_ACTION_STATUS_IN_PROGRESS_FILES || $currentAction['status'] == SG_ACTION_STATUS_IN_PROGRESS_DB) { die(json_encode($currentAction)); } die('0'); } die('0'); }