本文整理匯總了PHP中Phar::isReadable方法的典型用法代碼示例。如果您正苦於以下問題:PHP Phar::isReadable方法的具體用法?PHP Phar::isReadable怎麽用?PHP Phar::isReadable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Phar
的用法示例。
在下文中一共展示了Phar::isReadable方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Phar
} else {
$file = $argv[2] . ".phar";
}
if (file_exists($file)) {
try {
$phar = new Phar($file, 0);
if ($phar->hasMetadata()) {
$metadata = metadataToString($phar->getMetadata());
} else {
$metadata = "No metadata found\n";
}
echo "Size: " . round(filesize($file) * 0.0009765625 * 0.0009765625, 2) . " MB (" . round(filesize($file) * 0.0009765625, 3) . " KB)\n";
echo "Signature: " . $phar->getSignature()["hash"] . "\n";
echo "Signature type: " . $phar->getSignature()["hash_type"] . "\n";
echo "Writable: " . strbool($phar->isWritable()) . "\n";
echo "Readable: " . strbool($phar->isReadable()) . "\n";
echo "Metadata: " . $metadata;
echo "Show stub (y, n)? ";
$input = fopen("php://stdin", "r");
$line = fgets($input);
if (trim($line) == 'y') {
echo $phar->getStub();
}
echo "\n";
} catch (Exception $e) {
echo "Invalid phar file\n";
}
} else {
echo "File not found\n";
}
} else {