当前位置: 首页>>代码示例>>PHP>>正文


PHP tar::new_tar方法代码示例

本文整理汇总了PHP中tar::new_tar方法的典型用法代码示例。如果您正苦于以下问题:PHP tar::new_tar方法的具体用法?PHP tar::new_tar怎么用?PHP tar::new_tar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tar的用法示例。


在下文中一共展示了tar::new_tar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gzTempfile

            $temp = gzTempfile($file);
            $temp = realpath($temp);
            include 'classes/class.tar.php';
            $tar = new tar();
            $tar->new_tar(dirname($temp), basename($temp));
            $tar->extract_files(realpath($dir));
            $err = $tar->error;
            $filesystem->unlink($temp);
            if (!empty($err)) {
                error($redirect, $err);
            }
        } elseif ($extension == 'tar') {
            include 'classes/class.tar.php';
            $tar = new tar();
            $file = realpath($file);
            $tar->new_tar(dirname($file), basename($file));
            $tar->extract_files($dir);
        } elseif ($extension == 'gz') {
            gzAbortNotLoaded();
            $new = $dir . DIRECTORY_SEPARATOR . basename($file);
            $temp = gzTempfile($file, $new);
        }
    }
    if (!isset($extension)) {
        error($redirect, 'File is not an supported archive. (Failed at position: setting extension)');
    } else {
        ok($redirect);
    }
} else {
    $ServerNavigator->useImageIcons(true);
    $ServerNavigator->showSubfoldersSize(true);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:explorer.php

示例2: gzTempfile

            $temp = gzTempfile($file);
            $temp = realpath($temp);
            include 'classes/class.tar.php';
            $tar = new tar();
            $tar->new_tar(viscacha_dirname($temp), basename($temp));
            $tar->extract_files(realpath($dir));
            $err = $tar->error;
            $filesystem->unlink($temp);
            if (!empty($err)) {
                error($redirect, $err);
            }
        } elseif ($extension == 'tar') {
            include 'classes/class.tar.php';
            $tar = new tar();
            $file = realpath($file);
            $tar->new_tar(viscacha_dirname($file), basename($file));
            $tar->extract_files($dir);
        } elseif ($extension == 'gz') {
            gzAbortNotLoaded();
            $new = $dir . DIRECTORY_SEPARATOR . basename($file);
            $temp = gzTempfile($file, $new);
        }
    }
    if (!isset($extension)) {
        error($redirect, 'File is not an supported archive. (Failed at position: setting extension)');
    } else {
        ok($redirect);
    }
} else {
    $ServerNavigator->useImageIcons(true);
    $ServerNavigator->showSubfoldersSize(true);
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:explorer.php

示例3: array

                 $m->error_redir("backup_notar");
             }
         } else {
             if (@file_exists($s->cfg['path']['data'] . "/backup.tar")) {
                 @unlink($s->cfg['path']['data'] . "/backup.tar");
             }
             if (!$HTTP_POST_FILES['file']['tmp_name']) {
                 $m->error_redir("backup_upload_notmp");
             }
             if (!preg_match("/\\.tar\$/", $HTTP_POST_FILES['file']['name'])) {
                 @unlink($HTTP_POST_FILES['file']['tmp_name']);
                 $m->error_redir("backup_upload_invalid");
             }
             @move_uploaded_file($HTTP_POST_FILES['file']['tmp_name'], $s->cfg['path']['data'] . "/backup.tar");
         }
         $tar->new_tar($s->cfg['path']['data'], "backup.tar");
         $list1 = $tar->list_files();
         $list2 = array();
         foreach ($s->cfg['file'] as $file) {
             $list2[] = basename($file);
         }
         if ($list1 !== $list2) {
             @unlink($s->cfg['path']['data'] . "/backup.tar");
             $m->error_redir("backup_corrupt");
         }
         $tar->extract_files($s->cfg['path']['data']);
     }
     $s->cfg['block:config'] = 1;
     $m->location("sec=backup", "Backup restaurado");
 } else {
     if ($act == "remove") {
开发者ID:JulioCF,项目名称:MZnews,代码行数:31,代码来源:i_backup.php


注:本文中的tar::new_tar方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。