Skip to content

Commit 7f0eced

Browse files
committed
important php extensions
1 parent e8b68cc commit 7f0eced

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

app/php_extensions.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
# Ensure that chars show in browser correctly.
3+
header('Content-Type: text/plain; charset=utf-8');
4+
5+
// The following modules, should exist in the build
6+
$mods_check = explode(',', 'apache2handler,apcu,calendar,ctype,curl,date,dom,exif,fileinfo,filter,ftp,gd,gettext,hash,iconv,imagick,json,libxml,mbstring,mcrypt,mysqli,mysqlnd,openssl,pcre,pdo,pdo_mysql,phar,posix,readline,reflection,session,shmop,simplexml,sockets,spl,standard,sysvmsg,sysvsem,sysvshm,tokenizer,wddx,xml,xmlreader,xmlwriter,xsl,zend opcache,zip,zlib');
7+
8+
// Sort alphabetically.
9+
sort($mods_check);
10+
11+
// Get regular (non-Zend) extensions.
12+
$mods = get_loaded_extensions();
13+
14+
// 'zend_extensions' param only introduced in PHP 5.2.4,
15+
// setting the param returns NULL in PHP 5.1.
16+
$zend_mods = get_loaded_extensions(true);
17+
if ($zend_mods) {
18+
$mods = array_merge($mods, $zend_mods);
19+
}
20+
$mods = array_map('strtolower', $mods);
21+
// Remove duplicates.
22+
$mods = array_unique($mods);
23+
24+
print 'Extensions: ' ."\n\n";
25+
26+
#
27+
# Output modules table.
28+
#
29+
foreach($mods_check as $mod) {
30+
# Search for Apache module, does it exist
31+
printf('%-16s ', $mod);
32+
if(in_array($mod, $mods)) {
33+
echo '| ✓ ';
34+
} else {
35+
echo '| ';
36+
}
37+
echo "\n";
38+
}

0 commit comments

Comments
 (0)