downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ZipArchive::unchangeAll> <ZipArchive::statIndex
Last updated: Fri, 30 Oct 2009

view this page in

ZipArchive::statName

(PHP 5 >= 5.2.0, PECL zip >= 1.5.0)

ZipArchive::statNameGibt die Details eines via Namen bestimmten Eintrags zurück

Beschreibung

mixed ZipArchive::statName ( name $name [, int $flags ] )

Die Funktion erhält Informationen über einen Eintrag, der mittels seines Namens bestimmt wird.

Parameter-Liste

name

Name des Eintrags

flags

Das flags-Argument gibt an, wie die Namensauflösung durchgeführt werden soll. Außerdem kann ZIPARCHIVE::FL_UNCHANGED angewendet werden, um ohne Berücksichtigung eventueller Veränderungen Informationen über die originale Datei im Archiv zu erhalten.

  • ZIPARCHIVE::FL_NOCASE

  • ZIPARCHIVE::FL_NODIR

  • ZIPARCHIVE::FL_UNCHANGED

Rückgabewerte

Gibt ein Array zurück, das die Eintragsdetails enthält. Im Fehlerfall wird FALSE zurückgegeben.

Beispiele

Beispiel #1 Die Statusinformation eines Eintrags ausgeben

<?php
$zip 
= new ZipArchive;
$res $zip->open('test.zip');
if (
$res === TRUE) {
    
print_r($zip->statName('foobar/baz'));
    
$zip->close();
} else {
    echo 
'Fehler, Code:' $res;
}
?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Array
(
    [name] => foobar/baz
    [index] => 3
    [crc] => 499465816
    [size] => 27
    [mtime] => 1123164748
    [comp_size] => 24
    [comp_method] => 8
)


add a note add a note User Contributed Notes
ZipArchive::statName
martin_packer at uk dot ibm dot com
23-Oct-2009 03:43
This may be stating the obvious but I assume that mtime is "millisecond time". Using http://www.onlineconversion.com/unix_time.htm  the example time "1123164748" converts to "Thu, 04 Aug 2005 14:12:28 GMT".

The two sizes - size and comp_size are presumably in bytes (the latter being the compressed file in the archive).

ZipArchive::unchangeAll> <ZipArchive::statIndex
Last updated: Fri, 30 Oct 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites