mirror of
https://github.com/php-win-ext/php-rar.git
synced 2026-04-27 22:33:12 +02:00
78b7a5f63b
Add a musl/LLVM Docker build environment for compiling portable Linux binaries that work on both musl and glibc systems, along with a minimal PHP Docker image for testing. Add CI workflows to build and publish these images to ghcr.io. Update test and build scripts to use the new Docker-based environment, and remove SKIPIF guards from tests since the extension is always present and doing otherwise would mask extension loading failures.
45 lines
1.0 KiB
PHP
45 lines
1.0 KiB
PHP
--TEST--
|
|
rar_open() with volume find (callback variants 1)
|
|
--FILE--
|
|
<?php
|
|
class A {
|
|
public static function resolve($vol) {
|
|
if (preg_match('/_broken/', $vol))
|
|
return str_replace('_broken', '', $vol);
|
|
else
|
|
return null;
|
|
}
|
|
public static function resolveStatic($vol) {
|
|
echo "A::resolveStatic()\n";
|
|
return self::resolve($vol);
|
|
}
|
|
|
|
public function resolveInstance($vol) {
|
|
echo "A::resolveInstance()\n";
|
|
return self::resolve($vol);
|
|
}
|
|
}
|
|
|
|
$fn = dirname(__FILE__) . '/multi_broken.part1.rar';
|
|
$rar = RarArchive::open($fn, null, "A::resolveStatic");
|
|
$rar->getEntries();
|
|
$rar = RarArchive::open($fn, null, array("A", "resolveStatic"));
|
|
$rar->getEntries();
|
|
$rar = RarArchive::open($fn, null, array(new A(), "resolveInstance"));
|
|
$rar->getEntries();
|
|
function testA() {
|
|
global $fn;
|
|
$obj = new A();
|
|
return RarArchive::open($fn, null, array($obj, "resolveInstance"));
|
|
}
|
|
$rar = testA();
|
|
$rar->getEntries();
|
|
echo "Done.\n";
|
|
--EXPECTF--
|
|
A::resolveStatic()
|
|
A::resolveStatic()
|
|
A::resolveInstance()
|
|
A::resolveInstance()
|
|
Done.
|
|
|