ZipArchive::unchangeIndex

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

ZipArchive::unchangeIndexRevert all changes done to an entry at the given index

Description

bool ZipArchive::unchangeIndex ( int $index )

Revert all changes done to an entry at the given index.

Parameters

index

Index of the entry.

Return Values

Returns TRUE on success or FALSE on failure.

Коментарии

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.
2010-08-29 11:29:36
http://php5.kiev.ua/manual/ru/ziparchive.unchangeindex.html

    Поддержать сайт на родительском проекте КГБ