Skip to content

Commit 19f53c0

Browse files
committed
Add php mime type
While PHP files don't have an official mime type adding these in will allow the package to identify various php extensions. The type used is one prefixed with text since PHP files should be human readable, this allows someone to identify a PHP file as plain text. It's particularly useful to detect and then display the contents of a PHP file in a web app.
1 parent 47eae81 commit 19f53c0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/Dflydev/ApacheMimeTypes/PhpRepository.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,13 @@ class PhpRepository implements RepositoryInterface
927927
'h' => 'text/x-c',
928928
'hh' => 'text/x-c',
929929
'dic' => 'text/x-c',
930+
'php' => 'text/x-php',
931+
'phtml' => 'text/x-php',
932+
'php3' => 'text/x-php',
933+
'php4' => 'text/x-php',
934+
'php5' => 'text/x-php',
935+
'php7' => 'text/x-php',
936+
'phps' => 'text/x-php',
930937
'f' => 'text/x-fortran',
931938
'for' => 'text/x-fortran',
932939
'f77' => 'text/x-fortran',
@@ -1722,6 +1729,7 @@ class PhpRepository implements RepositoryInterface
17221729
'text/x-java-source' => array('java'),
17231730
'text/x-opml' => array('opml'),
17241731
'text/x-pascal' => array('p', 'pas'),
1732+
'text/x-php' => array('php', 'phtml', 'php3', 'php4', 'php5', 'php7', 'phps'),
17251733
'text/x-nfo' => array('nfo'),
17261734
'text/x-setext' => array('etx'),
17271735
'text/x-sfv' => array('sfv'),

0 commit comments

Comments
 (0)