本文整理匯總了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);
示例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);
示例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") {