O
O
Optimus2015-09-28 19:37:50
PHP
Optimus, 2015-09-28 19:37:50

Is it possible to update a file in phar?

Looked php.net/manual/en/book.phar.php something there are no methods like update or something like that. Or is the existing file in the archive simply written back to Phar::addFile and updated in the archive itself?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivanq, 2015-09-28
Pyan @marrk2

Use Phar::addFileit - it will overwrite itself

N
Nazar Mokrinsky, 2015-09-28
@nazarpc

And here's a counter question for you: is it difficult for you to write three lines and check?
And yes, it was possible to clarify this point in the documentation (you have a chance to fix it).
This is all about the fact that before asking you need to try to solve the question yourself, especially since it is elementary - open the file, write the file, then check if it has changed. It's really 3 lines along with <?php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question