Editing a Phar file

I’ve had my first introduction to a Phar file today with Bulat Shakirzyanov’s Imagine script (https://github.com/avalanche123/Imagine)

It’s all very nice until I went to remove a line from the actual Phar file itself and the following error was produced:

Warning: require_once(phar://application/third_party/imagine.phar) [function.require-once]: failed to open stream: phar "C:\\wamp\\www\\CodeSharpTwo\\application\	hird_party\\imagine.phar" SHA1 signature could not be verified: broken signature in C:\\wamp\\www\\CodeSharpTwo\\application\\config\\config.php on line 364

It doesn’t matter what I do to the Phar file - even just adding or deleting a white space - it still produces the same " SHA1 signature could not be verified: broken signature in" error.

I want to do is remove one line, var_dump($file); !

You have to extract the PHAR, edit it. Can then repack it into a PHAR. PHAR is an archive like ZIP treat it as such.

http://us2.php.net/phar