1--TEST-- 2Phar::buildFromDirectory() - readonly 3--EXTENSIONS-- 4phar 5--INI-- 6phar.require_hash=0 7phar.readonly=0 8--FILE-- 9<?php 10$phar = new Phar(__DIR__ . '/buildfromdirectory1.phar'); 11try { 12 ini_set('phar.readonly', 1); 13 $phar->buildFromDirectory(1); 14} catch (Exception $e) { 15 var_dump(get_class($e)); 16 echo $e->getMessage() . "\n"; 17} 18?> 19--CLEAN-- 20<?php 21unlink(__DIR__ . '/buildfromdirectory1.phar'); 22__HALT_COMPILER(); 23?> 24--EXPECTF-- 25%s(24) "UnexpectedValueException" 26Cannot write to archive - write operations restricted by INI setting 27