本文整理汇总了PHP中tar::extract_files方法的典型用法代码示例。如果您正苦于以下问题:PHP tar::extract_files方法的具体用法?PHP tar::extract_files怎么用?PHP tar::extract_files使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tar
的用法示例。
在下文中一共展示了tar::extract_files方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: filesystem
if (!class_exists('filesystem')) {
require_once 'install/classes/class.filesystem.php';
$filesystem = new filesystem($config['ftp_server'], $config['ftp_user'], $config['ftp_pw'], $config['ftp_port']);
$filesystem->set_wd($config['ftp_path'], $config['fpath']);
}
$tar_packs = array(1 => 'update.admin.tar', 2 => 'update.misc.tar');
if (empty($_REQUEST['sub']) || !isset($tar_packs[$_REQUEST['sub']])) {
$sub = 1;
} else {
$sub = $_REQUEST['sub'];
}
require 'install/classes/function.chmod.php';
require 'install/classes/class.tar.php';
$tar = new tar(realpath('install/files/'), $tar_packs[$sub]);
$tar->ignore_chmod();
$error = $tar->extract_files('./');
$files = implode("\n", $tar->list_files());
$dirs = array('language' => null, 'templates' => null, 'designs' => null, 'images' => null);
preg_match_all('~^(' . implode('|', array_keys($dirs)) . ')/(\\d+)/([^\\n]+)$~m', $files, $replicable, PREG_SET_ORDER);
foreach ($replicable as $rep) {
if ($dirs[$rep[1]] === null) {
$dirs[$rep[1]] = array();
$dir = dir($rep[1]);
while (false !== ($entry = $dir->read())) {
if (is_id($entry) && is_dir($rep[1] . '/' . $entry)) {
$dirs[$rep[1]][$entry] = $rep[1] . '/' . $entry . '/';
}
}
$dir->close();
}
$content = file_get_contents($rep[0]);
示例2: elseif
} elseif ($extension == 'tar.gz') {
gzAbortNotLoaded();
$temp = gzTempfile($file);
$temp = realpath($temp);
include 'classes/class.tar.php';
$tar = new tar(dirname($temp), basename($temp));
$tar->extract_files(realpath($dir));
$filesystem->unlink($temp);
if (!empty($tar->error)) {
error($redirect, $tar->error);
}
} elseif ($extension == 'tar') {
$file = realpath($file);
include 'classes/class.tar.php';
$tar = new tar(dirname($file), basename($file));
$tar->extract_files($dir);
if (!empty($tar->error)) {
error($redirect, $tar->error);
}
} elseif ($extension == 'gz') {
gzAbortNotLoaded();
$new = $dir . DIRECTORY_SEPARATOR . basename($file);
$temp = gzTempfile($file, $new);
}
}
ok($redirect);
} elseif ($job == 'all_chmod') {
echo head();
$chmod = getViscachaCHMODs();
?>
<table class="border" border="0" cellspacing="0" cellpadding="4" align="center">
示例3: array
@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") {
if (!$s->cfg['ver']['demo']) {
if (@file_exists($s->cfg['path']['data'] . "/backup.tar")) {
@unlink($s->cfg['path']['data'] . "/backup.tar");
}
}
$m->location("sec=backup", "Backup removido");
}
}
}
}