Commit e8b24d49c93ec2088fabac4e4b357f088cf70240

Authored by nbm
1 parent 02c27faf

Fix up extension checking for people who have extensions but they aren't

loaded by default.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3257 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 17 additions and 3 deletions
setup/precheckup.php
... ... @@ -126,9 +126,23 @@ function bigEnough($name, $setting, $preferred, $bytes = false, $red = true) {
126 126 return $ret;
127 127 }
128 128  
129   -function must_extension_loaded($ext, $message = "") {
130   - @dl($ext);
  129 +function haveExtension($ext) {
131 130 if (extension_loaded($ext)) {
  131 + return true;
  132 + }
  133 + $libfileext = '.so';
  134 + $libraryprefix = '';
  135 + if (substr(PHP_OS, 0, 3) == "WIN") {
  136 + $libfileext = '.dll';
  137 + $libraryprefix = 'php_';
  138 + }
  139 + @dl(sprintf("%s%s%s", $libraryprefix, $ext, $libfileext));
  140 + return extension_loaded($ext);
  141 +}
  142 +
  143 +
  144 +function must_extension_loaded($ext, $message = "") {
  145 + if (haveExtension($ext)) {
132 146 return '<b><font color="green">Available</font></b>';
133 147 }
134 148 if ($message) {
... ... @@ -137,7 +151,7 @@ function must_extension_loaded($ext, $message = &quot;&quot;) {
137 151 return '<b><font color="red">Unavailable</font></b>';
138 152 }
139 153 function can_extension_loaded($ext, $message = "") {
140   - if (extension_loaded($ext)) {
  154 + if (haveExtension($ext)) {
141 155 return '<b><font color="green">Available</font></b>';
142 156 }
143 157 if ($message) {
... ...