Add ZipArchive::closeString()#21497
Conversation
6ad9c14 to
f8b8959
Compare
|
Imo, either |
2c11df3 to
a266aa3
Compare
|
@ndossche It would be good to have your review on this. @remicollet I considered making an @alecpl I think |
|
@tstarling I'm sorry but I'm taking a step back from PHP, so someone else will need to review this. |
09a25f1 to
283c75c
Compare
@alecpl I renamed it from |
283c75c to
5eae17f
Compare
| ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_openString, 0, 1, MAY_BE_BOOL|MAY_BE_LONG) | ||
| ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) | ||
| ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_ZipArchive_openString, 0, 0, MAY_BE_BOOL|MAY_BE_LONG) | ||
| ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, data, IS_STRING, 0, "\'\'") |
There was a problem hiding this comment.
hmm, @kocsismate does this need to be escaped in the arginfo? Not an actual suggestion to change in this patch, but just to document my thinking, why couldn't this be
| ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, data, IS_STRING, 0, "\'\'") | |
| ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, data, IS_STRING, 0, "''") |
? (Just using this as an example since I'm not sure I've seen it before - since this is automatically generated please don't actually apply this suggestion @tstarling)
5eae17f to
de15d91
Compare
DanielEScherzer
left a comment
There was a problem hiding this comment.
generally looks good, I'll take another look after #21659 merges so it is easier to see what is changing in this patch
de15d91 to
248c02c
Compare
DanielEScherzer
left a comment
There was a problem hiding this comment.
thanks for splitting out #21659, makes this so much easier to review
a few suggestions, code mostly looks good
59e42cd to
26e6159
Compare
DanielEScherzer
left a comment
There was a problem hiding this comment.
generally looks good, I'll plan to test this a bit tomorrow and then hopefully merge it - thanks for bearing with me since I wasn't familiar with the extension
DanielEScherzer
left a comment
There was a problem hiding this comment.
Came back to this, looks ready to merge modulo the requested comment
- Add a $flags parameter to ZipArchive::openString(), by analogy with ZipArchive::open(). This allows the string to be opened read/write. - Have the $data parameter to ZipArchive::openString() default to an empty string, for convenience of callers that want to create an empty archive. This works on all versions of libzip since the change in 1.6.0 only applied to files, it's opt-in for generic sources. - Add ZipArchive::closeString() which closes the archive and returns the resulting string. For consistency with openString(), return an empty string if the archive is empty.
26e6159 to
db5b845
Compare
DanielEScherzer
left a comment
There was a problem hiding this comment.
Looks good to me - since I'm not too familiar with ext/zip I'll want to do another round of review with fresh eyes before merging but I don't see anything that needs to be changed
Uh oh!
There was an error while loading. Please reload this page.