Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 415275d066d02d33e0345c5b20559529 > files > 6

php-pear-MIME_Type-1.3.4-1.mga5.noarch.rpm

<?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";
}

?>