FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
php-src/ext/fileinfo/fileinfo.php at master · EndlessCoding/php-src · GitHub
EndlessCoding
/
php-src
Public
forked from
php/php-src
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
php-src
/
ext
/
fileinfo
/
fileinfo.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (27 loc) · 865 Bytes
Breadcrumbs
php-src
/
ext
/
fileinfo
/
fileinfo.php
Copy path
File metadata and controls
29 lines (27 loc) · 865 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
if
(!
extension_loaded
(
'
fileinfo
'
)) {
dl
(
'
fileinfo.
'
.
PHP_SHLIB_SUFFIX
);
}
if
(!
extension_loaded
(
'
fileinfo
'
)) {
die
(
"
fileinfo extension is not avaliable, please compile it.
\n"
);
}
// normal operation
$
res
=
finfo_open
(
FILEINFO_MIME
);
/* return mime type ala mimetype extension */
$
files
=
glob
(
"
*
"
);
foreach
(
$
files
as
$
file
) {
echo
finfo_file
(
$
res
,
$
file
) .
"\n"
;
}
finfo_close
(
$
res
);
// OO mode
/*
* FILEINFO_PRESERVE_ATIME - if possible preserve the original access time
* FILEINFO_SYMLINK - follow symlinks
* FILEINFO_DEVICES - look at the contents of blocks or character special devices
* FILEINFO_COMPRESS - decompress compressed files
*/
$
fi
=
new
finfo
(
FILEINFO_PRESERVE_ATIME
|
FILEINFO_SYMLINK
|
FILEINFO_DEVICES
|
FILEINFO_COMPRESS
);
$
files
=
glob
(
"
*
"
);
foreach
(
$
files
as
$
file
) {
echo
$
fi
->
buffer
(
file_get_contents
(
$
file
)) .
"\n"
;
}
?>
Back
|
FazBrowse Home
|
New Git URL