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

search for in the

ZipArchive::unchangeName> <ZipArchive::unchangeArchive
[edit] Last updated: Fri, 25 May 2012

view this page in

ZipArchive::unchangeIndex

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

ZipArchive::unchangeIndexAnnule toutes les modifications faites sur une entrée, définie par nom index

Description

mixed ZipArchive::unchangeIndex ( int $index )

Annule toutes les modifications faites sur une entrée, définie par son index.

Liste de paramètres

index

Index de l'entrée

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.



add a note add a note User Contributed Notes ZipArchive::unchangeIndex
till at php dot net 29-Aug-2010 08:29
Consider this example:

<?php
$zip
= new ZipArchive;
$zip->open(...);

$zip->addFile('path/file', 'foo');
$zip->renameIndex(0, 'bar');

echo
$zip->getNameIndex(0); // 'bar'

$zip->unchangeIndex(0);

echo
$zip->getNameIndex(0); // 'false'
?>

Unless you call save() in between, the unchangeIndex() call reverts back to the initial state of the archive - where index '0' did not exist.

If you called save() after addFile() and then renamed the file, you would be able to revert/undo the name change.

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