1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
/**
* ZipArchiveのラッパークラス。
* これにより、PHP4でもPHP5でも、同じ関数で利用できる。
* $Id: ZipArchiveWrapper.inc,v 1.1 2015/10/08 11:18:56 wanggb Exp $
* @package jp.aimslib2.io
*/
class ZipArchiveWrapper {
public $zip_archive;
public function ZipArchiveWrapper() {
$version = 4;
if (preg_match("/^(\d+)\./", phpversion(), $m)) {
$version = $m[1];
}
if ($version >= 5) {
$this->zip_archive = new ZipArchive();
} else {
$this->zip_archive = new ZipArchivePhp4Impl();
}
}
public function addEmptyDir($dirname) {
$this->zip_archive->addEmptyDir($dirname);
}
public function addFile($filename, $localname = null) {
$this->zip_archive->addFile($filename, $localname);
}
public function addFromString($localname, $contents) {
$this->zip_archive->addFromString($localname, $contents);
}
public function close() {
$this->zip_archive->close();
}
public function deleteIndex($index) {
$this->zip_archive->deleteIndex($index);
}
public function deleteName($name) {
$this->zip_archive->deleteName($name);
}
public function extractTo($destination, $entries = null) {
$this->zip_archive->extractTo($destination, $entries);
}
public function getArchiveComment() {
$this->zip_archive->getArchiveComment();
}
public function getCommentIndex($index, $flags = null) {
$this->zip_archive->getCommentIndex($index, $flags);
}
public function getCommentName($name, $flags = null) {
$this->zip_archive->getCommentName($name, $flags);
}
public function getFromIndex($index, $flags = null) {
$this->zip_archive->getFromIndex($index, $flags);
}
public function getFromName($name, $flags = null) {
$this->zip_archive->getFromName($name, $flags);
}
public function getNameIndex($index) {
$this->zip_archive->getNameIndex($index);
}
public function getStream($name) {
$this->zip_archive->getStream($name);
}
public function locateName($name) {
$this->zip_archive->locateName($name);
}
public function open($filename, $flags = null) {
$this->zip_archive->open($filename, $flags);
}
public function renameIndex($index, $newname) {
$this->zip_archive->renameIndex($index, $newname);
}
public function renameName($name, $newname) {
$this->zip_archive->renameName($name, $newname);
}
public function setArchiveComment($comment) {
$this->zip_archive->setArchiveComment($comment);
}
public function setCommentIndex($index, $comment) {
$this->zip_archive->setCommentIndex($index, $comment);
}
public function setCommentName($name, $comment) {
$this->zip_archive->setCommentName($name, $comment);
}
public function statIndex($index, $flags = null) {
$this->zip_archive->statIndex($index, $flags);
}
public function statName($name, $flags = null) {
$this->zip_archive->statName($name, $flags);
}
public function unchangeAll() {
$this->zip_archive->unchangeAll();
}
public function unchangeArchive() {
$this->zip_archive->unchangeArchive();
}
public function unchangeIndex($index) {
$this->zip_archive->unchangeIndex($index);
}
public function unchangeName($name) {
$this->zip_archive->unchangeName($name);
}
}
?>