annotate installer/check.php @ 34:50ac5484d514

one fix to distro
author Charlie Root
date Sun, 27 May 2018 16:53:56 -0400
parents 1e000243b222
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
1 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
2
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
3 if (!class_exists('rcmail_install', false) || !is_object($RCI)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
4 die("Not allowed! Please open installer/index.php instead.");
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
5 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
6
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
7 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
8 <form action="index.php" method="get">
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
9 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
10
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
11 $required_php_exts = array(
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
12 'PCRE' => 'pcre',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
13 'DOM' => 'dom',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
14 'Session' => 'session',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
15 'XML' => 'xml',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
16 'JSON' => 'json',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
17 'PDO' => 'PDO',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
18 'Multibyte' => 'mbstring',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
19 'OpenSSL' => 'openssl',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
20 );
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
21
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
22 $optional_php_exts = array(
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
23 'FileInfo' => 'fileinfo',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
24 'Libiconv' => 'iconv',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
25 'Intl' => 'intl',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
26 'Exif' => 'exif',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
27 'LDAP' => 'ldap',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
28 'GD' => 'gd',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
29 'Imagick' => 'imagick',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
30 );
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
31
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
32 $required_libs = array(
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
33 'PEAR' => 'pear.php.net',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
34 'Auth_SASL' => 'pear.php.net',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
35 'Net_SMTP' => 'pear.php.net',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
36 'Net_IDNA2' => 'pear.php.net',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
37 'Mail_mime' => 'pear.php.net',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
38 );
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
39
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
40 $optional_libs = array(
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
41 'Net_LDAP3' => 'git.kolab.org',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
42 );
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
43
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
44 $ini_checks = array(
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
45 'file_uploads' => 1,
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
46 'session.auto_start' => 0,
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
47 'mbstring.func_overload' => 0,
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
48 'suhosin.session.encrypt' => 0,
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
49 );
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
50
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
51 $optional_checks = array(
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
52 // required for utils/modcss.inc, should we require this?
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
53 'allow_url_fopen' => 1,
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
54 'date.timezone' => '-VALID-',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
55 );
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
56
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
57 $source_urls = array(
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
58 'Sockets' => 'http://www.php.net/manual/en/book.sockets.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
59 'Session' => 'http://www.php.net/manual/en/book.session.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
60 'PCRE' => 'http://www.php.net/manual/en/book.pcre.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
61 'FileInfo' => 'http://www.php.net/manual/en/book.fileinfo.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
62 'Libiconv' => 'http://www.php.net/manual/en/book.iconv.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
63 'Multibyte' => 'http://www.php.net/manual/en/book.mbstring.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
64 'OpenSSL' => 'http://www.php.net/manual/en/book.openssl.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
65 'JSON' => 'http://www.php.net/manual/en/book.json.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
66 'DOM' => 'http://www.php.net/manual/en/book.dom.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
67 'Intl' => 'http://www.php.net/manual/en/book.intl.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
68 'Exif' => 'http://www.php.net/manual/en/book.exif.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
69 'oci8' => 'http://www.php.net/manual/en/book.oci8.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
70 'PDO' => 'http://www.php.net/manual/en/book.pdo.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
71 'LDAP' => 'http://www.php.net/manual/en/book.ldap.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
72 'GD' => 'http://www.php.net/manual/en/book.image.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
73 'Imagick' => 'http://www.php.net/manual/en/book.imagick.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
74 'pdo_mysql' => 'http://www.php.net/manual/en/ref.pdo-mysql.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
75 'pdo_pgsql' => 'http://www.php.net/manual/en/ref.pdo-pgsql.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
76 'pdo_sqlite' => 'http://www.php.net/manual/en/ref.pdo-sqlite.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
77 'pdo_sqlite2' => 'http://www.php.net/manual/en/ref.pdo-sqlite.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
78 'pdo_sqlsrv' => 'http://www.php.net/manual/en/ref.pdo-sqlsrv.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
79 'pdo_dblib' => 'http://www.php.net/manual/en/ref.pdo-dblib.php',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
80 'PEAR' => 'http://pear.php.net',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
81 'Net_SMTP' => 'http://pear.php.net/package/Net_SMTP',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
82 'Mail_mime' => 'http://pear.php.net/package/Mail_mime',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
83 'Net_IDNA2' => 'http://pear.php.net/package/Net_IDNA2',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
84 'Net_LDAP3' => 'https://git.kolab.org/diffusion/PNL',
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
85 );
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
86
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
87 echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) . '" />';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
88 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
89
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
90 <h3>Checking PHP version</h3>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
91 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
92
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
93 define('MIN_PHP_VERSION', '5.4.0');
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
94 if (version_compare(PHP_VERSION, MIN_PHP_VERSION, '>=')) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
95 $RCI->pass('Version', 'PHP ' . PHP_VERSION . ' detected');
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
96 } else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
97 $RCI->fail('Version', 'PHP Version ' . MIN_PHP_VERSION . ' or greater is required ' . PHP_VERSION . ' detected');
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
98 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
99 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
100
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
101 <h3>Checking PHP extensions</h3>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
102 <p class="hint">The following modules/extensions are <em>required</em> to run Roundcube:</p>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
103 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
104
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
105 // get extensions location
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
106 $ext_dir = ini_get('extension_dir');
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
107
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
108 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
109 foreach ($required_php_exts as $name => $ext) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
110 if (extension_loaded($ext)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
111 $RCI->pass($name);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
112 } else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
113 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
114 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
115 $RCI->fail($name, $msg, $source_urls[$name]);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
116 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
117 echo '<br />';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
118 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
119
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
120 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
121
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
122 <p class="hint">The next couple of extensions are <em>optional</em> and recommended to get the best performance:</p>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
123 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
124
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
125 foreach ($optional_php_exts as $name => $ext) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
126 if (extension_loaded($ext)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
127 $RCI->pass($name);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
128 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
129 else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
130 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
131 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
132 $RCI->na($name, $msg, $source_urls[$name]);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
133 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
134 echo '<br />';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
135 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
136
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
137 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
138
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
139
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
140 <h3>Checking available databases</h3>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
141 <p class="hint">Check which of the supported extensions are installed. At least one of them is required.</p>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
142
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
143 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
144
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
145 $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
146 foreach ($RCI->supported_dbs as $database => $ext) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
147 if (extension_loaded($ext)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
148 $RCI->pass($database);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
149 $found_db_driver = true;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
150 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
151 else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
152 $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
153 $msg = @is_readable($_ext) ? 'Could be loaded. Please add in php.ini' : '';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
154 $RCI->na($database, $msg, $source_urls[$ext]);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
155 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
156 echo '<br />';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
157 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
158 if (empty($found_db_driver)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
159 $RCI->failures++;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
160 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
161
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
162 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
163
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
164
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
165 <h3>Check for required 3rd party libs</h3>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
166 <p class="hint">This also checks if the include path is set correctly.</p>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
167
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
168 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
169
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
170 foreach ($required_libs as $classname => $vendor) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
171 if (class_exists($classname)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
172 $RCI->pass($classname);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
173 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
174 else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
175 $RCI->fail($classname, "Failed to load class $classname from $vendor", $source_urls[$classname]);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
176 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
177 echo "<br />";
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
178 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
179
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
180 foreach ($optional_libs as $classname => $vendor) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
181 if (class_exists($classname)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
182 $RCI->pass($classname);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
183 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
184 else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
185 $RCI->na($classname, "Recommended to install $classname from $vendor", $source_urls[$classname]);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
186 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
187 echo "<br />";
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
188 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
189
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
190 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
191
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
192 <h3>Checking php.ini/.htaccess settings</h3>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
193 <p class="hint">The following settings are <em>required</em> to run Roundcube:</p>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
194
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
195 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
196
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
197 foreach ($ini_checks as $var => $val) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
198 $status = ini_get($var);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
199 if ($val === '-NOTEMPTY-') {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
200 if (empty($status)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
201 $RCI->fail($var, "empty value detected");
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
202 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
203 else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
204 $RCI->pass($var);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
205 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
206 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
207 else if (filter_var($status, FILTER_VALIDATE_BOOLEAN) == $val) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
208 $RCI->pass($var);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
209 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
210 else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
211 $RCI->fail($var, "is '$status', should be '$val'");
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
212 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
213 echo '<br />';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
214 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
215 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
216
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
217 <p class="hint">The following settings are <em>optional</em> and recommended:</p>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
218
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
219 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
220
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
221 foreach ($optional_checks as $var => $val) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
222 $status = ini_get($var);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
223 if ($val === '-NOTEMPTY-') {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
224 if (empty($status)) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
225 $RCI->optfail($var, "Could be set");
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
226 } else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
227 $RCI->pass($var);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
228 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
229 echo '<br />';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
230 continue;
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
231 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
232 if ($val === '-VALID-') {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
233 if ($var == 'date.timezone') {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
234 try {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
235 $tz = new DateTimeZone($status);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
236 $RCI->pass($var);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
237 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
238 catch (Exception $e) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
239 $RCI->optfail($var, empty($status) ? "not set" : "invalid value detected: $status");
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
240 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
241 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
242 else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
243 $RCI->pass($var);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
244 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
245 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
246 else if (filter_var($status, FILTER_VALIDATE_BOOLEAN) == $val) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
247 $RCI->pass($var);
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
248 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
249 else {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
250 $RCI->optfail($var, "is '$status', could be '$val'");
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
251 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
252 echo '<br />';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
253 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
254 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
255
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
256 <?php
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
257
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
258 if ($RCI->failures) {
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
259 echo '<p class="warning">Sorry but your webserver does not meet the requirements for Roundcube!<br />
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
260 Please install the missing modules or fix the php.ini settings according to the above check results.<br />
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
261 Hint: only checks showing <span class="fail">NOT OK</span> need to be fixed.</p>';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
262 }
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
263 echo '<p><br /><input type="submit" value="NEXT" ' . ($RCI->failures ? 'disabled' : '') . ' /></p>';
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
264
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
265 ?>
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
266
1e000243b222 vanilla 1.3.3 distro, I hope
Charlie Root
parents:
diff changeset
267 </form>