Elgg\Filesystem\MimeTypeDetector::tryFile PHP Метод

tryFile() публичный статический Метод

Detect MIME type using file(1)
public static tryFile ( string $file ) : string
$file string File path
Результат string Type detected. Empty string on failure
    public static function tryFile($file)
    {
        if (DIRECTORY_SEPARATOR !== '/' || !function_exists('exec')) {
            return '';
        }
        $type = @exec("file -b --mime-type " . escapeshellarg($file));
        return $type ? $type : '';
    }