Closed wapmorgan closed 6 years ago
Can you show similar functionality in other projects or describe why you need this method in real life?
I don't have examples in other projects, but what if for some reason 7z executable disapper from os? Update problems/etc. Just simple isBinaryAvailable()
could be called to check it.
You can call null !== $obj7z->getBinary7z()
.
But in General, there should be no situation when binary path is not available. An exception must be thrown.
https://github.com/Gemorroj/Archive7z/blob/68eddc4466906c269809130d2ec9ac3bc2620dd9/src/Archive7z.php#L171-L186
Ok, but now this method seems to be deleted. Can you provide another static one to avoid object creation?
I would suggest, for example, overriding the makeBinary7z
method.
https://github.com/Gemorroj/Archive7z/blob/40e2f86b0e30fcc80847ec826d15f126a8a35148/src/Archive7z.php#L72-L85
https://github.com/Gemorroj/Archive7z/blob/40e2f86b0e30fcc80847ec826d15f126a8a35148/src/Archive7zTrait.php#L56-L73
The ideology of the library is based on the fact that its base class will be extended.
Hello. What do you think about adding a method for performing check that
7z
is available?