note 108601 added to class.ziparchive
| From: | bruno dot vibert at bonobox dot fr | Date: | Wed, 09 May 2012 20:21:34 +0000 |
| Subject: | note 108601 added to class.ziparchive | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-187557@lists.php.net to get a copy of this message | ||
There is a usefull function to get the ZipArchive status as a human readable string :
<?php
function ZipStatusString( $status )
{
switch( (int) $status )
{
case ZipArchive::ER_OK : return 'N No error';
case ZipArchive::ER_MULTIDISK : return 'N Multi-disk zip archives not supported';
case ZipArchive::ER_RENAME : return 'S Renaming temporary file failed';
case ZipArchive::ER_CLOSE : return 'S Closing zip archive failed';
case ZipArchive::ER_SEEK : return 'S Seek error';
case ZipArchive::ER_READ : return 'S Read error';
case ZipArchive::ER_WRITE : return 'S Write error';
case ZipArchive::ER_CRC : return 'N CRC error';
case ZipArchive::ER_ZIPCLOSED : return 'N Containing zip archive was closed';
case ZipArchive::ER_NOENT : return 'N No such file';
case ZipArchive::ER_EXISTS : return 'N File already exists';
case ZipArchive::ER_OPEN : return 'S Can\'t open file';
case ZipArchive::ER_TMPOPEN : return 'S Failure to create temporary file';
case ZipArchive::ER_ZLIB : return 'Z Zlib error';
case ZipArchive::ER_MEMORY : return 'N Malloc failure';
case ZipArchive::ER_CHANGED : return 'N Entry has been changed';
case ZipArchive::ER_COMPNOTSUPP : return 'N Compression method not supported';
case ZipArchive::ER_EOF : return 'N Premature EOF';
case ZipArchive::ER_INVAL : return 'N Invalid argument';
case ZipArchive::ER_NOZIP : return 'N Not a zip archive';
case ZipArchive::ER_INTERNAL : return 'N Internal error';
case ZipArchive::ER_INCONS : return 'N Zip archive inconsistent';
case ZipArchive::ER_REMOVE : return 'S Can\'t remove file';
case ZipArchive::ER_DELETED : return 'N Entry has been deleted';
default: return sprintf('Unknown status %s', $status );
}
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 78.247.237.18
----
Manual Page -- http://www.php.net/manual/en/class.ziparchive.php
Edit -- https://master.php.net/note/edit/108601
Del: integrated -- https://master.php.net/note/delete/108601/integrated
Del: useless -- https://master.php.net/note/delete/108601/useless
Del: bad code -- https://master.php.net/note/delete/108601/bad+code
Del: spam -- https://master.php.net/note/delete/108601/spam
Del: non-english -- https://master.php.net/note/delete/108601/non-english
Del: in docs -- https://master.php.net/note/delete/108601/in+docs
Del: other reasons-- https://master.php.net/note/delete/108601
Reject -- https://master.php.net/note/reject/108601
Search -- https://master.php.net/manage/user-notes.php