From 9815159490f14d6d03daa519bed1f04116e35e03 Mon Sep 17 00:00:00 2001 From: Chenx221 Date: Sun, 11 Feb 2024 12:38:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD=20=E8=BF=94=E5=9B=9E=E5=AF=B9=E5=BA=94=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E7=B1=BB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/FileTypeDetector.php | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 utils/FileTypeDetector.php diff --git a/utils/FileTypeDetector.php b/utils/FileTypeDetector.php new file mode 100644 index 0000000..45412ed --- /dev/null +++ b/utils/FileTypeDetector.php @@ -0,0 +1,58 @@ + 'fa-regular fa-file-lines', + 'pdf' => 'fa-regular fa-file-pdf', + 'doc', 'docx', 'docm', 'dot', 'dotx', 'odm', 'odt', 'ott', 'wps' => 'fa-regular fa-file-word', + 'xls', 'xlsx', 'xlk', 'xlsb', 'xlsm', 'xlt', 'xltm', 'xlw' => 'fa-regular fa-file-excel', + 'csv' => 'fa-regular fa-file-csv', + 'ppt', 'pptx' => 'fa-regular fa-file-powerpoint', + 'jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'psd', 'clip', 'raw', 'tiff', 'tif' => 'fa-regular fa-file-image', + 'zip', 'rar', '7z', 'tar', 'tar.gz', 'xz', 'cab' => 'fa-regular fa-file-zipper', + 'mp3', 'wav', 'flac', 'acc', 'ogg', 'wma', 'ac3' => 'fa-regular fa-file-audio', + 'mp4', 'mkv', '3gp', 'avi', 'flv', 'm4v', 'mov', 'mpeg', 'mpg', 'mpe', 'rm', 'wmv', 'webm' => 'fa-regular fa-file-video', + 'xhtml', 'asp', 'aspx', 'cgi', 'jsp', 'pl', 'phtml', 'php', 'html', 'htm', 'css', 'c', 'cpp', 'py', 'cs', 'ahk', 'as', 'au3', 'bat', 'fs', 'go', 'ipynb', 'kt', 'lua', 'o', 'ps1', 'ps1xml', 'psc1', 'psd1', 'psm1', 'pyc', 'pyo', 'r', 'rb', 'vbs', 'vb', 'cls', 'cc', 'cxx', 'cbp', 'csproj', 'h', 'hpp', 'hxx', 'vbg', 'vbp', 'vip', 'vbproj', 'vcproj', 'vdproj' => 'fa-regular fa-file-code', + 'abb', 'apk' => 'fa-brands fa-android', + 'exe', 'appx', 'esd', 'wim', 'msi', 'cpl', 'com', 'dll' => 'fa-brands fa-windows', + 'ass', 'srt' => 'fa-regular fa-closed-captioning', + 'deb' => 'fa-brands fa-debian', + 'java', 'jar', 'class' => 'fa-brands fa-java', + 'js' => 'fa-brands fa-js', + 'iso', 'img', 'mds', 'mdx', 'dmg', 'cdi', 'cue' => 'fa-regular fa-compact-disc', + 'vmdk', 'vhdx', 'vhd', 'vfd', 'vud', 'vdi', 'hdd', 'cow', 'qcow', 'qcow2', 'qed' => 'fa-regular fa-hard-drive', + 'db', 'frm', 'mdb', 'mdf', 'myd', 'myi', 'sqlite', 'sql' => 'fa-regular fa-database', + 'epub', 'cpz' => 'fa-brands fa-leanpub', + 'otf', 'tff', 'ttc', 'woff' => 'fa-regular fa-font', + 'ico' => 'fa-regular fa-icons', + 'lnk', 'url' => 'fa-regular fa-link', + 'ipa' => 'fa-brands fa-apple', + 'so' => 'fa-brands fa-linux', + 'rdp' => 'fa-regular fa-laptop-file', + 'omf', 'ssh', 'pub', 'ppk', 'cer', 'crt', 'der', 'p7b', 'p7c', 'p12', 'pfx', 'pem' => 'fa-regular fa-key', + 'm3u', 'm3u8' => 'fa-regular fa-rectangle-list', + 'cnf', 'conf', 'cfg' => 'fa-regular fa-gears', + default => 'fa-regular fa-file', + }; + } + } +} \ No newline at end of file