コード例 #1
0
ファイル: service.php プロジェクト: WebCrew/CODEIT-IDE
    exit;
}
if (isset($_POST['action'])) {
    if (!isUserLogged()) {
        exit;
    }
    $_POST['action'] = sanitizeString($_POST['action']);
    switch ($_POST['action']) {
        case "getFile":
            getFile();
            break;
        case "saveFile":
            saveFile();
            break;
        case "createNewFile":
            createNewFile();
            break;
        case "createDir":
            createDir();
            break;
        case "renameFile":
            renameFile();
            break;
        case "removeFile":
            removeFile();
            break;
        case "duplicateFile":
            duplicateFile();
            break;
        case "moveFile":
            moveFile();
コード例 #2
0
/**
 * Saves the created data of global var $dump['data'] to the dump file.
 *
 * If Multipart is used and the maximum filesize is reached a new file is
 * created. Sets global var $dump['filesize'] to new vaule for printing
 * on sccreen.
 *
 * @return void
 */
function writeToDumpFile()
{
    global $config, $dump;
    $file = $config['paths']['backup'] . $dump['backupdatei'];
    if ($config['compression'] == 1) {
        if ($dump['data'] != '') {
            $fp = gzopen($file, 'ab');
            gzwrite($fp, $dump['data']);
            gzclose($fp);
        }
    } else {
        if ($dump['data'] != '') {
            $fp = fopen($file, 'ab');
            fwrite($fp, $dump['data']);
            fclose($fp);
        }
    }
    $dump['data'] = '';
    clearstatcache();
    $dump['filesize'] = intval(@filesize($file));
    // if Multipart is used and maximum filesize is reached -> create new file
    if ($config['multi_part'] == 1) {
        if ($dump['filesize'] + MULTIPART_FILESIZE_BUFFER > $config['multipart_groesse']) {
            @chmod($file, 0777);
            createNewFile();
        }
    }
}