2 Phar: PharFileInfo::setMetadata/delMetadata extra code coverage
4 <?php if (!extension_loaded("phar")) die("skip"); ?>
9 $fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar';
10 $pname = 'phar://' . $fname;
12 $phar = new Phar($fname);
14 $phar['a/b'] = 'hi there';
15 $tar = $phar->convertToData(Phar::TAR);
19 $phar['a']->setMetadata('hi');
20 } catch (Exception $e) {
21 echo $e->getMessage(), "\n";
24 $phar['a']->delMetadata();
25 } catch (Exception $e) {
26 echo $e->getMessage(), "\n";
28 ini_set('phar.readonly', 1);
30 $b->setMetadata('hi');
31 } catch (Exception $e) {
32 echo $e->getMessage(), "\n";
36 } catch (Exception $e) {
37 echo $e->getMessage(), "\n";
41 <?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?>
42 <?php unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?>
44 Phar entry is a temporary directory (not an actual entry in the archive), cannot set metadata
45 Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata
46 Write operations disabled by the php.ini setting phar.readonly
47 Write operations disabled by the php.ini setting phar.readonly