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
[edit] Last updated: Fri, 25 May 2012

view this page in

ZipArchive::statName

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

ZipArchive::statNameRécupère les détails de l'entrée définie par son nom

Description

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

Cette fonction obtient des informations sur l'entrée définie par son nom.

Liste de paramètres

name

Nom de l'entrée

flags

Le flag spécifie comment la recherche sur le nom doit s'effectuer. ZIPARCHIVE::FL_UNCHANGED doit être utilisé pour récupérer les informations sur le fichier original de l'archive, ignorant toutes les modifications effectuées.

  • ZIPARCHIVE::FL_NOCASE

  • ZIPARCHIVE::FL_NODIR

  • ZIPARCHIVE::FL_UNCHANGED

Valeurs de retour

Retourne un tableau contenant les détails de l'entrée, ou FALSE si une erreur survient.

Exemples

Exemple #1 Récupère les informations d'une entrée

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

L'exemple ci-dessus va afficher quelque chose de similaire à :

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
Stewart Rice 26-Mar-2010 04:18
Since a Unix Timestamp is measured in seconds, not milliseconds, I would have to assume that mtime is 'modified time' rather than 'millisecond time'... however it does not appear to work on a Linux system
martin_packer at uk dot ibm dot com 23-Oct-2009 08: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).

 
show source | credits | sitemap | contact | advertising | mirror sites