本文整理汇总了PHP中tar::list_files方法的典型用法代码示例。如果您正苦于以下问题:PHP tar::list_files方法的具体用法?PHP tar::list_files怎么用?PHP tar::list_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tar
的用法示例。
在下文中一共展示了tar::list_files方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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]);
foreach ($dirs[$rep[1]] as $path) {
示例2: array
}
} 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") {
if (!$s->cfg['ver']['demo']) {