phpphar

PHAR archive internals


I'm developing a plugin for 7-Zip that will allow users to open and modify phar archives. But I don't fully understand the file format. The documentation describes the "Length of manifest in bytes (1 MB limit)" field. And I can't understand what this field is. What manifest is documentation talking about? How to calculate the correct value of this field when saving the phar file?

(The question is indirectly related to the php tag, but I think only php developers can answer.)


Solution

  • The manifest is the list of files in the archive. The length is the combined number of bytes taken by all of the files in the manifest.