ZipArchive::unchangeIndex

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

ZipArchive::unchangeIndexОтменяет все изменения у позиции с заданным индексом

Описание

public ZipArchive::unchangeIndex(int $index): bool

Отменяет все изменения у позиции с заданным индексом.

Список параметров

index

Индекс позиции.

Возвращаемые значения

Функция возвращает true, если выполнилась успешно, или false, если возникла ошибка.

Добавить

Примечания пользователей 1 note

up
1
till at php dot net
14 years ago
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.
To Top