Commit 5cb45a222c374beaedcf30400a1a6956810458d5

Authored by conradverm
1 parent cf67a07b

KTS-2832

"Must test if mb_string extension is in php.ini, and maybe provide a recovery option"
Fixed.

Committed By: Conrad Vermeulen
Reviewed By: Megan Watson

git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8278 c91229c3-7414-0410-bfa2-8a42b809f60b
config/dmsDefaults.php
... ... @@ -396,7 +396,7 @@ function catchFatalErrors($p_OnOff='On'){
396 396 $sUrl = KTInit::guessRootUrl();
397 397 global $default;
398 398 $sRootUrl = ($default->sslEnabled ? 'https' : 'http') .'://'.$_SERVER['HTTP_HOST'].$sUrl;
399   -
  399 +
400 400 $phperror='</div>><form name="catcher" action="'.$sRootUrl.'/customerrorpage.php" method="post" ><input type="hidden" name="fatal" value=""></form>
401 401 <script> document.catcher.fatal.value = document.getElementById("phperror").innerHTML; document.catcher.submit();</script>';
402 402 ini_set('error_append_string',$phperror);
... ... @@ -727,6 +727,11 @@ if ($checkup !== true) {
727 727 $default->versionName = $default->versionName.' '._kt('(Community Edition)');
728 728 }
729 729 }
  730 +if (!extension_loaded('mbstring'))
  731 +{
  732 + require_once(KT_LIB_DIR . '/lib/mbstring.inc.php');
  733 +}
  734 +
730 735  
731 736 require_once(KT_LIB_DIR . '/templating/kt3template.inc.php');
732 737 $GLOBALS['main'] =new KTPage();
... ...
lib/mbstring.inc.php 0 → 100644
  1 +<?php
  2 +
  3 +if (!extension_loaded('mbstring'))
  4 +{
  5 +
  6 + function mb_detect_encoding($str, $encoding_list=null, $strict=null)
  7 + {
  8 + return mb_internal_encoding();
  9 + }
  10 +
  11 + function mb_strtolower($str)
  12 + {
  13 + return strtolower($str);
  14 + }
  15 +
  16 + function mb_internal_encoding($encoding=null)
  17 + {
  18 + return 'ISO-8859-1';
  19 + }
  20 +
  21 + function mb_strlen($str, $encoding=null)
  22 + {
  23 + return strlen($str);
  24 + }
  25 +
  26 + function mb_substr($str, $start, $length=null, $encoding=null)
  27 + {
  28 + return substr($str, $start, $length);
  29 + }
  30 +}
  31 +
  32 +?>
0 33 \ No newline at end of file
... ...
setup/precheckup.php
... ... @@ -5,32 +5,32 @@
5 5 * KnowledgeTree Open Source Edition
6 6 * Document Management Made Simple
7 7 * Copyright (C) 2004 - 2008 The Jam Warehouse Software (Pty) Limited
8   - *
  8 + *
9 9 * This program is free software; you can redistribute it and/or modify it under
10 10 * the terms of the GNU General Public License version 3 as published by the
11 11 * Free Software Foundation.
12   - *
  12 + *
13 13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 16 * details.
17   - *
  17 + *
18 18 * You should have received a copy of the GNU General Public License
19 19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20   - *
  20 + *
21 21 * You can contact The Jam Warehouse Software (Pty) Limited, Unit 1, Tramber Place,
22 22 * Blake Street, Observatory, 7925 South Africa. or email info@knowledgetree.com.
23   - *
  23 + *
24 24 * The interactive user interfaces in modified source and object code versions
25 25 * of this program must display Appropriate Legal Notices, as required under
26 26 * Section 5 of the GNU General Public License version 3.
27   - *
  27 + *
28 28 * In accordance with Section 7(b) of the GNU General Public License version 3,
29 29 * these Appropriate Legal Notices must retain the display of the "Powered by
30   - * KnowledgeTree" logo and retain the original copyright notice. If the display of the
  30 + * KnowledgeTree" logo and retain the original copyright notice. If the display of the
31 31 * logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices
32   - * must display the words "Powered by KnowledgeTree" and retain the original
33   - * copyright notice.
  32 + * must display the words "Powered by KnowledgeTree" and retain the original
  33 + * copyright notice.
34 34 * Contributor( s): ______________________________________
35 35 *
36 36 */
... ... @@ -288,11 +288,52 @@ configuring your web server to use the .htaccess files that come with
288 288  
289 289 <?php echo htaccess()?>
290 290  
  291 +<?php
  292 +
  293 +$kturl = KTUtil::kt_url();
  294 +
  295 +?>
  296 +
  297 +<h2>General KnowledgeTree</h2>
  298 +
  299 +<table>
  300 +<tbody>
  301 +<tr>
  302 +<th width=400>KnowledgeTree Server Directory</td>
  303 +<td><?php echo KT_DIR;?></td>
  304 +</tr>
  305 +<tr>
  306 +<th>KnowledgeTree URL</td>
  307 +<td><?php echo $kturl;?></td>
  308 +</tr>
  309 +</tbody>
  310 +</table>
  311 +
  312 +
291 313 <h2>PHP version and extensions</h2>
292 314  
293 315 <p>This relates to your PHP installation environment - which version of
294 316 PHP you are running, and which modules are available.</p>
295 317  
  318 +<?php
  319 +$extensions = array(
  320 + 'session'=>'Session',
  321 + 'mysql'=>'MySQL',
  322 + 'mbstring'=>'Multi Byte String',
  323 + 'curl'=>'cURL',
  324 + 'exif'=>'Exif',
  325 + 'sockets'=>'Sockets',
  326 +);
  327 +$optional_extensions = array(
  328 + 'gettext'=>array('Gettext','Only needed for using non-English languages'),
  329 + 'fileinfo'=>array('Fileinfo','Provides better file identification support - not necessary if you use file extensions'),
  330 + 'win32service'=>array('Win32 Service','Allows Microsoft Windows services to be controlled. '),
  331 + 'openssl'=>array('OpenSSL','Provides encryption support')
  332 +);
  333 +
  334 +
  335 +?>
  336 +
296 337 <table width="100%">
297 338 <tbody>
298 339 <tr>
... ... @@ -307,22 +348,27 @@ PHP you are running, and which modules are available.&lt;/p&gt;
307 348 <th>PHP version below 6</th>
308 349 <td><?php echo $phpversion6text?></td>
309 350 </tr>
  351 +<?php
  352 + foreach($extensions as $ext=>$name)
  353 + {
  354 +?>
310 355 <tr>
311   - <th>Session support</th>
312   - <td><?php echo must_extension_loaded('session');?></td>
313   - </tr>
314   - <tr>
315   - <th>MySQL support</th>
316   - <td><?php echo must_extension_loaded('mysql');?></td>
317   - </tr>
318   - <tr>
319   - <th>Gettext support</th>
320   - <td><?php echo can_extension_loaded('gettext', "Only needed for using non-English languages");?></td>
  356 + <th><?php echo $name?> support</th>
  357 + <td><?php echo must_extension_loaded($ext);?></td>
321 358 </tr>
  359 +<?php
  360 + }
  361 + foreach($optional_extensions as $ext=>$detail)
  362 + {
  363 + list($name, $desc) = $detail;
  364 +?>
322 365 <tr>
323   - <th>Fileinfo support</th>
324   - <td><?php echo can_extension_loaded('fileinfo', "Provides better file identification support - not necessary if you use file extensions");?></td>
  366 + <th><?php echo $name?> support</th>
  367 + <td><?php echo can_extension_loaded($ext, $desc);?></td>
325 368 </tr>
  369 +<?php
  370 + }
  371 +?>
326 372 </tbody>
327 373 </table>
328 374  
... ...