Show the correct parameter names and numbers - the errors are caused by the
second parameter being empty or having null bytes, not the first.
close GH-15755
The LICENSE file of libmagic had been inadvertently removed when the
lib had been upgraded to 5.43. So we add the file `COPYING` from that
release[1], and rename it to `LICENSE`.
[1] <https://github.com/file/file/releases/tag/FILE5_43>
Closes GH-14917.
This test performs a few checks to ensure that "not too much" memory
is used while fileinfo is detecting encodings. It is however platform
specific, and memory usage varies across hosts and as libmagic changes.
Recently a Gentoo user reported a failure in this test at,
https://bugs.gentoo.org/927461
on a big-endian PPC64 machine with output,
---- EXPECTED OUTPUT
131072 => ok
262144 => ok
524288 => ok
1048576 => ok
2097152 => ok
4194304 => ok
8388608 => ok
16777216 => ok
---- ACTUAL OUTPUT
131072 => 10092544
262144 => 10092544
524288 => 12189696
1048576 => 12189696
2097152 => 14352384
4194304 => 18612224
8388608 => 24903680
16777216 => 37486592
---- FAILED
Those numbers are with 8.3.4 and therefore missing commit b7c5813c
which also raises the limits. Checking the "actual" numbers above
against the current values, we see that the limit for 524288 would
need to be bumped to 12189696 to allow this test to pass. Since that
seems reasonable, that's what this commit does.
Closes GH-13795
Closes GH-13940
On some configurations, the COMPILE_DL_FILEINFO must come from the
config.h file. If the COMPILE_DL_FILEINFO macro is not set, the build
won't include the ZEND_GET_MODULE block necessary for building this
extension as a shared object.
Closes GH-11505.
The peak memory usage increased by the blanket 1mb on s390 only.
This is good to note but otherwise seems acceptable, so just
adjusting the test is fine.
Signed-off-by: Anatol Belski <ab@php.net>
For the time being, the new args passing pre-compiled regex are cut out.
On the PHP side, PCRE patterns are cached and thus a duplicated
mechanism isn't necessary.
There might be still advantages to carry pre-compiled patterns for
libmagic separately, but reusing this mechanism needs a better
consideration, as it might require to retain from the PHP internal pattern
caching mechanism.
Signed-off-by: Anatol Belski <ab@php.net>
This reverts commit 94ee4f9834.
The commit was a bit too late to be included in PHP 8.2 RC1. Given it's a massive ABI break, we decide to postpone the change to PHP 8.3.
@cname currently refers to the constant name in C. However, it is not always a (constant) name, but sometimes a function invocation, so naming it as @cvalue would be more appropriate.