[0] | 1 | <?php |
---|
| 2 | # -- BEGIN LICENSE BLOCK --------------------------------------- |
---|
| 3 | # |
---|
| 4 | # This file is part of Dotclear 2. |
---|
| 5 | # |
---|
[1179] | 6 | # Copyright (c) 2003-2013 Olivier Meunier & Association Dotclear |
---|
[0] | 7 | # Licensed under the GPL version 2.0 license. |
---|
| 8 | # See LICENSE file or |
---|
| 9 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
| 10 | # |
---|
| 11 | # -- END LICENSE BLOCK ----------------------------------------- |
---|
| 12 | if (!defined('DC_RC_PATH')) { return; } |
---|
| 13 | |
---|
| 14 | function dcSystemCheck($con,&$err) |
---|
| 15 | { |
---|
| 16 | $err = array(); |
---|
[2566] | 17 | |
---|
[3137] | 18 | if (version_compare(phpversion(),'5.3','<')) { |
---|
| 19 | $err[] = sprintf(__('PHP version is %s (5.3 or earlier needed).'),phpversion()); |
---|
[0] | 20 | } |
---|
[2566] | 21 | |
---|
[0] | 22 | if (!function_exists('mb_detect_encoding')) { |
---|
| 23 | $err[] = __('Multibyte string module (mbstring) is not available.'); |
---|
| 24 | } |
---|
[2566] | 25 | |
---|
[0] | 26 | if (!function_exists('iconv')) { |
---|
| 27 | $err[] = __('Iconv module is not available.'); |
---|
| 28 | } |
---|
[2566] | 29 | |
---|
[0] | 30 | if (!function_exists('ob_start')) { |
---|
| 31 | $err[] = __('Output control functions are not available.'); |
---|
| 32 | } |
---|
[2566] | 33 | |
---|
[0] | 34 | if (!function_exists('simplexml_load_string')) { |
---|
| 35 | $err[] = __('SimpleXML module is not available.'); |
---|
| 36 | } |
---|
[2566] | 37 | |
---|
[0] | 38 | if (!function_exists('dom_import_simplexml')) { |
---|
| 39 | $err[] = __('DOM XML module is not available.'); |
---|
| 40 | } |
---|
[2566] | 41 | |
---|
[0] | 42 | $pcre_str = base64_decode('w6nDqMOgw6o='); |
---|
| 43 | if (!@preg_match('/'.$pcre_str.'/u', $pcre_str)) { |
---|
| 44 | $err[] = __('PCRE engine does not support UTF-8 strings.'); |
---|
| 45 | } |
---|
[2566] | 46 | |
---|
[0] | 47 | if (!function_exists("spl_classes")) { |
---|
| 48 | $err[] = __('SPL module is not available.'); |
---|
| 49 | } |
---|
[2566] | 50 | |
---|
[1743] | 51 | if ($con->driver() == 'mysql' || $con->driver() == 'mysqli') |
---|
[0] | 52 | { |
---|
| 53 | if (version_compare($con->version(),'4.1','<')) |
---|
| 54 | { |
---|
| 55 | $err[] = sprintf(__('MySQL version is %s (4.1 or earlier needed).'),$con->version()); |
---|
| 56 | } |
---|
| 57 | else |
---|
| 58 | { |
---|
| 59 | $rs = $con->select('SHOW ENGINES'); |
---|
| 60 | $innodb = false; |
---|
| 61 | while ($rs->fetch()) { |
---|
| 62 | if (strtolower($rs->f(0)) == 'innodb' && strtolower($rs->f(1)) != 'disabled' && strtolower($rs->f(1)) != 'no') { |
---|
| 63 | $innodb = true; |
---|
| 64 | break; |
---|
| 65 | } |
---|
| 66 | } |
---|
[2566] | 67 | |
---|
[0] | 68 | if (!$innodb) { |
---|
| 69 | $err[] = __('MySQL InnoDB engine is not available.'); |
---|
| 70 | } |
---|
| 71 | } |
---|
| 72 | } |
---|
| 73 | elseif ($con->driver() == 'pgsql') |
---|
| 74 | { |
---|
| 75 | if (version_compare($con->version(),'8.0','<')) |
---|
| 76 | { |
---|
| 77 | $err[] = sprintf(__('PostgreSQL version is %s (8.0 or earlier needed).'),$con->version()); |
---|
| 78 | } |
---|
| 79 | } |
---|
[2566] | 80 | |
---|
[0] | 81 | return count($err) == 0; |
---|
| 82 | } |
---|