/usr/share/doc/php-mime-type/MIME_Type/docs/examples/example.php is in php-mime-type 1.3.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | <?php
require_once 'MIME/Type.php';
$type = 'application/x-test-app; foo="bar" (First argument); bar=baz (Second argument)';
$type2 = 'application/vnd.pear.test-type';
print "Checking type: $type\n";
if (MIME_Type::isExperimental($type)) {
print "Type is experimental\n";
} else {
print "Type is not experimental\n";
}
print "\nChecking type: $type2\n";
if (MIME_Type::isVendor($type2)) {
print "Type is vendor-specific\n";
} else {
print "Type is not vendor-specific\n";
}
$file = '@doc_dir@/MIME_Type/example.php';
print "\nChecking type of: $file\n";
$type = MIME_Type::autoDetect($file);
if (PEAR::isError($type)) {
print 'Error: ' . $type->getMessage() . "\n";
} else {
print $type . "\n";
}
?>
|