$temFile = $_FILES["file"]["tmp_name"];
if($rar = RarArchive::open($tempFile)){
$files = $rar->getEntries();
}
RarArchive :: open выводит список файлов в алфавитном порядке.
Глядя на обычный файл, в операционной системе, есть фильтры в списке файлов в RAR. Но ни один из них никоим образом не превосходит порядок, возвращаемый PHP -> getEntries (). Так, каков будет критерий позиции, отфильтрованный классом? (Мне особенно нужна эта информация) Позиция, о которой я говорю, — это каждый атрибут позиции для каждого файла, возвращаемого функцией -> getEntries (), где он находится в порядке возрастания от 0 до общего количества записей в RAR.
Пример вернулся (посмотрите имена файлов):
Array
(
[0] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 0
[name:RarEntry:private] => f.pdf
[unpacked_size:RarEntry:private] => 19195
[packed_size:RarEntry:private] => 14531
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2016-12-26 17:31:30
[crc:RarEntry:private] => b66e9ea3
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
[1] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 1
[name:RarEntry:private] => g.pdf
[unpacked_size:RarEntry:private] => 19195
[packed_size:RarEntry:private] => 14531
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2016-12-26 17:31:30
[crc:RarEntry:private] => b66e9ea3
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
[2] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 2
[name:RarEntry:private] => h.pdf
[unpacked_size:RarEntry:private] => 95698
[packed_size:RarEntry:private] => 88300
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2016-12-26 17:31:56
[crc:RarEntry:private] => 425fbc2e
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
[3] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 3
[name:RarEntry:private] => i.pdf
[unpacked_size:RarEntry:private] => 95698
[packed_size:RarEntry:private] => 88300
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2016-12-26 17:31:56
[crc:RarEntry:private] => 425fbc2e
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
[4] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 4
[name:RarEntry:private] => a.pdf
[unpacked_size:RarEntry:private] => 10865
[packed_size:RarEntry:private] => 6687
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2017-01-05 12:47:34
[crc:RarEntry:private] => 13f80676
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
[5] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 5
[name:RarEntry:private] => b.pdf
[unpacked_size:RarEntry:private] => 19195
[packed_size:RarEntry:private] => 14531
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2016-12-26 17:31:30
[crc:RarEntry:private] => b66e9ea3
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
[6] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 6
[name:RarEntry:private] => c.pdf
[unpacked_size:RarEntry:private] => 19195
[packed_size:RarEntry:private] => 14531
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2016-12-26 17:31:30
[crc:RarEntry:private] => b66e9ea3
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
[7] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 7
[name:RarEntry:private] => d.pdf
[unpacked_size:RarEntry:private] => 19195
[packed_size:RarEntry:private] => 14531
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2016-12-26 17:31:30
[crc:RarEntry:private] => b66e9ea3
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
[8] => RarEntry Object
(
[rarfile:RarEntry:private] => RarArchive Object
(
)
[position:RarEntry:private] => 8
[name:RarEntry:private] => e.pdf
[unpacked_size:RarEntry:private] => 19195
[packed_size:RarEntry:private] => 14531
[host_os:RarEntry:private] => 2
[file_time:RarEntry:private] => 2016-12-26 17:31:30
[crc:RarEntry:private] => b66e9ea3
[attr:RarEntry:private] => 32
[version:RarEntry:private] => 29
[method:RarEntry:private] => 51
[flags:RarEntry:private] => 36896
)
)
Задача ещё не решена.
Других решений пока нет …